diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Expr.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index b92ecac6a3..fa5ce9f047 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -588,6 +588,9 @@ bool Expr::isUnusedResultAWarning(SourceLocation &Loc, SourceRange &R1, // effects (e.g. a placement new with an uninitialized POD). case CXXDeleteExprClass: return false; + case CXXBindTemporaryExprClass: + return cast<CXXBindTemporaryExpr>(this) + ->getSubExpr()->isUnusedResultAWarning(Loc, R1, R2); case CXXExprWithTemporariesClass: return cast<CXXExprWithTemporaries>(this) ->getSubExpr()->isUnusedResultAWarning(Loc, R1, R2); diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index d4187f2ce1..6b76ce80d7 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -4041,9 +4041,10 @@ Sema::OwningExprResult Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UsualUnaryConversions(FnExpr); input.release(); - return Owned(new (Context) CXXOperatorCallExpr(Context, Op, FnExpr, - &Input, 1, ResultTy, - OpLoc)); + + Expr *CE = new (Context) CXXOperatorCallExpr(Context, Op, FnExpr, + &Input, 1, ResultTy, OpLoc); + return MaybeBindToTemporary(CE); } else { // We matched a built-in operator. Convert the arguments, then // break out so that we will build the appropriate built-in @@ -4196,9 +4197,9 @@ Sema::CreateOverloadedBinOp(SourceLocation OpLoc, OpLoc); UsualUnaryConversions(FnExpr); - return Owned(new (Context) CXXOperatorCallExpr(Context, Op, FnExpr, - Args, 2, ResultTy, - OpLoc)); + Expr *CE = new (Context) CXXOperatorCallExpr(Context, Op, FnExpr, + Args, 2, ResultTy, OpLoc); + return MaybeBindToTemporary(CE); } else { // We matched a built-in operator. Convert the arguments, then // break out so that we will build the appropriate built-in |