* invoke.texi (-Woverloaded-virtual): Clarify documentation.
authorMark Mitchell <mark@codesourcery.com>
Sat, 17 Feb 2001 23:45:54 +0000 (23:45 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sat, 17 Feb 2001 23:45:54 +0000 (23:45 +0000)
From-SVN: r39807

gcc/ChangeLog
gcc/invoke.texi

index d24594b..1fcd3a6 100644 (file)
@@ -1,3 +1,7 @@
+2001-02-17  Mark Mitchell  <mark@codesourcery.com>
+
+       * invoke.texi (-Woverloaded-virtual): Clarify documentation.
+
 2001-02-17  Richard Henderson  <rth@redhat.com>
 
        * reload1.c (reload_cse_simplify_set): Respect LOAD_EXTEND_OP
index 302f97a..a6c67b0 100644 (file)
@@ -1480,13 +1480,28 @@ new-style casts (@samp{static_cast}, @samp{reinterpret_cast}, and
 @item -Woverloaded-virtual (C++ only)
 @cindex overloaded virtual fn, warning
 @cindex warning for overloaded virtual fn
-Warn when a derived class function declaration may be an error in
-defining a virtual function.  In a derived class, the
-definitions of virtual functions must match the type signature of a
-virtual function declared in the base class.  With this option, the
-compiler warns when you define a function with the same name as a
-virtual function, but with a type signature that does not match any
-declarations from the base class.
+Warn when a function declaration hides virtual functions from a
+base class.  For example, in:
+
+@smallexample
+struct A @{
+  virtual void f();
+@};
+
+struct B: public A @{
+  void f(int);
+@};
+@end smallexample
+
+the @code{A} class version of @code{f} is hidden in @code{B}, and code
+like this:
+
+@smallexample
+B* b;
+b->f();
+@end smallexample
+
+will fail to compile.
 
 @item -Wno-pmf-conversions (C++ only)
 Disable the diagnostic for converting a bound pointer to member function