This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10600: method lookup does not work correctly in dervied classes with virtual methods
- From: giovannibajo at libero dot it
- To: ctron at dentrassi dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 2 May 2003 10:29:01 -0000
- Subject: Re: c++/10600: method lookup does not work correctly in dervied classes with virtual methods
- Reply-to: giovannibajo at libero dot it, ctron at dentrassi dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
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