summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/explicit57.C
blob: ba841021e9d5ae08aad4e3ace1bda3dd5e484cc3 (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
// { dg-do run  }
extern "C" void abort ();

int a = 0;

template <class T> void f ();
template <class T> void g ()
{
  if (a)
    abort ();
}

template <> void g<char> ()
{
}

template <class T> class C
{
  public:
    void ff () { f<T> (); }
    void gg () { g<T> (); }
};

template <class T> void f ()
{
  if (a)
    abort ();
}

template <> void f<char> ()
{
}

int main ()
{
  C<int> c;
  c.ff();
  c.gg();
  a = 1;
  C<char> d;
  d.ff();
  d.gg();
}