Daniel Dunbar | 8fbe78f | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Andy Gibbs | c6e68da | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Steve Naroff | 8ec2784 | 2009-02-26 11:32:02 +0000 | [diff] [blame] | 3 | @interface NSObject @end |
| 4 | |
| 5 | @protocol ProtocolA |
| 6 | |
| 7 | + (id)classMethod; |
| 8 | - (id)instanceMethod; |
| 9 | |
| 10 | @end |
| 11 | |
| 12 | @protocol ProtocolB <ProtocolA> |
| 13 | |
| 14 | @end |
| 15 | |
| 16 | @interface Foo : NSObject <ProtocolB> |
| 17 | |
| 18 | @end |
| 19 | |
| 20 | @interface SubFoo : Foo |
| 21 | |
| 22 | @end |
| 23 | |
| 24 | @implementation SubFoo |
| 25 | |
| 26 | + (id)method { |
| 27 | return [super classMethod]; |
| 28 | } |
| 29 | |
| 30 | - (id)method { |
| 31 | return [super instanceMethod]; |
| 32 | } |
| 33 | |
| 34 | @end |
Argyrios Kyrtzidis | 04703a6 | 2013-04-27 00:10:12 +0000 | [diff] [blame] | 35 | |
| 36 | |
| 37 | @protocol ProtC |
| 38 | -document; |
| 39 | @end |
| 40 | |
| 41 | @interface I1 : NSObject |
| 42 | @end |
| 43 | |
| 44 | @interface I1(cat) |
| 45 | -document; |
| 46 | @end |
| 47 | |
| 48 | @interface I2 : NSObject |
| 49 | -document; |
| 50 | @end |
| 51 | |
| 52 | @interface I2() <ProtC> |
| 53 | @end |
| 54 | |
| 55 | @implementation I2 |
| 56 | - document { return 0; } |
| 57 | @end |