re PR c++/28861 (ICE on invalid in-class specialization)
authorLee Millward <lee.millward@codesourcery.com>
Thu, 21 Sep 2006 18:22:11 +0000 (18:22 +0000)
committerLee Millward <lmillward@gcc.gnu.org>
Thu, 21 Sep 2006 18:22:11 +0000 (18:22 +0000)
        PR c++/28861
        * decl.c (shadow_tag): Return error_mark_node
        if maybe_process_partial_specialization failed.

        * g++.dg/template/spec32.C: New test.
        * g++.dg/parse/crash9.C: Adjust error markers.

From-SVN: r117117

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/crash9.C
gcc/testsuite/g++.dg/template/spec32.C [new file with mode: 0644]

index fed109fe50e6821f6a8462b7c009febd2c241deb..fce58ed98e3124b7d032de51fbb4334223f73f56 100644 (file)
@@ -1,3 +1,9 @@
+2006-09-21  Lee Millward  <lee.millward@codesourcery.com>
+
+       PR c++/28861
+       * decl.c (shadow_tag): Return error_mark_node
+        if maybe_process_partial_specialization failed.
+       
 2006-09-20  Danny Smith  <dannysmith@users.sourceforge.net>
 
        PR target/27650
index 46c1d33874c3e377388a0e0282a4d21425288b4f..1d83aa32fd77250b2b1aae4605d099bd7ef21048 100644 (file)
@@ -3745,7 +3745,8 @@ shadow_tag (cp_decl_specifier_seq *declspecs)
 
     }
 
-  maybe_process_partial_specialization (t);
+  if (maybe_process_partial_specialization (t) == error_mark_node)
+    return NULL_TREE;
 
   /* This is where the variables in an anonymous union are
      declared.  An anonymous union declaration looks like:
index 788df3779a799bcfc22873d4e8caf601858f1650..f1be2adaf8f67a9a8210ac645c3c3ca2d2530a25 100644 (file)
@@ -1,3 +1,9 @@
+2006-09-21  Lee Millward  <lee.millward@codesourcery.com>
+
+        PR c++/28861
+        * g++.dg/template/spec32.C: New test.
+        * g++.dg/parse/crash9.C: Adjust error markers.
+       
 2006-09-21  Janis Johnson  <janis187@us.ibm.com>
 
        * gcc.dg/dfp/decfloat-constants.c: Remove 'dg-do compile', fix typo.
index 44ce57b1316c9652062c8cc1956866cc818e160f..d121d5dd10626576679300a4f58f52ba543e456f 100644 (file)
@@ -6,4 +6,4 @@
 // contains error.
 
 template <typename> struct A {};
-template <typename> struct A<INVALID> : A<int> { }; // { dg-error "not declared|invalid" }
+template <typename> struct A<INVALID> : A<int> { }; // { dg-error "not declared|invalid|token|extra" }
diff --git a/gcc/testsuite/g++.dg/template/spec32.C b/gcc/testsuite/g++.dg/template/spec32.C
new file mode 100644 (file)
index 0000000..6ef172b
--- /dev/null
@@ -0,0 +1,6 @@
+//PR c++/28861
+
+struct A
+{
+  template<template<int> class B> struct B<0>;  // { dg-error "name of class shadows" }
+};