[clang] Avoid printing overly large integer. (PR #75902)

via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 21 10:32:13 PST 2023


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 497b2ebb9edcfd5315586b796f47589e9820b4b9 5e6326fb1cf4f1591fe927c94b1d16d1a7be0e66 -- clang/lib/Sema/SemaDeclCXX.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 196e32a4a3..80e6cd9ee0 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,8 @@ static bool ConvertAPValueToString(const APValue &V, QualType T,
         case BuiltinType::WChar_U: {
           unsigned TyWidth = Context.getIntWidth(T);
           assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-          if (V.getInt() > std::numeric_limits<uint64_t>::max() || V.getInt() < std::numeric_limits<int64_t>::min()) {
+          if (V.getInt() > std::numeric_limits<uint64_t>::max() ||
+              V.getInt() < std::numeric_limits<int64_t>::min()) {
             return false;
           }
           uint32_t CodeUnit = static_cast<uint32_t>(V.getInt().getZExtValue());

``````````

</details>


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


More information about the cfe-commits mailing list