summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/attr-require-constant-initialization.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
commitadf66b617461c250ad75163c938a1887a47adafb (patch)
tree2fa25db52e8db8687c8cbe2a7aac93c2235af22c /clang/test/SemaCXX/attr-require-constant-initialization.cpp
parent9d68565262401bd9d26c69ec496e76e92616d8df (diff)
downloadbcm5719-llvm-adf66b617461c250ad75163c938a1887a47adafb.tar.gz
bcm5719-llvm-adf66b617461c250ad75163c938a1887a47adafb.zip
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). llvm-svn: 319002
Diffstat (limited to 'clang/test/SemaCXX/attr-require-constant-initialization.cpp')
-rw-r--r--clang/test/SemaCXX/attr-require-constant-initialization.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/SemaCXX/attr-require-constant-initialization.cpp b/clang/test/SemaCXX/attr-require-constant-initialization.cpp
index 0df9f2e8802..2dd72ea6dba 100644
--- a/clang/test/SemaCXX/attr-require-constant-initialization.cpp
+++ b/clang/test/SemaCXX/attr-require-constant-initialization.cpp
@@ -56,12 +56,12 @@ struct StoresNonLit {
#if defined(TEST_ONE) // Test semantics of attribute
// Test diagnostics when attribute is applied to non-static declarations.
-void test_func_local(ATTR int param) { // expected-error {{only applies to variables with static or thread}}
- ATTR int x = 42; // expected-error {{only applies to variables with static or thread}}
+void test_func_local(ATTR int param) { // expected-error {{only applies to global variables}}
+ ATTR int x = 42; // expected-error {{only applies to}}
ATTR extern int y;
}
-struct ATTR class_mem { // expected-error {{only applies to variables with static or thread}}
- ATTR int x; // expected-error {{only applies to variables with static or thread}}
+struct ATTR class_mem { // expected-error {{only applies to}}
+ ATTR int x; // expected-error {{only applies to}}
};
// [basic.start.static]p2.1
OpenPOWER on IntegriCloud