Patrick Beard | b2f6820 | 2012-04-06 18:12:22 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
Fariborz Jahanian | 4b6df3f | 2007-10-04 00:22:33 +0000 | [diff] [blame] | 2 | |
Fariborz Jahanian | d0b0154 | 2007-09-27 18:57:03 +0000 | [diff] [blame] | 3 | @interface INTF |
| 4 | - (void) meth; |
| 5 | - (void) meth : (int) arg1; |
Ted Kremenek | 8b43d2b | 2013-03-27 00:02:21 +0000 | [diff] [blame] | 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}} |
Fariborz Jahanian | d0b0154 | 2007-09-27 18:57:03 +0000 | [diff] [blame] | 9 | @end |
| 10 | |
Ted Kremenek | 8b43d2b | 2013-03-27 00:02:21 +0000 | [diff] [blame] | 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}} |
Fariborz Jahanian | d0b0154 | 2007-09-27 18:57:03 +0000 | [diff] [blame] | 14 | - (void) meth {} |
| 15 | - (void) meth : (int) arg2{} |
| 16 | - (void) cls_meth1 : (int) arg2{} |
Fariborz Jahanian | 4b6df3f | 2007-10-04 00:22:33 +0000 | [diff] [blame] | 17 | @end |
Fariborz Jahanian | d0b0154 | 2007-09-27 18:57:03 +0000 | [diff] [blame] | 18 | |
| 19 | @interface INTF1 |
| 20 | - (void) meth; |
| 21 | - (void) meth : (int) arg1; |
Ted Kremenek | 8b43d2b | 2013-03-27 00:02:21 +0000 | [diff] [blame] | 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}} |
Fariborz Jahanian | d0b0154 | 2007-09-27 18:57:03 +0000 | [diff] [blame] | 25 | @end |
| 26 | |
Ted Kremenek | 8b43d2b | 2013-03-27 00:02:21 +0000 | [diff] [blame] | 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}} |
Fariborz Jahanian | d0b0154 | 2007-09-27 18:57:03 +0000 | [diff] [blame] | 30 | - (void) meth {} |
| 31 | - (void) meth : (int) arg2{} |
| 32 | - (void) cls_meth1 : (int) arg2{} |
Fariborz Jahanian | 4b6df3f | 2007-10-04 00:22:33 +0000 | [diff] [blame] | 33 | @end |
Fariborz Jahanian | d0b0154 | 2007-09-27 18:57:03 +0000 | [diff] [blame] | 34 | |
| 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 Jahanian | 9ab8063 | 2011-02-18 22:37:54 +0000 | [diff] [blame] | 47 | |
| 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 |