1 // RUN: %clang_cc1 -fsyntax-only -verify %s
5 @protocol NSCopying @end
7 @protocol NSPROTO1 @end
8 @protocol NSPROTO2 @end
10 @interface NSObject <NSCopying, NSPROTO, NSPROTO1> {
15 void gorf(NSObject <NSCopying> *); // expected-note {{passing argument to parameter here}}
17 NSObject <NSCopying> *foo(id <NSCopying> bar, id id_obj)
19 NSObject <NSCopying> *Init = bar; // expected-warning {{initializing 'NSObject<NSCopying> *' with an expression of incompatible type 'id<NSCopying>'}}
20 NSObject *Init1 = bar; // expected-warning {{initializing 'NSObject *' with an expression of incompatible type 'id<NSCopying>'}}
22 NSObject <NSCopying> *I = id_obj;
23 NSObject *I1 = id_obj;
24 gorf(bar); // expected-warning {{passing 'id<NSCopying>' to parameter of incompatible type 'NSObject<NSCopying> *'}}
28 return bar; // expected-warning {{returning 'id<NSCopying>' from a function with incompatible result type 'NSObject<NSCopying> *'}}
31 void test(id <NSCopying, NSPROTO, NSPROTO2> bar)
33 NSObject <NSCopying> *Init = bar; // expected-warning {{initializing 'NSObject<NSCopying> *' with an expression of incompatible type 'id<NSCopying,NSPROTO,NSPROTO2>'}}