c++/10600: method lookup does not work correctly in dervied classes with virtual methods

giovannibajo@libero.it giovannibajo@libero.it
Fri May 2 10:29:00 GMT 2003


Synopsis: method lookup does not work correctly in dervied classes with virtual methods

State-Changed-From-To: open->closed
State-Changed-By: bajo
State-Changed-When: Fri May  2 10:29:01 2003
State-Changed-Why:
    Not a bug, this is how C++ works: a function in a derived
    class completely shadows function(s) in a base class with
    the same name. Here C::test(int) is shadowing B::test(),
    hence the compilation error. Another workaround would be
    to put "using B::test;" inside the definition of class C.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10600



More information about the Gcc-bugs mailing list