This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/20710] g++ should warn when hiding non-virtual method in base class


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20710

Tom Tromey <tromey at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu.org

--- Comment #8 from Tom Tromey <tromey at gcc dot gnu.org> ---
It would be nice to have a way to prevent hiding.

See the partial example in bug 64877.  Here, gcc 5
warns about the construct used to prevent hiding.
However, "final" will not work as the function in question
is non-virtual.

The class in question is a base class, so it seems rather
strange to make the function "virtual final".  And, while
not an issue in this particular case, that would in some
cases introduce a vtable where none was previously needed.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]