1 2 3 4 5 6 7 8 9 10 11 12
#include <typeinfo> class A { public: virtual void j () {} }; class B : public A { }; void x (A& a) { const B& b1 = dynamic_cast<B&>((const A&)a); // ERROR - opps }