I assume the answer is yes but I haven't explicitly found an assertion of this for every possible situation.
Given an intricate inheritance tree that probably would require step by step upcasting due to intermediate non virtual inheritance and also after multiple chains of upwards casting and downwards dynamic casting of pointers (always starting from the very same instance) the final address to the virtual base of that instance is guaranteed to be the same?
class A {};
class B : virtual public A {};
class C : virtual public A {};
class D : public B, public C {};
class E{};
class F{};
class G : public D, public E{};
class H : public D, public F{};
class I : public G, public H{};
...
class X: ... {} //Some inheritance that has A as virtual base
//We start with pointers from an X type instance:
X x;
X* p_i = &x;
//We always end with A* pointers following different paths:
A* a_i = (A*) ...
I guess I answered myself saying "the address to the virtual base of the same instance" should obviously be the same.
But if that is the case and extending the question, if we have obtained the same address (only through casting) but using different paths, could we end in a situation "similar" to this one where we get the same address but we are not guaranteed to end up with a defined behavior if we wanted to use the final pointer? Link to ccpreference where the following note is shown:
Note that two pointers that represent the same address may nonetheless have different values
struct C {
int x, y;
} c;
int* px = &c.x; // value of px is "pointer to c.x"
int* pxe= px + 1; // value of pxe is "pointer past the end of c.x"
int* py = &c.y; // value of py is "pointer to c.y"
assert(pxe == py); // == tests if two pointers represent the same address
// may or may not fire
*pxe = 1; // undefined behavior even if the assertion does not fire