diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-14 22:39:08 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-14 22:39:08 +0000 |
commit | 419563768ef4929a622d7c2b066856e82901bb91 (patch) | |
tree | 37dc9742cbd74ad8a19182bbcbad2fcda138ce5d /lib/Parse/ParseStmt.cpp | |
parent | 7c9dbb76f6847fb30527c8e74ef9a25a3d4eb731 (diff) |
Refactor to call ActOnFinishFullExpr on every full expression. Teach
ActOnFinishFullExpr that some of its checks only apply to discarded-value
expressions. This adds missing checks for unexpanded variadic template
parameter packs to a handful of constructs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index be77991b37..87c1d46f6c 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -335,7 +335,7 @@ StmtResult Parser::ParseExprStatement() { // Otherwise, eat the semicolon. ExpectAndConsumeSemi(diag::err_expected_semi_after_expr); - return Actions.ActOnExprStmt(Actions.MakeFullExpr(Expr.get())); + return Actions.ActOnExprStmt(Expr); } StmtResult Parser::ParseSEHTryBlock() { @@ -856,7 +856,7 @@ StmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) { // Eat the semicolon at the end of stmt and convert the expr into a // statement. ExpectAndConsumeSemi(diag::err_expected_semi_after_expr); - R = Actions.ActOnExprStmt(Actions.MakeFullExpr(Res.get())); + R = Actions.ActOnExprStmt(Res); } } @@ -1437,7 +1437,7 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) { if (ForEach) FirstPart = Actions.ActOnForEachLValueExpr(Value.get()); else - FirstPart = Actions.ActOnExprStmt(Actions.MakeFullExpr(Value.get())); + FirstPart = Actions.ActOnExprStmt(Value); } if (Tok.is(tok::semi)) { @@ -1505,7 +1505,9 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) { // Parse the third part of the for specifier. if (Tok.isNot(tok::r_paren)) { // for (...;...;) ExprResult Third = ParseExpression(); - ThirdPart = Actions.MakeFullExpr(Third.take()); + // FIXME: The C++11 standard doesn't actually say that this is a + // discarded-value expression, but it clearly should be. + ThirdPart = Actions.MakeFullDiscardedValueExpr(Third.take()); } } // Match the ')'. |