diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2017-11-26 20:01:12 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2017-11-26 20:01:12 +0000 |
commit | adf66b617461c250ad75163c938a1887a47adafb (patch) | |
tree | 2fa25db52e8db8687c8cbe2a7aac93c2235af22c /clang/test/SemaCXX/warn-consumed-parsing.cpp | |
parent | 9d68565262401bd9d26c69ec496e76e92616d8df (diff) | |
download | bcm5719-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/warn-consumed-parsing.cpp')
-rw-r--r-- | clang/test/SemaCXX/warn-consumed-parsing.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/test/SemaCXX/warn-consumed-parsing.cpp b/clang/test/SemaCXX/warn-consumed-parsing.cpp index 179604141b7..722a60bf986 100644 --- a/clang/test/SemaCXX/warn-consumed-parsing.cpp +++ b/clang/test/SemaCXX/warn-consumed-parsing.cpp @@ -22,15 +22,15 @@ class AttrTester0 { void callableWhen() __attribute__ ((callable_when())); // expected-error {{'callable_when' attribute takes at least 1 argument}} }; -int var0 SET_TYPESTATE(consumed); // expected-warning {{'set_typestate' attribute only applies to methods}} -int var1 TEST_TYPESTATE(consumed); // expected-warning {{'test_typestate' attribute only applies to methods}} -int var2 CALLABLE_WHEN("consumed"); // expected-warning {{'callable_when' attribute only applies to methods}} +int var0 SET_TYPESTATE(consumed); // expected-warning {{'set_typestate' attribute only applies to functions}} +int var1 TEST_TYPESTATE(consumed); // expected-warning {{'test_typestate' attribute only applies to}} +int var2 CALLABLE_WHEN("consumed"); // expected-warning {{'callable_when' attribute only applies to}} int var3 CONSUMABLE(consumed); // expected-warning {{'consumable' attribute only applies to classes}} int var4 RETURN_TYPESTATE(consumed); // expected-warning {{'return_typestate' attribute only applies to functions}} -void function0() SET_TYPESTATE(consumed); // expected-warning {{'set_typestate' attribute only applies to methods}} -void function1() TEST_TYPESTATE(consumed); // expected-warning {{'test_typestate' attribute only applies to methods}} -void function2() CALLABLE_WHEN("consumed"); // expected-warning {{'callable_when' attribute only applies to methods}} +void function0() SET_TYPESTATE(consumed); // expected-warning {{'set_typestate' attribute only applies to}} +void function1() TEST_TYPESTATE(consumed); // expected-warning {{'test_typestate' attribute only applies to}} +void function2() CALLABLE_WHEN("consumed"); // expected-warning {{'callable_when' attribute only applies to}} void function3() CONSUMABLE(consumed); // expected-warning {{'consumable' attribute only applies to classes}} class CONSUMABLE(unknown) AttrTester1 { |