summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/spec20.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/spec20.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec20.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec20.C b/gcc/testsuite/g++.old-deja/g++.pt/spec20.C
new file mode 100644
index 000000000..b6148e5de
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec20.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+
+// According to the non-normative example in
+// [temp.class.spec.mfunc]/2, these should be valid, but the grammar
+// in the Standard does not allow partial nor full specializations as
+// member-declarations, so we'd better not support them.
+
+template <class T>
+struct S {
+ template <class U> void f(U);
+ template <> void f<int>(int); // { dg-error "" } invalid specialization
+
+ template <class V> struct I {}; // { dg-error "template" }
+ template <class V> struct I<V*> {}; // { dg-error "template" }
+ template <> struct I<int>; // { dg-error "" } invalid specialization
+};