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]

Internal compiler error 61



The following code causes an internal compiler error (61) with the current head of 
the gcc-2.95 branch.

With the template removed from iterator, it gives the warning:
foo.C:16: warning: lookup of `iterator' finds `struct iterator'
foo.C:16: warning:   instead of `HashTable<T>::iterator' from dependent base class
foo.C:16: warning:   (use `typename HashTable::iterator' if that's what you meant)

-nick


template <class T>
struct iterator {
};

template <class T> 
class map {
public:
  typedef int iterator;
  static void erase(iterator __position);
};

template<class T>
class HashTable {
  public:
    typedef map<T> hash;
    typedef hash::iterator iterator;
    void            erase(iterator i) { hash::erase(i); return; }
};


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