OSDN Git Service

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