https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63179
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- I don't think this is valid, the standard says it is OK to access the stored value of the Child object through a union that has a Child member, or to access it through Base, but not through a union that has a Base member. So the program has undefined behaviour and any result is valid.