[clang] [llvm] [clang] Use separator for large numeric values in overflow diagnostic (PR #80939)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 9 00:02:06 PST 2024
================
@@ -2774,7 +2774,8 @@ 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(), false, true, true)
----------------
tbaederr wrote:
```suggestion
<< toString(Result, 10, Result.isSigned(), /*formatAsCLiteral=*/false, /*upperCase=*/true, /*insertSeparators=*/true)
```
same with the other callsite.
https://github.com/llvm/llvm-project/pull/80939
More information about the cfe-commits
mailing list