Index: lib/AST/Expr.cpp =================================================================== --- lib/AST/Expr.cpp +++ lib/AST/Expr.cpp @@ -2861,8 +2861,15 @@ // These never have a side-effect. return false; + case CXXOperatorCallExprClass: { + // If it is an operator call expr it can have side effects when the + // underlaying operator is of assignment type + OverloadedOperatorKind binOp = cast(this)->getOperator(); + if (binOp == OO_Equal || (binOp >= OO_PlusEqual && binOp <= OO_PipeEqual)) { + return true; + } + } case CallExprClass: - case CXXOperatorCallExprClass: case CXXMemberCallExprClass: case CUDAKernelCallExprClass: case UserDefinedLiteralClass: {