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-1.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 you can not declare two methods, in the same protocol,
7
   with the same name but conflicting method signatures.  */
8
 
9
@protocol MyProtocol
10
+ (int) method1: (int)x;   /* { dg-message "previous declaration" } */
11
+ (float) method1: (int)x; /* { dg-error "duplicate declaration of method .\\+method1." } */
12
 
13
- (int) method2: (int)x;   /* { dg-message "previous declaration" } */
14
- (int) method2: (float)x; /* { dg-error "duplicate declaration of method .\\-method2." } */
15
 
16
@optional
17
+ (int *) method3: (int)x;    /* { dg-message "previous declaration" } */
18
+ (int *) method3: (int **)x; /* { dg-error "duplicate declaration of method .\\+method3." } */
19
 
20
- (id) method4: (id)x;   /* { dg-message "previous declaration" } */
21
- (void) method4: (id)x; /* { dg-error "duplicate declaration of method .\\-method4." } */
22
@end
23
 
24
/* We don't test conflicting types between @required and @optional
25
   methods, as that is tested in method-conflict-2.  */
26
 

powered by: WebSVN 2.1.0

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