| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-Wno-return-type" } */ |
| 3 |
// { dg-additional-options "-Wno-objc-root-class" } |
| 4 |
|
| 5 |
/* We used to ICE because we removed the cast to List_linked* |
| 6 |
in -[ListIndex_linked next]. */ |
| 7 |
|
| 8 |
@interface List |
| 9 |
{ |
| 10 |
@public |
| 11 |
int firstLink; |
| 12 |
} |
| 13 |
@end |
| 14 |
|
| 15 |
@interface ListIndex_linked |
| 16 |
{ |
| 17 |
@public |
| 18 |
List *collection; |
| 19 |
int link; |
| 20 |
} |
| 21 |
@end |
| 22 |
|
| 23 |
@interface List_linked: List |
| 24 |
@end |
| 25 |
|
| 26 |
@implementation List |
| 27 |
@end |
| 28 |
|
| 29 |
@implementation ListIndex_linked |
| 30 |
- next |
| 31 |
{ |
| 32 |
link = ((List_linked*)collection)->firstLink; |
| 33 |
} |
| 34 |
@end |
| 35 |
|