What does the standard say about this code, and why is it a frequently-missed undefined behavior?
#include <cstring>
struct T { int a; };
void* mem = ::operator new(sizeof(T));
T* p = static_cast<T*>(mem);
p->a = 42; // (1)
int x = p->a; // (2)