diff options
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 84052fd9d8..bf4939d9fd 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -594,6 +594,12 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, ObjCPropertyDecl::PropertyAttributeKind kind = property->getPropertyAttributes(); QualType PropType = Context.getCanonicalType(property->getType()); + bool PropertyIsGCWeak = (kind & ObjCPropertyDecl::OBJC_PR_weak && + !getLangOptions().ObjCAutoRefCount && + getLangOptions().getGCMode() != + LangOptions::NonGC); + if (PropertyIsGCWeak) + PropType = Context.getObjCGCQualType(PropType, Qualifiers::Weak); QualType PropertyIvarType = PropType; if (PropType->isReferenceType()) PropertyIvarType = cast<ReferenceType>(PropType)->getPointeeType(); |