https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85707
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- IMHO classes and their friends should not have any special exemptions, because undefined behaviour is still undefined behaviour, it doesn't matter who does it. But in this case I don't think there is any UB.