Fix another fallout from defining __weak unconditionally.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68834 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 898ecbb..74a0316 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1840,7 +1840,8 @@
return DeclPtrTy();
}
if ((Context.isObjCObjectPointerType(property->getType()) ||
- PropType.isObjCGCStrong()) && IvarType.isObjCGCWeak()) {
+ PropType.isObjCGCStrong()) && IvarType.isObjCGCWeak() &&
+ getLangOptions().getGCMode() != LangOptions::NonGC) {
Diag(PropertyLoc, diag::error_strong_property)
<< property->getDeclName() << Ivar->getDeclName();
return DeclPtrTy();