c++: bogus error with nested lambdas [PR117602]
The error here should also check that we aren't nested in another
lambda; in it, at_function_scope_p() will be false.
PR c++/117602
gcc/cp/ChangeLog:
* cp-tree.h (current_nonlambda_scope): Add a default argument.
* lambda.cc (current_nonlambda_scope): New bool parameter. Use it.
* parser.cc (cp_parser_lambda_introducer): Use current_nonlambda_scope
to check if the lambda is non-local.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/lambda-uneval21.C: New test.
Reviewed-by:
Jason Merrill <jason@redhat.com>
Loading
Please register or sign in to comment