OSDN Git Service

2001-02-26 Jeffrey Oldham <oldham@codesourcery.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / spec15.C
1 extern "C" void abort();
2
3 template <class T>
4 struct S1
5 {
6   static void f();
7 };
8
9 template <>
10 void S1<int>::f() {}
11
12 struct S2
13 {
14   template <class T>
15   static void g(T);
16 };
17
18 template <>
19 void S2::g(double) {}
20
21 template <>
22 void S2::g<int>(int) {}
23
24 template <class T>
25 struct S3
26 {
27   template <class U>
28   static int h(U);
29 };
30
31 template <>
32 template <>
33 int S3<double>::h(int) { return 0; }
34
35 template <>
36 template <>
37 int S3<char>::h(int) { return 1; }
38
39 int main()
40 {
41   S1<int>::f();
42   S2::g(3.0);
43   S2::g(7);
44
45   if (S3<double>::h(7) != 0) 
46     abort();
47   if (S3<char>::h(7) != 1)
48     abort();
49 }