]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Sun, 25 Jan 2004 15:08:20 +0000 (15:08 +0000)
committerNo Author <no-author@gcc.gnu.org>
Sun, 25 Jan 2004 15:08:20 +0000 (15:08 +0000)
'gcc-3_3-branch'.

From-SVN: r76561

gcc/testsuite/g++.dg/template/nontype4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/nontype5.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/template/nontype4.C b/gcc/testsuite/g++.dg/template/nontype4.C
new file mode 100644 (file)
index 0000000..43ef2b0
--- /dev/null
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Origin: Ivan Godard <igodard@pacbell.net>
+//        Volker Reichelt <reichelt@gcc.gnu.org>
+
+// PR c++/13797: ICE invalid nontype template parameter
+
+template <int> struct A
+{
+    typedef A<0> B;            // { dg-error "not a valid type|conflict" }
+    template <B> struct B {};  // { dg-error "not a valid type|declaration" }
+};
+
+A<0> a;                                // { dg-error "instantiated" }
diff --git a/gcc/testsuite/g++.dg/template/nontype5.C b/gcc/testsuite/g++.dg/template/nontype5.C
new file mode 100644 (file)
index 0000000..e53b6c1
--- /dev/null
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Origin: Ivan Godard <igodard@pacbell.net>
+//        Volker Reichelt <reichelt@gcc.gnu.org>
+
+// PR c++/13797: ICE invalid nontype template parameter
+
+template <int> struct A
+{
+    typedef A<0> B;
+    template <B> struct C {};  // { dg-error "not a valid type" }
+};
+
+A<0> a;                                // { dg-error "instantiated" }