summaryrefslogtreecommitdiffstats
path: root/test/CXX/temp/temp.spec/temp.expl.spec/p20.cpp
blob: d270b8167a1675814128ec2ae8dcee12286f0bae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: clang-cc -fsyntax-only -verify %s
template<typename T>
void f(T);

template<typename T>
struct A { };

struct X {
  template<> friend void f<int>(int); // expected-error{{in class scope}}
  template<> friend class A<int>; // expected-error{{cannot be a friend}}
  
  friend void f<float>(float); // okay
  friend class A<float>; // okay
};