Clang and GCC appear not to honor
Access checks are performed as if from a context unrelated to T and any of the types in Args. Only the validity of the immediate context of the variable definition is considered.
friend class Friend;
// Both of these should fire, but they do not.
"the constructor is public");
"the destructor is public");
// There is no error here.
This is exactly what
Access checks are performed as if from a context unrelated to
Tand any of the types in
says. "A friend of
T" is by definition not "unrelated to
"immediate context" is a term of art, but in any event the sentence is talking about the immediate context of the hypothetical variable definition, not the use of
It would be madness to make the
is_constructible check context-dependent; that would mean that the same type,
is_constructible<T, Args...>, has different base classes in different contexts.