summaryrefslogtreecommitdiffstats
path: root/libvtv/testsuite/libvtv.cc/template-list2.cc
blob: 3df8d372418660e6f72d5869aa49a28442f033b9 (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
44
45
46
// { dg-do run }

#include <assert.h>

extern "C" int printf(const char *, ...);

class Subscriptor
{
  public:

  Subscriptor()
    { counter = 1;}

  virtual ~Subscriptor()
  {
    counter--;
    assert(counter == 0);
  }

  private:
    static int counter;
};

int Subscriptor::counter;

template <typename number>
class Polynomial : public Subscriptor
{
};

class LagrangeEquidistant: public Polynomial<double>
{
};

template<typename _Tp>
inline void
_MyDestroy(_Tp* __pointer)
  { __pointer->~_Tp(); }

int main()
{
  LagrangeEquidistant * s1 =  new  LagrangeEquidistant;
  _MyDestroy(s1);

  return 0;
}
OpenPOWER on IntegriCloud