// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s //rdar: //8591619 // pr8453 @protocol NSCopying @end @protocol NSPROTO @end @protocol NSPROTO1 @end @protocol NSPROTO2 @end @interface NSObject { Class isa; } @end void gorf(NSObject *); // expected-note {{passing argument to parameter here}} NSObject *foo(id bar, id id_obj) { NSObject *Init = bar; // expected-warning {{initializing 'NSObject *' with an expression of incompatible type 'id'}} NSObject *Init1 = bar; // expected-warning {{initializing 'NSObject *' with an expression of incompatible type 'id'}} NSObject *I = id_obj; NSObject *I1 = id_obj; gorf(bar); // expected-warning {{passing 'id' to parameter of incompatible type 'NSObject *'}} gorf(id_obj); return bar; // expected-warning {{returning 'id' from a function with incompatible result type 'NSObject *'}} } void test(id bar) { NSObject *Init = bar; // expected-warning {{initializing 'NSObject *' with an expression of incompatible type 'id'}} } // rdar://8843851 @interface NSObject (CAT) + (struct S*)Meth : (struct S*)arg; @end struct S { char *types; }; @interface I @end @implementation I - (struct S *)Meth : (struct S*)a { return [NSObject Meth : a]; } @end