aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-10-02 17:12:56 +0000
committerSteve Naroff <snaroff@apple.com>2008-10-02 17:12:56 +0000
commit8af6a451ea075de1c9ec7cea0cd59f13cfc53adf (patch)
tree2cb1aea0b56b11b3de1d4f80a502e44f0bc3a14a /lib
parent91cd320ea2b7da98227869b0dd803a4953c076d0 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaDecl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 800ffc5706..9c5c4f2d4b 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1286,6 +1286,10 @@ bool Sema::CheckForConstantInitializer(Expr *Init, QualType DclT) {
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;