public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15541] New: No warning if static checking can tell that a dynamic_cast will fail
@ 2004-05-20  9:02 bangerth at dealii dot org
  2004-05-20 11:36 ` [Bug c++/15541] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: bangerth at dealii dot org @ 2004-05-20  9:02 UTC (permalink / raw)
  To: gcc-bugs

Per conclusion from PR 15531: 
 
In this code, the dynamic_cast will always fail: 
------------------------- 
struct Base 
  { 
    virtual ~Base () {} 
  }; 
 
  class Derived : Base 
  { 
    friend int main (); 
  }; 
 
  #include <cassert> 
 
  int main () 
  { 
    Base * p = new Derived; 
 
    assert(dynamic_cast<Derived *>(p)); // fails 
  } 
------------ 
We should issue a warning about this, but don't. 
 
W.

-- 
           Summary: No warning if static checking can tell that a
                    dynamic_cast will fail
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org,gccbugs at contacts dot
                    eelis dot net,gdr at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/15541] No warning if static checking can tell that a dynamic_cast will fail
  2004-05-20  9:02 [Bug c++/15541] New: No warning if static checking can tell that a dynamic_cast will fail bangerth at dealii dot org
@ 2004-05-20 11:36 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-20 11:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-19 13:30 -------
This is a dup of bug 12277.

*** This bug has been marked as a duplicate of 12277 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-19 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-20  9:02 [Bug c++/15541] New: No warning if static checking can tell that a dynamic_cast will fail bangerth at dealii dot org
2004-05-20 11:36 ` [Bug c++/15541] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).