Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.pt/explicit57.C

raw
1 // { dg-do run }
2 extern "C" void abort ();
3
4 int a = 0;
5
6 template <class T> void f ();
7 template <class T> void g ()
8 {
9 if (a)
10 abort ();
11 }
12
13 template <> void g<char> ()
14 {
15 }
16
17 template <class T> class C
18 {
19 public:
20 void ff () { f<T> (); }
21 void gg () { g<T> (); }
22 };
23
24 template <class T> void f ()
25 {
26 if (a)
27 abort ();
28 }
29
30 template <> void f<char> ()
31 {
32 }
33
34 int main ()
35 {
36 C<int> c;
37 c.ff();
38 c.gg();
39 a = 1;
40 C<char> d;
41 d.ff();
42 d.gg();
43 }