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