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/dllexport.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/dllexport.cpp')
| -rw-r--r-- | clang/test/SemaCXX/dllexport.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/test/SemaCXX/dllexport.cpp b/clang/test/SemaCXX/dllexport.cpp index a3fed70ec95..c09a531c19b 100644 --- a/clang/test/SemaCXX/dllexport.cpp +++ b/clang/test/SemaCXX/dllexport.cpp @@ -17,18 +17,18 @@ struct External { int v; }; // Invalid usage. __declspec(dllexport) typedef int typedef1; -// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}} +// expected-warning@-1{{'dllexport' attribute only applies to functions, variables, classes, and Objective-C interfaces}} typedef __declspec(dllexport) int typedef2; -// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}} +// expected-warning@-1{{'dllexport' attribute only applies to}} typedef int __declspec(dllexport) typedef3; -// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}} +// expected-warning@-1{{'dllexport' attribute only applies to}} typedef __declspec(dllexport) void (*FunTy)(); -// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}} +// expected-warning@-1{{'dllexport' attribute only applies to}} enum __declspec(dllexport) Enum {}; -// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}} +// expected-warning@-1{{'dllexport' attribute only applies to}} #if __has_feature(cxx_strong_enums) enum class __declspec(dllexport) EnumClass {}; -// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}} +// expected-warning@-1{{'dllexport' attribute only applies to}} #endif @@ -565,7 +565,7 @@ private: __declspec(dllexport) void privateDef(); public: - __declspec(dllexport) int Field; // expected-warning{{'dllexport' attribute only applies to variables, functions and classes}} + __declspec(dllexport) int Field; // expected-warning{{'dllexport' attribute only applies to}} __declspec(dllexport) static int StaticField; __declspec(dllexport) static int StaticFieldDef; __declspec(dllexport) static const int StaticConstField; @@ -977,7 +977,7 @@ private: __declspec(dllexport) void privateDef(); public: - __declspec(dllexport) int Field; // expected-warning{{'dllexport' attribute only applies to variables, functions and classes}} + __declspec(dllexport) int Field; // expected-warning{{'dllexport' attribute only applies to}} __declspec(dllexport) static int StaticField; __declspec(dllexport) static int StaticFieldDef; __declspec(dllexport) static const int StaticConstField; |

