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: c++/4232: template instantiation in function body using a template argument fails


On Sep  9, 2001, Philip Martin <philip_martin@ntlworld.com> wrote:

> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4232&database=gcc

> This is not a gcc bug, your code is invalid.

Not really.  The `template' keyword should only be required below in
case the type of `f' was dependent on template arguments.  But this is
not the case, so `template' is optional.  Using it is just a
work-around for GCC.

>    template <typename _type>
>    _type moo( const foo& f ) { return f.template cast_foo<_type>(); }

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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