Fixup CodeGen for __weak __block variables. Radar 6756266
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69010 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index ef8b9e8..f4f1311 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1803,7 +1803,8 @@
Invalid = true;
}
- if (NewVD->hasLocalStorage() && T.isObjCGCWeak())
+ if (NewVD->hasLocalStorage() && T.isObjCGCWeak()
+ && !NewVD->getAttr<BlocksAttr>())
Diag(NewVD->getLocation(), diag::warn_attribute_weak_on_local);
bool isIllegalVLA = T->isVariableArrayType() && NewVD->hasGlobalStorage();