https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96496
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed (again with a compile time test): enum E : bool { One, Two }; constexpr int f1 (int x) { return (E) x; } static_assert(f1(6), ""); static_assert(f1(7), "");