summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/visibility/template6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/visibility/template6.C')
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility/template6.C17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/visibility/template6.C b/gcc/testsuite/g++.dg/ext/visibility/template6.C
new file mode 100644
index 000000000..7892a46e2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility/template6.C
@@ -0,0 +1,17 @@
+// Test for explicit visibility taking precedence
+
+// { dg-require-visibility "" }
+// { dg-final { scan-not-hidden "_ZN1AIiE1fEv" } }
+
+template <class T> struct A
+{
+ // This attribute takes precedence over...
+ __attribute ((visibility ("default"))) void f ();
+};
+
+template <class T>
+void A<T>::f ()
+{ }
+
+// ...this attribute.
+template struct __attribute ((visibility ("hidden"))) A<int>;