aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-11-23 10:01:06 +0000
committerJonathan Wakely <jwakely@redhat.com>2022-11-23 15:45:45 +0000
commit51f28e3aaf8b50554e7d356c8117399e63132323 (patch)
treecdaf722a123b62d29efe6e35b60301925ad9a6f0
parentd601708870ad8dc3ef935e440bf03394891d42e2 (diff)
downloadgcc-51f28e3aaf8b50554e7d356c8117399e63132323.zip
gcc-51f28e3aaf8b50554e7d356c8117399e63132323.tar.gz
gcc-51f28e3aaf8b50554e7d356c8117399e63132323.tar.bz2
doc: -Wdelete-non-virtual-dtor supersedes -Wnon-virtual-dtor
The newer -Wdelete-non-virtual-dtor has no false positives and fewer bugs. There is very little reason to use -Wnon-virtual-dtor instead. gcc/ChangeLog: * doc/invoke.texi (C++ Dialect Options): Recommend using -Wdelete-non-virtual-dtor instead of -Wnon-virtual-dtor.
-rw-r--r--gcc/doc/invoke.texi3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 330da6e..4899bd1 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -3986,6 +3986,9 @@ destructor itself or in an accessible polymorphic base class, in which
case it is possible but unsafe to delete an instance of a derived
class through a pointer to the class itself or base class. This
warning is automatically enabled if @option{-Weffc++} is specified.
+The @option{-Wdelete-non-virtual-dtor} option (enabled by @option{-Wall})
+should be preferred because it warns about the unsafe cases without false
+positives.
@item -Wregister @r{(C++ and Objective-C++ only)}
@opindex Wregister