This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++ bug report (egcs-971016)
- To: Stefan Naeher <naeher at infsn dot informatik dot uni-halle dot de>
- Subject: Re: g++ bug report (egcs-971016)
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 22 Oct 1997 14:38:10 -0200
- Cc: egcs-bugs at cygnus dot com
- References: <199710221534.RAA22535@infsn.informatik.uni-halle.de>
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