summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/template-id-2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/template-id-2.C')
-rw-r--r--gcc/testsuite/g++.dg/template/template-id-2.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/template-id-2.C b/gcc/testsuite/g++.dg/template/template-id-2.C
new file mode 100644
index 000000000..6d37350e9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/template-id-2.C
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Origin: Richard Guenther <rguenth@tat.physik.uni-tuebingen.de>
+
+// PR c++/12924
+
+template<typename> struct A {};
+
+template<> struct A<void>
+{
+ template<typename T> void foo()
+ {
+ A<T> a;
+ a.template foo<int>(); // { dg-error "no member" }
+ }
+};
+
+void bar()
+{
+ A<void> a;
+ a.foo<int>(); // { dg-message "instantiated" }
+}