Internal Compiler Error report

Alexander Samoilov spike@Gambit.Msk.SU
Thu Apr 30 15:07:00 GMT 1998

Hi all,

The following code fragment


template <class T> class List;
template <class T>
class ListIterator
    ListIterator (const List<T>& aList);

//  This declaration causes internal compiler error
    ListIterator (const ListIterator<T>& rhs);

    operator void* () const;
    ListIterator<T>& operator++ ();


template <class T>
class List
    int length () const {
        int len = 0;
        for (ListIterator<T> li(*this); li; ++li)
        return len;

void test(List<int>& vals)
    int val = vals.length();

causes ICE:

-------------------------------------------------------------------- In method `int List<int>::length<int>() const': Internal compiler error. Please submit a full bug report to `'.

for all snapshots later than 1998-03-02 including the latest
CVS snapshot. This has been tested on Linux gnulibc1 and Sparc Solaris

Please note, that after commenting copy constructor declaration
this example can be compiled by egcs. gcc-2.8.1 compiles this sample ok.

Hope this help.


Alexander Samoilov

More information about the Gcc-bugs mailing list