[libcxx-commits] [libcxx] [libc++][ABI BREAK] Make std::pair trivially copyable if its members are (PR #89652)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Apr 22 12:05:00 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 c8e5ad4e123a5fb082355947a896980464689c31 90e202944d6032a3cccb6ffe777835f139374987 -- libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/trivially_copyable.compile.pass.cpp libcxx/include/__utility/pair.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__utility/pair.h b/libcxx/include/__utility/pair.h
index 5a9f9f4a3a..5b3dec6e4d 100644
--- a/libcxx/include/__utility/pair.h
+++ b/libcxx/include/__utility/pair.h
@@ -144,7 +144,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
// Make pair trivially copyable if we have a way to do it
static const bool __enable_defaulted_assignment_operators =
!is_reference<first_type>::value && !is_reference<second_type>::value;
-#if _LIBCPP_STD_VER >= 20
+# if _LIBCPP_STD_VER >= 20
static const bool __has_defaulted_members = __enable_defaulted_assignment_operators;
_LIBCPP_HIDE_FROM_ABI constexpr pair& operator=(const pair&)
@@ -162,7 +162,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
_LIBCPP_HIDE_FROM_ABI pair& operator=(pair&&)
__attribute__((__enable_if__(__enable_defaulted_assignment_operators, ""))) = default;
-#else
+# else
static const bool __has_defaulted_members = false;
# endif // __has_attribute(__enable_if__)
``````````
</details>
https://github.com/llvm/llvm-project/pull/89652
More information about the libcxx-commits
mailing list