Hi. The below is accepted by GCC and rejected by ICC. It's consistently
rejected if I remove any trace of namespace detail:

namespace detail
{
template<typename A, typename B>
  class one;

template<typename C>
  class one<int, C>;
}

template<typename T>
  class two
  {
    template<typename A/*, typename B*/>
      friend class detail::one;

    int num;
  };

namespace detail
{
template<typename C>
  struct one<int, C>
  { 
    void f()
    {
      two<int> t;
      t.num = 1;
    }
  };
}

int main()
{
  detail::one<int, double> o;
  o.f();
}


-- 
           Summary: Trouble with friend declaration across namespaces
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pcarlini at suse dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34724

Reply via email to