summaryrefslogtreecommitdiff
path: root/test/SemaCXX/internal_linkage.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2017-11-26 20:01:12 +0000
committerAaron Ballman <aaron@aaronballman.com>2017-11-26 20:01:12 +0000
commitf3dc13021086ea1868536c072117c33b45f80584 (patch)
treec61c356e6645dc582831a19cdc8938584b1612cd /test/SemaCXX/internal_linkage.cpp
parentdace80474949dad7ff70ab721adadf47966fdeb7 (diff)
downloadclang-f3dc13021086ea1868536c072117c33b45f80584.tar.gz
Determine the attribute subject for diagnostics based on declarative information in DeclNodes.td. This greatly reduces the number of enumerated values used for more complex diagnostics; these are now only required when the "attribute only applies to" diagnostic needs to be generated manually as part of semantic processing.
This also clarifies some terminology used by the diagnostic (methods -> Objective-C methods, fields -> non-static data members, etc). Many of the tests needed to be updated in multiple places for the diagnostic wording tweaks. The first instance of the diagnostic for that attribute is fully specified and subsequent instances cut off the complete list (to make it easier if additional subjects are added in the future for the attribute). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/internal_linkage.cpp')
-rw-r--r--test/SemaCXX/internal_linkage.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/SemaCXX/internal_linkage.cpp b/test/SemaCXX/internal_linkage.cpp
index d5cc676739..921a90ab4a 100644
--- a/test/SemaCXX/internal_linkage.cpp
+++ b/test/SemaCXX/internal_linkage.cpp
@@ -5,7 +5,7 @@ int f() __attribute__((internal_linkage));
class A;
class __attribute__((internal_linkage)) A {
public:
- int x __attribute__((internal_linkage)); // expected-warning{{'internal_linkage' attribute only applies to variables, functions and classes}}
+ int x __attribute__((internal_linkage)); // expected-warning{{'internal_linkage' attribute only applies to variables, functions, and classes}}
static int y __attribute__((internal_linkage));
void f1() __attribute__((internal_linkage));
void f2() __attribute__((internal_linkage)) {}
@@ -16,7 +16,7 @@ public:
~A() __attribute__((internal_linkage)) {}
A& operator=(const A&) __attribute__((internal_linkage)) { return *this; }
struct {
- int z __attribute__((internal_linkage)); // expected-warning{{'internal_linkage' attribute only applies to variables, functions and classes}}
+ int z __attribute__((internal_linkage)); // expected-warning{{'internal_linkage' attribute only applies to}}
};
};
@@ -24,14 +24,14 @@ __attribute__((internal_linkage)) void A::f4() {} // expected-error{{'internal_l
__attribute__((internal_linkage)) int A::zz; // expected-error{{'internal_linkage' attribute does not appear on the first declaration of 'zz'}}
-namespace Z __attribute__((internal_linkage)) { // expected-warning{{'internal_linkage' attribute only applies to variables, functions and classes}}
+namespace Z __attribute__((internal_linkage)) { // expected-warning{{'internal_linkage' attribute only applies to}}
}
__attribute__((internal_linkage("foo"))) int g() {} // expected-error{{'internal_linkage' attribute takes no arguments}}
[[clang::internal_linkage]] int h() {}
-enum struct __attribute__((internal_linkage)) E { // expected-warning{{'internal_linkage' attribute only applies to variables, functions and classes}}
+enum struct __attribute__((internal_linkage)) E { // expected-warning{{'internal_linkage' attribute only applies to}}
a = 1,
b = 2
};