Problem with combination of namespaces, templates, and friends

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Wed Mar 29 21:04:00 GMT 2000


> 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


More information about the Gcc-bugs mailing list