problem with explicit template function specification

Alexandre Oliva aoliva@cygnus.com
Sat Apr 29 05:20:00 GMT 2000


On Apr 29, 2000, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de> wrote:

>> In the program below, calling the template function A::f<>()
>> from the member function in a template class fails,
>> while calling it from an ordinary member function succeeds.

> Thanks for your bug report. This is not a bug in the compiler, but in your
> code. You have to write

>                int i = a.template f<int>();

I think the `template' keyword is only required when the object type
is template-dependent.  In this case, it wasn't, so GCC shouldn't
require the `template' keyword.  But this is one of the bugs that are
unlikely to be fixed before the C++ parser rewrite.

-- 
Alexandre Oliva    Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me



More information about the Gcc-bugs mailing list