public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11624] New: -Wnon-virtual-dtor doesn't always work
@ 2003-07-21 21:10 bangerth at dealii dot org
2003-07-23 21:01 ` [Bug c++/11624] " pinskia at physics dot uc dot edu
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2003-07-21 21:10 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11624
Summary: -Wnon-virtual-dtor doesn't always work
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
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,gdr at gcc dot gnu dot
org
I just closed a PR that had essentially this code:
------------------------------------
struct A
{
virtual void afunc () {};
};
struct B
{
virtual void bfunc () {};
};
struct C : A, B
{};
int main (void)
{
B * Bptr = new C();
delete Bptr;
}
----------------------------
What was wrong with that PR is immaterial here, but one of the things
is that the submitter didn't recognize that he should have a virtual
destructor. That's what we have -Wnon-virtual-dtor for, I thought, since
it says:
-----------------------------------
@item -Wnon-virtual-dtor @r{(C++ only)}
@opindex Wnon-virtual-dtor
Warn when a class appears to be polymorphic, thereby requiring a virtual
destructor, yet it declares a non-virtual one.
This warning is enabled by @option{-Wall}.
-----------------------------------
Alas, this option doesn't trigger on above code, for no version after 3.2.
(I don't have an older version on my present system, so can't check.) I
think it should, though, shouldn't it?
W.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11624] -Wnon-virtual-dtor doesn't always work
2003-07-21 21:10 [Bug c++/11624] New: -Wnon-virtual-dtor doesn't always work bangerth at dealii dot org
@ 2003-07-23 21:01 ` pinskia at physics dot uc dot edu
2003-08-04 20:41 ` pinskia at physics dot uc dot edu
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-23 21:01 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11624
pinskia at physics dot uc dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-07-23 21:01:45
date| |
------- Additional Comments From pinskia at physics dot uc dot edu 2003-07-23 21:01 -------
I can confirm this on the mainline (20030723).
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11624] -Wnon-virtual-dtor doesn't always work
2003-07-21 21:10 [Bug c++/11624] New: -Wnon-virtual-dtor doesn't always work bangerth at dealii dot org
2003-07-23 21:01 ` [Bug c++/11624] " pinskia at physics dot uc dot edu
@ 2003-08-04 20:41 ` pinskia at physics dot uc dot edu
2004-01-03 13:33 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-04 20:41 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11624
pinskia at physics dot uc dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4 |---
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11624] -Wnon-virtual-dtor doesn't always work
2003-07-21 21:10 [Bug c++/11624] New: -Wnon-virtual-dtor doesn't always work bangerth at dealii dot org
2003-07-23 21:01 ` [Bug c++/11624] " pinskia at physics dot uc dot edu
2003-08-04 20:41 ` pinskia at physics dot uc dot edu
@ 2004-01-03 13:33 ` pinskia at gcc dot gnu dot org
2004-01-03 13:36 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ 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 -------
*** Bug 13518 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |debian-gcc at lists dot
| |debian dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11624
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11624] -Wnon-virtual-dtor doesn't always work
2003-07-21 21:10 [Bug c++/11624] New: -Wnon-virtual-dtor doesn't always work bangerth at dealii dot org
` (2 preceding siblings ...)
2004-01-03 13:33 ` pinskia at gcc dot gnu dot org
@ 2004-01-03 13:36 ` pinskia at gcc dot gnu dot org
2004-09-28 23:58 ` mrs at apple dot com
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-03 13:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-03 13:36 -------
The problem is that -Wnon-virtual-dtor does not work with classes with no declared dtor's.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11624
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11624] -Wnon-virtual-dtor doesn't always work
2003-07-21 21:10 [Bug c++/11624] New: -Wnon-virtual-dtor doesn't always work bangerth at dealii dot org
` (3 preceding siblings ...)
2004-01-03 13:36 ` pinskia at gcc dot gnu dot org
@ 2004-09-28 23:58 ` mrs at apple dot com
2005-03-19 21:05 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mrs at apple dot com @ 2004-09-28 23:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mrs at apple dot com 2004-09-28 23:58 -------
radr://problem/3816531
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mrs at apple dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11624
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11624] -Wnon-virtual-dtor doesn't always work
2003-07-21 21:10 [Bug c++/11624] New: -Wnon-virtual-dtor doesn't always work bangerth at dealii dot org
` (4 preceding siblings ...)
2004-09-28 23:58 ` mrs at apple dot com
@ 2005-03-19 21:05 ` pinskia at gcc dot gnu dot org
2005-03-19 21:07 ` pinskia at gcc dot gnu dot org
2005-07-29 21:15 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-19 21:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-19 21:05 -------
Fixed in 4.0.0 and above already.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11624
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11624] -Wnon-virtual-dtor doesn't always work
2003-07-21 21:10 [Bug c++/11624] New: -Wnon-virtual-dtor doesn't always work bangerth at dealii dot org
` (5 preceding siblings ...)
2005-03-19 21:05 ` pinskia at gcc dot gnu dot org
@ 2005-03-19 21:07 ` pinskia at gcc dot gnu dot org
2005-07-29 21:15 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-19 21:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-19 21:07 -------
*** Bug 20560 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |andyreif at studcs dot uni-
| |sb dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11624
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11624] -Wnon-virtual-dtor doesn't always work
2003-07-21 21:10 [Bug c++/11624] New: -Wnon-virtual-dtor doesn't always work bangerth at dealii dot org
` (6 preceding siblings ...)
2005-03-19 21:07 ` pinskia at gcc dot gnu dot org
@ 2005-07-29 21:15 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-29 21:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-29 21:14 -------
*** Bug 23140 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |thor at math dot tu-berlin
| |dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11624
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-07-29 21:15 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-21 21:10 [Bug c++/11624] New: -Wnon-virtual-dtor doesn't always work bangerth at dealii dot org
2003-07-23 21:01 ` [Bug c++/11624] " pinskia at physics dot uc dot edu
2003-08-04 20:41 ` pinskia at physics dot uc dot edu
2004-01-03 13:33 ` pinskia at gcc dot gnu dot org
2004-01-03 13:36 ` pinskia at gcc dot gnu dot org
2004-09-28 23:58 ` mrs at apple dot com
2005-03-19 21:05 ` pinskia at gcc dot gnu dot org
2005-03-19 21:07 ` pinskia at gcc dot gnu dot org
2005-07-29 21:15 ` 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).