blob: 8e47837c6e07e21e3e991481b5b1424fa033f75c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// { dg-do run }
// prms-id: 12306
// a net report of the same problem as 12306
class a {
public:
int i;
};
class g : virtual public a {
};
class b : virtual public a {
int j;
};
class c : public g, public b {
};
class d {
public:
virtual class b* get() {return 0;}
};
class f : public d {
public:
virtual class b* get() {return &_c;}
c _c;
};
int main(void) {
f D;
b* bp=D.get();
D._c.i = 42;
return &D._c.i != &bp->i;
}
|