1 /* Test to warn on protocol mismatch in a variety of initializations. */
3 /* { dg-do compile } */
5 typedef struct objc_class *Class;
7 typedef struct objc_object {
14 @interface NSObject <NSObject>
21 @interface Foo:NSObject <NSCopying>
25 extern id <NSObject> NSCopyObject();
28 - (void)copyWithZone {
29 Foo *copy = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
31 Foo<NSObject,NSCopying> *g = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
33 id<NSObject,NSCopying> h = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */