[Bug libstdc++/87855] std::optional<T> only copy-constructible if T is trivially copy-constructible
ville.voutilainen at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Nov 19 12:28:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87855
--- Comment #14 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
(In reply to fiesh from comment #12)
> X(double) : X(X(42)) {} // clang doesn't like this
>
> is also enough to show the difference, no need for an operator.
Yeah. The list-archive link that you probably can't open leads to
Richard's explanation why copy elision should not happen with
delegating constructors. That's the bug, not the lack of deletedness
of the union's copy constructor.
More information about the Gcc-bugs
mailing list