Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Steve Naroff | 037cda5 | 2008-09-30 14:38:43 +0000 | [diff] [blame] | 2 | |
| 3 | typedef struct { int y; } Abstract; |
| 4 | |
| 5 | typedef struct { int x; } Alternate; |
| 6 | |
| 7 | #define INTERFERE_TYPE Alternate* |
| 8 | |
| 9 | @protocol A |
Chris Lattner | 1326a3d | 2008-11-23 23:26:13 +0000 | [diff] [blame] | 10 | @property Abstract *x; // expected-note {{using}} |
Steve Naroff | 037cda5 | 2008-09-30 14:38:43 +0000 | [diff] [blame] | 11 | @end |
| 12 | |
| 13 | @interface B |
Chris Lattner | 1326a3d | 2008-11-23 23:26:13 +0000 | [diff] [blame] | 14 | @property Abstract *y; // expected-note {{using}} |
Steve Naroff | 037cda5 | 2008-09-30 14:38:43 +0000 | [diff] [blame] | 15 | @end |
| 16 | |
| 17 | @interface B (Category) |
Chris Lattner | 1326a3d | 2008-11-23 23:26:13 +0000 | [diff] [blame] | 18 | @property Abstract *z; // expected-note {{using}} |
Steve Naroff | 037cda5 | 2008-09-30 14:38:43 +0000 | [diff] [blame] | 19 | @end |
| 20 | |
| 21 | @interface InterferencePre |
Chris Lattner | 1326a3d | 2008-11-23 23:26:13 +0000 | [diff] [blame] | 22 | -(void) x; // expected-note {{also found}} |
| 23 | -(void) y; // expected-note {{also found}} |
| 24 | -(void) z; // expected-note {{also found}} |
Steve Naroff | fe6b0dc | 2008-10-21 10:37:50 +0000 | [diff] [blame] | 25 | -(void) setX: (INTERFERE_TYPE) arg; |
| 26 | -(void) setY: (INTERFERE_TYPE) arg; |
| 27 | -(void) setZ: (INTERFERE_TYPE) arg; |
Steve Naroff | 037cda5 | 2008-09-30 14:38:43 +0000 | [diff] [blame] | 28 | @end |
| 29 | |
| 30 | void f0(id a0) { |
| 31 | Abstract *l = [a0 x]; // expected-warning {{multiple methods named 'x' found}} |
| 32 | } |
| 33 | |
| 34 | void f1(id a0) { |
| 35 | Abstract *l = [a0 y]; // expected-warning {{multiple methods named 'y' found}} |
| 36 | } |
| 37 | |
| 38 | void f2(id a0) { |
| 39 | Abstract *l = [a0 z]; // expected-warning {{multiple methods named 'z' found}} |
| 40 | } |
| 41 | |
| 42 | void f3(id a0, Abstract *a1) { |
Steve Naroff | fe6b0dc | 2008-10-21 10:37:50 +0000 | [diff] [blame] | 43 | [ a0 setX: a1]; |
Steve Naroff | 037cda5 | 2008-09-30 14:38:43 +0000 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | void f4(id a0, Abstract *a1) { |
Steve Naroff | fe6b0dc | 2008-10-21 10:37:50 +0000 | [diff] [blame] | 47 | [ a0 setY: a1]; |
Steve Naroff | 037cda5 | 2008-09-30 14:38:43 +0000 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | void f5(id a0, Abstract *a1) { |
Steve Naroff | fe6b0dc | 2008-10-21 10:37:50 +0000 | [diff] [blame] | 51 | [ a0 setZ: a1]; |
Steve Naroff | 037cda5 | 2008-09-30 14:38:43 +0000 | [diff] [blame] | 52 | } |
Fariborz Jahanian | ba55198 | 2010-08-10 18:10:50 +0000 | [diff] [blame] | 53 | |
| 54 | // pr7861 |
| 55 | void f6(id<A> a0) { |
| 56 | Abstract *l = [a0 x]; |
| 57 | } |