https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61327
--- Comment #2 from Pavel <isak50 at mail dot ru> --- // Clang compiles without errors. class B { protected: void f() {} }; template <typename...> struct S; template <typename R> struct S<R>{ template <typename T> static void caller(T *p) {p->B::f();} // error: 'void B::f()' is protected //static void caller(T *p) {p->f();} // Ok }; class Q : B{ template <typename...> friend struct S; }; int main(){ Q q; S<int>::caller(&q); return 0; }