summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/attr-visibility.c
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-05-10 02:50:16 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-05-10 02:50:16 +0000
commitc67f223c9ee4cbfa478a1d6e9cfe5b03c524b4fa (patch)
treef663bdb4be2998a02f90d5d6a9c8a5891334f75e /clang/test/Sema/attr-visibility.c
parent62cce9e47d2cb1f3068cd7346bdedb0ce4c7c24d (diff)
downloadbcm5719-llvm-c67f223c9ee4cbfa478a1d6e9cfe5b03c524b4fa.tar.gz
bcm5719-llvm-c67f223c9ee4cbfa478a1d6e9cfe5b03c524b4fa.zip
Fix an old (2009) FIXME:
// FIXME: This needs to happen before we merge declarations. Then, // let attribute merging cope with attribute conflicts. This was already being done for variables, but for functions we were merging then first and then applying the attributes. To avoid duplicating merging logic, some of the helpers in SemaDeclAttr.cpp become methods that can handle merging two attributes in one decl or inheriting attributes from one decl to another. With this change we are now able to produce errors for variables with incompatible visibility attributes or warn about unused dllimports in variables. This changes the attribute list iteration back to being in reverse source code order, as that matches what decl merging does and avoids differentiating the two cases is the merge*Attr methods. llvm-svn: 156531
Diffstat (limited to 'clang/test/Sema/attr-visibility.c')
-rw-r--r--clang/test/Sema/attr-visibility.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/Sema/attr-visibility.c b/clang/test/Sema/attr-visibility.c
index cb549921abe..cc3c54a047b 100644
--- a/clang/test/Sema/attr-visibility.c
+++ b/clang/test/Sema/attr-visibility.c
@@ -17,3 +17,6 @@ struct __attribute__((visibility("default"))) test5; // expected-error {{visibil
void test6() __attribute__((visibility("hidden"), // expected-note {{previous attribute is here}}
visibility("default"))); // expected-error {{visibility does not match previous declaration}}
+
+extern int test7 __attribute__((visibility("default"))); // expected-note {{previous attribute is here}}
+extern int test7 __attribute__((visibility("hidden"))); // expected-error {{visibility does not match previous declaration}}
OpenPOWER on IntegriCloud