bogus? `ambiguous in MI lattice' error with templates
scott snyder
snyder@d0sgif.fnal.gov
Thu Mar 12 20:49:00 GMT 1998
hi -
This is relevant to egcs-2.91.13, checked out the afternoon of the 12th,
on a mips-sgi-irix6.2 platform. I've also installed two of Mark's recent
patches, in decl2.c and pt.c.
On the following input, egcs gives a compilation error:
bug29.cc:17: request for member `value_type' is ambiguous in multiple inheritance lattice
-- bug29.cc ------------------------------------------------------------------
class alloc {};
template <class T, class Alloc = alloc>
class list {
public:
typedef T value_type;
};
template <class T>
class d0_List_1
: public list<T>
{
public:
typedef typename list<T>::value_type value_type;
d0_List_1 (const value_type& value = value_type ());
};
------------------------------------------------------------------------------
This error message is a bit strange, since there's no multiple
inheritance in this example. The error goes away if the
second template parameter to `list' is removed, or if the
`-pedantic' flag is specified.
thanks,
sss
More information about the Gcc-bugs
mailing list