mirror of https://github.com/microsoft/clang.git
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200238 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3257095965
commit
359bfa80ed
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue