aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/destruct.C
blob: a9d7e86a467154edd5dda5530e4e24e5f580e690 (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
// Exhaustive test for destructors of simple types.
// PRMS Id: 2744, 3308
// Build don't link:

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

typedef char * cp;

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

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