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 | 6cf3f3c75efdf24456ee084e4b8d55ecbd3809d0 (patch) | |
| tree | 55bea87bd018db62c3a245a3602463e9a1d3aa00 /clang/lib/Sema/SemaExpr.cpp | |
| parent | e78aac41debf968be07fb755ba94b6fed29167b5 (diff) | |
| download | bcm5719-llvm-6cf3f3c75efdf24456ee084e4b8d55ecbd3809d0.tar.gz bcm5719-llvm-6cf3f3c75efdf24456ee084e4b8d55ecbd3809d0.zip | |
Statement expressions can be used in global- or namespace-scoped blocks
llvm-svn: 98135
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)); | 

