Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 3 | |
| 4 | @protocol P0 |
| 5 | -bar; |
| 6 | @end |
| 7 | |
| 8 | @interface A <P0> |
| 9 | @end |
| 10 | |
Daniel Dunbar | ab49c0b | 2008-09-04 21:54:53 +0000 | [diff] [blame] | 11 | // Interface conforms to inherited protocol |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 12 | |
| 13 | @interface B0 : A <P0> |
| 14 | @end |
| 15 | |
| 16 | @implementation B0 |
| 17 | @end |
| 18 | |
Daniel Dunbar | ab49c0b | 2008-09-04 21:54:53 +0000 | [diff] [blame] | 19 | // Interface conforms to a protocol which extends another. The other |
| 20 | // protocol is inherited, and extended methods are implemented. |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 21 | |
| 22 | @protocol P1 <P0> |
| 23 | -foo; |
| 24 | @end |
| 25 | |
| 26 | @interface B1 : A <P1> |
| 27 | @end |
| 28 | |
| 29 | @implementation B1 |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 30 | -foo { return 0; }; |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 31 | @end |
| 32 | |
Daniel Dunbar | ab49c0b | 2008-09-04 21:54:53 +0000 | [diff] [blame] | 33 | // Interface conforms to a protocol whose methods are provided by an |
| 34 | // alternate inherited protocol. |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 35 | |
| 36 | @protocol P2 |
| 37 | -bar; |
| 38 | @end |
| 39 | |
| 40 | @interface B2 : A <P2> |
| 41 | @end |
| 42 | |
| 43 | @implementation B2 |
| 44 | @end |
| 45 | |
Daniel Dunbar | ab49c0b | 2008-09-04 21:54:53 +0000 | [diff] [blame] | 46 | // Interface conforms to a protocol whose methods are provided by a base class. |
Daniel Dunbar | 7ad1b1f | 2008-09-04 20:01:15 +0000 | [diff] [blame] | 47 | |
| 48 | @interface A1 |
| 49 | -bar; |
| 50 | @end |
| 51 | |
| 52 | @interface B3 : A1 <P2> |
| 53 | @end |
| 54 | |
| 55 | @implementation B3 |
| 56 | @end |
| 57 | |