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

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Mar 13 23:34:51 2019
New Revision: 269667

URL: https://gcc.gnu.org/viewcvs?rev=269667&root=gcc&view=rev
Log:
        PR c++/86521 - C++17 copy elision in initialization by constructor.

This is an overlooked case in C++17 mandatory copy elision: We want overload
resolution to reflect that initializing an object from a prvalue does not
involve a copy or move constructor even when [over.match.ctor] says that
only constructors are candidates.  Here I implement that by looking through
the copy/move constructor in joust.

        * call.c (joust_maybe_elide_copy): New.
        (joust): Call it.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/testsuite/g++.dg/cpp0x/overload-conv-3.C
    trunk/gcc/testsuite/g++.dg/overload/conv-op2.C

Reply via email to