aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/except.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2020-07-29 00:57:40 -0400
committerJason Merrill <jason@redhat.com>2020-07-29 14:24:15 -0400
commit81bc0ec3e926d7a2c90502847ddaacf3d56d5b75 (patch)
treebce6e4fa4b767f55e1c9d456e6430991c45ddf1a /gcc/cp/except.c
parentd8140b9ed3c0fed041aedaff3fa4a603984ca10f (diff)
downloadgcc-81bc0ec3e926d7a2c90502847ddaacf3d56d5b75.zip
gcc-81bc0ec3e926d7a2c90502847ddaacf3d56d5b75.tar.gz
gcc-81bc0ec3e926d7a2c90502847ddaacf3d56d5b75.tar.bz2
c++: Avoid calling const copy ctor on implicit move. [PR91212]
Our implementation of C++11 implicit move was wrong for return; we didn't actually hit the check for the type of the first parameter of the selected constructor, because we didn't see LOOKUP_PREFER_RVALUE set properly. Fixing that to look at the right flags fixed the issue for this testcase, but broke implicit move for a by-value converting constructor (PR58051). I think this was not allowed in C++17, but it is allowed under the implicit move changes from C++20, and those changes were voted to apply as a DR to earlier standards as well, so I don't want to break it now. So after fixing the flags check I changed the test to allow value parameters. gcc/cp/ChangeLog: PR c++/91212 * call.c (build_over_call): Don't call a const ref overload for implicit move. gcc/testsuite/ChangeLog: PR c++/91212 * g++.dg/cpp0x/move-return3.C: New test.
Diffstat (limited to 'gcc/cp/except.c')
0 files changed, 0 insertions, 0 deletions