[Bug c++/88313] generic lambda in default template argument
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 29 20:37:31 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88313
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:72a7ab891ae0061841c4eb641ef6ab7719bf0369
commit r15-2387-g72a7ab891ae0061841c4eb641ef6ab7719bf0369
Author: Patrick Palka <ppalka@redhat.com>
Date: Mon Jul 29 16:37:19 2024 -0400
c++: generic lambda in default template argument [PR88313]
Here we're rejecting the generic lambda inside the default template
argument ultimately because auto_is_implicit_function_template_parm_p
doesn't get set during parsing of the lambda's parameter list, due
to the !processing_template_parmlist restriction. But when parsing a
lambda parameter list we should always set that flag regardless of where
the lambda appears. This patch makes sure of this via a local lambda_p
flag.
PR c++/88313
gcc/cp/ChangeLog:
* parser.cc (cp_parser_lambda_declarator_opt): Pass
lambda_p=true to cp_parser_parameter_declaration_clause.
(cp_parser_direct_declarator): Pass lambda_p=false to
to cp_parser_parameter_declaration_clause.
(cp_parser_parameter_declaration_clause): Add bool lambda_p
parameter. Consider lambda_p instead of current_class_type
when setting parser->auto_is_implicit_function_template_parm_p.
Don't consider processing_template_parmlist.
(cp_parser_requirement_parameter_list): Pass lambda_p=false
to cp_parser_parameter_declaration_clause.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/lambda-targ6.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
More information about the Gcc-bugs
mailing list