From 3747f3dc7290394aa6c0786763fc16efda0956cc Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Sat, 17 Feb 2001 23:45:54 +0000 Subject: [PATCH] * invoke.texi (-Woverloaded-virtual): Clarify documentation. From-SVN: r39807 --- gcc/ChangeLog | 4 ++++ gcc/invoke.texi | 29 ++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d24594b..1fcd3a6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2001-02-17 Mark Mitchell + + * invoke.texi (-Woverloaded-virtual): Clarify documentation. + 2001-02-17 Richard Henderson * reload1.c (reload_cse_simplify_set): Respect LOAD_EXTEND_OP diff --git a/gcc/invoke.texi b/gcc/invoke.texi index 302f97a..a6c67b0 100644 --- a/gcc/invoke.texi +++ b/gcc/invoke.texi @@ -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 -- 2.7.4