https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102586
--- Comment #14 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #13) > So, perhaps if RECORD_TYPE type has TYPE_BINFO in clear_padding_type, we > should be ignoring all the DECL_ARTIFICIAL unnamed fields in the structure > and instead walk the BINFO_BASE_BINFOS ? That would make sense. > Though, in the C8 case, the C7 type of the first FIELD_DECL is the same as > TREE_TYPE of BINFO_BASE_BINFOS[0], so I'm lost where to find the right types. I'd think that should be fine; iIf you ignore the base fields, the other fields are the same between the complete class type and the as-base type.