diff options
Diffstat (limited to 'clang/test/SemaCXX')
-rw-r--r-- | clang/test/SemaCXX/attr-visibility.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-visibility.cpp b/clang/test/SemaCXX/attr-visibility.cpp new file mode 100644 index 00000000000..26dc67c6de2 --- /dev/null +++ b/clang/test/SemaCXX/attr-visibility.cpp @@ -0,0 +1,16 @@ +// 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>() { +} |