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