1// PR c++/48035 2// { dg-do run } 3 4#include <new> 5#include <cstring> 6#include <cstdlib> 7 8struct A 9{ 10 virtual void foo (void) {} 11 virtual ~A () {} 12}; 13 14struct B : public A 15{ 16 virtual ~B () {} 17}; 18 19struct C 20{ 21 virtual ~C () {} 22 int c; 23}; 24 25struct D : public virtual B, public C 26{ 27 virtual ~D () {} 28}; 29 30struct E : public virtual D 31{ 32 virtual ~E () {} 33}; 34 35int 36main () 37{ 38 char *v = new char[sizeof (E) + 16]; 39 memset (v, 0x55, sizeof (E) + 16); 40 E *e = new (v) E (); 41 e->~E (); 42 43 for (unsigned i = sizeof (E); i < sizeof (E) + 16; ++i) 44 if (v[i] != 0x55) 45 abort (); 46 47 delete[] v; 48} 49