This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/7302] -Wnon-virtual-dtor should't complain of protected dtor
- From: "ben at decadent dot org dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Feb 2007 01:10:39 -0000
- Subject: [Bug c++/7302] -Wnon-virtual-dtor should't complain of protected dtor
- References: <bug-7302-1037@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #15 from ben at decadent dot org dot uk 2007-02-22 01:10 -------
Pawel: Yes, any friend class or function can call a protected or private
destructor wrongly. So can members of the class - in fact, even pure virtual
members can, since they may still have definitions!
The current implementation warns whenever any function might be able to call a
non-virtual destructor in a polymorphic class; this results in many false
positives. False warnings result in programmers disabling the warning, or
paying less attention to warnings, or (in this case) introducing a virtual
destructor for no good reason. That is why I consider the behaviour a bug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7302