2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / memtemp96.C
blob52519fad64621d96c287bbbc4b870f308979870d
1 // { dg-do run  }
2 // Test for partial specialization of a member function template.
3 // Origin: Jason Merrill <jason@cygnus.com>
5 template <class T> struct A {
6   template <class U> int f(U) { return 42; }
7 };
9 template <>
10 template <class U>
11 int A<char>::f(U);
13 template <>
14 template <class U>
15 int A<double>::f(U) { return 24; }
17 int main ()
19   A<int> ai;
20   if (ai.f(0) != 42)
21     return 1;
23   A<double> ad;
24   if (ad.f(0) != 24)
25     return 1;
27   A<char> ac;
28   if (ac.f(0) != 36)
29     return 1;
32 template <>
33 template <class U>
34 int A<char>::f(U) { return 36; }