URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [inherit/] [virtual8.C] - Rev 693
Compare with Previous | Blame | View Log
// 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;
}