diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
commit | be1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch) | |
tree | 1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/SemaObjC/method-lookup-3.m | |
parent | c4626a62754862d20b41e8a46a3574264ea80e6d (diff) | |
parent | f1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff) |
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/SemaObjC/method-lookup-3.m')
-rw-r--r-- | clang/test/SemaObjC/method-lookup-3.m | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/method-lookup-3.m b/clang/test/SemaObjC/method-lookup-3.m new file mode 100644 index 0000000..b3d9c46 --- /dev/null +++ b/clang/test/SemaObjC/method-lookup-3.m @@ -0,0 +1,73 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +typedef struct { int y; } Abstract; + +typedef struct { int x; } Alternate; + +#define INTERFERE_TYPE Alternate* + +@protocol A +@property Abstract *x; // expected-note {{using}} +@end + +@interface B +@property Abstract *y; // expected-note {{using}} +@end + +@interface B (Category) +@property Abstract *z; // expected-note {{using}} +@end + +@interface InterferencePre +-(void) x; // expected-note {{also found}} +-(void) y; // expected-note {{also found}} +-(void) z; // expected-note {{also found}} +-(void) setX: (INTERFERE_TYPE) arg; +-(void) setY: (INTERFERE_TYPE) arg; +-(void) setZ: (INTERFERE_TYPE) arg; +@end + +void f0(id a0) { + Abstract *l = [a0 x]; // expected-warning {{multiple methods named 'x' found}} +} + +void f1(id a0) { + Abstract *l = [a0 y]; // expected-warning {{multiple methods named 'y' found}} +} + +void f2(id a0) { + Abstract *l = [a0 z]; // expected-warning {{multiple methods named 'z' found}} +} + +void f3(id a0, Abstract *a1) { + [ a0 setX: a1]; +} + +void f4(id a0, Abstract *a1) { + [ a0 setY: a1]; +} + +void f5(id a0, Abstract *a1) { + [ a0 setZ: a1]; +} + +// pr7861 +void f6(id<A> a0) { + Abstract *l = [a0 x]; +} + +struct test3a { int x, y; }; +struct test3b { unsigned x, y; }; +@interface Test3A - (struct test3a) test3; @end +@interface Test3B - (struct test3b) test3; @end +void test3(id x) { + (void) [x test3]; +} + +struct test4a { int x, y; }; +struct test4b { float x, y; }; +@interface Test4A - (struct test4a) test4; @end //expected-note{{using}} +@interface Test4B - (struct test4b) test4; @end //expected-note{{also found}} +void test4(id x) { + (void) [x test4]; //expected-warning {{multiple methods named 'test4' found}} +} |