https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63226
--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Turning the assert to warning (I probably ought to do that and also compare alignments) gets me the following: one.ii:7:16: warning: type �struct ynodetype_t� violates one definition rule [-Wodr] typedef struct ynodetype_t { ^ two.ii:8:16: note: a type with different size is defined in another translation unit typedef struct ynodetype_t { ^ one.ii:9:12: warning: type �struct <anon>� violates one definition rule [-Wodr] struct { ynode child1, child3; } i; ^ two.ii:10:12: note: a different type is defined in another translation unit struct { yleaftype leaf; } i; ^ one.ii:9:20: note: the first difference of corresponding definitions is field �child1� struct { ynode child1, child3; } i; ^ two.ii:10:24: note: a field with different name is defined in another translation unit struct { yleaftype leaf; } i; ^ one.ii:12:7: warning: type �struct ONE� violates one definition rule [-Wodr] class ONE { ^ two.ii:14:7: note: a type with different number of fields is defined in another translation unit class ONE { I suppose main problem is that we fail to warn on the union. I will dig into why.