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++/3012: c++ bug


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>().




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