This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH: Improve -Woverloaded-virtual documentation
- To: gcc-patches at gcc dot gnu dot org
- Subject: C++ PATCH: Improve -Woverloaded-virtual documentation
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sat, 17 Feb 2001 15:54:00 -0800
- Organization: CodeSourcery, LLC
PR 213 complains that -Woverloaded-virtual does not behave as
documented, and suggests that the implementation should change to
match the documentation. In fact, I think that the problem is that
the documentation should change to match the implementation.
Applied on the mainline.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
2001-02-17 Mark Mitchell <mark@codesourcery.com>
* invoke.texi (-Woverloaded-virtual): Clarify documentation.
Index: invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/invoke.texi,v
retrieving revision 1.277
diff -c -p -r1.277 invoke.texi
*** invoke.texi 2001/02/15 18:23:33 1.277
--- invoke.texi 2001/02/17 23:43:09
*************** new-style casts (@samp{static_cast}, @sa
*** 1480,1492 ****
@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.
@item -Wno-pmf-conversions (C++ only)
Disable the diagnostic for converting a bound pointer to member function
--- 1480,1507 ----
@item -Woverloaded-virtual (C++ only)
@cindex overloaded virtual fn, warning
@cindex warning for overloaded virtual fn
! 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