2010-10-15 05:30:10 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
// rdar: //8550657
|
|
|
|
|
|
|
|
@interface NSArray @end
|
|
|
|
|
|
|
|
@interface NSMutableArray : NSArray @end
|
|
|
|
|
|
|
|
@interface MyClass
|
|
|
|
{
|
|
|
|
NSMutableArray * _array;
|
|
|
|
}
|
|
|
|
|
2011-09-24 08:56:59 +08:00
|
|
|
@property (readonly) NSMutableArray * array;
|
2010-10-15 05:30:10 +08:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface MyClass ()
|
|
|
|
|
|
|
|
@property (readwrite) NSMutableArray * array;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation MyClass
|
|
|
|
|
2010-10-16 06:42:59 +08:00
|
|
|
@synthesize array=_array;
|
2010-10-15 05:30:10 +08:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2011-10-07 02:38:18 +08:00
|
|
|
|
|
|
|
// rdar://6137845
|
|
|
|
class TCPPObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TCPPObject(const TCPPObject& inObj);
|
|
|
|
TCPPObject();
|
|
|
|
~TCPPObject();
|
|
|
|
TCPPObject& operator=(const TCPPObject& inObj);
|
|
|
|
private:
|
|
|
|
void* fData;
|
|
|
|
};
|
|
|
|
|
2011-10-08 05:08:14 +08:00
|
|
|
class Trivial
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Trivial(const Trivial& inObj);
|
|
|
|
Trivial();
|
|
|
|
~Trivial();
|
|
|
|
private:
|
|
|
|
void* fData;
|
|
|
|
};
|
|
|
|
|
2011-10-07 02:38:18 +08:00
|
|
|
@interface MyDocument
|
|
|
|
{
|
|
|
|
@private
|
|
|
|
TCPPObject _cppObject;
|
|
|
|
TCPPObject _ncppObject;
|
2011-10-08 05:08:14 +08:00
|
|
|
Trivial _tcppObject;
|
2011-10-07 02:38:18 +08:00
|
|
|
}
|
|
|
|
@property (assign, readwrite) const TCPPObject& cppObject;
|
|
|
|
@property (assign, readwrite, nonatomic) const TCPPObject& ncppObject;
|
2011-10-08 05:08:14 +08:00
|
|
|
@property (assign, readwrite) const Trivial& tcppObject;
|
2011-10-07 02:38:18 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation MyDocument
|
|
|
|
|
2011-10-08 05:08:14 +08:00
|
|
|
@synthesize cppObject = _cppObject; // expected-warning {{atomic property of type 'const TCPPObject &' synthesizing setter using non-trivial assignment operator}}
|
2011-10-07 02:38:18 +08:00
|
|
|
@synthesize ncppObject = _ncppObject;
|
|
|
|
|
2011-10-08 05:08:14 +08:00
|
|
|
@synthesize tcppObject = _tcppObject;
|
2011-10-07 02:38:18 +08:00
|
|
|
@end
|