blob: bded913c0650f223d96692ea3fd86bd0b8ed2a08 (
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
|
// { dg-do run }
extern "C" int printf(const char *, ...);
class A {
public:
char *x;
};
class B1:public virtual A { };
class B2:public virtual A { };
class C:public B1, public B2 {
public:
C() { }
};
int main() {
C c;
printf("&c.x = %x\n", &c.x);
printf("&c.B1::x = %x\n", &c.B1::x);
printf("&c.B2::x = %x\n", &c.B2::x);
printf("&c.A::x = %x\n", &c.A::x);
if (&c.x != &c.B1::x
|| &c.x != &c.B2::x
|| &c.x != &c.A::x)
return 1;
}
|