public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* Internal compiler error 90. Bug report
@ 1998-08-14  0:29 Roberto Viviani
  1998-08-14  7:50 ` Thomas Kunert
  1998-08-14 12:28 ` Alexandre Oliva
  0 siblings, 2 replies; 3+ messages in thread
From: Roberto Viviani @ 1998-08-14  0:29 UTC (permalink / raw)
  To: egcs-bugs

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Internal compiler error 90. Bug report
  1998-08-14  0:29 Internal compiler error 90. Bug report Roberto Viviani
@ 1998-08-14  7:50 ` Thomas Kunert
  1998-08-14 12:28 ` Alexandre Oliva
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Kunert @ 1998-08-14  7:50 UTC (permalink / raw)
  To: Roberto Viviani; +Cc: egcs-bugs

Roberto Viviani wrote:
> 
> 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
>         };
> };

What compiler do you use? For me the error occurs with egcs-1.0.2 and
gcc-2.8.1, but not with the current snapshot.
Seems to be fixed for the upcoming egcs-1.1 .

--
Thomas Kunert


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Internal compiler error 90. Bug report
  1998-08-14  0:29 Internal compiler error 90. Bug report Roberto Viviani
  1998-08-14  7:50 ` Thomas Kunert
@ 1998-08-14 12:28 ` Alexandre Oliva
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 1998-08-14 12:28 UTC (permalink / raw)
  To: Roberto Viviani; +Cc: egcs-bugs

Roberto Viviani <rv103@hermes.cam.ac.uk> writes:

> 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
> 	};
> };

I can't reproduce your problem with the latest snapshot of egcs.
Anyway, you're required to precede template-dependent qualified type
names with the `typename' keyword, i.e., you should write `typename
base::iterator' instead of just `base::iterator', because the compiler 
can't know at template parse time whether base::iterator will be the
name of a type or of a member.  egcs accepts base::iterator at certain 
points as an extension.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-08-14 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-14  0:29 Internal compiler error 90. Bug report Roberto Viviani
1998-08-14  7:50 ` Thomas Kunert
1998-08-14 12:28 ` Alexandre Oliva

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).