PATCH for friend/template/inline link-failure

Alexandre Oliva
Tue Sep 1 23:22:00 GMT 1998

Mark Mitchell <> writes:

>>>>>> "Alexandre" == Alexandre Oliva <> writes:
Alexandre> Mark Mitchell <> 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
Universidade Estadual de Campinas, SP, Brasil

More information about the Gcc-patches mailing list