diff options
author | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | f27e5a09a0d815b8a4814152954ff87dadfdefc0 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/SemaObjC/method-lookup-3.m | |
download | FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.zip FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.tar.gz |
Import Clang, at r72732.
Diffstat (limited to 'test/SemaObjC/method-lookup-3.m')
-rw-r--r-- | test/SemaObjC/method-lookup-3.m | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test/SemaObjC/method-lookup-3.m b/test/SemaObjC/method-lookup-3.m new file mode 100644 index 0000000..8ed583f --- /dev/null +++ b/test/SemaObjC/method-lookup-3.m @@ -0,0 +1,52 @@ +// RUN: clang-cc -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]; +} |