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: 971031 and 971105: friendly template functions are not instantiated


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


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