2013-09-28 04:21:48 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-03-06 04:12:00 +08:00
|
|
|
|
|
|
|
@interface B
|
|
|
|
+(int) classGetter;
|
|
|
|
-(int) getter;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface A : B
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation A
|
|
|
|
+(int) classGetter {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
+(int) classGetter2 {
|
|
|
|
return super.classGetter;
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) method {
|
|
|
|
int x = super.getter;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
void f0() {
|
|
|
|
// FIXME: not implemented yet.
|
|
|
|
//int l1 = A.classGetter;
|
|
|
|
int l2 = [A classGetter2];
|
|
|
|
}
|
|
|
|
|
2013-03-12 06:26:33 +08:00
|
|
|
// rdar://13349296
|
|
|
|
__attribute__((objc_root_class)) @interface ClassBase
|
2014-10-11 06:08:23 +08:00
|
|
|
@property (nonatomic, retain) ClassBase * foo; // expected-note {{property declared here}}
|
2013-03-12 06:26:33 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation ClassBase
|
|
|
|
- (void) Meth:(ClassBase*)foo {
|
|
|
|
super.foo = foo; // expected-error {{'ClassBase' cannot use 'super' because it is a root class}}
|
|
|
|
[super setFoo:foo]; // expected-error {{'ClassBase' cannot use 'super' because it is a root class}}
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface ClassDerived : ClassBase
|
2014-08-30 02:31:16 +08:00
|
|
|
@property (nonatomic, retain) ClassDerived * foo; // expected-warning {{auto property synthesis will not synthesize property 'foo'; it will be implemented by its superclass}}
|
2013-03-12 06:26:33 +08:00
|
|
|
@end
|
|
|
|
|
2014-07-27 04:52:26 +08:00
|
|
|
@implementation ClassDerived // expected-note {{detected while default synthesizing properties in class implementation}}
|
2013-03-12 06:26:33 +08:00
|
|
|
- (void) Meth:(ClassBase*)foo {
|
2013-03-12 23:53:46 +08:00
|
|
|
super.foo = foo; // must work with no warning
|
2013-03-12 06:26:33 +08:00
|
|
|
[super setFoo:foo]; // works with no warning
|
|
|
|
}
|
|
|
|
@end
|
2015-01-21 00:53:34 +08:00
|
|
|
|
|
|
|
@implementation IFaceNotFound (Foo) // expected-error {{cannot find interface declaration for 'IFaceNotFound'}}
|
|
|
|
-(int) foo {
|
|
|
|
return super.foo; // expected-error {{expected identifier or '('}}
|
|
|
|
}
|
|
|
|
@end
|