1// Test for partial specialization of a member function template. 2// Origin: Jason Merrill <jason@cygnus.com> 3 4template <class T> struct A { 5 template <class U> int f(U) { return 42; } 6}; 7 8template <> 9template <class U> 10int A<char>::f(U); 11 12template <> 13template <class U> 14int A<double>::f(U) { return 24; } 15 16int main () 17{ 18 A<int> ai; 19 if (ai.f(0) != 42) 20 return 1; 21 22 A<double> ad; 23 if (ad.f(0) != 24) 24 return 1; 25 26 A<char> ac; 27 if (ac.f(0) != 36) 28 return 1; 29} 30 31template <> 32template <class U> 33int A<char>::f(U) { return 36; } 34