c++: Allow template lambdas without lambda-declarator [PR97839]
Our implementation of template lambdas incorrectly requires the optional
lambda-declarator. This was probably required by an early draft of
generic lambdas, but now the production is [expr.prim.lambda.general]:
lambda-expression:
lambda-introducer lambda-declarator [opt] compound-statement
lambda-introducer < template-parameter-list > requires-clause [opt]
lambda-declarator [opt] compound-statement
Therefore, we should accept the following test.
gcc/cp/ChangeLog:
PR c++/97839
* parser.c (cp_parser_lambda_declarator_opt): Don't require ().
gcc/testsuite/ChangeLog:
PR c++/97839
* g++.dg/cpp2a/lambda-generic8.C: New test.