Douglas Gregor | 86f6cf6 | 2012-12-11 18:53:07 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 2 | |
| 3 | @interface I |
Ted Kremenek | 8b43d2b | 2013-03-27 00:02:21 +0000 | [diff] [blame] | 4 | - Meth; // expected-note 2 {{method 'Meth' declared here}} |
Douglas Gregor | 86f6cf6 | 2012-12-11 18:53:07 +0000 | [diff] [blame] | 5 | - unavailableMeth __attribute__((availability(macosx,unavailable))); |
| 6 | - unavailableMeth2 __attribute__((unavailable)); |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 7 | @end |
| 8 | |
Ted Kremenek | 8b43d2b | 2013-03-27 00:02:21 +0000 | [diff] [blame] | 9 | @implementation I // expected-warning {{method definition for 'Meth' not found}} |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 10 | @end |
| 11 | |
| 12 | @implementation I(CAT) |
Fariborz Jahanian | fefe91e | 2011-07-28 23:19:50 +0000 | [diff] [blame] | 13 | - Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 14 | @end |
| 15 | |
| 16 | #pragma GCC diagnostic ignored "-Wincomplete-implementation" |
| 17 | @interface I2 |
Ted Kremenek | 3306ec1 | 2012-02-27 22:55:11 +0000 | [diff] [blame] | 18 | - Meth; // expected-note{{method 'Meth' declared here}} |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 19 | @end |
| 20 | |
| 21 | @implementation I2 |
| 22 | @end |
| 23 | |
| 24 | @implementation I2(CAT) |
Fariborz Jahanian | fefe91e | 2011-07-28 23:19:50 +0000 | [diff] [blame] | 25 | - Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 26 | @end |
| 27 | |
Argyrios Kyrtzidis | 458bacf | 2011-10-27 00:09:34 +0000 | [diff] [blame] | 28 | @interface Q |
| 29 | @end |
| 30 | |
| 31 | // rdar://10336158 |
| 32 | @implementation Q |
| 33 | |
| 34 | __attribute__((visibility("default"))) |
Argyrios Kyrtzidis | fce79eb | 2012-03-23 23:24:23 +0000 | [diff] [blame] | 35 | @interface QN // expected-error {{Objective-C declarations may only appear in global scope}} |
Argyrios Kyrtzidis | 458bacf | 2011-10-27 00:09:34 +0000 | [diff] [blame] | 36 | { |
| 37 | } |
| 38 | @end |
| 39 | |
| 40 | @end |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 41 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 42 | // rdar://15580969 |
| 43 | typedef char BOOL; |
| 44 | |
| 45 | @protocol NSObject |
| 46 | - (BOOL)isEqual:(id)object; |
| 47 | @end |
| 48 | |
| 49 | @interface NSObject <NSObject> |
| 50 | @end |
| 51 | |
| 52 | @protocol NSApplicationDelegate <NSObject> |
| 53 | - (void)ImpleThisMethod; // expected-note {{method 'ImpleThisMethod' declared here}} |
| 54 | @end |
| 55 | |
| 56 | @interface AppDelegate : NSObject <NSApplicationDelegate> |
| 57 | @end |
| 58 | |
| 59 | @implementation AppDelegate (MRRCategory) |
| 60 | |
| 61 | - (BOOL)isEqual:(id)object |
| 62 | { |
| 63 | return __objc_no; |
| 64 | } |
| 65 | |
| 66 | - (void)ImpleThisMethod {} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} |
| 67 | @end |