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