1// { dg-do compile } 2template<typename T, template<T> class C> 3void f1(T, C<5>); // { dg-message "note" } 4 5template<typename T, template<T> class C> 6void f2(C<5>, T); 7 8template<typename T, template<T> class C> 9void f3(C<5>, T); // { dg-message "note" } 10 11template<typename T> struct metafun { typedef T type; }; 12 13template<> struct metafun<short> { typedef int type; }; 14 15template<typename T, template<typename metafun<T>::type> class C> 16void f4(T, C<5>); // { dg-message "note" } 17 18template<int N> struct X {}; 19void g() { 20 f1(5l, X<5>()); // { dg-error "no matching" } 21 // { dg-message "(candidate|inconsistent with)" "candidate note" { target *-*-* } 20 } 22 f2(X<5>(), 5); 23 f3(X<5>(), 5l); // { dg-error "no matching" } 24 // { dg-message "(candidate|inconsistent with)" "candidate note" { target *-*-* } 23 } 25 f4(5, X<5>()); 26 f4(5l, X<5>()); // { dg-error "no matching" } 27 // { dg-message "(candidate|inconsistent with)" "candidate note" { target *-*-* } 26 } 28 f4((short)5, X<5>()); 29} 30