From f3fae3fc58401b1955106ac46249e9aff2749ab2 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Thu, 21 Mar 2019 13:30:56 +0000 Subject: Permit redeclarations of a builtin to specify calling convention. After https://reviews.llvm.org/rL355317 we noticed that quite a decent amount of code redeclares builtins (memcpy in particular, I believe reduced from an MSVC header) with a calling convention specified. This gets particularly troublesome when the user specifies a new 'default' calling convention on the command line. When looking to add a diagnostic for this case, it was noticed that we had 3 other diagnostics that differed only slightly. This patch ALSO unifies those under a 'select'. Unfortunately, the order of words in ONE of these diagnostics was reversed ("'thiscall' calling convention" vs "calling convention 'thiscall'"), so this patch also standardizes on the former. Differential Revision: https://reviews.llvm.org/D59560 Change-Id: I79f99fe7c2301640755ffdd774b46eb44526bb22 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356663 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaCXX/cxx11-gnu-attrs.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/SemaCXX/cxx11-gnu-attrs.cpp') diff --git a/test/SemaCXX/cxx11-gnu-attrs.cpp b/test/SemaCXX/cxx11-gnu-attrs.cpp index b020d2ae29..1e8ad1e495 100644 --- a/test/SemaCXX/cxx11-gnu-attrs.cpp +++ b/test/SemaCXX/cxx11-gnu-attrs.cpp @@ -9,18 +9,18 @@ int [[gnu::unused]] attr_on_type; int *[[gnu::unused]] attr_on_ptr; // expected-warning@-1 {{attribute 'unused' ignored, because it cannot be applied to a type}} [[gnu::fastcall]] void pr17424_1(); -// expected-warning@-1 {{calling convention 'fastcall' ignored for this target}} +// expected-warning@-1 {{'fastcall' calling convention ignored for this target}} [[gnu::fastcall]] [[gnu::stdcall]] void pr17424_2(); -// expected-warning@-1 {{calling convention 'fastcall' ignored for this target}} -// expected-warning@-2 {{calling convention 'stdcall' ignored for this target}} +// expected-warning@-1 {{'fastcall' calling convention ignored for this target}} +// expected-warning@-2 {{'stdcall' calling convention ignored for this target}} [[gnu::fastcall]] __stdcall void pr17424_3(); -// expected-warning@-1 {{calling convention 'fastcall' ignored for this target}} -// expected-warning@-2 {{calling convention '__stdcall' ignored for this target}} +// expected-warning@-1 {{'fastcall' calling convention ignored for this target}} +// expected-warning@-2 {{'__stdcall' calling convention ignored for this target}} [[gnu::fastcall]] void pr17424_4() [[gnu::stdcall]]; -// expected-warning@-1 {{calling convention 'fastcall' ignored for this target}} -// expected-warning@-2 {{calling convention 'stdcall' ignored for this target}} +// expected-warning@-1 {{'fastcall' calling convention ignored for this target}} +// expected-warning@-2 {{'stdcall' calling convention ignored for this target}} void pr17424_5 [[gnu::fastcall]](); -// expected-warning@-1 {{calling convention 'fastcall' ignored for this target}} +// expected-warning@-1 {{'fastcall' calling convention ignored for this target}} // Valid cases. -- cgit v1.2.3