PR c++/28861
authorlmillward <lmillward@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Sep 2006 18:22:11 +0000 (18:22 +0000)
committerlmillward <lmillward@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Sep 2006 18:22:11 +0000 (18:22 +0000)
        * 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.

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

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 fed109f..fce58ed 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 46c1d33..1d83aa3 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 788df37..f1be2ad 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 44ce57b..d121d5d 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" }
+};