Skip to content
Snippets Groups Projects
Commit 6d8a0e8b authored by Marek Polacek's avatar Marek Polacek
Browse files

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: default avatarJason Merrill <jason@redhat.com>
parent 4ce9e353
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment