This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: 971031 and 971105: friendly template functions are not instantiated
- To: buhr at stat dot wisc dot edu (Kevin Buhr)
- Subject: Re: 971031 and 971105: friendly template functions are not instantiated
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 07 Nov 1997 18:49:39 -0200
- Cc: egcs-bugs at cygnus dot com
- References: <vbayb30la92.fsf@mozart.stat.wisc.edu>
Kevin Buhr writes:
> Here's an architecture-independent bug in template instantiation.
I'd say it's an architecture-independent bug in your code :-)
> if we also "INSTATIATE_F_EXPLICITLY", the name mangling for the
> explicit instance is different from the undefined implicit instance:
> perhaps this will point someone to the source of the problem.
It will. the problem is that C++ allows a non-template function and a
template specialization to have the same signature. So, when you
refer to the template specialization, you must use angle brackets:
> friend void f(foo x);
^^
friend void f<>(foo); // this should work
> template f(foo);
^^ angle brackets are missing here too, but egcs++ accepts
this syntax as an extension (should it?)
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil