OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [inherit/] [virtual8.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/48035
2
// { dg-do run }
3
 
4
#include 
5
#include 
6
#include 
7
 
8
struct A
9
{
10
  virtual void foo (void) {}
11
  virtual ~A () {}
12
};
13
 
14
struct B : public A
15
{
16
  virtual ~B () {}
17
};
18
 
19
struct C
20
{
21
  virtual ~C () {}
22
  int c;
23
};
24
 
25
struct D : public virtual B, public C
26
{
27
  virtual ~D () {}
28
};
29
 
30
struct E : public virtual D
31
{
32
  virtual ~E () {}
33
};
34
 
35
int
36
main ()
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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.