c++/3012: c++ bug

Artem Khodush artem@duma.gov.ru
Fri Jun 1 03:39:00 GMT 2001


Robert B. Lowrie wrote:
>         If a templated member function `foo' of even a non-templated class
> `A' is called within a templated class `B' with the syntax
> foo<double>(), the compiler gives a syntax error.

> // when B is a template, compile fails on this line:
> a.foo<double>();

Not a bug.
According to c++ grammar rules, '<' here means less-then operator.
You should write a.template foo<double>().





More information about the Gcc-bugs mailing list