------- Comment #5 from jason at gcc dot gnu dot org 2009-07-06 20:45 ------- This is only known to be NULL if we know the dynamic type of p. Consider:
struct Foo: Base {}; struct Bar: Derived, Foo {}; Bar bar; Base *p2 = (Foo*)&bar; A dynamic_cast to Derived from p2 should succeed. But it still seems reasonable to give a warning for pinskia's testcase. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12277