xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/method-undefined-warn-1.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc@interface INTF
4*f4a2713aSLionel Sambuc- (void) meth;
5*f4a2713aSLionel Sambuc- (void) meth : (int) arg1;
6*f4a2713aSLionel Sambuc- (int) int_meth;  // expected-note {{method 'int_meth' declared here}}
7*f4a2713aSLionel Sambuc+ (int) cls_meth;  // expected-note {{method 'cls_meth' declared here}}
8*f4a2713aSLionel Sambuc+ (void) cls_meth1 : (int) arg1;  // expected-note {{method 'cls_meth1:' declared here}}
9*f4a2713aSLionel Sambuc@end
10*f4a2713aSLionel Sambuc
11*f4a2713aSLionel Sambuc@implementation INTF // expected-warning {{method definition for 'int_meth' not found}} \
12*f4a2713aSLionel Sambuc                     // expected-warning {{method definition for 'cls_meth' not found}} \
13*f4a2713aSLionel Sambuc                     // expected-warning {{method definition for 'cls_meth1:' not found}}
14*f4a2713aSLionel Sambuc- (void) meth {}
15*f4a2713aSLionel Sambuc- (void) meth : (int) arg2{}
16*f4a2713aSLionel Sambuc- (void) cls_meth1 : (int) arg2{}
17*f4a2713aSLionel Sambuc@end
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambuc@interface INTF1
20*f4a2713aSLionel Sambuc- (void) meth;
21*f4a2713aSLionel Sambuc- (void) meth : (int) arg1;
22*f4a2713aSLionel Sambuc- (int)  int_meth; // expected-note {{method 'int_meth' declared here}}
23*f4a2713aSLionel Sambuc+ (int) cls_meth;  // expected-note {{method 'cls_meth' declared here}}
24*f4a2713aSLionel Sambuc+ (void) cls_meth1 : (int) arg1;  // expected-note {{method 'cls_meth1:' declared here}}
25*f4a2713aSLionel Sambuc@end
26*f4a2713aSLionel Sambuc
27*f4a2713aSLionel Sambuc@implementation INTF1 // expected-warning {{method definition for 'int_meth' not found}} \
28*f4a2713aSLionel Sambuc                      // expected-warning {{method definition for 'cls_meth' not found}} \
29*f4a2713aSLionel Sambuc                      // expected-warning {{method definition for 'cls_meth1:' not found}}
30*f4a2713aSLionel Sambuc- (void) meth {}
31*f4a2713aSLionel Sambuc- (void) meth : (int) arg2{}
32*f4a2713aSLionel Sambuc- (void) cls_meth1 : (int) arg2{}
33*f4a2713aSLionel Sambuc@end
34*f4a2713aSLionel Sambuc
35*f4a2713aSLionel Sambuc@interface INTF2
36*f4a2713aSLionel Sambuc- (void) meth;
37*f4a2713aSLionel Sambuc- (void) meth : (int) arg1;
38*f4a2713aSLionel Sambuc- (void) cls_meth1 : (int) arg1;
39*f4a2713aSLionel Sambuc@end
40*f4a2713aSLionel Sambuc
41*f4a2713aSLionel Sambuc@implementation INTF2
42*f4a2713aSLionel Sambuc- (void) meth {}
43*f4a2713aSLionel Sambuc- (void) meth : (int) arg2{}
44*f4a2713aSLionel Sambuc- (void) cls_meth1 : (int) arg2{}
45*f4a2713aSLionel Sambuc@end
46*f4a2713aSLionel Sambuc
47*f4a2713aSLionel Sambuc
48*f4a2713aSLionel Sambuc// rdar://8850818
49*f4a2713aSLionel Sambuc@interface Root @end
50*f4a2713aSLionel Sambuc
51*f4a2713aSLionel Sambuc@interface Foo : Root @end
52*f4a2713aSLionel Sambuc
53*f4a2713aSLionel Sambuc@implementation Foo
54*f4a2713aSLionel Sambuc
55*f4a2713aSLionel Sambuc- (void)someFunction { return; }
56*f4a2713aSLionel Sambuc
57*f4a2713aSLionel Sambuc+ (void)anotherFunction {
58*f4a2713aSLionel Sambuc    [self someFunction]; // expected-warning {{method '+someFunction' not found (return type defaults to 'id')}}
59*f4a2713aSLionel Sambuc}
60*f4a2713aSLionel Sambuc@end
61