// 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);
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
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
};
// RUN: grep "call void @_ZN1DC1Ev" %t | count 1 &&
-// RUN: grep "call void @_ZN1DD1Ev" %t | count 2
+// RUN: grep "call void @_ZN1DD1Ev" %t | count 2 &&
void f4() {
D()();
}
+// Overloaded operators
+struct E {
+ E();
+ ~E();
+ E operator+(const E&);
+ E operator!();
+};
+
+// RUN: grep "call void @_ZN1EC1Ev" %t | count 3 &&
+// RUN: grep "call void @_ZN1ED1Ev" %t | count 5
+void f5() {
+ E() + E();
+ !E();
+}