111
|
1 /* Tests of duplication. */
|
|
2 /* { dg-do compile } */
|
|
3
|
|
4 @interface class1
|
|
5 - (int) meth1; /* { dg-message "previous declaration" } */
|
|
6 - (void) meth1; /* { dg-error "duplicate declaration of method .\\-meth1." } */
|
|
7 @end
|
|
8
|
|
9 @interface class2
|
|
10 + (void) meth1; /* { dg-message "previous declaration" } */
|
|
11 + (int) meth1; /* { dg-error "duplicate declaration of method .\\+meth1." } */
|
|
12 @end
|
|
13
|
|
14 @interface class3
|
|
15 - (int) meth1;
|
|
16 @end
|
|
17
|
|
18 @implementation class3
|
|
19 - (int) meth1 { return 0; } /* { dg-message "previous definition" } */
|
|
20 - (int) meth1 { return 0; } /* { dg-error "redefinition of" } */
|
|
21 @end
|
|
22
|
|
23 @interface class4
|
|
24 + (void) meth1;
|
|
25 @end
|
|
26
|
|
27 @implementation class4
|
|
28 + (void) meth1 {} /* { dg-message "previous definition" } */
|
|
29 + (void) meth1 {} /* { dg-error "redefinition of" } */
|
|
30 @end
|