This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Visibility problems in gcc 2.95.2
- To: "Denis Perchine" <dyp at perchine dot com>, <gcc at gcc dot gnu dot org>
- Subject: Re: Visibility problems in gcc 2.95.2
- From: "Artem Khodush" <artem at duma dot gov dot ru>
- Date: Mon, 9 Oct 2000 11:22:17 +0400
- >Received: from artem by mailsrv.duma.gov.ru (SMI-8.6/SMI-SVR4)id LAA09816; Mon, 9 Oct 2000 11:28:19 +0300
- References: <00100910295008.01934@dyp.perchine.com>
Denis Perchine wrote:
> test.cpp:27: no matching function for call to `B::rread (char *&, int
> &)'
> test.cpp:18: candidates are: bool B::rread (C *, char *)
>
> This is obviously wrong as there is one in the class A.
>
> class A {
> public:
> A(){};
> ~A(){};
> bool rread(char* packet, int size){};
> };
>
> class B : public A {
> public:
> B(){};
> ~B(){};
> bool rread(C* hdr, char *data){};
> };
>
This is not a bug.
It may seem wrong to you, but that's how c++ works.
The declaration of rread in class B hides one in class A.
However, you still may call A's rread by specifying it
explicitly:
b.A::rread( packet, size );
Best regards,
Artem.