Commit c0425f32 by Jason Merrill Committed by Jason Merrill

re PR c++/51587 (ICE with struct vs. enum clash)

	PR c++/51587
	* decl.c (start_enum): Avoid using ENUM_UNDERLYING_TYPE on a
	non-enum.

From-SVN: r182441
parent 46a76d4b
2011-12-17 Jason Merrill <jason@redhat.com>
PR c++/51587
* decl.c (start_enum): Avoid using ENUM_UNDERLYING_TYPE on a
non-enum.
2011-12-16 Jason Merrill <jason@redhat.com> 2011-12-16 Jason Merrill <jason@redhat.com>
PR c++/51416 PR c++/51416
......
...@@ -12069,6 +12069,7 @@ start_enum (tree name, tree enumtype, tree underlying_type, ...@@ -12069,6 +12069,7 @@ start_enum (tree name, tree enumtype, tree underlying_type,
/* Do not push the decl more than once, unless we need to /* Do not push the decl more than once, unless we need to
compare underlying types at instantiation time */ compare underlying types at instantiation time */
if (!enumtype if (!enumtype
|| TREE_CODE (enumtype) != ENUMERAL_TYPE
|| (underlying_type || (underlying_type
&& dependent_type_p (underlying_type)) && dependent_type_p (underlying_type))
|| (ENUM_UNDERLYING_TYPE (enumtype) || (ENUM_UNDERLYING_TYPE (enumtype)
......
2011-12-17 Jason Merrill <jason@redhat.com>
PR c++/51587
* g++.dg/parse/enum6.C: New.
2011-12-17 Tom de Vries <tom@codesourcery.com> 2011-12-17 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/51491 PR tree-optimization/51491
......
// PR c++/51587
namespace N
{
struct X; // { dg-message "previous declaration" }
}
enum N::X {}; // { dg-error "conflicting declaration" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment