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: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 2 Jun 2011 21:30:11 +0000
- Subject: [Bug c++/7302] -Wnon-virtual-dtor should't complain of protected dtor
- Auto-submitted: auto-generated
- References: <bug-7302-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7302
--- Comment #26 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-02 21:29:53 UTC ---
(can this bug be un-ASSIGNED?)
(In reply to comment #25)
> Here, H must have a virtual destructor. The point where it can know it should
> warn is the "delete this;" line.
I've posted a patch to http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00191.html
which gives this for the code in comment 25
7302.cc:16:12: warning: deleting object of abstract class type âHâ which has
non-virtual destructor will cause undefined behaviour
[-Wdelete-non-virtual-dtor]