diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/obj-c++.dg/method-conflict-3.mm | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/method-conflict-3.mm')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/method-conflict-3.mm | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/method-conflict-3.mm b/gcc/testsuite/obj-c++.dg/method-conflict-3.mm new file mode 100644 index 000000000..73e80c948 --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/method-conflict-3.mm @@ -0,0 +1,63 @@ +/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */ +/* { dg-do compile } */ + +#include <objc/objc.h> + +/* Test that the compiler can correctly compare protocols in types of + method signatures. */ + +@protocol A, B, C; + +@interface MyClass +- (void) method1: (id)x; +- (void) method1: (id)x; /* Ok */ + +- (void) method2: (id <A>)x; +- (void) method2: (id <A>)x; /* Ok */ + +- (void) method3: (id <A, B>)x; +- (void) method3: (id <A, B>)x; /* Ok */ + +- (void) method4: (id <A, B>)x; +- (void) method4: (id <A, B, B>)x; /* Ok */ + +- (void) method5: (id <A, A, B>)x; +- (void) method5: (id <A, B, B>)x; /* Ok */ + +- (void) method6: (id <A, A, B, B, C, C>)x; +- (void) method6: (id <C, A, B>)x; /* Ok */ + +- (void) method7: (id)x; /* { dg-message "previous declaration" } */ +- (void) method7: (id <A>)x; /* { dg-error "duplicate declaration" } */ + +- (void) method8: (id <A>)x; /* { dg-message "previous declaration" } */ +- (void) method8: (id)x; /* { dg-error "duplicate declaration" } */ + +- (void) method9: (id <A>)x; /* { dg-message "previous declaration" } */ +- (void) method9: (id <B>)x; /* { dg-error "duplicate declaration" } */ + +- (void) methodA: (id <A>)x; /* { dg-message "previous declaration" } */ +- (void) methodA: (id <A, B>)x; /* { dg-error "duplicate declaration" } */ + +- (void) methodB: (id <A, B>)x; /* { dg-message "previous declaration" } */ +- (void) methodB: (id <A>)x; /* { dg-error "duplicate declaration" } */ + +- (void) methodC: (id <A, B, C>)x; /* { dg-message "previous declaration" } */ +- (void) methodC: (id <A, B>)x; /* { dg-error "duplicate declaration" } */ + +- (void) methodD: (id <A, B, C>)x; /* { dg-message "previous declaration" } */ +- (void) methodD: (id <A, B, A>)x; /* { dg-error "duplicate declaration" } */ + +- (void) methodE: (MyClass <A, B, C> *)x; /* { dg-message "previous declaration" } */ +- (void) methodE: (MyClass <A, B, A> *)x; /* { dg-error "duplicate declaration" } */ + +- (void) methodF: (MyClass <A, B, A> *)x; +- (void) methodF: (MyClass <A, B, A> *)x; /* Ok */ + +- (void) methodG: (MyClass *)x; /* { dg-message "previous declaration" } */ +- (void) methodG: (MyClass <A, B, C> *)x; /* { dg-error "duplicate declaration" } */ + +- (void) methodH: (MyClass <A, C>*)x; /* { dg-message "previous declaration" } */ +- (void) methodH: (MyClass *)x; /* { dg-error "duplicate declaration" } */ + +@end |