https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120123
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:8bdbd3b73464f7b12b7d31af91660381be2b5e17 commit r12-11123-g8bdbd3b73464f7b12b7d31af91660381be2b5e17 Author: Jason Merrill <ja...@redhat.com> Date: Fri May 30 18:27:45 2025 -0400 c++: lambda this capture and requires [PR120123] We shouldn't need to be within the lambda body to look through it to the enclosing non-static member function. This change is a small subset of r16-970. PR c++/120123 gcc/cp/ChangeLog: * lambda.cc (nonlambda_method_basetype): Look through lambdas even when current_class_ref is null. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-lambda24.C: New test.