The rule is that sub-objects of the same type cannot be at the same address. You have 2 X
sub-objects here, hence each one must be at a different address.
Objects of the same type cannot share the same address because the identity of an object in C++ is its address. If multiples objects of the same type share the same address they are indistinguishable. And this is why the minimum complete object size is 1, so that each object in an array has a distinct address. See "§ The C++ object model [intro.object]":
An object is a region of storage.
...
Objects can contain other objects, called subobjects. A subobject can be a member subobject (9.2), a base class subobject (Clause 10), or an array element. An object that is not a subobject of any other object is
called a complete object.
...
Unless it is a bit-field (9.6), a most derived object shall have a non-zero size and shall occupy one or more bytes of storage. Base class subobjects may have zero size.
...
Unless an object is a bit-field or a base class subobject of zero size, the address of that object is the address of the first byte it occupies. Two objects that are not bit-fields may have the same address if one is a subobject of the other, or if at least one is a base class subobject of zero size and they are of different types; otherwise, they shall have distinct addresses.
This is why, for example, boost::noncopyable
can increase a class size if one inherits it more than once unwittingly indirectly through empty base classes. E.g. in:
struct A : boost::noncopyable {};
struct B : boost::noncopyable {};
struct C : boost::noncopyable {};
struct D : A, B, C {};
sizeof(D) == 3
because there are three distinct boost::noncopyable
sub-subjects. If derivation from boost::noncopyable
is dropped, then sizeof(D) == 1
.