diff options
author | Jonathan Wakely <jwakely.gcc@gmail.com> | 2011-07-01 22:24:42 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2011-07-01 23:24:42 +0100 |
commit | e2ab8a0f88198a43c90cef65f1701beaaa98f525 (patch) | |
tree | c3f4f9dfba06a6b896621c34a9ba015466d79032 /gcc/cp/init.c | |
parent | 2eb223898126713d0077e44eb78a66f2553557bb (diff) | |
download | gcc-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/init.c')
-rw-r--r-- | gcc/cp/init.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); |