1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
4 @protocol NSCopying @end
6 @protocol NSPROTO1 @end
7 @protocol NSPROTO2 @end
9 @interface NSObject <NSCopying, NSPROTO, NSPROTO1> {
14 void gorf(NSObject <NSCopying> *); // expected-note {{passing argument to parameter here}}
16 NSObject <NSCopying> *foo(id <NSCopying> bar, id id_obj)
18 NSObject <NSCopying> *Init = bar; // expected-warning {{initializing 'NSObject<NSCopying> *' with an expression of incompatible type 'id<NSCopying>'}}
19 NSObject *Init1 = bar; // expected-warning {{initializing 'NSObject *' with an expression of incompatible type 'id<NSCopying>'}}
21 NSObject <NSCopying> *I = id_obj;
22 NSObject *I1 = id_obj;
23 gorf(bar); // expected-warning {{passing 'id<NSCopying>' to parameter of incompatible type 'NSObject<NSCopying> *'}}
27 return bar; // expected-warning {{returning 'id<NSCopying>' from a function with incompatible result type 'NSObject<NSCopying> *'}}
30 void test(id <NSCopying, NSPROTO, NSPROTO2> bar)
32 NSObject <NSCopying> *Init = bar; // expected-warning {{initializing 'NSObject<NSCopying> *' with an expression of incompatible type 'id<NSCopying,NSPROTO,NSPROTO2>'}}
35 @interface NSObject (CAT)
36 + (struct S*)Meth : (struct S*)arg;
47 - (struct S *)Meth : (struct S*)a {
48 return [NSObject Meth : a];