Richard, I'm not sure I understand your position... Given the following complete program ...
On 01/06/2014 04:26 AM, Fabio Fracassi wrote:The access is not allowed by the aliasing rules in 3.10. But it seems
> if it is not (legal): could we make it legal or would we run afoul of
> the aliasing rules?
that this would be:
B bmem;
struct B {
int i;
};
struct D {
void foo() { /* access bmem.i */ }
};
B b;
reinterpret_cast<D&>(b).foo();
because B is a non-static data member of D, and 9.2/19 guarantees that
the address of D::bmem is the same as the address of the D object.