]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/16190 (-Wnon-virtual-dtor, in -Wall, silenced only by pessimizing code)
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Sun, 22 Jan 2006 02:38:03 +0000 (02:38 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Sun, 22 Jan 2006 02:38:03 +0000 (02:38 +0000)
        PR c++/16190
        * c-opts.c (c_common_handle_option): Don't include
        -Wnon-virtual-dtor in -Wall; enable if -Weffc++.
        * doc/invoke.texi (C++ Dialect Options): Document that
        -Wnon-virtual-dtor is no longer included in -Wall.

From-SVN: r110085

gcc/ChangeLog
gcc/c-opts.c
gcc/doc/invoke.texi

index 986d4d2f4cde926dfbae5ffed618ad1ea667cd57..a17914004baf71c798df906831a0de6e5f0d83cf 100644 (file)
@@ -1,3 +1,11 @@
+2006-01-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       PR c++/16190
+       * c-opts.c (c_common_handle_option): Don't include
+       -Wnon-virtual-dtor in -Wall; enable if -Weffc++.
+       * doc/invoke.texi (C++ Dialect Options): Document that
+       -Wnon-virtual-dtor is no longer included in -Wall.
+
 2006-01-21  Joseph S. Myers  <joseph@codesourcery.com>
 
        * gcov.c (print_version), gcov-dump.c (print_version),
index f508e4e0481a5e26c28e1a87eeaf106b8035dae3..5bc5f5de9eae2927714672061ea2372503299a5d 100644 (file)
@@ -409,7 +409,6 @@ c_common_handle_option (size_t scode, const char *arg, int value)
       else
        {
          /* C++-specific warnings.  */
-         warn_nonvdtor = value;
          warn_reorder = value;
          warn_nontemplate_friend = value;
        }
@@ -539,6 +538,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
        warn_write_strings = value;
       break;
 
+    case OPT_Weffc__:
+      warn_ecpp = value;
+      if (value)
+        warn_nonvdtor = true;
+      break;
+
     case OPT_ansi:
       if (!c_dialect_cxx ())
        set_std_c89 (false, true);
index 1e5a21670777f851882095ea911b189bf50d5891..0d0c521424ac8583391985c181736b97805f7cde 100644 (file)
@@ -1736,8 +1736,8 @@ 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 enabled by @option{-Wall}.
+destructor, yet it declares a non-virtual one.  This warning is also
+enabled if -Weffc++ is specified.
 
 @item -Wreorder @r{(C++ only)}
 @opindex Wreorder