summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-03-10 17:45:58 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-03-10 17:45:58 +0000
commita16e9ac1f192503038f49e0c52edd7dcb2ce023a (patch)
tree56c1dd85a159948815817b5a90bedb39cf9ad105 /lib/Sema/SemaExpr.cpp
parentdd5132ce2569a1ef901c92772eb8581aa1705f25 (diff)
Notes
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 10001c356d1c..2249579ba4e1 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -6593,7 +6593,8 @@ Sema::ActOnStmtExpr(SourceLocation LPLoc, StmtArg substmt,
assert(SubStmt && isa<CompoundStmt>(SubStmt) && "Invalid action invocation!");
CompoundStmt *Compound = cast<CompoundStmt>(SubStmt);
- bool isFileScope = getCurFunctionOrMethodDecl() == 0;
+ bool isFileScope
+ = (getCurFunctionOrMethodDecl() == 0) && (getCurBlock() == 0);
if (isFileScope)
return ExprError(Diag(LPLoc, diag::err_stmtexpr_file_scope));