1 // PR c++/70295 2 // { dg-do compile } 3 // { dg-options "-O2 -Wnonnull-compare" } 4 5 struct A { A (); virtual ~A (); bool foo (bool); }; 6 struct B : virtual public A { B (); virtual ~B (); }; 7 8 bool foo(bool x)9A::foo (bool x) 10 { 11 if (x && dynamic_cast<B *>(this) != (B *) 0) // { dg-bogus "nonnull argument" } 12 return true; 13 return false; 14 } 15