c++: template depth of lambda in default targ [PR116567]

For GCC 14, let's narrowly fix this bug by just pruning the result of
add_extra_args after the fact to get rid of any unwanted outer levels.

	PR c++/116567

gcc/cp/ChangeLog:

	* pt.cc (tsubst_lambda_expr): For a deferred-substitution lambda,
	trim the augmented template arguments to match the template depth
	of the lambda.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/lambda-targ7.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
2 files changed