aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/explicit60.C
blob: 5fda33355854097f8321205de645bbd274d7eb34 (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
extern "C" void abort ();

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

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

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

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

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

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