* obj-c++.dg/bitfield-[1-5].mm: New. * obj-c++.dg/class-protocol-1.mm: New. * obj-c++.dg/comp-types-1[0-1].mm: New. * obj-c++.dg/comp-types-[2-9].mm: New. * obj-c++.dg/encode-[4-8].mm: New. * obj-c++.dg/layout-1.mm: New. * obj-c++.dg/method-1[0-9].mm: New. * obj-c++.dg/method-2[0-1].mm: New. * obj-c++.dg/method-[8-9].mm: New. * obj-c++.dg/objc-gc-3.mm: New. * obj-c++.dg/try-catch-10.mm: New. * objc.dg/bitfield-5.m: New. * objc.dg/comp-types-10.m: New. * objc.dg/comp-types-9.m: New. * objc.dg/layout-1.m: New. * objc.dg/objc-gc-4.m: New. * objc.dg/try-catch-9.m: New. * objc.dg/class-protocol-1.m: Tweak diagnostics. * objc.dg/comp-types-1.m: Likewise. * objc.dg/comp-types-[5-6].m: Likewise. * objc.dg/method-9.m: Likewise. From-SVN: r100121
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
/* Test for lookup of class (factory) methods. */
|
|
/* Author: Ziemowit Laski <zlaski@apple.com>. */
|
|
/* { dg-do compile } */
|
|
|
|
@interface MyBase
|
|
- (void) rootInstanceMethod;
|
|
@end
|
|
|
|
@interface MyIntermediate: MyBase
|
|
@end
|
|
|
|
@interface MyDerived: MyIntermediate
|
|
- (void) instanceMethod;
|
|
+ (void) classMethod;
|
|
@end
|
|
|
|
@implementation MyDerived
|
|
- (void) instanceMethod {
|
|
}
|
|
|
|
+ (void) classMethod { /* If a class method is not found, the root */
|
|
[self rootInstanceMethod]; /* class is searched for an instance method */
|
|
[MyIntermediate rootInstanceMethod]; /* with the same name. */
|
|
|
|
[self instanceMethod]; /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
|
|
[MyDerived instanceMethod]; /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
|
|
}
|
|
@end
|
|
|
|
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 0 } */
|
|
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 0 } */
|
|
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 0 } */
|
|
|