brintos

brintos / llvm-project-archived public Read only

0
0
Text · 653 B · 26718ae Raw
53 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// expected-no-diagnostics3@protocol NSObject4- retain;5- release;6@end7 8@interface NSObject9- init;10- dealloc;11@end12 13@protocol Foo <NSObject>14@end15 16@protocol Bar <Foo>17@end18 19@interface Baz : NSObject {20	id <Foo> _foo;21	id <Bar> _bar;22}23- (id)initWithFoo:(id <Foo>)foo bar:(id <Bar>)bar;24@end25 26@implementation Baz27 28- (id)init29{30	return [self initWithFoo:0 bar:0];31}32 33- (id)initWithFoo:(id <Foo>)foo bar:(id <Bar>)bar34{35	self = [super init];36	if (self != 0) {37		_foo = [foo retain];38		_bar = [bar retain];39	}40	return self;41}42 43- dealloc44{45	[_foo release];46	[_bar release];47	[super dealloc];48	return 0;49}50 51@end52 53