diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-10 04:54:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-10 04:54:39 +0000 |
commit | dd8f569f84a73c0b0e1449475f333d101e6c9401 (patch) | |
tree | 0666238fe52963c4f2aa7c0f4051823368870817 /lib | |
parent | 3cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4 (diff) |
Statement expressions can be used in global- or namespace-scoped blocks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98135 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 10001c356d..2249579ba4 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)); |