OSDN Git Service

2001-02-26 Jeffrey Oldham <oldham@codesourcery.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / spec3.C
1 extern "C" void abort();
2
3 class X
4 {
5   public:
6     virtual int f() const = 0;
7 };
8
9 template <class T>
10 class Y: public X
11 {
12   public:
13     virtual int f() const;
14 };
15
16 template <class T>
17 int Y<T>::f() const
18 {
19   abort();
20   return 0;
21 }
22
23 template <>
24 int Y<bool>::f() const;
25
26 template <>
27 int Y<bool>::f() const
28 {
29   return 0;
30 }
31
32 int main()
33 {
34   Y<bool> yb;
35
36   yb.f();
37 }