| 1 |
// { dg-do compile } |
| 2 |
|
| 3 |
// Contributed by Nathan Sidwell 23 Oct 2003 <[email protected]> |
| 4 |
// Origin: [email protected] |
| 5 |
// PR c++/12700 ICE with covariancy |
| 6 |
|
| 7 |
struct c2 { int i; }; |
| 8 |
|
| 9 |
struct c1 { |
| 10 |
virtual c2& f8() { static c2 a; return a; } |
| 11 |
}; |
| 12 |
|
| 13 |
struct c3 : c1, c2 { |
| 14 |
virtual c2& f8() { static c2 a; return a; } |
| 15 |
}; |
| 16 |
|
| 17 |
struct c11 : public c1 { |
| 18 |
virtual c3& f8() { static c3 a; return a; } |
| 19 |
}; |
| 20 |
|
| 21 |
struct c15 : virtual c3 { |
| 22 |
virtual c2& f8() { static c3 a; return a; } |
| 23 |
}; |
| 24 |
|
| 25 |
struct c18 : virtual c11 { |
| 26 |
virtual c15& f8(); |
| 27 |
}; |
| 28 |
|
| 29 |
c15& c18::f8() { throw 0; } |