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

--- Comment #10 from TC <rs2740 at gmail dot com> ---
C&P'ing the relevant parts of my email to the lists here for the record:

The new default member initializers use {}, and it's not too hard to find test
cases where {} and value-initialization do different things, including cases
where {} doesn't compile but () does. (So much for "uniform" initialization.)

> Because the default constructor is defined as defaulted it will be
> deleted when the underlying sequence isn't default constructible,

That's not correct. There's no implicit deletion due to the presence of DMIs.
The reason the explicit instantiation works is that constructors explicitly
defaulted at their first declaration are not implicitly defined until ODR-used.

So, unlike the SFINAE-based approach outlined in [comment #1], this patch
causes is_default_constructible<queue<T, NonDefaultConstructible>> to trigger a
hard error (though the standard's version isn't SFINAE-friendly either).

Reply via email to