1 /* Test for handling of protocol hierarchies. */
2 /* Author: Ziemowit Laski <zlaski@apple.com>. */
3 /* { dg-do compile } */
4 /* { dg-additional-options "-Wno-objc-root-class" } */
6 /* One-line substitute for objc/objc.h */
7 typedef struct objc_object { struct objc_class *class_pointer; } *id;
14 - (void)someOtherMethod;
17 @interface NSObject <NSObj>
21 @implementation NSObject
25 @protocol Booing <NSObj>
29 @interface Boo: NSObject <Booing> // protocol has only one parent
36 @protocol Fooing <NSCopying, NSObj> // Fooing has two parent protocols
40 @interface Foo: NSObject <Fooing>
45 - (void)someOtherMethod {}
49 id<Booing, Fooing> stupidVar;
52 [stupidVar anotherMsg]; /* { dg-warning ".\\-anotherMsg. not found in protocol" } */
53 /* { dg-warning "no .\\-anotherMsg. method found" "" { target *-*-* } .-1 } */
57 /* { dg-warning "messages without a matching method signature will be assumed to return .id. and accept .\.\.\.. as arguments" "" { target *-*-* } 0 } */