| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
// expected-no-diagnostics |
| 3 |
@protocol NSObject |
| 4 |
- retain; |
| 5 |
- release; |
| 6 |
@end |
| 7 |
|
| 8 |
@interface NSObject |
| 9 |
- init; |
| 10 |
- dealloc; |
| 11 |
@end |
| 12 |
|
| 13 |
@protocol Foo <NSObject> |
| 14 |
@end |
| 15 |
|
| 16 |
@protocol Bar <Foo> |
| 17 |
@end |
| 18 |
|
| 19 |
@interface Baz : NSObject { |
| 20 |
id <Foo> _foo; |
| 21 |
id <Bar> _bar; |
| 22 |
} |
| 23 |
- (id)initWithFoo:(id <Foo>)foo bar:(id <Bar>)bar; |
| 24 |
@end |
| 25 |
|
| 26 |
@implementation Baz |
| 27 |
|
| 28 |
- (id)init |
| 29 |
{ |
| 30 |
return [self initWithFoo:0 bar:0]; |
| 31 |
} |
| 32 |
|
| 33 |
- (id)initWithFoo:(id <Foo>)foo bar:(id <Bar>)bar |
| 34 |
{ |
| 35 |
self = [super init]; |
| 36 |
if (self != 0) { |
| 37 |
_foo = [foo retain]; |
| 38 |
_bar = [bar retain]; |
| 39 |
} |
| 40 |
return self; |
| 41 |
} |
| 42 |
|
| 43 |
- dealloc |
| 44 |
{ |
| 45 |
[_foo release]; |
| 46 |
[_bar release]; |
| 47 |
[super dealloc]; |
| 48 |
return 0; |
| 49 |
} |
| 50 |
|
| 51 |
@end |
| 52 |
|