public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13518] New: "virtual functions but non-virtual destructor" warning incomplete
@ 2003-12-30 12:58 debian-gcc at lists dot debian dot org
2003-12-30 18:23 ` [Bug c++/13518] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2003-12-30 12:58 UTC (permalink / raw)
To: gcc-bugs
[forwarded from http://bugs.debian.org/212260]
This code:
#include <stdio.h>
struct foo {
~foo() { }
virtual void bar() { }
};
struct fum: public foo {
virtual ~fum() { printf("x\n"); }
};
main() { foo *x = new fum; delete x; }
generates:
blah.cc:2: warning: `struct foo' has virtual functions but non-virtual
destructor
and "x" is not output. (This is expected.)
Comment out the ~foo dtor. The code is still incorrect ("x" is still
not output), but no warning is reported. As the default dtor is
non-virtual, this warning should also be output if an object has virtual
functions but no destructor at all.
--
Summary: "virtual functions but non-virtual destructor" warning
incomplete
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: debian-gcc at lists dot debian dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13518
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/13518] "virtual functions but non-virtual destructor" warning incomplete
2003-12-30 12:58 [Bug c++/13518] New: "virtual functions but non-virtual destructor" warning incomplete debian-gcc at lists dot debian dot org
@ 2003-12-30 18:23 ` pinskia at gcc dot gnu dot org
2004-01-01 22:41 ` pinskia at gcc dot gnu dot org
2004-01-03 13:33 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-30 18:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-12-30 18:04 -------
Confirmed. A better explation is that there is no warning if there is not a destructor there at all.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2003-12-30 18:04:09
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13518
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/13518] "virtual functions but non-virtual destructor" warning incomplete
2003-12-30 12:58 [Bug c++/13518] New: "virtual functions but non-virtual destructor" warning incomplete debian-gcc at lists dot debian dot org
2003-12-30 18:23 ` [Bug c++/13518] " pinskia at gcc dot gnu dot org
@ 2004-01-01 22:41 ` pinskia at gcc dot gnu dot org
2004-01-03 13:33 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-01 22:41 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13518
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/13518] "virtual functions but non-virtual destructor" warning incomplete
2003-12-30 12:58 [Bug c++/13518] New: "virtual functions but non-virtual destructor" warning incomplete debian-gcc at lists dot debian dot org
2003-12-30 18:23 ` [Bug c++/13518] " pinskia at gcc dot gnu dot org
2004-01-01 22:41 ` pinskia at gcc dot gnu dot org
@ 2004-01-03 13:33 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-03 13:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-03 13:33 -------
This is a dup of bug 11624.
*** This bug has been marked as a duplicate of 11624 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13518
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-01-03 13:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-30 12:58 [Bug c++/13518] New: "virtual functions but non-virtual destructor" warning incomplete debian-gcc at lists dot debian dot org
2003-12-30 18:23 ` [Bug c++/13518] " pinskia at gcc dot gnu dot org
2004-01-01 22:41 ` pinskia at gcc dot gnu dot org
2004-01-03 13:33 ` 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).