Annex F (informative) Core undefined behavior [ub]

F.3 [expr]: Expressions [ub.expr]

F.3.2[ub:expr.basic.lvalue.strict.aliasing.violation]
Specified in: [basic.lval]

If a program attempts to access ([defns.access]) the stored value of an object whose dynamic type is T through a glvalue whose type is not similar ([conv.qual]) to T (or its corresponding signed or unsigned types) the behavior is undefined.
[Example 1: int foo(float* f, int* i) { *i = 1; *f = 0.f; // undefined behavior, glvalue is not similar to int return *i; } int main() { int x = 0; x = foo(reinterpret_cast<float*>(&x), &x); } — end example]