diff options
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 7d6796d..a7e0d5a 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -2805,9 +2805,9 @@ static bool CheckedIntArithmetic(EvalInfo &Info, const Expr *E, } /// Perform the given binary integer operation. -static bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, - BinaryOperatorKind Opcode, APSInt RHS, - APSInt &Result) { +static bool handleIntIntBinOp(EvalInfo &Info, const BinaryOperator *E, + const APSInt &LHS, BinaryOperatorKind Opcode, + APSInt RHS, APSInt &Result) { bool HandleOverflowResult = true; switch (Opcode) { default: @@ -2828,7 +2828,8 @@ static bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, case BO_Div: case BO_Rem: if (RHS == 0) { - Info.FFDiag(E, diag::note_expr_divide_by_zero); + Info.FFDiag(E, diag::note_expr_divide_by_zero) + << E->getRHS()->getSourceRange(); return false; } // Check for overflow case: INT_MIN / -1 or INT_MIN % -1. APSInt supports |