diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2013-12-02 17:07:07 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2013-12-02 17:07:07 +0000 |
| commit | 604dfec8dcfbbb899820022ce7bab7ad57618f8a (patch) | |
| tree | f483fdf24190fdb70cc780945c86765c974db810 /clang/test/SemaCXX/attr-weak.cpp | |
| parent | d505d403604a5a253f4dc3adcf1c0fcb343aa62c (diff) | |
| download | bcm5719-llvm-604dfec8dcfbbb899820022ce7bab7ad57618f8a.tar.gz bcm5719-llvm-604dfec8dcfbbb899820022ce7bab7ad57618f8a.zip | |
Re-enabled support for the Subjects for the weak attribute. This changes the diagnostic involved to be more accurate -- for C++ code, it will now report that weak applies to variables, functions or classes. Added additional test case for this.
llvm-svn: 196120
Diffstat (limited to 'clang/test/SemaCXX/attr-weak.cpp')
| -rw-r--r-- | clang/test/SemaCXX/attr-weak.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/attr-weak.cpp b/clang/test/SemaCXX/attr-weak.cpp index 8939a28d75e..2000e7fc683 100644 --- a/clang/test/SemaCXX/attr-weak.cpp +++ b/clang/test/SemaCXX/attr-weak.cpp @@ -3,7 +3,7 @@ static int test0 __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}} static void test1() __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}} -namespace test2 __attribute__((weak)) { // expected-warning {{'weak' attribute only applies to variables and functions}} +namespace test2 __attribute__((weak)) { // expected-warning {{'weak' attribute only applies to variables, functions and classes}} } namespace { @@ -34,3 +34,5 @@ int Test7<T>::var; namespace { class Internal; } template struct Test7<Internal>; template struct Test7<int>; + +class __attribute__((weak)) Test8 {}; // OK |

