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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [obj-c++.dg/] [method-9.mm] - Blame information for rev 20

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* Test for lookup of class (factory) methods.  */
2
/* Author: Ziemowit Laski .  */
3
/* { dg-do compile } */
4
 
5
@interface MyBase
6
- (void) rootInstanceMethod;
7
@end
8
 
9
@interface MyIntermediate: MyBase
10
@end
11
 
12
@interface MyDerived: MyIntermediate
13
- (void) instanceMethod;
14
+ (void) classMethod;
15
@end
16
 
17
@implementation MyDerived
18
- (void) instanceMethod {
19
}
20
 
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.                       */
24
 
25
    [self instanceMethod];   /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
26
    [MyDerived instanceMethod];   /* { dg-warning ".MyDerived. may not respond to .\\+instanceMethod." } */
27
}
28
@end
29
 
30
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 0 } */
31
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 0 } */
32
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 0 } */
33
 

powered by: WebSVN 2.1.0

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