aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 41e7b52..5cfcf43 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -2343,12 +2343,13 @@ cp_parser_parse_and_diagnose_invalid_type_name (cp_parser *parser)
the scope is dependent, we cannot do much. */
if (!cp_lexer_next_token_is (parser->lexer, CPP_NAME)
|| (parser->scope && TYPE_P (parser->scope)
- && dependent_type_p (parser->scope)))
+ && dependent_type_p (parser->scope))
+ || TREE_CODE (id) == TYPE_DECL)
{
cp_parser_abort_tentative_parse (parser);
return false;
}
- if (!cp_parser_parse_definitely (parser) || TREE_CODE (id) == TYPE_DECL)
+ if (!cp_parser_parse_definitely (parser))
return false;
/* Emit a diagnostic for the invalid type. */