| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
@interface B |
| 4 |
+(int) classGetter; |
| 5 |
-(int) getter; |
| 6 |
@end |
| 7 |
|
| 8 |
@interface A : B |
| 9 |
@end |
| 10 |
|
| 11 |
@implementation A |
| 12 |
+(int) classGetter { |
| 13 |
return 0; |
| 14 |
} |
| 15 |
|
| 16 |
+(int) classGetter2 { |
| 17 |
return super.classGetter; |
| 18 |
} |
| 19 |
|
| 20 |
-(void) method { |
| 21 |
int x = super.getter; |
| 22 |
} |
| 23 |
@end |
| 24 |
|
| 25 |
void f0(void) { |
| 26 |
// FIXME: not implemented yet. |
| 27 |
//int l1 = A.classGetter; |
| 28 |
int l2 = [A classGetter2]; |
| 29 |
} |
| 30 |
|
| 31 |
__attribute__((objc_root_class)) @interface ClassBase |
| 32 |
@property (nonatomic, retain) ClassBase * foo; // expected-note {{property declared here}} |
| 33 |
@end |
| 34 |
|
| 35 |
@implementation ClassBase |
| 36 |
- (void) Meth:(ClassBase*)foo { |
| 37 |
super.foo = foo; // expected-error {{'ClassBase' cannot use 'super' because it is a root class}} |
| 38 |
[super setFoo:foo]; // expected-error {{'ClassBase' cannot use 'super' because it is a root class}} |
| 39 |
} |
| 40 |
@end |
| 41 |
|
| 42 |
@interface ClassDerived : ClassBase |
| 43 |
@property (nonatomic, retain) ClassDerived * foo; // expected-warning {{auto property synthesis will not synthesize property 'foo'; it will be implemented by its superclass}} |
| 44 |
@end |
| 45 |
|
| 46 |
@implementation ClassDerived // expected-note {{detected while default synthesizing properties in class implementation}} |
| 47 |
- (void) Meth:(ClassBase*)foo { |
| 48 |
super.foo = foo; // must work with no warning |
| 49 |
[super setFoo:foo]; // works with no warning |
| 50 |
} |
| 51 |
@end |
| 52 |
|
| 53 |
@implementation IFaceNotFound (Foo) // expected-error {{cannot find interface declaration for 'IFaceNotFound'}} |
| 54 |
-(int) foo { |
| 55 |
return super.foo; // expected-error {{expected identifier or '('}} |
| 56 |
} |
| 57 |
@end |