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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Nadav Har'El from comment #1)
> I don't know why the standard decided that the default constructor should
> not be marked "constexpr", unlike the value-taking constructors.

Because the standard requires that the default constructor doesn't initialize
the value, for compatibility with "atomic_int i;" in C which leaves it
uninitialized. A constexpr constructor must not leave data uninitialized, so
they can't be constexpr if they're C-compatible.

Reply via email to