re PR c++/6037 (ICE in enum after switch() (gcc 3.0.4))

PR c++/6037
	* decl.c (start_enum): Don't set TREE_ADDRESSABLE on TREE_LIST node.

	* g++.dg/other/enum1.C: New test.

From-SVN: r51227
This commit is contained in:
Jakub Jelinek 2002-03-23 10:30:32 +01:00 committed by Jakub Jelinek
parent 5365c83fd8
commit e756a7da56
4 changed files with 28 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2002-03-23 Jakub Jelinek <jakub@redhat.com>
PR c++/6037
* decl.c (start_enum): Don't set TREE_ADDRESSABLE on TREE_LIST node.
2002-03-23 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
* error.c (dump_type): Be careful about implicit typenames.

View File

@ -13110,9 +13110,6 @@ start_enum (name)
pushtag (name, enumtype, 0);
}
if (current_class_type)
TREE_ADDRESSABLE (b->tags) = 1;
return enumtype;
}

View File

@ -1,3 +1,7 @@
2002-03-23 Jakub Jelinek <jakub@redhat.com>
* g++.dg/other/enum1.C: New test.
2002-03-23 Zack Weinberg <zack@codesourcery.com>
* gcc.dg/pragma-ep-3.c: Fix typo.

View File

@ -0,0 +1,19 @@
// PR c++/6037
// This testcase ICEd because start_enum expected pushtag to insert
// the tag always into current binding level.
struct A
{
~A () { }
};
struct B
{
void foo ()
{
switch (0) { default: ; }
A a;
enum C { };
(void) a;
}
};