2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
|
2008-10-16 22:59:30 +08:00
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2010-04-09 05:33:23 +08:00
|
|
|
@property (readonly) int; // expected-warning {{declaration does not declare anything}}
|
2012-03-12 15:56:15 +08:00
|
|
|
@property (readonly) ; // expected-error {{type name requires a specifier or qualifier}}
|
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 '('}}
|
2011-12-15 08:38:15 +08:00
|
|
|
readonly getter=isAwesome) // expected-error {{expected ')'}}
|
2008-11-24 07:17:07 +08:00
|
|
|
|
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 '('}}
|
2011-12-15 08:38:15 +08:00
|
|
|
+) // expected-error {{expected ')'}}
|
2008-11-24 07:17:07 +08:00
|
|
|
|
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
|
2010-01-06 08:18:12 +08:00
|
|
|
|
|
|
|
// radar 7427072
|
|
|
|
@interface MyStyleIntf
|
|
|
|
{
|
|
|
|
int _myStyle;
|
|
|
|
}
|
|
|
|
|
|
|
|
@property(readonly) int myStyle;
|
|
|
|
|
|
|
|
- (float)setMyStyle:(int)style;
|
|
|
|
@end
|
|
|
|
|
2010-12-16 08:56:28 +08:00
|
|
|
// rdar://8774513
|
2011-11-15 06:10:01 +08:00
|
|
|
@class MDAInstance; // expected-note {{forward declaration of class here}}
|
2010-12-16 08:56:28 +08:00
|
|
|
|
|
|
|
@interface MDATestDocument
|
|
|
|
@property(retain) MDAInstance *instance;
|
|
|
|
@end
|
|
|
|
|
|
|
|
id f0(MDATestDocument *d) {
|
2011-11-15 06:10:01 +08:00
|
|
|
return d.instance.path; // expected-error {{property 'path' cannot be found in forward class object 'MDAInstance'}}
|
2010-12-16 08:56:28 +08:00
|
|
|
}
|
|
|
|
|