ObjectiveC. When introducing a new property declaration in

parimary class and in mrr mode, assume property's default
memory attribute (assign) and to prevent a bogus warning.
// rdar://15859862

llvm-svn: 200238
This commit is contained in:
Fariborz Jahanian 2014-01-27 19:14:49 +00:00
parent 9b8dcebbca
commit 369a9c3b51
2 changed files with 24 additions and 0 deletions

View File

@ -463,6 +463,18 @@ Sema::HandlePropertyInClassExtension(Scope *S,
DeclContext *DC = cast<DeclContext>(CCPrimary);
if (!ObjCPropertyDecl::findPropertyDecl(DC,
PIDecl->getDeclName().getAsIdentifierInfo())) {
// In mrr mode, 'readwrite' property must have an explicit
// memory attribute. If none specified, select the default (assign).
if (!getLangOpts().ObjCAutoRefCount) {
if (!(PIkind & (ObjCDeclSpec::DQ_PR_assign |
ObjCDeclSpec::DQ_PR_retain |
ObjCDeclSpec::DQ_PR_strong |
ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_unsafe_unretained |
ObjCDeclSpec::DQ_PR_weak)))
PIkind |= ObjCPropertyDecl::OBJC_PR_assign;
}
// Protocol is not in the primary class. Must build one for it.
ObjCDeclSpec ProtocolPropertyODS;
// FIXME. Assuming that ObjCDeclSpec::ObjCPropertyAttributeKind

View File

@ -61,3 +61,15 @@ struct S1;
@property (nonatomic, readwrite, assign) struct S1 *httpRequest3;
@property (nonatomic, readwrite, assign) struct S2 *httpRequest4;
@end
// rdar://15859862
@protocol ADCameraJSO_Bindings
@property (nonatomic, readonly) NSString *currentPictureURI;
@end
@interface ADCameraJSO
@end
@interface ADCameraJSO() <ADCameraJSO_Bindings>
@property (nonatomic, copy) NSString *currentPictureURI;
@end