https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84044
--- Comment #12 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Actually the issue here is that enum is context that is the type B and it has keyed vtable which makes it unmerged. So we are correct to not merge here provided that we want to keep TYPE_CONTEXT here (which I am not 100% sure we want) I will check in the testcase along the fix.