[Bug c++/59526] [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function

daniel.kruegler at googlemail dot com gcc-bugzilla@gcc.gnu.org
Sun Feb 9 15:22:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59526

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Jonathan Wakely from comment #1)
> Trunk doesn't give the same errors, but fails two of the assertions:
> 
> n.cc:30:1: error: static assertion failed: 
>  static_assert(std::is_nothrow_constructible<X>::value, "");

The reason seems to be that the compiler makes this a deleted function, arguing 

"'X::X() noexcept' is implicitly deleted because its exception-specification
does not match the implicit exception-specification 'noexcept
(<uninstantiated>)' X() noexcept = default;"

This looks incorrect to me.


More information about the Gcc-bugs mailing list