aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2019-08-23 19:29:10 -0400
committerJason Merrill <jason@gcc.gnu.org>2019-08-23 19:29:10 -0400
commit01c53a74cd594131d9b066eb3036c6245562dc41 (patch)
treedaacee2ea72bc3694b7314bba3b48847c3c670c2 /gcc
parent9bf6c63da9ff140bb37d957ad1252848e2df28ef (diff)
downloadgcc-01c53a74cd594131d9b066eb3036c6245562dc41.zip
gcc-01c53a74cd594131d9b066eb3036c6245562dc41.tar.gz
gcc-01c53a74cd594131d9b066eb3036c6245562dc41.tar.bz2
* parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant error.
From-SVN: r274893
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8eebf89..0643755 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2019-08-22 Jason Merrill <jason@redhat.com>
+
+ * parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant
+ error.
+
2019-08-23 Marek Polacek <polacek@redhat.com>
PR c++/91521 - wrong error with operator->.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 5351478..3825753 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, "%<decltype%> 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, "%<decltype%> evaluates to %qT, "
+ "which is not a class or enumeration type",
+ dtype);
parser->scope = error_mark_node;
error_p = true;
/* As below. */