aboutsummaryrefslogtreecommitdiff
path: root/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-31 21:49:55 +0000
committerChris Lattner <sabre@nondot.org>2007-08-31 21:49:55 +0000
commit98414c1b7d1944a57156d52e29bd41c005de09ac (patch)
tree47fbed1c7e597bc7a962919e8e1fa44bff614ba3 /Parse/ParseExpr.cpp
parent805e9a8300af9489ec13cd804c070267b7c4cfec (diff)
Fix a bug/missing-feature Ted noticed: the 'unused' warning should not
warn about the last stmt in a stmtexpr, f.e. there should be no warning for: int maxval_stmt_expr(int x, int y) { return ({int _a = x, _b = y; _a > _b ? _a : _b; }); } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Parse/ParseExpr.cpp')
-rw-r--r--Parse/ParseExpr.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Parse/ParseExpr.cpp b/Parse/ParseExpr.cpp
index 51ad217e31..c2b5482855 100644
--- a/Parse/ParseExpr.cpp
+++ b/Parse/ParseExpr.cpp
@@ -928,10 +928,9 @@ Parser::ExprResult Parser::ParseParenExpression(ParenParseOption &ExprType,
ExprResult Result(true);
CastTy = 0;
- if (ExprType >= CompoundStmt && Tok.getKind() == tok::l_brace &&
- !getLang().NoExtensions) {
+ if (ExprType >= CompoundStmt && Tok.getKind() == tok::l_brace) {
Diag(Tok, diag::ext_gnu_statement_expr);
- Parser::StmtResult Stmt = ParseCompoundStatement();
+ Parser::StmtResult Stmt = ParseCompoundStatement(true);
ExprType = CompoundStmt;
// If the substmt parsed correctly, build the AST node.