diff options
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 10001c356d1..2249579ba4e 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/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)); | 

