[libcxx-commits] [libcxx] [libc++] Fix native wait alignment (PR #180928)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 11 04:12:55 PST 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/atomics/atomics.syn/wait.native.compile.pass.cpp libcxx/include/__atomic/atomic_waitable_traits.h libcxx/src/atomic.cpp --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/src/atomic.cpp b/libcxx/src/atomic.cpp
index bed40840e..1277b20ca 100644
--- a/libcxx/src/atomic.cpp
+++ b/libcxx/src/atomic.cpp
@@ -100,8 +100,7 @@ template <std::size_t _Size>
 static void __platform_wait_on_address(void const* __ptr, void const* __val, uint64_t __timeout_ns) {
   static_assert(_Size == 8 || _Size == 4, "Can only wait on 8 bytes or 4 bytes value");
   auto __timeout_us = __timeout_ns == 0 ? 0 : static_cast<uint32_t>(__timeout_ns / 1000);
-  if constexpr (_Size == 4)
-  {
+  if constexpr (_Size == 4) {
     alignas(uint32_t) char buffer[_Size];
     std::memcpy(&buffer, const_cast<const void*>(__val), _Size);
     __ulock_wait(

``````````

</details>


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


More information about the libcxx-commits mailing list