[Bug c++/82478] Rejects valid access to private member type that should be allowed by friend
eieio at google dot com
gcc-bugzilla@gcc.gnu.org
Wed Oct 18 19:04:00 GMT 2017
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?
More information about the Gcc-bugs
mailing list