Patrick Beard | b2f6820 | 2012-04-06 18:12:22 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
Chris Lattner | cddc888 | 2009-03-01 00:56:52 +0000 | [diff] [blame] | 2 | |
Fariborz Jahanian | 8822f7c | 2010-03-27 19:02:17 +0000 | [diff] [blame] | 3 | @interface MyClass // expected-note {{required for direct or indirect protocol 'P'}} |
Chris Lattner | cddc888 | 2009-03-01 00:56:52 +0000 | [diff] [blame] | 4 | @end |
| 5 | |
| 6 | @protocol P |
| 7 | - (void)Pmeth; |
Ted Kremenek | 3306ec1 | 2012-02-27 22:55:11 +0000 | [diff] [blame] | 8 | - (void)Pmeth1; // expected-note {{method 'Pmeth1' declared here}} |
Chris Lattner | cddc888 | 2009-03-01 00:56:52 +0000 | [diff] [blame] | 9 | @end |
| 10 | |
| 11 | // Class extension |
| 12 | @interface MyClass () <P> |
Fariborz Jahanian | 8822f7c | 2010-03-27 19:02:17 +0000 | [diff] [blame] | 13 | - (void)meth2; // expected-note {{method definition for 'meth2' not found}} |
Chris Lattner | cddc888 | 2009-03-01 00:56:52 +0000 | [diff] [blame] | 14 | @end |
| 15 | |
| 16 | // Add a category to test that clang does not emit warning for this method. |
| 17 | @interface MyClass (Category) |
| 18 | - (void)categoryMethod; |
| 19 | @end |
| 20 | |
Fariborz Jahanian | 61c8d3e | 2010-10-29 23:20:05 +0000 | [diff] [blame] | 21 | @implementation MyClass // expected-warning {{incomplete implementation}} \ |
Ted Kremenek | 3306ec1 | 2012-02-27 22:55:11 +0000 | [diff] [blame] | 22 | // expected-warning {{method 'Pmeth1' in protocol not implemented}} |
Chris Lattner | cddc888 | 2009-03-01 00:56:52 +0000 | [diff] [blame] | 23 | - (void)Pmeth {} |
| 24 | @end |