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