summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/spec15.C
blob: c812da068f59c57ebbe18c8de176379c4dd6f326 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// { dg-do run  }
extern "C" void abort();

template <class T>
struct S1
{
  static void f();
};

template <>
void S1<int>::f() {}

struct S2
{
  template <class T>
  static void g(T);
};

template <>
void S2::g(double) {}

template <>
void S2::g<int>(int) {}

template <class T>
struct S3
{
  template <class U>
  static int h(U);
};

template <>
template <>
int S3<double>::h(int) { return 0; }

template <>
template <>
int S3<char>::h(int) { return 1; }

int main()
{
  S1<int>::f();
  S2::g(3.0);
  S2::g(7);

  if (S3<double>::h(7) != 0) 
    abort();
  if (S3<char>::h(7) != 1)
    abort();
}