From standard n3337 draft 5.2.9/2
An lvalue of type “cv1 B,” where B is a class type, can be cast to type “reference to cv2 D,” where D is a class derived (Clause 10) from B, if a valid standard conversion from “pointer to D” to “pointer to B” exists (4.10), cv2 is the same cv-qualification as, or greater cv-qualification than, cv1, and B is neither a virtual base class of D nor a base class of a virtual base class of D.
In your case:
B
is class derived from A
, both are non-const, and conversion from A*
to B*
is allowed, A
is not virtual base class of D
.