This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Internal compiler error 90. Bug report



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]