This is the mail archive of the gcc@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]

Fwd: Visibility problems in gcc 2.95.2


Hello,

there is a problem with the following small program.
It will not compile with error:
bash-2.04$ /opt/gcc/bin/gcc -o /dev/null -c test.cpp
test.cpp: In function `int main ()':
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.

----------  Forwarded Message  ----------
Subject: Visibility problems in gcc 2.95.2
Date: Mon, 9 Oct 2000 10:17:53 +0700
From: Veklov Alexey <alexey@technoart.net>
To: dyp@perchine.com


class C {
	public:
		C(){};
		~C(){};
};

class A {
	public:
		A(){};
		~A(){};
		bool rread(char* packet, int size){};
};

class B : public A {
	public:
		B(){};
		~B(){};
		bool rread(C* hdr, char *data){};
};

int main()
{
	B b;
	char* packet;
	int size;

	b.rread(packet, size);
}

-------------------------------------------------------

> class C {
> 	public:
> 		C(){};
> 		~C(){};
> };
>
> class A {
> 	public:
> 		A(){};
> 		~A(){};
> 		bool rread(char* packet, int size){};
> };
>
> class B : public A {
> 	public:
> 		B(){};
> 		~B(){};
> 		bool rread(C* hdr, char *data){};
> };
>
> int main()
> {
> 	B b;
> 	char* packet;
> 	int size;
>
> 	b.rread(packet, size);
> }

-- 
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

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