re PR c++/20499 (ICE on duplicate class definition)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Tue, 22 Mar 2005 14:44:10 +0000 (14:44 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Tue, 22 Mar 2005 14:44:10 +0000 (14:44 +0000)
PR c++/20499
* parser.c (cp_parser_class_head): Return NULL_TREE when
encountering a redefinition.

* g++.dg/parse/error16.C: Tweak error markers.

From-SVN: r96870

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/error16.C

index ddac9f88769843a432bcccee6983bec51375169e..bb0c547eeb8a21e268a8fff29f010290a667057f 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/20499
+       * parser.c (cp_parser_class_head): Return NULL_TREE when
+       encountering a redefinition.
+
 2005-03-22  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/20465
index 6df7bad1d810052dbecb37de66fd1962834d9b53..a6145406de9800261e6788c7633777e37fa024ea 100644 (file)
@@ -12858,7 +12858,8 @@ cp_parser_class_head (cp_parser* parser,
     {
       error ("redefinition of %q#T", type);
       cp_error_at ("previous definition of %q#T", type);
-      type = error_mark_node;
+      type = NULL_TREE;
+      goto done;
     }
 
   /* We will have entered the scope containing the class; the names of
index 896052860afe74b50baa83a76c68575f324b1355..3909d568423f4aae95e1b2e17f21f11ea55fdfa4 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/20499
+       * g++.dg/parse/error16.C: Tweak error markers.
+
 2005-03-22  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/20561
index afc790e072e455d876ab9f9db835260280526d0c..3dc58ad53c0684918439d1bc1e381a1392e82f1c 100644 (file)
@@ -2,7 +2,7 @@
 
 struct A
 {
-  struct B {}; // { dg-error "" }
+  struct B {}; // { dg-error "previous" }
 };
 
-struct A::B{}; // { dg-error "" }
+struct A::B{}; // { dg-error "redefinition" }