https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116567
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:0c80216b7bb0938bff7db230cbefa5bc3e8b3034 commit r14-10652-g0c80216b7bb0938bff7db230cbefa5bc3e8b3034 Author: Patrick Palka <ppa...@redhat.com> Date: Sat Sep 7 14:10:09 2024 -0400 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 <ja...@redhat.com>