// RUN: %clang_cc1 -fsyntax-only -verify %s template void f(T); template struct A { }; // expected-note{{template is declared here}} struct X { template<> friend void f(int); // expected-error{{in a friend}} template<> friend class A; // expected-error{{cannot be a friend}} friend void f(float); // okay friend class A; // okay }; struct PR41792 { // expected-error@+1{{cannot declare an explicit specialization in a friend}} template <> friend void f<>(int); // expected-error@+2{{template specialization declaration cannot be a friend}} // expected-error@+1{{too few template arguments for class template 'A'}} template <> friend class A<>; };