https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87016
--- Comment #7 from bobogu at atlas dot cz --- (In reply to Jonathan Wakely from comment #5) > (In reply to bobogu from comment #4) > All implementations define the assignment operator as defaulted, and so the > compiler makes it constexpr. > > In fact the p0602R3 proposal you linked to is relevant, because it would > *require* implementations to define the operator as defaulted (in order to > be trivial) and so the compiler is always going to make it constexpr for > std::optional<int>. Ah, finally it makes sense to me! > Anyway, I don't consider "I can use more things in constant expressions than > the standard says" to be a bug. All right, I'm sorry then... I just thought that as this is undocumented, it could lead to producing an unportable code. Anyway, thank you for clearing it out. > I've raised this with the standards committee. Thanks!