aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-4.C
blob: 548caac36e977c1945f600dcd632fdbfeac4396b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/51299
// { dg-options "-Wzero-as-null-pointer-constant" }

class Base
{
  public:
  virtual ~Base();
};

class Derived : public Base
{
};

void foo(Base* b)
{
  Derived* d = dynamic_cast<Derived*>(b);
}

void bar(Base& b)
{
  Derived& d = dynamic_cast<Derived&>(b);
}