Skip to content

Commit

Permalink
* parser.c (cp_parser_enum_specifier): Check for error_mark_node.
Browse files Browse the repository at this point in the history
From-SVN: r195818
  • Loading branch information
jicama authored and Jason Merrill committed Feb 6, 2013
1 parent 828e50c commit ceb8649
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions gcc/cp/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2013-02-06 Jason Merrill <[email protected]>

* parser.c (cp_parser_enum_specifier): Check for error_mark_node.

2013-02-05 Jason Merrill <[email protected]>

PR c++/54122
Expand Down
2 changes: 1 addition & 1 deletion gcc/cp/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -14567,7 +14567,7 @@ cp_parser_enum_specifier (cp_parser* parser)
/*check_dependency=*/true,
/*ambiguous_decls=*/NULL,
input_location);
if (name)
if (name && name != error_mark_node)
{
type = TREE_TYPE (name);
if (TREE_CODE (type) == TYPENAME_TYPE)
Expand Down
2 changes: 2 additions & 0 deletions gcc/testsuite/g++.dg/parse/enum10.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
namespace A { }
enum A::B { }; // { dg-error "" }

0 comments on commit ceb8649

Please sign in to comment.