diff options
author | Justin Bogner <mail@justinbogner.com> | 2013-10-08 00:19:09 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2013-10-08 00:19:09 +0000 |
commit | 2dd68de1bf29993c8c8d7e20a3f230fc9a5a40e8 (patch) | |
tree | 1e5420301dcd93da80de09a515b59b1e8f280b86 /test/SemaCXX/attr-deprecated.cpp | |
parent | feba9f2bdc5711894e452dfc67c9679482fbf897 (diff) | |
download | clang-2dd68de1bf29993c8c8d7e20a3f230fc9a5a40e8.tar.gz |
Sema: Only merge typedef attributes if the previous decl is a typedef
In r186373, we started merging attributes on typedefs, but this causes
us to try to merge attributes even if the previous declaration was not
a typedef.
Only merge the attributes if the previous decl was also a typedef.
Fixes rdar://problem/15044218
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/attr-deprecated.cpp')
-rw-r--r-- | test/SemaCXX/attr-deprecated.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaCXX/attr-deprecated.cpp b/test/SemaCXX/attr-deprecated.cpp index d09faf34d7..b3223f3997 100644 --- a/test/SemaCXX/attr-deprecated.cpp +++ b/test/SemaCXX/attr-deprecated.cpp @@ -244,3 +244,9 @@ namespace test7 { X *x = new X; // expected-warning{{'operator new' is deprecated}} expected-warning{{'operator delete' is deprecated}} } } + +// rdar://problem/15044218 +typedef struct TDS { +} TDS __attribute__((deprecated)); // expected-note {{'TDS' declared here}} +TDS tds; // expected-warning {{'TDS' is deprecated}} +struct TDS tds2; // no warning, attribute only applies to the typedef. |