Annex F (informative) Core undefined behavior [ub]

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

F.3.18[ub:expr.static.cast.downcast.wrong.derived.type]
Specified in: [expr.static.cast]

Casting from a pointer to a base class to a pointer to a derived class when there is no enclosing object of that derived class at the specified location has undefined behavior.
[Example 1: struct B {}; struct D1 : B {}; struct D2 : B {}; void f() { B *bp = new D1; static_cast<D2 *>(bp); // undefined behavior, base class object of type D1 not D2 } — end example]