1 // PR c++/51299 2 // { dg-options "-Wzero-as-null-pointer-constant" } 3 4 class Base 5 { 6 public: 7 virtual ~Base(); 8 }; 9 10 class Derived : public Base 11 { 12 }; 13 foo(Base * b)14void foo(Base* b) 15 { 16 Derived* d = dynamic_cast<Derived*>(b); 17 } 18 bar(Base & b)19void bar(Base& b) 20 { 21 Derived& d = dynamic_cast<Derived&>(b); 22 } 23