re PR c++/20499 (ICE on duplicate class definition)

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
This commit is contained in:
Volker Reichelt 2005-03-22 14:44:10 +00:00 committed by Volker Reichelt
parent b2a6a2fb64
commit 0f3744f8c2
4 changed files with 15 additions and 3 deletions

View 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

View 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

View 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

View 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" }