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

Nathaniel Shead <nathanieloshead at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathanieloshead at gmail dot 
com

--- Comment #2 from Nathaniel Shead <nathanieloshead at gmail dot com> ---
I'm working on a patch for this. But worth noting...

> static_assert(!is_nothrow_default_constructible_v<yesthrow_t>);
I'm not sure this is correct. By https://eel.is/c++draft/meta.unary.prop#9 this
is testing noexceptness of value-initialisation. And
https://eel.is/c++draft/dcl.init.general#9.1 says

> if T has either no default constructor ([class.default.ctor]) or
>    a default constructor that is user-provided or deleted, then
>    the object is default-initialized;
> otherwise, the object is zero-initialized and the semantic constraints
>    for default-initialization are checked, and if T has a non-trivial
>    default constructor, the object is default-initialized;
Since the default constructor here is not user-provided, and also trivial, the
object should not be default-initialized and thus the default constructor is
not called, and thus this is not potentially-throwing.

Reply via email to