]> git.ipfire.org Git - thirdparty/gcc.git/blob - libvtv/testsuite/template-list2.cc
Commit the vtable verification feature. This feature is designed to
[thirdparty/gcc.git] / libvtv / testsuite / template-list2.cc
1 #include <assert.h>
2
3 extern "C" int printf(const char *, ...);
4
5 class Subscriptor
6 {
7 public:
8
9 Subscriptor()
10 { counter = 1;}
11
12 virtual ~Subscriptor()
13 {
14 counter--;
15 assert(counter == 0);
16 }
17
18 private:
19 static int counter;
20 };
21
22 int Subscriptor::counter;
23
24 template <typename number>
25 class Polynomial : public Subscriptor
26 {
27 };
28
29 class LagrangeEquidistant: public Polynomial<double>
30 {
31 };
32
33 template<typename _Tp>
34 inline void
35 _MyDestroy(_Tp* __pointer)
36 { __pointer->~_Tp(); }
37
38 int main()
39 {
40 LagrangeEquidistant * s1 = new LagrangeEquidistant;
41 _MyDestroy(s1);
42
43 return 0;
44 }