]> granicus.if.org Git - clang/commitdiff
objc-gc: Don't force a __strong type'd property
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 7 Sep 2011 00:38:49 +0000 (00:38 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 7 Sep 2011 00:38:49 +0000 (00:38 +0000)
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

lib/Sema/SemaObjCProperty.cpp

index bf4939d9fd662dccd5cd44b384eae9b68fe91cad..9695b811ee57aad659c9efbfd8cbd0df30960151 100644 (file)
@@ -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())