This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/4232: template instantiation in function body using a template argument fails
- To: Philip Martin <philip_martin at ntlworld dot com>
- Subject: Re: c++/4232: template instantiation in function body using a template argument fails
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 09 Sep 2001 17:41:23 -0300
- Cc: gcc-gnats at gcc dot gnu dot org, vyzo at media dot mit dot edu, gcc-bugs at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <87ofokdtyi.fsf@ntlworld.com>
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