aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-09-23 14:47:33 +0200
committerGitHub <noreply@github.com>2025-09-23 14:47:33 +0200
commit2bc46ae8ffdd9510bc0f623c3ea35f7febbcd671 (patch)
treee25a049cd63672dcb105260044b196af04f14bde /clang/lib/Sema/SemaDecl.cpp
parent32ff98726b563bb6b0da99a9d0a61c6b37e5af73 (diff)
downloadllvm-2bc46ae8ffdd9510bc0f623c3ea35f7febbcd671.zip
llvm-2bc46ae8ffdd9510bc0f623c3ea35f7febbcd671.tar.gz
llvm-2bc46ae8ffdd9510bc0f623c3ea35f7febbcd671.tar.bz2
[clang] Format "array is too large" diagnostics with separators (#160260)
We only display this diagnostic with large numbers, so add the separators. Not sure if `295'147'905'179'352'825'841` is much better than `295147905179352825841` but I think it would be nice to have separators in more diagnostics.
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index e10511c..9ef7a26 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -6794,7 +6794,9 @@ bool Sema::tryToFixVariablyModifiedVarType(TypeSourceInfo *&TInfo,
if (SizeIsNegative)
Diag(Loc, diag::err_typecheck_negative_array_size);
else if (Oversized.getBoolValue())
- Diag(Loc, diag::err_array_too_large) << toString(Oversized, 10);
+ Diag(Loc, diag::err_array_too_large) << toString(
+ Oversized, 10, Oversized.isSigned(), /*formatAsCLiteral=*/false,
+ /*UpperCase=*/false, /*InsertSeparators=*/true);
else if (FailedFoldDiagID)
Diag(Loc, FailedFoldDiagID);
return false;