public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Internal Compiler Error report
@ 1998-04-30 18:55 Alexander Samoilov
  0 siblings, 0 replies; only message in thread
From: Alexander Samoilov @ 1998-04-30 18:55 UTC (permalink / raw)
  To: egcs-bugs; +Cc: egcs

Hi all,

The following code fragment

---------------------------------

template <class T> class List;
 
template <class T>
class ListIterator
{
public:
    
    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
{
public:
    
    int length () const {
        int len = 0;
        for (ListIterator<T> li(*this); li; ++li)
            len++;
        return len;
    }
};

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

causes ICE:

--------------------------------------------------------------------
t12.cc: In method `int List<int>::length<int>() const':
t12.cc:27: Internal compiler error.
t12.cc:27: Please submit a full bug report to `egcs-bugs@cygnus.com'.

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

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.

Regards,

Alexander Samoilov


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-04-30 18:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-30 18:55 Internal Compiler Error report Alexander Samoilov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).