This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49605] -Wdelete-non-virtual-dtor is not picky enough
- 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: Fri, 1 Jul 2011 09:42:44 +0000
- Subject: [Bug c++/49605] -Wdelete-non-virtual-dtor is not picky enough
- Auto-submitted: auto-generated
- References: <bug-49605-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49605
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Target Milestone|--- |4.7.0
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-07-01 09:42:26 UTC ---
I'm not sure if this its right but it fixes the testcase:
--- init.c.orig 2011-07-01 09:39:20.825997109 +0000
+++ init.c 2011-07-01 09:39:38.954089615 +0000
@@ -3421,8 +3421,9 @@
}
complete_p = false;
}
- else if (warn_delnonvdtor && MAYBE_CLASS_TYPE_P (type)
- && !CLASSTYPE_FINAL (type) && TYPE_POLYMORPHIC_P (type))
+ else if (warn_delnonvdtor && auto_delete == sfk_deleting_destructor
+ && MAYBE_CLASS_TYPE_P (type) && !CLASSTYPE_FINAL (type)
+ && TYPE_POLYMORPHIC_P (type))
{
tree dtor;
dtor = CLASSTYPE_DESTRUCTORS (type);
I'll look into it properly and run the testsuite later today