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

ambiguities in multiple inheritance


egcs-2.91.14 fail to compile the following example.

my system SuSE Linux 5.0 with libc5.4.44, binutils 2.8.1.0.23

compiler output :
eg++ -Vegcs-2.91.14 bug1.cpp
bug1.cpp: In method `int D<T>::GetSome()':
bug1.cpp:35: request for member `nSome' is ambiguous in multiple inheritance lattice

but since class D has it's own member  nSome the request should not be ambiguous

however, egcs 2.91.09  is working fine

=========================================================================
template < class T >
class A
{
    int nSome;
public:	
    A() { };
};


template < class T >
class B
{
    int nSome;
public:
    B() { };
};


template < class U, class V >
class C 
{
    int nSome;
public:
    C() {};
};


template < class T >
class D : public C< A<T>, B<T> >
{
    int nSome;
public:
    D() {};
    
    int GetSome() { return nSome; }    // <-- line 35
};



int main()
{
    D<int> oSomeD;
    int nDummy = oSomeD.GetSome();
};


=========================================================================


Thanks, 
       Andi



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