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
c++: Add [dcl.init.aggr] examples to testsuite
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
vbase1.C
blob
4392784f94f8d309458d546d625033666cccf422
1
// { dg-do run }
2
// { dg-options "-w" }
3
// Origin: Mark Mitchell <mark@codesourcery.com>
4
5
int result;
6
7
struct A {
8
A ();
9
10
int i;
11
};
12
13
A* ap;
14
15
A::A ()
16
{
17
ap = this;
18
}
19
20
struct B : virtual public A
21
{
22
B ();
23
~B ();
24
25
int j;
26
};
27
28
B::B () {
29
if ((A*) this != ap)
30
result = 1;
31
}
32
33
B::~B () {
34
if ((A*) this != ap)
35
result = 1;
36
}
37
38
struct C : public B {
39
};
40
41
struct D : public C, public B
42
{
43
};
44
45
int main ()
46
{
47
{
48
D d;
49
}
50
51
return result;
52
}