blob: e22140d446c3d92227ca1231b1fc15b1bb59c65d [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;
Ted Kremenek8b43d2b2013-03-27 00:02:21 +00006- (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}}
Fariborz Jahaniand0b01542007-09-27 18:57:03 +00009@end
10
Ted Kremenek8b43d2b2013-03-27 00:02:21 +000011@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}}
Fariborz Jahaniand0b01542007-09-27 18:57:03 +000014- (void) meth {}
15- (void) meth : (int) arg2{}
16- (void) cls_meth1 : (int) arg2{}
Fariborz Jahanian4b6df3f2007-10-04 00:22:33 +000017@end
Fariborz Jahaniand0b01542007-09-27 18:57:03 +000018
19@interface INTF1
20- (void) meth;
21- (void) meth : (int) arg1;
Ted Kremenek8b43d2b2013-03-27 00:02:21 +000022- (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}}
Fariborz Jahaniand0b01542007-09-27 18:57:03 +000025@end
26
Ted Kremenek8b43d2b2013-03-27 00:02:21 +000027@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}}
Fariborz Jahaniand0b01542007-09-27 18:57:03 +000030- (void) meth {}
31- (void) meth : (int) arg2{}
32- (void) cls_meth1 : (int) arg2{}
Fariborz Jahanian4b6df3f2007-10-04 00:22:33 +000033@end
Fariborz Jahaniand0b01542007-09-27 18:57:03 +000034
35@interface INTF2
36- (void) meth;
37- (void) meth : (int) arg1;
38- (void) cls_meth1 : (int) arg1;
39@end
40
41@implementation INTF2
42- (void) meth {}
43- (void) meth : (int) arg2{}
44- (void) cls_meth1 : (int) arg2{}
45@end
46
Fariborz Jahanian9ab80632011-02-18 22:37:54 +000047
48// rdar://8850818
49@interface Root @end
50
51@interface Foo : Root @end
52
53@implementation Foo
54
55- (void)someFunction { return; }
56
57+ (void)anotherFunction {
58 [self someFunction]; // expected-warning {{method '+someFunction' not found (return type defaults to 'id')}}
59}
60@end