]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: generic lambda, implicit 'this' capture, xobj memfn [PR119038]
authorPatrick Palka <ppalka@redhat.com>
Fri, 28 Feb 2025 15:56:49 +0000 (10:56 -0500)
committerPatrick Palka <ppalka@redhat.com>
Fri, 28 Feb 2025 15:56:49 +0000 (10:56 -0500)
commit1a150f1f688486b12cd975bdc4cd1bd52a7e0110
treee15d974b8f7b2cc62ad1a1bc8b919a7e49af0f24
parent815f1f27a1dba2f0acd1f02d0beafedadebe967c
c++: generic lambda, implicit 'this' capture, xobj memfn [PR119038]

When a generic lambda calls an overload set containing an iobj member
function we speculatively capture 'this'.  We need to do the same
for an xobj member function.

PR c++/119038

gcc/cp/ChangeLog:

* lambda.cc (maybe_generic_this_capture): Consider xobj
member functions as well, not just iobj.  Update function
comment.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/explicit-obj-lambda15.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/lambda.cc
gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda15.C [new file with mode: 0644]