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]