Consider a simple union with a changed "active member":
union U {
int i;
char *p;
};
U u = { 1 };
u.p = 0;
Is there any revision of the C++ standard that can properly define what happens here?
In particular, what is u.p
semantically? It's a lvalue at compile time, but what does its evaluation refer to at run time?
Can a pointer object exist in u
before it's assigned to?
Can objects exist before their lifetime even begins?
Can two scalar objects (of distinct types) coexist at the same time at the same address?