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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [method-12.mm] - Blame information for rev 717

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

Line No. Rev Author Line
1 703 jeremybenn
/* Check that sending messages to variables of type 'Class' does not involve instance methods, unless they reside in root classes.  */
2
/* Author: Ziemowit Laski   */
3
/* { dg-options "-Wstrict-selector-match" } */
4
/* { dg-do compile } */
5
 
6
#include 
7
 
8
@interface Base
9
- (unsigned)port;
10
@end
11
 
12
@interface Derived: Base
13
- (Object *)port;
14
+ (Protocol *)port;
15
- (id)starboard;
16
@end
17
 
18
void foo(void) {
19
  Class receiver;
20
 
21
  [receiver port];  /* { dg-warning "multiple methods named .\\+port. found" } */
22
       /* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } 9 } */
23
       /* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } 14 } */
24
 
25
  [receiver starboard];  /* { dg-warning "no .\\+starboard. method found" } */
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
 
30
  [Class port];  /* { dg-error ".Class. is not an Objective\\-C class name or alias" } */
31
}

powered by: WebSVN 2.1.0

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