diff options
Diffstat (limited to 'test/SemaCXX/attr-visibility.cpp')
-rw-r--r-- | test/SemaCXX/attr-visibility.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/SemaCXX/attr-visibility.cpp b/test/SemaCXX/attr-visibility.cpp new file mode 100644 index 000000000000..05aa5a33c72e --- /dev/null +++ b/test/SemaCXX/attr-visibility.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +template <class Element> +void foo() { +} +template <> + __attribute__((visibility("hidden"))) // expected-note {{previous attribute is here}} +void foo<int>(); + +template <> +void foo<int>(); + +template <> + __attribute__((visibility("default"))) // expected-error {{visibility does not match previous declaration}} +void foo<int>() { +} + +struct x3 { + static int y; +} __attribute((visibility("default"))); // expected-warning {{attribute 'visibility' after definition is ignored}} |