https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101378
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- The C++ standard forbids two objects of the same type having the same address. That is true for the empty base-class optimization and it's true for [[no_unique_address]]. [intro.object] > Two objects with overlapping lifetimes that are not bit-fields may have the > same address if one is nested within the other, or if at least one is a > subobject of zero size and they are of different types; otherwise, they have > distinct addresses and occupy disjoint bytes of storage. There is a footnote that says: > Under the “as-if” rule an implementation is allowed to store two objects at > the same machine address or not store an object at all if the program cannot > observe the difference. But I don't think GCC does that, because if some property that is reflected in the debuginfo would allow you to observe the difference, then it's not allowed.