[Bug c++/7302] -Wnon-virtual-dtor should't complain of protected dtor
- To: debian-gcc@lists.debian.org
- Subject: [Bug c++/7302] -Wnon-virtual-dtor should't complain of protected dtor
- From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
- Date: Thu, 2 Jun 2011 21:31:18 +0000
- Message-id: <bug-7302-5724-zLJNNRxXgU@http.gcc.gnu.org/bugzilla/>
- In-reply-to: <bug-7302-5724@http.gcc.gnu.org/bugzilla/>
- References: <bug-7302-5724@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]
--
Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Reply to: