p17.cpp revision 02024a9f0d8e6c898de276193af604c42ee41269
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3template<int i> class A {  };
4template<short s> void f(A<s>); // expected-note{{failed template argument deduction}}
5
6void k1() {
7  A<1> a;
8  f(a); // expected-error{{no matching function for call}}
9  f<1>(a);
10}
11template<const short cs> class B { };
12template<short s> void g(B<s>);
13void k2() {
14  B<1> b;
15  g(b); // OK: cv-qualifiers are ignored on template parameter types
16}
17
18template<short s> void h(int (&)[s]); // expected-note{{failed template argument deduction}}
19void k3() {
20  int array[5];
21  h(array);
22  h<5>(array);
23}
24
25template<short s> void h(int (&)[s], A<s>);  // expected-note{{failed template argument deduction}}
26void 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