1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
4 @protocol NSObject @end
33 @protocol TFooProtocol <NSObject>
42 @interface TFoo : NSObject
44 - (void) setBlah: (id<TFooProtocol>)blah;
53 - (void) setBlah: (id<TFooProtocol>)blah
61 @interface TBar : NSObject
63 - (void) setBlah: (id)blah;
71 - (void) setBlah: (id)blah
79 int main (int argc, const char * argv[]) {
81 NSObject* object1 = [[[NSObject alloc] init] autorelease];
82 TNSAutoRef<NSObject*> object2([[NSObject alloc] init]);
83 TNSAutoRef<TBar*> bar([[TBar alloc] init]);
84 [bar setBlah: object1]; // <== Does not compile. It should.
85 if (object1 == object2)
86 [bar setBlah: object2]; // <== Does not compile. It should.