59 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2 3@interface INTF4- (void) meth;5- (void) meth : (int) arg1;6- (int) int_meth; // expected-note {{method 'int_meth' declared here}}7+ (int) cls_meth; // expected-note {{method 'cls_meth' declared here}}8+ (void) cls_meth1 : (int) arg1; // expected-note {{method 'cls_meth1:' declared here}}9@end10 11@implementation INTF // expected-warning {{method definition for 'int_meth' not found}} \12 // expected-warning {{method definition for 'cls_meth' not found}} \13 // expected-warning {{method definition for 'cls_meth1:' not found}}14- (void) meth {}15- (void) meth : (int) arg2{}16- (void) cls_meth1 : (int) arg2{}17@end18 19@interface INTF120- (void) meth;21- (void) meth : (int) arg1;22- (int) int_meth; // expected-note {{method 'int_meth' declared here}}23+ (int) cls_meth; // expected-note {{method 'cls_meth' declared here}}24+ (void) cls_meth1 : (int) arg1; // expected-note {{method 'cls_meth1:' declared here}}25@end26 27@implementation INTF1 // expected-warning {{method definition for 'int_meth' not found}} \28 // expected-warning {{method definition for 'cls_meth' not found}} \29 // expected-warning {{method definition for 'cls_meth1:' not found}}30- (void) meth {}31- (void) meth : (int) arg2{}32- (void) cls_meth1 : (int) arg2{}33@end34 35@interface INTF236- (void) meth;37- (void) meth : (int) arg1;38- (void) cls_meth1 : (int) arg1; 39@end40 41@implementation INTF242- (void) meth {}43- (void) meth : (int) arg2{}44- (void) cls_meth1 : (int) arg2{}45@end46 47@interface Root @end48 49@interface Foo : Root @end50 51@implementation Foo52 53- (void)someFunction { return; }54 55+ (void)anotherFunction {56 [self someFunction]; // expected-warning {{method '+someFunction' not found (return type defaults to 'id')}}57}58@end59