From 43f1474491615c9c895716ef0e2a01d0280b1ef1 Mon Sep 17 00:00:00 2001 From: Pawel Sikora Date: Mon, 20 Aug 2007 15:08:24 +0000 Subject: re PR c++/7302 (-Wnon-virtual-dtor should't complain of protected dtor) PR c++/7302 * cp/class.c (finish_struct_1): Warn when a class has virtual functions and accessible non-virtual destructor. * doc/invoke.texi (-Wnon-virtual-dtor): Update documentation. * g++.dg/warn/Wnvdtor-2.C: New testcase. From-SVN: r127649 --- gcc/doc/invoke.texi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/doc/invoke.texi') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 3815e59..73d4966 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2011,9 +2011,10 @@ public static member functions. @item -Wnon-virtual-dtor @r{(C++ only)} @opindex Wnon-virtual-dtor -Warn when a class appears to be polymorphic, thereby requiring a virtual -destructor, yet it declares a non-virtual one. This warning is also -enabled if -Weffc++ is specified. +Warn when a class has virtual functions and accessible non-virtual +destructor, in which case it would be possible but unsafe to delete +an instance of a derived class through a pointer to the base class. +This warning is also enabled if -Weffc++ is specified. @item -Wreorder @r{(C++ only)} @opindex Wreorder -- cgit v1.1