This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12277] Warn on dynamic casts with known NULL results.


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-19 13:31 -------
And here is an example:
struct Base 
  { 
    virtual ~Base () {} 
  }; 
 
  class Derived : Base 
  { 
    friend int main (); 
  }; 
 
  #include <cassert> 
 
  int main () 
  { 
    Base * p = new Derived; 
 
    assert(dynamic_cast<Derived *>(p)); // fails 
  } 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12277


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]