2008-10-16 22:59:30 +08:00
|
|
|
// RUN: clang -fsyntax-only -verify %s
|
|
|
|
|
|
|
|
typedef signed char BOOL;
|
|
|
|
@protocol NSObject - (BOOL)isEqual:(id)object; @end
|
|
|
|
|
|
|
|
@interface NSObject <NSObject> {} @end
|
|
|
|
|
|
|
|
@interface _NSServicesInContextMenu : NSObject {
|
|
|
|
id _requestor;
|
|
|
|
NSObject *_appleEventDescriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
@property (retain, nonatomic) id requestor;
|
|
|
|
@property (retain, nonatomic) id appleEventDescriptor;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation _NSServicesInContextMenu
|
|
|
|
|
|
|
|
@synthesize requestor = _requestor, appleEventDescriptor = _appleEventDescriptor;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@class NSString;
|
|
|
|
|
|
|
|
@protocol MyProtocol
|
|
|
|
- (NSString *)stringValue;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface MyClass : NSObject {
|
|
|
|
id _myIvar;
|
|
|
|
}
|
|
|
|
@property (readwrite, retain) id<MyProtocol> myIvar;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation MyClass
|
|
|
|
@synthesize myIvar = _myIvar;
|
|
|
|
@end
|
2008-10-20 14:33:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
@interface BadPropClass
|
|
|
|
{
|
2008-10-20 15:03:51 +08:00
|
|
|
int _awesome;
|
2008-10-20 14:33:53 +08:00
|
|
|
}
|
|
|
|
|
2009-01-13 06:49:06 +08:00
|
|
|
@property (readonly) int; // expected-error {{declaration does not declare anything}}
|
2008-10-20 14:33:53 +08:00
|
|
|
@property (readonly) ; // expected-error {{type name requires a specifier or qualifier}} \
|
2009-01-13 06:49:06 +08:00
|
|
|
expected-error {{declaration does not declare anything}}
|
2008-10-20 14:33:53 +08:00
|
|
|
@property (readonly) int : 4; // expected-error {{property requires fields to be named}}
|
|
|
|
|
2008-10-20 15:03:51 +08:00
|
|
|
|
|
|
|
// test parser recovery: rdar://6254579
|
2008-11-24 07:17:07 +08:00
|
|
|
@property ( // expected-note {{to match this '('}}
|
|
|
|
readonly getter=isAwesome) // expected-error {{error: expected ')'}}
|
|
|
|
|
2008-10-20 15:03:51 +08:00
|
|
|
int _awesome;
|
2008-10-20 15:15:22 +08:00
|
|
|
@property (readonlyx) // expected-error {{unknown property attribute 'readonlyx'}}
|
|
|
|
int _awesome2;
|
|
|
|
|
2008-11-24 07:17:07 +08:00
|
|
|
@property ( // expected-note {{to match this '('}}
|
|
|
|
+) // expected-error {{error: expected ')'}}
|
|
|
|
|
2008-10-20 15:15:22 +08:00
|
|
|
int _awesome3;
|
2008-10-20 15:03:51 +08:00
|
|
|
|
2008-10-20 14:33:53 +08:00
|
|
|
@end
|
2008-10-20 15:03:51 +08:00
|
|
|
|
2008-10-21 06:53:06 +08:00
|
|
|
@protocol PVImageViewProtocol
|
|
|
|
@property int inEyeDropperMode;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Cls
|
|
|
|
@property int inEyeDropperMode;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface PVAdjustColor @end
|
|
|
|
|
|
|
|
@implementation PVAdjustColor
|
|
|
|
|
|
|
|
- xx {
|
|
|
|
id <PVImageViewProtocol> view;
|
|
|
|
Cls *c;
|
|
|
|
|
|
|
|
c.inEyeDropperMode = 1;
|
|
|
|
view.inEyeDropperMode = 1;
|
|
|
|
}
|
|
|
|
@end
|