From c03642e9a86d9ed128676d5405a1906282d727ad Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Mon, 6 Aug 2018 16:05:08 +0000 Subject: [Fixed Point Arithmetic] Fix for FixedPointValueToString - Print negative numbers correctly - Handle APInts of different sizes - Add formal unit tests for FixedPointValueToString - Add tests for checking correct printing when padding is set - Restrict to printing in radix 10 since that's all we need for now Differential Revision: https://reviews.llvm.org/D49945 llvm-svn: 339026 --- clang/lib/AST/ExprConstant.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/lib/AST/ExprConstant.cpp') diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 222ff74aaac..7e596d0715c 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -9698,8 +9698,7 @@ bool FixedPointExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) { if (Value.isSigned() && Value.isMinSignedValue() && E->canOverflow()) { SmallString<64> S; FixedPointValueToString(S, Value, - Info.Ctx.getTypeInfo(E->getType()).Width, - /*Radix=*/10); + Info.Ctx.getTypeInfo(E->getType()).Width); Info.CCEDiag(E, diag::note_constexpr_overflow) << S << E->getType(); if (Info.noteUndefinedBehavior()) return false; } -- cgit v1.2.3