This does not compile in C++:
class A
{
};
class B : public A
{
};
...
A *a = new B();
B *b = dynamic_cast(a);
From 5.2.7 (Dynamic cast) :
The result of the expression
dynamic_castis the result of converting the expression v to type T.(v) [ ... multiple lines which refer to other cases ... ]
Otherwise v shall be a pointer to or an lvalue of a polymorphic type (10.3).
From 10.3 (Virtual functions) :
A class that declares or inherits a virtual function is called a polymorphic class.