/* Test to warn on protocol mismatch in a variety of initializations. */ /* { dg-do compile } */ typedef struct objc_class *Class; typedef struct objc_object { Class isa; } *id; @protocol NSObject @end @interface NSObject @end @protocol NSCopying - (void)copyWithZone; @end @interface Foo:NSObject @end extern id NSCopyObject(); @implementation Foo - (void)copyWithZone { Foo *copy = NSCopyObject(); /* { dg-warning "type \\'id \\' does not conform to the \\'NSCopying\\' protocol" } */ Foo *g = NSCopyObject(); /* { dg-warning "type \\'id \\' does not conform to the \\'NSCopying\\' protocol" } */ id h = NSCopyObject(); /* { dg-warning "type \\'id \\' does not conform to the \\'NSCopying\\' protocol" } */ } @end