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 | 84ff5ee44810adfbe948e473c8bd1da085c8186e (patch) | |
tree | 3e02ecea34cc06fe22a75cd3497a313ea54fbbd8 /clang/test/SemaCXX/attr-deprecated.cpp | |
parent | 4f755deaf659f2b07ed4f83eb5b73a68c9b2eade (diff) | |
download | bcm5719-llvm-84ff5ee44810adfbe948e473c8bd1da085c8186e.tar.gz bcm5719-llvm-84ff5ee44810adfbe948e473c8bd1da085c8186e.zip |
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
llvm-svn: 192146
Diffstat (limited to 'clang/test/SemaCXX/attr-deprecated.cpp')
-rw-r--r-- | clang/test/SemaCXX/attr-deprecated.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-deprecated.cpp b/clang/test/SemaCXX/attr-deprecated.cpp index d09faf34d7a..b3223f39979 100644 --- a/clang/test/SemaCXX/attr-deprecated.cpp +++ b/clang/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. |