2013-09-27 20:21:48 +00:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-03-05 20:12:00 +00: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
|
|
|
|
|
2022-02-07 15:28:35 -05:00
|
|
|
void f0(void) {
|
2009-03-05 20:12:00 +00:00
|
|
|
// FIXME: not implemented yet.
|
|
|
|
//int l1 = A.classGetter;
|
|
|
|
int l2 = [A classGetter2];
|
|
|
|
}
|
|
|
|
|
2013-03-11 22:26:33 +00:00
|
|
|
__attribute__((objc_root_class)) @interface ClassBase
|
2014-10-10 22:08:23 +00:00
|
|
|
@property (nonatomic, retain) ClassBase * foo; // expected-note {{property declared here}}
|
2013-03-11 22:26:33 +00: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-29 18:31:16 +00: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-11 22:26:33 +00:00
|
|
|
@end
|
|
|
|
|
2014-07-26 20:52:26 +00:00
|
|
|
@implementation ClassDerived // expected-note {{detected while default synthesizing properties in class implementation}}
|
2013-03-11 22:26:33 +00:00
|
|
|
- (void) Meth:(ClassBase*)foo {
|
2013-03-12 15:53:46 +00:00
|
|
|
super.foo = foo; // must work with no warning
|
2013-03-11 22:26:33 +00:00
|
|
|
[super setFoo:foo]; // works with no warning
|
|
|
|
}
|
|
|
|
@end
|
2015-01-20 16:53:34 +00:00
|
|
|
|
|
|
|
@implementation IFaceNotFound (Foo) // expected-error {{cannot find interface declaration for 'IFaceNotFound'}}
|
|
|
|
-(int) foo {
|
|
|
|
return super.foo; // expected-error {{expected identifier or '('}}
|
|
|
|
}
|
|
|
|
@end
|