PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / obj-c++.dg / proto-init-mimatch-1.mm
blob64e52e8126267d76c47df580d0832df71afc6fe2
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 {
8         Class isa;
9 } *id;
11 @protocol NSObject
12 @end
14 @interface NSObject <NSObject> 
15 @end
17 @protocol NSCopying
18 - (void)copyWithZone;
19 @end
21 @interface Foo:NSObject <NSCopying> 
22 @end
25 extern id <NSObject> NSCopyObject();
27 @implementation Foo
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" } */
35 @end