diff options
author | Pawel Sikora <pluto@pld-linux.org> | 2007-08-20 15:08:24 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2007-08-20 11:08:24 -0400 |
commit | 43f1474491615c9c895716ef0e2a01d0280b1ef1 (patch) | |
tree | 89dd492f0749e3baf99fc3690e6259c93197aed0 /gcc/doc/invoke.texi | |
parent | 01a2a2f512b20d95ac7cc229662787fa0babfdf0 (diff) | |
download | gcc-43f1474491615c9c895716ef0e2a01d0280b1ef1.zip gcc-43f1474491615c9c895716ef0e2a01d0280b1ef1.tar.gz gcc-43f1474491615c9c895716ef0e2a01d0280b1ef1.tar.bz2 |
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
Diffstat (limited to 'gcc/doc/invoke.texi')
-rw-r--r-- | gcc/doc/invoke.texi | 7 |
1 files changed, 4 insertions, 3 deletions
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 |