https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118543
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- There are defect reports in this area too. I can also get an ICE with: ``` template<class T> struct S { enum class E : T; enum E0 : T; static constexpr T f(int) { return 0; }; static constexpr T f(char) { return 1; }; }; template<class T> enum class S<T>::E : T { X = S<T>::f(T{}) }; template<class T> enum S<T>::E0 : T { X2 = S<T>::f(T{}) }; typedef S<char> S0; static_assert((int)S0::E::X == 1); static_assert((int)S0::X2 == 1); ```