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]

Re: g++ bug report (egcs-971016)


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


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