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
Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
opt
/
pr23299.C
blob
f14750eb30601489ff2c468a4d783a61690f482a
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 () { return 0; }
10
};
11
struct B : public A
12
{
13
virtual int b () { return 1; }
14
};
15
struct C : public A
16
{
17
virtual int c () { return 2; }
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
return x;
55
}
56
57
int
58
main (void)
59
{
60
{
61
E e;
62
}
63
if (x != 3)
64
abort ();
65
}