Fariborz Jahanian | a8fb24f | 2010-08-17 20:23:12 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify %s |
| 3 | // rdar: // 8308053 |
| 4 | |
| 5 | @interface I { |
| 6 | __attribute__((iboutletcollection(I))) id ivar1; |
| 7 | __attribute__((iboutletcollection(id))) id ivar2; |
| 8 | __attribute__((iboutletcollection())) id ivar3; |
| 9 | __attribute__((iboutletcollection)) id ivar4; |
| 10 | } |
| 11 | @property (nonatomic, retain) __attribute__((iboutletcollection(I))) id prop1; |
| 12 | @property (nonatomic, retain) __attribute__((iboutletcollection(id))) id prop2; |
| 13 | @property (nonatomic, retain) __attribute__((iboutletcollection())) id prop3; |
| 14 | @property (nonatomic, retain) __attribute__((iboutletcollection)) id prop4; |
| 15 | @end |
| 16 | |
| 17 | typedef void *PV; |
| 18 | @interface BAD { |
| 19 | __attribute__((iboutletcollection(I, 1))) id ivar1; // expected-error {{attribute requires 1 argument(s)}} |
| 20 | __attribute__((iboutletcollection(B))) id ivar2; // expected-error {{invalid type 'B' as argument of iboutletcollection attribue}} |
| 21 | __attribute__((iboutletcollection(PV))) id ivar3; // // expected-error {{invalid type 'PV' as argument of iboutletcollection attribue}} |
| 22 | } |
| 23 | @property (nonatomic, retain) __attribute__((iboutletcollection(I,2,3))) id prop1; // expected-error {{attribute requires 1 argument(s)}} |
| 24 | @property (nonatomic, retain) __attribute__((iboutletcollection(B))) id prop2; // expected-error {{invalid type 'B' as argument of iboutletcollection attribue}} |
| 25 | @end |
| 26 | |