From: Jason Merrill Date: Fri, 23 Aug 2019 23:29:10 +0000 (-0400) Subject: * parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant error. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01c53a74cd594131d9b066eb3036c6245562dc41;p=gcc.git * parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant error. From-SVN: r274893 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8eebf894f45..06437559480 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-08-22 Jason Merrill + + * parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant + error. + 2019-08-23 Marek Polacek PR c++/91521 - wrong error with operator->. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 53514787554..382575320de 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -6420,9 +6420,11 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser, == CPP_SCOPE)) { token = cp_lexer_consume_token (parser->lexer); - error_at (token->location, "% evaluates to %qT, " - "which is not a class or enumeration type", - token->u.tree_check_value->value); + tree dtype = token->u.tree_check_value->value; + if (dtype != error_mark_node) + error_at (token->location, "% evaluates to %qT, " + "which is not a class or enumeration type", + dtype); parser->scope = error_mark_node; error_p = true; /* As below. */