[libcxx-commits] [libcxx] [libc++] Use glibc random APIs for std::random_device on Linux (PR #222567)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 10 02:44:09 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-03/numerics/rand/rand.device/abi.compile.pass.cpp libcxx/test/libcxx/numerics/rand/rand.device/abi.compile.pass.cpp libcxx/include/__config libcxx/include/__cxx03/__config libcxx/include/__cxx03/__random/random_device.h libcxx/include/__random/random_device.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-03/numerics/rand/rand.device/abi.compile.pass.cpp b/libcxx/test/libcxx-03/numerics/rand/rand.device/abi.compile.pass.cpp
index 9106d6e05..c9555b174 100644
--- a/libcxx/test/libcxx-03/numerics/rand/rand.device/abi.compile.pass.cpp
+++ b/libcxx/test/libcxx-03/numerics/rand/rand.device/abi.compile.pass.cpp
@@ -14,7 +14,7 @@
#include "test_macros.h"
-#if defined(_LIBCPP_USING_DEV_RANDOM) || \
+#if defined(_LIBCPP_USING_DEV_RANDOM) || \
(!defined(_LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT) && (defined(__APPLE__) || defined(__GLIBC__)))
static_assert(sizeof(std::random_device) == sizeof(int), "");
diff --git a/libcxx/test/libcxx/numerics/rand/rand.device/abi.compile.pass.cpp b/libcxx/test/libcxx/numerics/rand/rand.device/abi.compile.pass.cpp
index 9106d6e05..c9555b174 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.device/abi.compile.pass.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.device/abi.compile.pass.cpp
@@ -14,7 +14,7 @@
#include "test_macros.h"
-#if defined(_LIBCPP_USING_DEV_RANDOM) || \
+#if defined(_LIBCPP_USING_DEV_RANDOM) || \
(!defined(_LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT) && (defined(__APPLE__) || defined(__GLIBC__)))
static_assert(sizeof(std::random_device) == sizeof(int), "");
``````````
</details>
https://github.com/llvm/llvm-project/pull/222567
More information about the libcxx-commits
mailing list