blob: 4f6a119b2879efe42cfd1f720536c0ef21090dca (
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
47
48
|
// PR c++/48035
// { dg-do run }
#include <new>
#include <cstring>
#include <cstdlib>
struct A
{
virtual void foo (void) {}
virtual ~A () {}
};
struct B : public A
{
virtual ~B () {}
};
struct C
{
virtual ~C () {}
int c;
};
struct D : public virtual B, public C
{
virtual ~D () {}
};
struct E : public virtual D
{
virtual ~E () {}
};
int
main ()
{
char *v = new char[sizeof (E) + 16];
memset (v, 0x55, sizeof (E) + 16);
E *e = new (v) E ();
e->~E ();
for (unsigned i = sizeof (E); i < sizeof (E) + 16; ++i)
if (v[i] != 0x55)
abort ();
delete[] v;
}
|