[libcxx-commits] [libcxx] [libc++] std::abs support for _BitInt(N) and __int128 (PR #196532)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 8 06:25:17 PDT 2026


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 h,cpp -- libcxx/test/libcxx/numerics/c.math/abs.bitint.pass.cpp libcxx/include/__math/abs.h --diff_from_common_commit
``````````

: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/libcxx/test/libcxx/numerics/c.math/abs.bitint.pass.cpp b/libcxx/test/libcxx/numerics/c.math/abs.bitint.pass.cpp
index d4494c837..05bfac0a3 100644
--- a/libcxx/test/libcxx/numerics/c.math/abs.bitint.pass.cpp
+++ b/libcxx/test/libcxx/numerics/c.math/abs.bitint.pass.cpp
@@ -89,8 +89,8 @@ int main(int, char**) {
 
   // Boundary: INT128_MAX (identity) and INT128_MIN+1 (negation cleanly
   // produces INT128_MAX).
-  __int128_t int128_max         = static_cast<__int128_t>(~static_cast<__uint128_t>(0) >> 1);
-  __int128_t int128_min_plus1   = -int128_max;
+  __int128_t int128_max       = static_cast<__int128_t>(~static_cast<__uint128_t>(0) >> 1);
+  __int128_t int128_min_plus1 = -int128_max;
   assert(std::abs(int128_max) == int128_max);
   assert(std::abs(int128_min_plus1) == int128_max);
 #endif

``````````

</details>


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


More information about the libcxx-commits mailing list