Changed Sema::CheckForConstantInitializer to allow global block literals.
This commit also includes some name changes in the blocks rewriter (no functionality change).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56955 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 800ffc5..9c5c4f2 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1286,6 +1286,10 @@
if (Init->getType()->isFunctionType())
return false;
+ // Allow block exprs at top level.
+ if (Init->getType()->isBlockPointerType())
+ return false;
+
Diag(Init->getExprLoc(), diag::err_init_element_not_constant,
Init->getSourceRange());
return true;