aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate9.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/template/instantiate9.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/template/instantiate9.C15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate9.C b/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate9.C
new file mode 100644
index 000000000..33f1d6018
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate9.C
@@ -0,0 +1,15 @@
+/* PR c++/14622. The invalid explicit instantiation was not reported. */
+/* { dg-do compile } */
+template<class T>
+class A
+{
+ static T a;
+};
+
+template<class T>
+T A<T>::a;
+
+struct B {};
+
+template B A<int>::a; /* { dg-error "does not match declared type" } */
+template float A<float>::a;