https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120531
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The enum type looks like it was not "laid out". This fixes the ICE but I am not 100% sure if it is the correct fix: ``` [apinski@xeond2 gcc]$ git diff diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 9a20ed62738..5d8af6dd8f8 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -17736,6 +17736,7 @@ start_enum (tree name, tree enumtype, tree underlying_type, { error ("underlying type %qT of %qT must be an integral type", underlying_type, enumtype); + copy_type_enum (enumtype, integer_type_node); ENUM_UNDERLYING_TYPE (enumtype) = integer_type_node; } } ```