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: Problem with combination of namespaces, templates, and friends


> I browsed around on http://gcc.gnu.org/ and on the gcc/g++ info pages
> but couldn't find any mention of this bug (feature?).

Thanks for your bug report. It's a known bug, and it is difficult to
fix. The work-around is to declare the entire template as a friend:

namespace A {
  template<class T>
  struct thing {
    template<class U>
    friend void B::fun(const thing &);
  };
}

Regards,
Martin

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