1// PR c++/52582 2// { dg-do compile } 3// { dg-options "-O2" } 4 5inline void *operator new (__SIZE_TYPE__, void *p) throw () 6{ 7 return p; 8} 9 10struct B 11{ 12 virtual ~B (); 13 B (); 14}; 15 16struct A : B 17{ 18 A () : B () {} 19 virtual void bar (); 20}; 21 22void 23foo () 24{ 25 char a[64]; 26 B *b = new (&a) A (); 27 b->~B (); 28} 29