https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122048

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Jason Merrill
<[email protected]>:

https://gcc.gnu.org/g:1e9e8c36d8f35c3256d78d4aa556f0ef4fba998e

commit r15-10657-g1e9e8c36d8f35c3256d78d4aa556f0ef4fba998e
Author: Jason Merrill <[email protected]>
Date:   Fri Jan 9 15:02:53 2026 +0800

    c++: implicit 'this' in generic lambda [PR122048]

    Here template substitution was replacing a reference to the 'this' of X::f
    with the implicit closure parameter of the operator(), which is wrong.  The
    closure parameter is never a suitable replacement for a 'this' parameter.

            PR c++/122048

    gcc/cp/ChangeLog:

            * pt.cc (tsubst_expr): Don't use a lambda current_class_ptr.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1y/lambda-generic-this6.C: New test.

    (cherry picked from commit 90ad957406104f9cc04365f6b071521a7c013dda)
  • [Bug c++/122048] sizeof non-sta... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to