mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/51586 (ICE with invalid union)
PR c++/51586 * parser.c (cp_parser_check_class_key): Handle error_mark_node. From-SVN: r182442
This commit is contained in:
parent
c0425f32f5
commit
9bd98b5ac3
|
@ -1,5 +1,8 @@
|
||||||
2011-12-17 Jason Merrill <jason@redhat.com>
|
2011-12-17 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/51586
|
||||||
|
* parser.c (cp_parser_check_class_key): Handle error_mark_node.
|
||||||
|
|
||||||
PR c++/51587
|
PR c++/51587
|
||||||
* decl.c (start_enum): Avoid using ENUM_UNDERLYING_TYPE on a
|
* decl.c (start_enum): Avoid using ENUM_UNDERLYING_TYPE on a
|
||||||
non-enum.
|
non-enum.
|
||||||
|
|
|
@ -22624,6 +22624,8 @@ cp_parser_token_is_class_key (cp_token* token)
|
||||||
static void
|
static void
|
||||||
cp_parser_check_class_key (enum tag_types class_key, tree type)
|
cp_parser_check_class_key (enum tag_types class_key, tree type)
|
||||||
{
|
{
|
||||||
|
if (type == error_mark_node)
|
||||||
|
return;
|
||||||
if ((TREE_CODE (type) == UNION_TYPE) != (class_key == union_type))
|
if ((TREE_CODE (type) == UNION_TYPE) != (class_key == union_type))
|
||||||
{
|
{
|
||||||
permerror (input_location, "%qs tag used in naming %q#T",
|
permerror (input_location, "%qs tag used in naming %q#T",
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
2011-12-17 Jason Merrill <jason@redhat.com>
|
2011-12-17 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/51586
|
||||||
|
* g++.dg/lookup/nested2.C: New.
|
||||||
|
|
||||||
PR c++/51587
|
PR c++/51587
|
||||||
* g++.dg/parse/enum6.C: New.
|
* g++.dg/parse/enum6.C: New.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
// PR c++/51586
|
||||||
|
|
||||||
|
union U
|
||||||
|
{
|
||||||
|
union U { int i; }; // { dg-error "same name" }
|
||||||
|
};
|
Loading…
Reference in New Issue