bug or feature in egcs-980321 ?

David C Binderman dcb@pncl.co.uk
Sun Mar 29 14:03:00 GMT 1998


Hello there,

Given the following source code,

class   A
{
protected:
  void                  f1()       {};
};

template <class T> class   B : private A {
protected:
  A::f1;
};

template <class T> class   D : private B< T >
{
public:
	void f2() { f1(); };
};

then egcs-980315 produces

/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x5a): undefined reference to `main'
collect2: ld returned 1 exit status

and egcs-980321 produces

mar25.cc: In method `void D<T>::f2()':
mar25.cc:16: Error: request for member `f1' is ambiguous in
	multiple inheritance lattice

I think the code is legal, and new egcs-980321 is wrong to produce
the error message. If I'm wrong, I'd appreciate hearing about it.
If the error message is not reproducable anywhere else, I'd also
like to hear about it.

I'd be happy for the above code to be added to the egcs C++ test suite.


Regards

David Binderman MSc BSc    +44 1293 534 847       dcb_AVOID_JUNK_MAIL@pncl.co.uk
There is no substitute for skill, taste and experience when programming
 - Dr Stroustrup, inventor of C++




More information about the Gcc-bugs mailing list