[clang] [llvm] [clang] Use separator for large numeric values in overflow diagnostic (PR #80939)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 4 09:34:25 PST 2024


================
@@ -2778,7 +2778,9 @@ static bool CheckedIntArithmetic(EvalInfo &Info, const Expr *E,
     if (Info.checkingForUndefinedBehavior())
       Info.Ctx.getDiagnostics().Report(E->getExprLoc(),
                                        diag::warn_integer_constant_overflow)
-          << toString(Result, 10) << E->getType() << E->getSourceRange();
+          << toString(Result, 10, Result.isSigned(), /*formatAsCLiteral=*/false,
+                      /*upperCase=*/true, /*insertSeparators=*/true)
----------------
AaronBallman wrote:

```suggestion
                      /*UpperCase=*/true, /*InsertSeparators=*/true)
```
Same changes needed elsewhere, but this should keep clang-tidy happy for folks using it.

https://github.com/llvm/llvm-project/pull/80939


More information about the cfe-commits mailing list