Template function specialization
Joe Buck
jbuck@racerx.synopsys.com
Thu Apr 5 22:33:00 GMT 2001
> On Apr 5, 2001, Ryszard Kabatek <Ryszard.Kabatek@softax.pl> wrote:
>
> > spec.cc:16: non-template used as template
> > spec.cc:16: syntax error before `{' token
>
> > As far as I know the original version should compile.
> > I am supposing a compiler bug. I am right?
Alexandre writes:
> Nope. The angle brackets are required in template specializations,
> even if all template arguments can be deduced from the function
> argument list.
Just the same, this is a case of poor parser error recovery. It
should be able to figure out what is going on and give a better
diagnostic.
(Generally when we see "syntax error before '{' token" the parser
is just lost and doesn't know what it's seeing).
More information about the Gcc
mailing list