PATCH: Better -Woverloaded-virtual diagnostics

Jason Merrill jason@cygnus.com
Fri Mar 19 00:12:00 GMT 1999


>>>>> Nathan Sidwell <nathan@acm.org> writes:

 > the current behaviour seems a little strange, and at variance with the
 > documentation. Indeed, when I investigated the code, I found that the
 > order of derived class member functions would affect whether you got a
 > warning or not - not good!

Agreed.

 > In this case I don't think it sensible to warn any way, because one
 > might well want to override a subset of virtual functions -- what one
 > doesn't want to do is introduce a new virtual function that looks
 > similar to a base virtual function.

I disagree.  That is also useful to check, but it is dangerous to override
some overloads and not others -- the ones that are not overridden will be
hidden, causing unexpected overload results.

Jason


More information about the Gcc-patches mailing list