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
strub: enable conditional support
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
torture
/
pr45699.C
blob
828c1ef8e579a0a0fb1670768ed104b42afb3b85
1
// { dg-do run }
2
3
extern "C" void abort ();
4
5
class A
6
{
7
public:
8
virtual void foo () {abort();}
9
};
10
11
class B : public A
12
{
13
public:
14
int z;
15
virtual void foo () {abort();}
16
};
17
18
class C : public A
19
{
20
public:
21
void *a[32];
22
unsigned long b;
23
long c[32];
24
25
virtual void foo () {abort();}
26
};
27
28
class D : public C, public B
29
{
30
public:
31
D () : C(), B()
32
{
33
int i;
34
for (i = 0; i < 32; i++)
35
{
36
a[i] = (void *) 0;
37
c[i] = 0;
38
}
39
b = 0xaaaa;
40
}
41
42
virtual void foo ();
43
};
44
45
void D::foo()
46
{
47
if (b != 0xaaaa)
48
abort();
49
}
50
51
static inline void bar (B &b)
52
{
53
b.foo ();
54
}
55
56
int main()
57
{
58
D d;
59
bar (d);
60
return 0;
61
}