xref: /aosp_15_r20/external/clang/test/Parser/objc-property-syntax.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2*67e74705SXin Li
3*67e74705SXin Li@interface MyClass {
4*67e74705SXin Li  int prop;
5*67e74705SXin Li};
6*67e74705SXin Li@property unsigned char bufferedUTF8Bytes[4];  // expected-error {{property cannot have array or function type}}
7*67e74705SXin Li@property unsigned char bufferedUTFBytes:1;    // expected-error {{property name cannot be a bitfield}}
8*67e74705SXin Li@property(nonatomic, retain, setter=ab_setDefaultToolbarItems) MyClass *ab_defaultToolbarItems; // expected-error {{method name referenced in property setter attribute must end with ':'}}
9*67e74705SXin Li
10*67e74705SXin Li@property int prop;
11*67e74705SXin Li@end
12*67e74705SXin Li
13*67e74705SXin Li@implementation MyClass
14*67e74705SXin Li@dynamic ab_defaultToolbarItems // expected-error{{expected ';' after @dynamic}}
15*67e74705SXin Li@synthesize prop // expected-error{{expected ';' after @synthesize}}
16*67e74705SXin Li@end
17*67e74705SXin Li
18