121 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2 3typedef signed char BOOL;4@protocol NSObject - (BOOL)isEqual:(id)object; @end5 6@interface NSObject <NSObject> {} @end7 8@interface _NSServicesInContextMenu : NSObject {9 id _requestor;10 NSObject *_appleEventDescriptor;11}12 13@property (retain, nonatomic) id requestor;14@property (retain, nonatomic) id appleEventDescriptor;15 16@end17 18@implementation _NSServicesInContextMenu19 20@synthesize requestor = _requestor, appleEventDescriptor = _appleEventDescriptor;21 22@end23 24@class NSString;25 26@protocol MyProtocol27- (NSString *)stringValue;28@end29 30@interface MyClass : NSObject {31 id _myIvar;32}33@property (readwrite, retain) id<MyProtocol> myIvar;34@end35 36@implementation MyClass37@synthesize myIvar = _myIvar;38@end39 40 41@interface BadPropClass42{43 int _awesome;44}45 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}}49 50 51// test parser recovery52@property ( // expected-note {{to match this '('}}53 readonly getter=isAwesome) // expected-error {{expected ')'}}54 55 int _awesome;56@property (readonlyx) // expected-error {{unknown property attribute 'readonlyx'}}57 int _awesome2;58 59@property ( // expected-note {{to match this '('}}60 +) // expected-error {{expected ')'}}61 62 int _awesome3;63 64@end65 66@protocol PVImageViewProtocol67@property int inEyeDropperMode;68@end69 70@interface Cls71@property int inEyeDropperMode;72@end73 74@interface PVAdjustColor @end75 76@implementation PVAdjustColor77 78- xx {79 id <PVImageViewProtocol> view;80 Cls *c;81 82 c.inEyeDropperMode = 1;83 view.inEyeDropperMode = 1;84}85@end86 87@interface MyStyleIntf 88{89 int _myStyle;90}91 92@property(readonly) int myStyle;93 94- (float)setMyStyle:(int)style;95@end96 97@class MDAInstance; // expected-note {{forward declaration of class here}}98 99@interface MDATestDocument100@property(retain) MDAInstance *instance;101@end102 103id f0(MDATestDocument *d) {104 return d.instance.path; // expected-error {{property 'path' cannot be found in forward class object 'MDAInstance'}}105}106 107@interface UIView @end108 109@interface FRFakeBannerView : UIView110@end111 112@interface FRAdCollectionViewCell113@property (nonatomic, weak, readonly) UIView *bannerView;114@end115 116@interface FRAdCollectionViewCell () 117 118@property (nonatomic, weak, readwrite) FRFakeBannerView *bannerView;119 120@end121