internal compiler error

M.Stekelenburg root@cal052304.student.utwente.nl
Tue May 19 05:34:00 GMT 1998


The code below generates an internal compiler error with 
egcs-2.90.29 980515 (egcs-1.0.3 release)
When "return" is replaced with "break" it compiles fine.
If temp_list is defined in the class instead of local it also compiles
fine.

If more info is need please reply to me (i do not read the egcs-bugs list
regularly)

Max

PS this problem was reported before by Jitse Niesen for egcs 1.0.2 with a
MUCH longer listing.
----
#include <list>

template <class M> class ibase {
	public:
		virtual int DoCall(M&) ;
};

template <class M> class MessageSender {
	public:
		void Send(M& m);
};

template <class M> void MessageSender<M>::Send(M& m) {
	list<ibase<M> *> temp_list;
	for(list<ibase<M> *>::iterator iter = temp_list.begin();
	  iter != temp_list.end(); iter++) {
		if ((*iter)->DoCall(m)) return; 
	}
}

template<class M> class mMessage {
};

class mFetchURL : public mMessage<mFetchURL> {
};

template class MessageSender<mFetchURL>;






More information about the Gcc-bugs mailing list