| // RUN: %clang_cc1 -fsyntax-only -verify %s |
| // expected-no-diagnostics |
| @protocol TFooProtocol <NSObject> |
| @interface TFoo : NSObject |
| - (void) setBlah: (id<TFooProtocol>)blah; |
| - (void) setBlah: (id<TFooProtocol>)blah |
| @interface TBar : NSObject |
| - (void) setBlah: (id)blah; |
| - (void) setBlah: (id)blah |
| int main (int argc, const char * argv[]) { |
| NSObject* object1 = [[[NSObject alloc] init] autorelease]; |
| TNSAutoRef<NSObject*> object2([[NSObject alloc] init]); |
| TNSAutoRef<TBar*> bar([[TBar alloc] init]); |
| [bar setBlah: object1]; // <== Does not compile. It should. |
| [bar setBlah: object2]; // <== Does not compile. It should. |