re PR c++/13810 (ICE on invalid default templates)
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>
Sun, 25 Jan 2004 22:46:48 +0000 (22:46 +0000)
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>
Sun, 25 Jan 2004 22:46:48 +0000 (22:46 +0000)
PR c++/13810
* g++.dg/template/ttp7.C: New test.

From-SVN: r76594

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

index 520966a9f4fe16d32b8f41faa055fed2d2ca2c2c..a8a7b5d0d16faf986d7000e3dbc61dbe2c862ab6 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
+
+       PR c++/13810
+       * g++.dg/template/ttp7.C: New test.
+
 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/13797
diff --git a/gcc/testsuite/g++.dg/template/ttp7.C b/gcc/testsuite/g++.dg/template/ttp7.C
new file mode 100644 (file)
index 0000000..0bcaa8f
--- /dev/null
@@ -0,0 +1,16 @@
+// { dg-do compile }
+// Contributed by Andrew Pinski <pinskia at gcc dot gnu dot org>
+// PR c++/13810: ICE while parsing invalid default argument for a 
+//   template template parameter.
+
+struct X;
+template<int> struct A {};   
+
+template<template<int> class = X > struct B1 {};     // { dg-error "as a default value" }
+template<template<int> class = A<0> > struct B2 {};  // { dg-error "as a default value" }
+
+template <typename T>
+struct S {
+  template <template <typename> class = S>   struct I1 {};  // { dg-error "as a default value" }
+  template <template <typename> class = ::S> struct I2 {};
+};