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
Merge reload-branch up to revision 101000
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
virtual9.C
blob
c10eef69f93b36e8dc4412d4443d297cf3b1f9d7
1
// { dg-do run }
2
// Source: Neil Booth, from PR #111.
3
4
class A
5
{
6
public :
7
int i;
8
};
9
10
class B : virtual public A
11
{
12
};
13
14
class C : virtual public A
15
{
16
};
17
18
class D : public B, public C
19
{
20
public :
21
int f(void);
22
int g(void);
23
};
24
25
int D::f(void)
26
{
27
return B::i;
28
}
29
30
int D::g(void)
31
{
32
return this->B::i;
33
}
34
35
D d;
36
extern "C" void abort (void);
37
38
int main(void)
39
{
40
d.C::i=325;
41
42
if (d.f() != d.B::i || d.f() != d.g())
43
abort ();
44
45
return 0;
46
}