OSDN Git Service

5248123e79a7d0e58d2513895d75444c65518154
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / super-class-4.m
1 /* Bail out gracefully if attempting to derive from a class that has only been
2    forward-declared (via @class).  Conversely, @compatibility_alias declarations
3    should be traversed to find the @interface.  */
4 /* { dg-do compile } */
5
6 #include <objc/Object.h>
7
8 @class MyWpModule;
9
10 @compatibility_alias MyObject Object;
11 @compatibility_alias FictitiousModule MyWpModule;
12
13 @protocol MySelTarget
14 - (id) meth1;
15 @end
16
17 @protocol Img
18 - (id) meth2;
19 @end
20
21 @interface FunnyModule: FictitiousModule <Img> /* { dg-error ".MyWpModule., superclass of .FunnyModule." } */
22 - (id) meth2;
23 @end
24
25 @interface MyProjWpModule : MyWpModule <MySelTarget, Img> /* { dg-error ".MyWpModule., superclass of .MyProjWpModule." } */ {
26   id i1, i2;
27 }
28 - (id) meth1;
29 - (id) meth2;
30 @end
31
32 @interface AnotherModule: MyObject <MySelTarget>
33 - (id) meth1;
34 @end