https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82478

--- Comment #5 from Corey Tabaka <eieio at google dot com> ---
>From what I can tell the standard is not very explicit about the access rules
in the argument list of a partial specialization specifically. However, there
are examples in the spec that demonstrate friend access does apply when
evaluating template arguments in general.

Here's the example from 11.0.6:

class A {
   typedef int I;
   I f();
   friend I g(I);
   static I x;
   template<int> struct Q;
   template<int> friend struct R;
   protected:
   struct B { };
};

A::I A::f() { return 0; }
A::I g(A::I p = A::x);
A::I g(A::I p) { return 0; }
A::I A::x = 0;
template<A::I> struct A::Q { };
template<A::I> struct R { };
struct D: A::B, A { };

Considering that "template<A::I> struct R" is allowed it seems reasonable that
"template<> struct X<A::I>" should also be allowed if X is a friend of A as
well.

What do you think?

Reply via email to