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]

bogus? `ambiguous in MI lattice' error with templates



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


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