]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/19667 (ICE on (very trivial) invalid)
authorMark Mitchell <mark@codesourcery.com>
Sat, 29 Jan 2005 00:47:57 +0000 (00:47 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sat, 29 Jan 2005 00:47:57 +0000 (00:47 +0000)
PR c++/19667
* g++.dg/template/crash32.C: New test.

PR c++/19667
* pt.c (redeclare_class_template): Robustify.

From-SVN: r94402

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/crash32.C [new file with mode: 0644]

index bb1ac4e787e61c2aab8feb51b40556be32ff7b60..077113c61dead142ed785221fe988249ae895d2f 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-28  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/19667
+       * pt.c (redeclare_class_template): Robustify.
+
 2005-01-27  Steven Bosscher  <stevenb@suse.de>
 
        * decl.c (finish_case_label): Use SWITCH_STMT accessor macros
index dc781b4afc818528a10d3993156002ea1c8f9841..176e6a3a9e929c20e19ff9e02742eb0c15fb71d4 100644 (file)
@@ -3236,6 +3236,13 @@ redeclare_class_template (tree type, tree parms)
        type.  */
     return;
 
+  if (!parms)
+    {
+      error ("template specifiers not specified in declaration of %qD",
+            tmpl);
+      return;
+    }
+
   parms = INNERMOST_TEMPLATE_PARMS (parms);
   tmpl_parms = DECL_INNERMOST_TEMPLATE_PARMS (tmpl);
 
index 647497a757b08bfa4662623a621421d90ba8efd1..06c06d3a3d6196b1b112f64f4dcb706cf771ec3b 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-28  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/19667
+       * g++.dg/template/crash32.C: New test.
+
 2005-01-28  Ian Lance Taylor  <ian@airs.com>
 
        PR middle-end/16558
diff --git a/gcc/testsuite/g++.dg/template/crash32.C b/gcc/testsuite/g++.dg/template/crash32.C
new file mode 100644 (file)
index 0000000..a836351
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/19667
+
+struct integral_constant { };
+
+template<typename _Tp>
+struct is_function : public integral_constant { }; // { dg-error "previous" }
+
+template<>
+struct is_function : public integral_constant { }; // { dg-error "" }