2010-08-18 04:23:12 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify %s
|
2010-11-09 10:16:57 +08:00
|
|
|
// rdar://8308053
|
2010-08-18 04:23:12 +08:00
|
|
|
|
|
|
|
@interface I {
|
|
|
|
__attribute__((iboutletcollection(I))) id ivar1;
|
|
|
|
__attribute__((iboutletcollection(id))) id ivar2;
|
|
|
|
__attribute__((iboutletcollection())) id ivar3;
|
|
|
|
__attribute__((iboutletcollection)) id ivar4;
|
|
|
|
}
|
|
|
|
@property (nonatomic, retain) __attribute__((iboutletcollection(I))) id prop1;
|
|
|
|
@property (nonatomic, retain) __attribute__((iboutletcollection(id))) id prop2;
|
|
|
|
@property (nonatomic, retain) __attribute__((iboutletcollection())) id prop3;
|
|
|
|
@property (nonatomic, retain) __attribute__((iboutletcollection)) id prop4;
|
|
|
|
@end
|
|
|
|
|
|
|
|
typedef void *PV;
|
|
|
|
@interface BAD {
|
2011-03-02 20:15:05 +08:00
|
|
|
__attribute__((iboutletcollection(I, 1))) id ivar1; // expected-error {{attribute takes one argument}}
|
2010-08-26 07:45:44 +08:00
|
|
|
__attribute__((iboutletcollection(B))) id ivar2; // expected-error {{invalid type 'B' as argument of iboutletcollection attribute}}
|
|
|
|
__attribute__((iboutletcollection(PV))) id ivar3; // expected-error {{invalid type 'PV' as argument of iboutletcollection attribute}}
|
2011-09-29 15:02:25 +08:00
|
|
|
__attribute__((iboutletcollection(PV))) void *ivar4; // expected-error {{ivar with 'iboutletcollection' attribute must be an object type (invalid 'void *')}}
|
2010-08-18 07:19:16 +08:00
|
|
|
__attribute__((iboutletcollection(int))) id ivar5; // expected-error {{type argument of iboutletcollection attribute cannot be a builtin type}}
|
2011-09-29 15:02:25 +08:00
|
|
|
__attribute__((iboutlet)) int ivar6; // expected-error {{ivar with 'iboutlet' attribute must be an object type}}
|
2010-08-18 04:23:12 +08:00
|
|
|
}
|
2011-03-02 20:15:05 +08:00
|
|
|
@property (nonatomic, retain) __attribute__((iboutletcollection(I,2,3))) id prop1; // expected-error {{attribute takes one argument}}
|
2010-08-26 07:45:44 +08:00
|
|
|
@property (nonatomic, retain) __attribute__((iboutletcollection(B))) id prop2; // expected-error {{invalid type 'B' as argument of iboutletcollection attribute}}
|
2010-08-18 05:39:27 +08:00
|
|
|
|
2011-09-29 15:02:25 +08:00
|
|
|
@property __attribute__((iboutletcollection(BAD))) int prop3; // expected-error {{property with 'iboutletcollection' attribute must be an object type (invalid 'int')}}
|
2010-08-18 04:23:12 +08:00
|
|
|
@end
|
|
|
|
|