aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/gcc/testsuite/obj-c++.dg/super-class-2.mm
blob: 41e2fd2bfeeb9d23bbe553cdd2abe34df8bc1786 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* Bail out gracefully if attempting to derive from a class that has only been
   forward-declared (via @class).  Conversely, @compatibility_alias declarations
   should be traversed to find the @interface.  */

/* { dg-do compile } */

#include <objc/Object.h>

@class MyWpModule;

@compatibility_alias MyObject Object;
@compatibility_alias FictitiousModule MyWpModule;

@protocol MySelTarget
- (id) meth1;
@end

@protocol Img
- (id) meth2;
@end

@interface FunnyModule: FictitiousModule <Img> /* { dg-error ".MyWpModule., superclass of .FunnyModule." } */
- (id) meth2;
@end

@interface MyProjWpModule : MyWpModule <MySelTarget, Img> /* { dg-error ".MyWpModule., superclass of .MyProjWpModule." } */ {
  id i1, i2;
}
- (id) meth1;
- (id) meth2;
@end

@interface AnotherModule: MyObject <MySelTarget>
- (id) meth1;
@end