repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00110.html
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
opt
/
pr23299.C
blob
94a414aa5f7999e70c77a5d6841eb2ffd91f5a07
1
// PR rtl-optimization/23299
2
// { dg-do run }
3
// { dg-options "-Os" }
4
5
extern "C" void abort ();
6
7
struct A
8
{
9
virtual int a () {}
10
};
11
struct B : public A
12
{
13
virtual int b () {}
14
};
15
struct C : public A
16
{
17
virtual int c () {}
18
};
19
struct D
20
{
21
D () { d = 64; }
22
~D ();
23
int d;
24
};
25
26
int x;
27
D::~D ()
28
{
29
x |= 1;
30
if (d != 64)
31
abort ();
32
}
33
34
struct E : public B, public C
35
{
36
E () {}
37
virtual int c ();
38
~E ();
39
D dv;
40
};
41
42
E::~E ()
43
{
44
int r = c ();
45
}
46
47
int
48
E::c ()
49
{
50
if (x > 10)
51
throw 1;
52
x |= 2;
53
}
54
55
int
56
main (void)
57
{
58
{
59
E e;
60
}
61
if (x != 3)
62
abort ();
63
}