| 1 |
// { dg-do run } |
| 2 |
// Copyright (C) 2000 Free Software Foundation, Inc. |
| 3 |
// Contributed by Nathan Sidwell 4 February 2001 <[email protected]> |
| 4 |
|
| 5 |
// Check primary bases are chosen correctly. |
| 6 |
|
| 7 |
struct A1 |
| 8 |
{ |
| 9 |
virtual void Foo () {} |
| 10 |
}; |
| 11 |
|
| 12 |
struct A : A1 |
| 13 |
{ |
| 14 |
}; |
| 15 |
|
| 16 |
struct B : A |
| 17 |
{ |
| 18 |
}; |
| 19 |
|
| 20 |
struct C : virtual B |
| 21 |
{ |
| 22 |
}; |
| 23 |
|
| 24 |
struct D : virtual B, virtual C |
| 25 |
{ |
| 26 |
}; |
| 27 |
|
| 28 |
int main() |
| 29 |
{ |
| 30 |
D d; |
| 31 |
#if __GXX_ABI_VERSION >= 100 |
| 32 |
if (sizeof (D) != sizeof (A)) |
| 33 |
return 1; |
| 34 |
#endif |
| 35 |
|
| 36 |
return 0; |
| 37 |
} |