Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / objc.dg / method-conflict-3.m
blobcc4d2631fa271f0b494577192a4f39b15be88502
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010.  */
2 /* { dg-do compile } */
4 #include <objc/objc.h>
6 /* Test that the compiler can correctly compare protocols in types of
7    method signatures.  */
9 @protocol A, B, C;
11 @interface MyClass
12 - (void) method1: (id)x;
13 - (void) method1: (id)x; /* Ok */
15 - (void) method2: (id <A>)x;
16 - (void) method2: (id <A>)x; /* Ok */
18 - (void) method3: (id <A, B>)x;
19 - (void) method3: (id <A, B>)x; /* Ok */
21 - (void) method4: (id <A, B>)x;
22 - (void) method4: (id <A, B, B>)x; /* Ok */
24 - (void) method5: (id <A, A, B>)x;
25 - (void) method5: (id <A, B, B>)x; /* Ok */
27 - (void) method6: (id <A, A, B, B, C, C>)x;
28 - (void) method6: (id <C, A, B>)x; /* Ok */
30 - (void) method7: (id)x; /* { dg-message "previous declaration" } */
31 - (void) method7: (id <A>)x; /* { dg-error "duplicate declaration" } */
33 - (void) method8: (id <A>)x; /* { dg-message "previous declaration" } */
34 - (void) method8: (id)x; /* { dg-error "duplicate declaration" } */
36 - (void) method9: (id <A>)x; /* { dg-message "previous declaration" } */
37 - (void) method9: (id <B>)x; /* { dg-error "duplicate declaration" } */
39 - (void) methodA: (id <A>)x; /* { dg-message "previous declaration" } */
40 - (void) methodA: (id <A, B>)x; /* { dg-error "duplicate declaration" } */
42 - (void) methodB: (id <A, B>)x; /* { dg-message "previous declaration" } */
43 - (void) methodB: (id <A>)x; /* { dg-error "duplicate declaration" } */
45 - (void) methodC: (id <A, B, C>)x; /* { dg-message "previous declaration" } */
46 - (void) methodC: (id <A, B>)x; /* { dg-error "duplicate declaration" } */
48 - (void) methodD: (id <A, B, C>)x; /* { dg-message "previous declaration" } */
49 - (void) methodD: (id <A, B, A>)x; /* { dg-error "duplicate declaration" } */
51 - (void) methodE: (MyClass <A, B, C> *)x; /* { dg-message "previous declaration" } */
52 - (void) methodE: (MyClass <A, B, A> *)x; /* { dg-error "duplicate declaration" } */
54 - (void) methodF: (MyClass <A, B, A> *)x;
55 - (void) methodF: (MyClass <A, B, A> *)x; /* Ok */
57 - (void) methodG: (MyClass *)x;  /* { dg-message "previous declaration" } */
58 - (void) methodG: (MyClass <A, B, C> *)x; /* { dg-error "duplicate declaration" } */
60 - (void) methodH: (MyClass <A, C>*)x;  /* { dg-message "previous declaration" } */
61 - (void) methodH: (MyClass *)x; /* { dg-error "duplicate declaration" } */
63 @end