1 // { dg-do run } 2 #include <typeinfo> 3 4 class Base 5 { 6 public: ~Base()7 virtual ~Base() { } 8 }; 9 10 class Derived : public Base 11 { 12 public: Derived()13 Derived() {} 14 }; 15 main()16int main() 17 { 18 const Derived b; 19 const Base* ap = &b; 20 21 const Derived* p1 = dynamic_cast<const Derived*>(ap); 22 return p1 == 0; 23 } 24