1 /* Test for lookup of class (factory) methods. */
2 /* Author: Ziemowit Laski <zlaski@apple.com>. */
3 /* { dg-do compile } */
6 - (void) rootInstanceMethod;
9 @interface MyIntermediate: MyBase
12 @interface MyDerived: MyIntermediate
13 - (void) instanceMethod;
17 @implementation MyDerived
18 - (void) instanceMethod {
21 + (void) classMethod { /* If a class method is not found, the root */
22 [self rootInstanceMethod]; /* class is searched for an instance method */
23 [MyIntermediate rootInstanceMethod]; /* with the same name. */
25 [self instanceMethod]; /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
26 /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 25 } */
27 /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 25 } */
28 /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 25 } */
29 [MyDerived instanceMethod]; /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */