[CI] Detect step failures in metrics job (#122564)
[llvm-project.git] / clang / test / CXX / temp / temp.spec / temp.expl.spec / p20.cpp
blob0283dba63b110aba4d6beba47b7f3d01fafbc25b
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 template<typename T>
3 void f(T);
5 template<typename T>
6 struct A { }; // expected-note{{template is declared here}}
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}}
12 friend void f<float>(float); // okay
13 friend class A<float>; // okay
16 struct PR41792 {
17 // expected-error@+1{{cannot declare an explicit specialization in a friend}}
18 template <> friend void f<>(int);
20 // expected-error@+2{{template specialization declaration cannot be a friend}}
21 // expected-error@+1{{too few template arguments for class template 'A'}}
22 template <> friend class A<>;