This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++: Internal compiler error
>>>>> "Peter" == Peter Schmid <schmid@ltoi.iap.physik.tu-darmstadt.de> writes:
Peter> egcs-2.91.13 generates an internal compiler error while
Peter> compiling the following file. The program works as
Peter> expected with the previous egcs-snapshot egcs-2.91.12.
Peter> Peter Schmid
Peter> cat t2.C #include<iostream> #include<list>
Peter> template <class T> void rev(const list<T>& L) {
Peter> list<T>::const_reverse_iterator rfirst(L.end());
Peter> list<T>::const_reverse_iterator rlast(L.begin());
This is a bug in the `implicit typename' extension. The standard
requires that you use `typename list<T>::const_reverse_iterator
rfirst' and so forth. I think that this will work. I've already let
Jason know about this bug, so hopefully he will get a chance to fix it
soon.
Peter> while (rfirst != rlast) cout << *rfirst++ << endl; }
Peter> int array [] = { 1, 5, 2, 3 };
Peter> int main () { list<int> v (array, array + 4); rev(v); }
--
Mark Mitchell <mmitchell@usa.net>
http://home.earthlink.net/~mbmitchell
Consulting Services Available