[Bug c++/123080] ICE when constructing parameter type in requires clause of lambda

egas.g.ribeiro at tecnico dot ulisboa.pt gcc-bugzilla@gcc.gnu.org
Mon Dec 22 15:19:13 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123080

--- Comment #4 from Egas  Ribeiro <egas.g.ribeiro at tecnico dot ulisboa.pt> ---
also here in cp_parser_lambda_declarator_opt:
  if (has_param_list)
    {
      /* Parse optional trailing requires clause.  */
      trailing_requires_clause = cp_parser_requires_clause_opt (parser, false);

      /* The function parameters must be in scope all the way until after the
         trailing-return-type in case of decltype.  */
      pop_bindings_and_leave_scope ();
    }

cp_parser_requires_clause_opt seems to mess with the context we were creating
for this lambda. on the implicit template case, it unsets
processing_template_decl.
for the explicit case, it doesn't.


More information about the Gcc-bugs mailing list