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]

C++ Error


I'm getting an error in C++ which I think is
incompatible with the standard.

I have

class A
{
	public:
		virtual set(int);
		virtual set(char);
		virtual set(double);
};

then I have

class B : public A
{
	public:
		using A::set;
		virtual set(int);
};

it compiles under g++ without the using A::set, but
this causes problems under SGI C++ and Sun C++. Adding
the using A::set fixes the problem in Sun C++ and it
is only a warning on SGI C++.

As I understand it the function lookup on an
overloaded virtual function looks at the local ones.
It will find and occurrence of set but it will have
the wrong signature so you get an error. What the
using A::set statement is supposed to do is bring the
parent functions in so that they will be searched in
addition to the child class when a call is made on the
overloaded function it can find 3 different versions
instead of one.

My question is:

Are my statements about this being standard C++
correct and if and when support for this is planned in
g++

Thanks

James Briggs
_____________________________________________________________________________
http://greetings.yahoo.com.au - Yahoo! Australia & NZ Greetings
- Better choose an online card now... Valentine's Day is coming sooner than you think!

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