OSDN Git Service

* config/alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS, ASM_WEAKEN_LABEL,
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / memtemp96.C
1 // Test for partial specialization of a member function template.
2 // Origin: Jason Merrill <jason@cygnus.com>
3
4 template <class T> struct A {
5   template <class U> int f(U) { return 42; }
6 };
7
8 template <>
9 template <class U>
10 int A<char>::f(U);
11
12 template <>
13 template <class U>
14 int A<double>::f(U) { return 24; }
15
16 int 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
31 template <>
32 template <class U>
33 int A<char>::f(U) { return 36; }