g++ bug report (egcs-971016)

Alexandre Oliva oliva@dcc.unicamp.br
Wed Oct 22 09:43:00 GMT 1997


Stefan Naeher writes:

> bug.c: In function `void test(T &)':
> bug.c:17: parse error before `0'

The error message is correct.  Template-dependent type names must be
preceded by the keyword typename:

> template<class T> 
> void test(T& x) {
>    x.func((
	     typename
	     T::ptr_type)0);
> }

The code above compiles successfully.

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



More information about the Gcc-bugs mailing list