summaryrefslogtreecommitdiff
path: root/gcc/cp/parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.cc')
-rw-r--r--gcc/cp/parser.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index bfd16e1ef62..2235da10c7c 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -20041,7 +20041,16 @@ cp_parser_placeholder_type_specifier (cp_parser *parser, location_t loc,
/* In a template parameter list, a type-parameter can be introduced
by type-constraints alone. */
if (processing_template_parmlist && !placeholder)
- return build_constrained_parameter (con, proto, args);
+ {
+ /* In a default argument we may not be creating new parameters. */
+ if (parser->local_variables_forbidden_p & LOCAL_VARS_FORBIDDEN)
+ {
+ /* If this assert turns out to be false, do error() instead. */
+ gcc_assert (tentative);
+ return error_mark_node;
+ }
+ return build_constrained_parameter (con, proto, args);
+ }
/* Diagnose issues placeholder issues. */
if (!flag_concepts_ts
@@ -25924,6 +25933,7 @@ cp_parser_class_specifier_1 (cp_parser* parser)
case CPP_OPEN_PAREN:
case CPP_CLOSE_PAREN:
case CPP_COMMA:
+ case CPP_SCOPE:
want_semicolon = false;
break;