1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 template<typename T>
3 void f(T);
4 
5 template<typename T>
6 struct A { };
7 
8 struct X {
9   template<> friend void f<int>(int); // expected-error{{in a friend}}
10   template<> friend class A<int>; // expected-error{{cannot be a friend}}
11 
12   friend void f<float>(float); // okay
13   friend class A<float>; // okay
14 };
15