ugly diagnostic

Andreas Kloeckner ak@ixion.net
Fri Apr 9 15:03:00 GMT 1999


Hi,

For this program 

8<-------------------------------------------------------
template<class Iterator> struct iterator_traits {
  typedef typename Iterator::iterator_category    iterator_category;
};

template<class Category>
struct iterator {
  typedef Category  iterator_category;
};


template <class Iterator>
struct reverse_iterator : public
iterator<iterator_traits<Iterator>::iterator_category> {
  protected:
  Iterator current;
  
};
class tag { };

template <class T>
struct list {
  template <class Item>
  struct list_iterator {
// ** uncomment this to prevent "Internal compiler error"
//    typedef tag iterator_category;
  };
  
  // Iterators
----------------------------------------------------------------
  reverse_iterator<list_iterator<T> > rbegin()
    { return reverse_iterator<list_iterator<T>
>(list_iterator<T>(Head->next())); }
};

template list<int>;

8<-------------------------------------------------------

i get the following diagnostic:

8<-------------------------------------------------------
17:12:46 ak@dendrite [~]g++ egcs-bug.cc
egcs-bug.cc: In instantiation of
`reverse_iterator<list<int>::list_iterator<int> >':
egcs-bug.cc:29:   instantiated from `list<int>::rbegin()'
egcs-bug.cc:32:   instantiated from here
egcs-bug.cc:16: Internal compiler error.
egcs-bug.cc:16: Please submit a full bug report to
`egcs-bugs@egcs.cygnus.com'.
egcs-bug.cc:16: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for
details.
8<-------------------------------------------------------

Uncommenting the //** line prevents the error.
egcs version is 2.93.12 (snapshot 19990314)
btw, thanks for making such a great compiler.

cu
andreas


More information about the Gcc-bugs mailing list