1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
3 typedef signed char BOOL;
4 @protocol NSObject - (BOOL)isEqual:(id)object; @end
6 @interface NSObject <NSObject> {} @end
8 @interface _NSServicesInContextMenu : NSObject {
10 NSObject *_appleEventDescriptor;
13 @property (retain, nonatomic) id requestor;
14 @property (retain, nonatomic) id appleEventDescriptor;
18 @implementation _NSServicesInContextMenu
20 @synthesize requestor = _requestor, appleEventDescriptor = _appleEventDescriptor;
27 - (NSString *)stringValue;
30 @interface MyClass : NSObject {
33 @property (readwrite, retain) id<MyProtocol> myIvar;
36 @implementation MyClass
37 @synthesize myIvar = _myIvar;
41 @interface BadPropClass
46 @property (readonly) int; // expected-warning {{declaration does not declare anything}}
47 @property (readonly) ; // expected-error {{type name requires a specifier or qualifier}}
48 @property (readonly) int : 4; // expected-error {{property requires fields to be named}}
51 // test parser recovery
52 @property ( // expected-note {{to match this '('}}
53 readonly getter=isAwesome) // expected-error {{expected ')'}}
56 @property (readonlyx) // expected-error {{unknown property attribute 'readonlyx'}}
59 @property ( // expected-note {{to match this '('}}
60 +) // expected-error {{expected ')'}}
66 @protocol PVImageViewProtocol
67 @property int inEyeDropperMode;
71 @property int inEyeDropperMode;
74 @interface PVAdjustColor @end
76 @implementation PVAdjustColor
79 id <PVImageViewProtocol> view;
82 c.inEyeDropperMode = 1;
83 view.inEyeDropperMode = 1;
87 @interface MyStyleIntf
92 @property(readonly) int myStyle;
94 - (float)setMyStyle:(int)style;
97 @class MDAInstance; // expected-note {{forward declaration of class here}}
99 @interface MDATestDocument
100 @property(retain) MDAInstance *instance;
103 id f0(MDATestDocument *d) {
104 return d.instance.path; // expected-error {{property 'path' cannot be found in forward class object 'MDAInstance'}}
107 @interface UIView @end
109 @interface FRFakeBannerView : UIView
112 @interface FRAdCollectionViewCell
113 @property (nonatomic, weak, readonly) UIView *bannerView;
116 @interface FRAdCollectionViewCell ()
118 @property (nonatomic, weak, readwrite) FRFakeBannerView *bannerView;