blob: 27d645e73bc1a9fa7012efdabbc6b0df644fa82a [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
Fariborz Jahanian4b6df3f2007-10-04 00:22:33 +00002
Fariborz Jahaniand0b01542007-09-27 18:57:03 +00003@interface INTF
4- (void) meth;
5- (void) meth : (int) arg1;
Fariborz Jahanian8822f7c2010-03-27 19:02:17 +00006- (int) int_meth; // expected-note {{method definition for 'int_meth' not found}}
7+ (int) cls_meth; // expected-note {{method definition for 'cls_meth' not found}}
8+ (void) cls_meth1 : (int) arg1; // expected-note {{method definition for 'cls_meth1:' not found}}
Fariborz Jahaniand0b01542007-09-27 18:57:03 +00009@end
10
Fariborz Jahanian8822f7c2010-03-27 19:02:17 +000011@implementation INTF // expected-warning {{incomplete implementation}}
Fariborz Jahaniand0b01542007-09-27 18:57:03 +000012- (void) meth {}
13- (void) meth : (int) arg2{}
14- (void) cls_meth1 : (int) arg2{}
Fariborz Jahanian4b6df3f2007-10-04 00:22:33 +000015@end
Fariborz Jahaniand0b01542007-09-27 18:57:03 +000016
17@interface INTF1
18- (void) meth;
19- (void) meth : (int) arg1;
Fariborz Jahanian8822f7c2010-03-27 19:02:17 +000020- (int) int_meth; // expected-note {{method definition for 'int_meth' not found}}
21+ (int) cls_meth; // expected-note {{method definition for 'cls_meth' not found}}
22+ (void) cls_meth1 : (int) arg1; // expected-note {{method definition for 'cls_meth1:' not found}}
Fariborz Jahaniand0b01542007-09-27 18:57:03 +000023@end
24
Fariborz Jahanian8822f7c2010-03-27 19:02:17 +000025@implementation INTF1 // expected-warning {{incomplete implementation}}
Fariborz Jahaniand0b01542007-09-27 18:57:03 +000026- (void) meth {}
27- (void) meth : (int) arg2{}
28- (void) cls_meth1 : (int) arg2{}
Fariborz Jahanian4b6df3f2007-10-04 00:22:33 +000029@end
Fariborz Jahaniand0b01542007-09-27 18:57:03 +000030
31@interface INTF2
32- (void) meth;
33- (void) meth : (int) arg1;
34- (void) cls_meth1 : (int) arg1;
35@end
36
37@implementation INTF2
38- (void) meth {}
39- (void) meth : (int) arg2{}
40- (void) cls_meth1 : (int) arg2{}
41@end
42
Fariborz Jahanian9ab80632011-02-18 22:37:54 +000043
44// rdar://8850818
45@interface Root @end
46
47@interface Foo : Root @end
48
49@implementation Foo
50
51- (void)someFunction { return; }
52
53+ (void)anotherFunction {
54 [self someFunction]; // expected-warning {{method '+someFunction' not found (return type defaults to 'id')}}
55}
56@end