summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/ttp25.C
blob: 861d187d4db7f089927afc94e67648ad580966d8 (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
// { dg-do compile }
template<typename T, template<T> class C>
void f1(T, C<5>);		// { dg-message "note" }

template<typename T, template<T> class C>
void f2(C<5>, T);

template<typename T, template<T> class C>
void f3(C<5>, T);		// { dg-message "note" }

template<typename T> struct metafun { typedef T type; };

template<> struct metafun<short> { typedef int type; };

template<typename T, template<typename metafun<T>::type> class C>
void f4(T, C<5>);		// { dg-message "note" }

template<int N> struct X {};
void g() {
  f1(5l, X<5>()); // { dg-error "no matching" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 20 }
  f2(X<5>(), 5);
  f3(X<5>(), 5l); // { dg-error "no matching" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 23 }
  f4(5, X<5>());
  f4(5l, X<5>()); // { dg-error "no matching" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 26 }
  f4((short)5, X<5>());
}