PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wnonnull-compare-5.C
blob8b31e6cf86e96edbf56fb6c2dc558d28ef88bf82
1 // PR c++/69902
2 // { dg-do compile }
3 // { dg-options "-Wall" }
5 struct A { virtual ~A (); };
6 struct B : A {};
8 bool
9 foo (A &a)
11   return dynamic_cast<B *>(&a) == (B *) 0;      // { dg-bogus "nonnull argument" }
14 bool
15 bar (A &a)
17   return dynamic_cast<B *>(&a) != (B *) 0;      // { dg-bogus "nonnull argument" }