]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: generic lambda, fn* conv, empty class [PR98326]
authorJason Merrill <jason@redhat.com>
Mon, 8 Feb 2021 22:04:03 +0000 (17:04 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 12 Feb 2021 02:30:08 +0000 (21:30 -0500)
commit031e97207463710797625382baff112b6c3ade51
tree06e5e1fc492e9a581f14762b542564ffcacd32d6
parente3f74f955aa2efcf3a731c5749b9a6a30888d4c1
c++: generic lambda, fn* conv, empty class [PR98326]

Here, in the thunk returned from the captureless lambda conversion to
pointer-to-function, we try to pass through invisible reference parameters
by reference, without doing a copy.  The empty class copy optimization was
messing that up.

gcc/cp/ChangeLog:

PR c++/98326
PR c++/20408
* cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
parm.

gcc/testsuite/ChangeLog:

PR c++/98326
* g++.dg/cpp1y/lambda-generic-empty1.C: New test.
gcc/cp/cp-gimplify.c
gcc/testsuite/g++.dg/cpp1y/lambda-generic-empty1.C [new file with mode: 0644]