https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95955
W E Brown <webrown.cpp at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |webrown.cpp at gmail dot com --- Comment #1 from Haoxin Tu <haoxintu at gmail dot com> --- Add a more readable case $cat p.c enum class a : struct{}; template < template <class> class A > enum class a : union b {}; enum class a { c;} $g++ p.cc p.cc:1:23: error: underlying type ‘<unnamed struct>’ of ‘a’ must be an integral type 1 | enum class a : struct{}; | ^ p.cc:4:12: error: different underlying type in enum ‘enum class a’ 4 | enum class a { c;} | ^ p.cc:1:23: note: previous definition here 1 | enum class a : struct{}; | ^ p.cc:4:16: internal compiler error: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952 4 | enum class a { c;} | ^