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