[clang] [Clang][Sema] Switch diagnostics from toString to operator<< for APSInt/APInt (PR #161474)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 1 07:50:52 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,c -- clang/lib/Sema/SemaChecking.cpp clang/test/AST/ByteCode/const-eval.c clang/test/Sema/const-eval.c clang/test/Sema/integer-overflow.c clang/test/Sema/unbounded-array-bounds.c clang/test/SemaCXX/array-bounds.cpp clang/test/SemaCXX/constant-expression-cxx14.cpp clang/test/SemaCXX/integer-overflow.cpp
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 020e496c2..38e94095b 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -14883,14 +14883,12 @@ void Sema::CheckArrayAccess(const Expr *BaseExpr, const Expr *IndexExpr,
// Diag message shows element size in bits and in "bytes" (platform-
// dependent CharUnits)
- DiagRuntimeBehavior(BaseExpr->getBeginLoc(), BaseExpr,
- PDiag(DiagID)
- << index << AddrBits
- << (unsigned)ASTC.toBits(*ElemCharUnits)
- << ElemBytes
- << MaxElems
- << (unsigned)MaxElems.getLimitedValue(~0U)
- << IndexExpr->getSourceRange());
+ DiagRuntimeBehavior(
+ BaseExpr->getBeginLoc(), BaseExpr,
+ PDiag(DiagID) << index << AddrBits
+ << (unsigned)ASTC.toBits(*ElemCharUnits) << ElemBytes
+ << MaxElems << (unsigned)MaxElems.getLimitedValue(~0U)
+ << IndexExpr->getSourceRange());
const NamedDecl *ND = nullptr;
// Try harder to find a NamedDecl to point at in the note.
``````````
</details>
https://github.com/llvm/llvm-project/pull/161474
More information about the cfe-commits
mailing list