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]

template friends


When compiling the following code with egcs-1.0
---------------------------------------------------------------------
class Z {};

template < class T >
class X {
  T a;
  friend void y<>( T);
};

template < class T >
void y( T) {
  X<T>().a;
}

int main()
{
  y( Z());
}
---------------------------------------------------------------------
I get

> g++ t1.C
t1.C:6: parse error before `>'
t1.C: In function `void y<Z>(class Z)':
t1.C:11: member `a' is a private member of class `X<Z>'

If I replace "y" by an operator, everything's fine.
Any hints?

-- 
Michael Hoffmann


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