A prvalue of type “pointer to
cv1 B”, where
B
is a class type, can be converted to a prvalue of type “pointer to
cv2 D”,
where
D is a complete class
derived
from
B,
if
cv2 is the same cv-qualification as,
or greater cv-qualification than,
cv1. If
B is a virtual base class of
D or
a base class of a virtual base class of
D, or
if no valid standard conversion from “pointer to
D”
to “pointer to
B” exists (
[conv.ptr]), the program is ill-formed
. The null pointer value (
[basic.compound]) is converted
to the null pointer value of the destination type
. If the prvalue of type
“pointer to
cv1 B” points to a
B that is
actually a base class subobject of an object of type
D, the resulting
pointer points to the enclosing object of type
D. Otherwise, the
behavior is undefined
.