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

--- Comment #9 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
See https://wandbox.org/permlink/snAuT59ocie38DU5
Here's a tl;dr:

struct NonTrivial {NonTrivial(const NonTrivial&) {}};
struct X {
    X() : x(42) {} 
    X(bool b) : X(b ? X(42): X(666)) {} // clang doesn't like this
    X(int foo) : x(foo) {} 
    ~X() {} 
    union {int x; NonTrivial y;};
}; 

X is not copyconstructible in either gcc or clang, but gcc apparently
elides the copy in the call to the delegated constructor on the commented
line, whereas clang does not.

Reply via email to