From: Fariborz Jahanian Date: Wed, 7 Sep 2011 00:38:49 +0000 (+0000) Subject: objc-gc: Don't force a __strong type'd property X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a776695e9f3831e59519fd45d130bff20456d7a;p=clang objc-gc: Don't force a __strong type'd property to be 'weak'. This prevents a crash and should probably be flagged as error - later to come. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139211 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index bf4939d9fd..9695b811ee 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -598,7 +598,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, !getLangOptions().ObjCAutoRefCount && getLangOptions().getGCMode() != LangOptions::NonGC); - if (PropertyIsGCWeak) + if (PropertyIsGCWeak && !PropType.isObjCGCStrong()) PropType = Context.getObjCGCQualType(PropType, Qualifiers::Weak); QualType PropertyIvarType = PropType; if (PropType->isReferenceType())