This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
ambiguities in multiple inheritance
- To: egcs-bugs at cygnus dot com
- Subject: ambiguities in multiple inheritance
- From: Andreas Wimmer <wim at pdib32 dot joanneum dot ac dot at>
- Date: Fri, 20 Mar 1998 13:50:12 +0100
- Reply-To: wim at pdib32 dot joanneum dot ac dot at
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