1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2
3 template<int i> class A { };
4 template<short s> void f(A<s>); // expected-note{{candidate template ignored: substitution failure}}
5
k1()6 void k1() {
7 A<1> a;
8 f(a); // expected-error{{no matching function for call}}
9 f<1>(a);
10 }
11 template<const short cs> class B { };
12 template<short s> void g(B<s>);
k2()13 void k2() {
14 B<1> b;
15 g(b); // OK: cv-qualifiers are ignored on template parameter types
16 }
17
18 template<short s> void h(int (&)[s]); // expected-note{{candidate function template not viable: requires 1 argument, but 2 were provided}}
k3()19 void k3() {
20 int array[5];
21 h(array);
22 h<5>(array);
23 }
24
25 template<short s> void h(int (&)[s], A<s>); // expected-note{{candidate template ignored: substitution failure}}
k4()26 void k4() {
27 A<5> a;
28 int array[5];
29 h(array, a); // expected-error{{no matching function for call}}
30 h<5>(array, a);
31 }
32