[libcxx-commits] [libcxx] [libc++] Remove potential 0-sized array in __compressed_pair_padding (PR #109028)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 30 01:44:20 PDT 2024


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 af47038fb1385435eb315cc1962464f19ea9e186 cb61492e21846a8590db15f8bd1f4e8587a44c06 --extensions ,h -- libcxx/include/__memory/padding.h libcxx/include/__format/format_arg_store.h libcxx/include/__memory/compressed_pair.h libcxx/include/string
``````````

</details>

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

``````````diff
diff --git a/libcxx/include/__memory/compressed_pair.h b/libcxx/include/__memory/compressed_pair.h
index 18a1a3a07e..113cc2c288 100644
--- a/libcxx/include/__memory/compressed_pair.h
+++ b/libcxx/include/__memory/compressed_pair.h
@@ -56,8 +56,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 template <class _ToPad>
 using __compressed_pair_padding =
     std::__padding<((is_empty<_ToPad>::value && !__libcpp_is_final<_ToPad>::value) || is_reference<_ToPad>::value)
-                  ? 0
-                  : (sizeof(_ToPad) - __datasizeof_v<_ToPad>)>;
+                       ? 0
+                       : (sizeof(_ToPad) - __datasizeof_v<_ToPad>)>;
 
 #  define _LIBCPP_COMPRESSED_PAIR(T1, Initializer1, T2, Initializer2)                                                  \
     _LIBCPP_NO_UNIQUE_ADDRESS __attribute__((__aligned__(_LIBCPP_ALIGNOF(T2)))) T1 Initializer1;                       \

``````````

</details>


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


More information about the libcxx-commits mailing list