return StmtEmpty();
}
- virtual OwningStmtResult ActOnExprStmt(ExprArg Expr) {
- return OwningStmtResult(*this, Expr.release());
+ virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
+ return OwningStmtResult(*this, Expr->release());
}
/// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
// effects (e.g. a placement new with an uninitialized POD).
case CXXDeleteExprClass:
return false;
+ case CXXExprWithTemporariesClass:
+ return cast<CXXExprWithTemporaries>(this)
+ ->getSubExpr()->isUnusedResultAWarning(Loc, R1, R2);
}
}
}
// Otherwise, eat the semicolon.
ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
- return Actions.ActOnExprStmt(move(Res));
+ return Actions.ActOnExprStmt(Actions.FullExpr(Res));
}
Parser::OwningExprResult Parser::ParseObjCAtExpression(SourceLocation AtLoc) {
}
// Otherwise, eat the semicolon.
ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
- return Actions.ActOnExprStmt(move(Expr));
+ return Actions.ActOnExprStmt(Actions.FullExpr(Expr));
}
case tok::kw_case: // C99 6.8.1: labeled-statement
// Eat the semicolon at the end of stmt and convert the expr into a
// statement.
ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
- R = Actions.ActOnExprStmt(move(Res));
+ R = Actions.ActOnExprStmt(Actions.FullExpr(Res));
}
}
// Turn the expression into a stmt.
if (!Value.isInvalid())
- FirstPart = Actions.ActOnExprStmt(move(Value));
+ FirstPart = Actions.ActOnExprStmt(Actions.FullExpr(Value));
if (Tok.is(tok::semi)) {
ConsumeToken();
//===--------------------------------------------------------------------===//
// Statement Parsing Callbacks: SemaStmt.cpp.
public:
- virtual OwningStmtResult ActOnExprStmt(ExprArg Expr);
+ virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr);
virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc);
virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L, SourceLocation R,
#include "clang/Basic/TargetInfo.h"
using namespace clang;
-Sema::OwningStmtResult Sema::ActOnExprStmt(ExprArg expr) {
- Expr *E = expr.takeAs<Expr>();
+Sema::OwningStmtResult Sema::ActOnExprStmt(FullExprArg expr) {
+ Expr *E = expr->takeAs<Expr>();
assert(E && "ActOnExprStmt(): missing expression");
// C99 6.8.3p2: The expression in an expression statement is evaluated as a
return StmtEmpty();
}
- virtual OwningStmtResult ActOnExprStmt(ExprArg Expr) {
+ virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
llvm::cout << __FUNCTION__ << "\n";
- return OwningStmtResult(*this, Expr.release());
+ return OwningStmtResult(*this, Expr->release());
}
/// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,