summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/destruct.C
blob: b0f2dfe107e6516dc152ad45cafddef67ee265f5 (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
// { dg-do assemble  }
// Exhaustive test for destructors of simple types.
// PRMS Id: 2744, 3308

template <class T> class A {
  T q;
public:
  ~A() {
    q.T::~T();
    q.~T();
    (&q)->T::~T();
    (&q)->~T();
  }
};

typedef char * cp;
typedef int I;

int main ()
{
  A<int> a;
  A<cp> b;
  int i;
  cp c;

  i.~I();
  i.I::~I();
  (&i)->~I();
  (&i)->I::~I();
  c.~cp();
  c.cp::~cp();
  (&c)->~cp();
  (&c)->cp::~cp();
}