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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [obj-c++.dg/] [method-15.mm] - Blame information for rev 816

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

Line No. Rev Author Line
1 308 jeremybenn
/* Check if finding multiple signatures for a method is handled gracefully when method lookup succeeds (see also method-7.m).  */
2
/* Contributed by Ziemowit Laski   */
3
/* { dg-options "-Wstrict-selector-match" } */
4
/* { dg-do compile } */
5
 
6
#include "../objc-obj-c++-shared/Object1.h"
7
 
8
@protocol MyObject
9
- (id)initWithData:(Object *)data;
10
@end
11
 
12
@protocol SomeOther
13
- (id)initWithData:(int)data;
14
@end
15
 
16
@protocol MyCoding
17
- (id)initWithData:(id)data;
18
@end
19
 
20
@interface NTGridDataObject: Object 
21
{
22
    Object *_data;
23
}
24
+ (NTGridDataObject*)dataObject:(id)data;
25
@end
26
 
27
@implementation NTGridDataObject
28
- (id)initWithData:(id)data {
29
  return data;
30
}
31
+ (NTGridDataObject*)dataObject:(id)data
32
{
33
    NTGridDataObject *result = [[NTGridDataObject alloc] initWithData:data];
34
     /* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } 33 } */
35
     /* { dg-warning "using .\\-\\(id\\)initWithData:\\(Object \\*\\)data." "" { target *-*-* } 9 } */
36
     /* { dg-warning "also found .\\-\\(id\\)initWithData:\\(id \\)data." "" { target *-*-* } 17 } */
37
     /* { dg-warning "also found .\\-\\(id\\)initWithData:\\(int\\)data." "" { target *-*-* } 13 } */
38
 
39
     /* The following warning is a consequence of picking the "wrong" method signature.  */
40
     /* { dg-warning "passing argument 1 of .initWithData:. from distinct Objective\\-C type" "" { target *-*-* } 33 } */
41
    return result;
42
}
43
@end

powered by: WebSVN 2.1.0

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