On Wed, Mar 25, 2020 at 12:17:41PM -0400, Patrick Palka via Gcc-patches wrote: > diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c > index 03ecd7838f6..14a22b85318 100644 > --- a/gcc/cp/parser.c > +++ b/gcc/cp/parser.c > @@ -27689,7 +27689,12 @@ cp_parser_requires_expression (cp_parser *parser) > else > parms = NULL_TREE; > > - /* Parse the requirement body. */ > + /* Always parse the requirement body as if we're inside a template so > that > + we always do full semantic processing only during evaluation of this > + requires-expression and not also now during parsing. */ > + processing_template_decl_sentinel ptds;
This looks weird; this sentinel will always set processing_template_decl to 0, right? So... > + if (!processing_template_decl) > + processing_template_decl = 1; ...this will always be true? Did you mean to use temp_override instead? I don't dare to say if this approach is OK or not, but I've certainly had my share of fun with CALL_EXPRs in templates :). > reqs = cp_parser_requirement_body (parser); > if (reqs == error_mark_node) > return error_mark_node; Marek