summaryrefslogtreecommitdiffstats
path: root/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp
blob: 2a7f16dc6b695629b6a9e404db896fda09bb1c9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// RUN: %clang_cc1 -fsyntax-only -verify %s

template<int i> class A {  };
template<short s> void f(A<s>); // expected-note{{failed template argument deduction}}

void k1() { 
  A<1> a;
  f(a); // expected-error{{no matching function for call}}
  f<1>(a);
}
template<const short cs> class B { }; 
template<short s> void g(B<s>); 
void k2() {
  B<1> b; 
  g(b); // OK: cv-qualifiers are ignored on template parameter types
}

template<short s> void h(int (&)[s]); // expected-note{{failed template argument deduction}}
void k3() {
  int array[5];
  h(array);
  h<5>(array);
}

template<short s> void h(int (&)[s], A<s>);  // expected-note{{failed template argument deduction}}
void k4() {
  A<5> a;
  int array[5];
  h(array, a); // expected-error{{no matching function for call}}
  h<5>(array, a);
}
OpenPOWER on IntegriCloud