blob: 25299ca6d3bdeea29e8fdb7a217c668099f60a2a [file] [log] [blame]
Steve Naroff68354f32008-09-30 14:38:43 +00001// RUN: clang -fsyntax-only -verify %s
2
3typedef struct { int y; } Abstract;
4
5typedef struct { int x; } Alternate;
6
7#define INTERFERE_TYPE Alternate*
8
9@protocol A
10@property Abstract *x; // expected-warning{{using}}
11@end
12
13@interface B
14@property Abstract *y; // expected-warning{{using}}
15@end
16
17@interface B (Category)
18@property Abstract *z; // expected-warning{{using}}
19@end
20
21@interface InterferencePre
22-(void) x; // expected-warning{{also found}}
23-(void) y; // expected-warning{{also found}}
24-(void) z; // expected-warning{{also found}}
Steve Naroffb91afca2008-10-21 10:37:50 +000025-(void) setX: (INTERFERE_TYPE) arg;
26-(void) setY: (INTERFERE_TYPE) arg;
27-(void) setZ: (INTERFERE_TYPE) arg;
Steve Naroff68354f32008-09-30 14:38:43 +000028@end
29
30void f0(id a0) {
31 Abstract *l = [a0 x]; // expected-warning {{multiple methods named 'x' found}}
32}
33
34void f1(id a0) {
35 Abstract *l = [a0 y]; // expected-warning {{multiple methods named 'y' found}}
36}
37
38void f2(id a0) {
39 Abstract *l = [a0 z]; // expected-warning {{multiple methods named 'z' found}}
40}
41
42void f3(id a0, Abstract *a1) {
Steve Naroffb91afca2008-10-21 10:37:50 +000043 [ a0 setX: a1];
Steve Naroff68354f32008-09-30 14:38:43 +000044}
45
46void f4(id a0, Abstract *a1) {
Steve Naroffb91afca2008-10-21 10:37:50 +000047 [ a0 setY: a1];
Steve Naroff68354f32008-09-30 14:38:43 +000048}
49
50void f5(id a0, Abstract *a1) {
Steve Naroffb91afca2008-10-21 10:37:50 +000051 [ a0 setZ: a1];
Steve Naroff68354f32008-09-30 14:38:43 +000052}