OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [obj-c++.dg/] [method-9.mm] - Diff between revs 154 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 154 Rev 816
/* Test for lookup of class (factory) methods.  */
/* Test for lookup of class (factory) methods.  */
/* Author: Ziemowit Laski .  */
/* Author: Ziemowit Laski .  */
/* { dg-do compile } */
/* { dg-do compile } */
@interface MyBase
@interface MyBase
- (void) rootInstanceMethod;
- (void) rootInstanceMethod;
@end
@end
@interface MyIntermediate: MyBase
@interface MyIntermediate: MyBase
@end
@end
@interface MyDerived: MyIntermediate
@interface MyDerived: MyIntermediate
- (void) instanceMethod;
- (void) instanceMethod;
+ (void) classMethod;
+ (void) classMethod;
@end
@end
@implementation MyDerived
@implementation MyDerived
- (void) instanceMethod {
- (void) instanceMethod {
}
}
+ (void) classMethod {                    /* If a class method is not found, the root  */
+ (void) classMethod {                    /* If a class method is not found, the root  */
    [self rootInstanceMethod];            /* class is searched for an instance method  */
    [self rootInstanceMethod];            /* class is searched for an instance method  */
    [MyIntermediate rootInstanceMethod];  /* with the same name.                       */
    [MyIntermediate rootInstanceMethod];  /* with the same name.                       */
    [self instanceMethod];   /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
    [self instanceMethod];   /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
    [MyDerived instanceMethod];   /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
    [MyDerived instanceMethod];   /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
}
}
@end
@end
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 0 } */
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 0 } */
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 0 } */
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 0 } */
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 0 } */
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 0 } */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.