diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-01-09 09:38:14 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-01-09 09:38:14 +0000 |
commit | 02e764487fa4a8e22e5ef3e8b2ab9c8361454b69 (patch) | |
tree | e961896f828f6cfea78b0ade6243711e188af44c /clang/lib/Sema/SemaExpr.cpp | |
parent | ed13fab4bc65ed8142070f9e8c9dc6e003287f87 (diff) | |
download | bcm5719-llvm-02e764487fa4a8e22e5ef3e8b2ab9c8361454b69.tar.gz bcm5719-llvm-02e764487fa4a8e22e5ef3e8b2ab9c8361454b69.zip |
Parse: Don't crash when namespace is in GNU statement expr
Parser::ParseNamespace can get a little confused when it found itself
inside a compound statement inside of a non-static data member
initializer.
Try to determine that the statement expression's scope makes sense
before trying to parse it's contents.
llvm-svn: 225514
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 623d18d04e7..68bad16ff38 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -10275,11 +10275,6 @@ Sema::ActOnStmtExpr(SourceLocation LPLoc, Stmt *SubStmt, assert(!ExprNeedsCleanups && "cleanups within StmtExpr not correctly bound!"); PopExpressionEvaluationContext(); - bool isFileScope - = (getCurFunctionOrMethodDecl() == nullptr) && (getCurBlock() == nullptr); - if (isFileScope) - return ExprError(Diag(LPLoc, diag::err_stmtexpr_file_scope)); - // FIXME: there are a variety of strange constraints to enforce here, for // example, it is not possible to goto into a stmt expression apparently. // More semantic analysis is needed. |