Internal compiler error 90. Bug report

Roberto Viviani rv103@hermes.cam.ac.uk
Fri Aug 14 00:29:00 GMT 1998


Object: bug report - typedef-ined types of template classes generate error
90 in nested classes
 
The following code snippet generates the error message 'Internal compiler
error 90. Please submit a full bug report to etc.':

template<class T> class baseclass {
public:
	typedef int* iterator;
};

template<class T> class derived : public baseclass<T> {
public:
	typedef baseclass<T> base;
	void f(base::iterator i);	//this compiles ok
	class internal {
	public:
		void g(base::iterator i);  //<- error here
	};
};


The problem does not occur if the classes are not template classes.
Furthermore, the problem can be resoved by naming the template base class
directly when the scope operator is used in the nested class, or by adding
a typedef as follows:


template<class T> class baseclass {
public:
	typedef int* iterator;
};

template<class T> class derived : public baseclass<T> {
public:
	typedef baseclass<T> base;
	class internal {
	public:
		typedef	baseclass<T> base;
		void g(base::iterator i);
	};
};


All the best,

R. Viviani
Dept. of Psychiatry III
University of Ulm
Germany




More information about the Gcc-bugs mailing list