OSDN Git Service

PR c++/19667
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Jan 2005 00:47:57 +0000 (00:47 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Jan 2005 00:47:57 +0000 (00:47 +0000)
* g++.dg/template/crash32.C: New test.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94402 138bc75d-0d04-0410-961f-82ee72b054a4

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

index bb1ac4e..077113c 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 dc781b4..176e6a3 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 647497a..06c06d3 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 "" }