This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Internal compiler error 61
- To: Nick Rasmussen <nick at jive dot org>
- Subject: Re: Internal compiler error 61
- From: Mumit Khan <khan at xraylith dot wisc dot EDU>
- Date: Mon, 05 Jul 1999 10:11:28 -0500
- cc: egcs-bugs at egcs dot cygnus dot com
Nick Rasmussen <nick@jive.org> writes:
>
> The following code causes an internal compiler error (61) with the current he
> ad 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 m
> eant)
>
> -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;
^^ typename
> void erase(iterator i) { hash::erase(i); return; }
> };
>
Need the typename when typedefing iterator since it's dependent type.
Of course, ICE's are always bugs.
Regards,
Mumit