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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Contributed by Nicola Pero , December 2010.  */
2
/* { dg-do compile } */
3
 
4
#include 
5
 
6
/* Test that the compiler can correctly compare protocols in types of
7
   method signatures.  In this test we look at protocols implementing
8
   other protocols.  The fact that one protocol implements another one
9
   doesn't mean that they are identical.  */
10
 
11
@protocol A
12
- (void) doSomething;
13
@end
14
 
15
@protocol B 
16
- (void) doSomethingElse;
17
@end
18
 
19
@protocol C 
20
- (void) doYetSomethingElse;
21
@end
22
 
23
@interface MyClass2
24
- (void) aMethod: (id )x;  /* { dg-message "previous declaration" } */
25
- (void) aMethod: (id )x;  /* { dg-error "duplicate declaration" } */
26
 
27
- (void) bMethod: (id )x;  /* { dg-message "previous declaration" } */
28
- (void) bMethod: (id )x;  /* { dg-error "duplicate declaration" } */
29
 
30
- (void) cMethod: (id )x;
31
- (void) cMethod: (id )x;  /* Ok - because if you implement B, then you also implement A, so  ==  */
32
 
33
- (void) dMethod: (id )x;
34
- (void) dMethod: (id )x; /* Ok */
35
 
36
- (void) eMethod: (id )x;    /* { dg-message "previous declaration" } */
37
- (void) eMethod: (id )x; /* { dg-error "duplicate declaration" } */
38
 
39
- (void) fMethod: (id )x;    /* { dg-message "previous declaration" } */
40
- (void) fMethod: (id )x;       /* { dg-error "duplicate declaration" } */
41
 
42
- (void) gMethod: (id )x;       /* { dg-message "previous declaration" } */
43
- (void) gMethod: (id )x; /* { dg-error "duplicate declaration" } */
44
 
45
- (void) hMethod: (id )x; /* { dg-message "previous declaration" } */
46
- (void) hMethod: (id )x;       /* { dg-error "duplicate declaration" } */
47
@end

powered by: WebSVN 2.1.0

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