aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely.gcc@gmail.com>2011-07-01 22:24:42 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2011-07-01 23:24:42 +0100
commite2ab8a0f88198a43c90cef65f1701beaaa98f525 (patch)
treec3f4f9dfba06a6b896621c34a9ba015466d79032 /gcc/cp
parent2eb223898126713d0077e44eb78a66f2553557bb (diff)
downloadgcc-e2ab8a0f88198a43c90cef65f1701beaaa98f525.zip
gcc-e2ab8a0f88198a43c90cef65f1701beaaa98f525.tar.gz
gcc-e2ab8a0f88198a43c90cef65f1701beaaa98f525.tar.bz2
re PR c++/49605 (-Wdelete-non-virtual-dtor is not picky enough)
2011-07-01 Jonathan Wakely <jwakely.gcc@gmail.com> PR c++/49605 * init.c (build_delete): Only warn for sfk_deleting_destructor. From-SVN: r175771
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/init.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8125299..6ffebf1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-01 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR c++/49605
+ * init.c (build_delete): Only warn for sfk_deleting_destructor.
+
2011-07-01 Jakub Jelinek <jakub@redhat.com>
* Make-lang.in (cp/decl.o): Depend on pointer-set.h.
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index f80c475..7970b9a 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -3467,8 +3467,9 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
}
complete_p = false;
}
- else if (warn_delnonvdtor && MAYBE_CLASS_TYPE_P (type)
- && !CLASSTYPE_FINAL (type) && TYPE_POLYMORPHIC_P (type))
+ else if (auto_delete == sfk_deleting_destructor && warn_delnonvdtor
+ && MAYBE_CLASS_TYPE_P (type) && !CLASSTYPE_FINAL (type)
+ && TYPE_POLYMORPHIC_P (type))
{
tree dtor;
dtor = CLASSTYPE_DESTRUCTORS (type);