https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95564
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Jiang An from comment #3) > (In reply to Andrew Pinski from comment #2) > > GCC is inconsitent here. with static_assert and constexpr GCC accepts it (PR > > 87724) while rejects it for noexcept. > > Currently narrowing conversions are still forbidden in noexcept and explicit > specifiers. > > The inconsistency is acknowledged in C++23 (WG21-P1401R5), but it seems that > P1401 is not a DR, as the related CWG 2320 is closed as extension. I don't > know whether we should reject narrowing conversions in static_assert/if > constexpr in earlier modes. Narrowing conversions were fine in earlier standards, it was an accidental change that made them ill-formed, which was fixed. Clang now also rejects the testcase.