Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Fariborz Jahanian | 4b6df3f | 2007-10-04 00:22:33 +0000 | [diff] [blame] | 2 | |
Fariborz Jahanian | 00ae8d5 | 2007-09-28 17:40:07 +0000 | [diff] [blame] | 3 | @protocol P1 |
Fariborz Jahanian | 5214683 | 2010-03-31 18:23:33 +0000 | [diff] [blame] | 4 | - (void) P1proto; // expected-warning {{method in protocol not implemented [-Wprotocol]}} |
| 5 | + (void) ClsP1Proto; // expected-warning {{method in protocol not implemented [-Wprotocol]}} |
Fariborz Jahanian | 00ae8d5 | 2007-09-28 17:40:07 +0000 | [diff] [blame] | 6 | - (void) DefP1proto; |
| 7 | @end |
| 8 | @protocol P2 |
Fariborz Jahanian | 5214683 | 2010-03-31 18:23:33 +0000 | [diff] [blame] | 9 | - (void) P2proto; // expected-warning {{method in protocol not implemented [-Wprotocol]}} |
| 10 | + (void) ClsP2Proto; // expected-warning {{method in protocol not implemented [-Wprotocol]}} |
Fariborz Jahanian | 00ae8d5 | 2007-09-28 17:40:07 +0000 | [diff] [blame] | 11 | @end |
| 12 | |
| 13 | @protocol P3<P2> |
Fariborz Jahanian | 5214683 | 2010-03-31 18:23:33 +0000 | [diff] [blame] | 14 | - (void) P3proto; // expected-warning {{method in protocol not implemented [-Wprotocol]}} |
| 15 | + (void) ClsP3Proto; // expected-warning {{method in protocol not implemented [-Wprotocol]}} |
Fariborz Jahanian | 00ae8d5 | 2007-09-28 17:40:07 +0000 | [diff] [blame] | 16 | + (void) DefClsP3Proto; |
| 17 | @end |
| 18 | |
| 19 | @protocol PROTO<P1, P3> |
Fariborz Jahanian | 5214683 | 2010-03-31 18:23:33 +0000 | [diff] [blame] | 20 | - (void) meth; // expected-warning {{method in protocol not implemented [-Wprotocol]}} |
| 21 | - (void) meth : (int) arg1; // expected-warning {{method in protocol not implemented [-Wprotocol]}} |
| 22 | + (void) cls_meth : (int) arg1; // expected-warning {{method in protocol not implemented [-Wprotocol]}} |
Fariborz Jahanian | 00ae8d5 | 2007-09-28 17:40:07 +0000 | [diff] [blame] | 23 | @end |
| 24 | |
Fariborz Jahanian | 8822f7c | 2010-03-27 19:02:17 +0000 | [diff] [blame] | 25 | @interface INTF <PROTO> // expected-note 3 {{required for direct or indirect protocol 'PROTO'}} \ |
| 26 | // expected-note 2 {{required for direct or indirect protocol 'P1'}} \ |
| 27 | // expected-note 2 {{required for direct or indirect protocol 'P3'}} \ |
| 28 | // expected-note 2 {{required for direct or indirect protocol 'P2'}} |
Fariborz Jahanian | 00ae8d5 | 2007-09-28 17:40:07 +0000 | [diff] [blame] | 29 | @end |
| 30 | |
Fariborz Jahanian | 8822f7c | 2010-03-27 19:02:17 +0000 | [diff] [blame] | 31 | @implementation INTF // expected-warning {{incomplete implementation}} |
Fariborz Jahanian | 00ae8d5 | 2007-09-28 17:40:07 +0000 | [diff] [blame] | 32 | - (void) DefP1proto{} |
| 33 | |
| 34 | + (void) DefClsP3Proto{} |
| 35 | |
Fariborz Jahanian | 4b6df3f | 2007-10-04 00:22:33 +0000 | [diff] [blame] | 36 | @end |