aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.cc')
-rw-r--r--gcc/cp/parser.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 1fa0780..f79736c 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -20786,9 +20786,13 @@ cp_parser_simple_type_specifier (cp_parser* parser,
}
/* If it didn't work out, we don't have a TYPE. */
- if ((flags & CP_PARSER_FLAGS_OPTIONAL)
- && !cp_parser_parse_definitely (parser))
- type = NULL_TREE;
+ if (flags & CP_PARSER_FLAGS_OPTIONAL)
+ {
+ if (!type)
+ cp_parser_simulate_error (parser);
+ if (!cp_parser_parse_definitely (parser))
+ type = NULL_TREE;
+ }
/* Keep track of all name-lookups performed in class scopes. */
if (type