PATCH for friend/template/inline link-failure

Alexandre Oliva oliva@dcc.unicamp.br
Tue Sep 1 23:22:00 GMT 1998


Mark Mitchell <mark@markmitchell.com> writes:

>>>>>> "Alexandre" == Alexandre Oliva <oliva@dcc.unicamp.br> writes:
Alexandre> Mark Mitchell <mark@markmitchell.com> writes:

>>> template <class P1> struct S1 { struct SS1 { }; friend void Foo
>>> (const SS1& ss1) { } };

Alexandre> In this case, I think Foo is a non-template function,
Alexandre> so it must be explicitly defined for each type
Alexandre> S1<P1>::SS1.  A template definition won't do.

> You're right, and, then again, you're not. :-)

I've just noticed that the template function was defined as
Foo<T>(S1<T>const&), not Foo<T>(S1<T>::SS1 const&), as I had first
parsed it.  In this case, the test case is correct.  Sorry for wasting 
bandwidth :-(

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil




More information about the Gcc-patches mailing list