[libcxx-commits] [libcxx] [libc++][bug] Fix compilation error in vector<bool> due to integral promotion (PR #119801)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Dec 12 18:40:49 PST 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 768754807f17754fb450ec672779b827ad5df4b4 97ccf883c6d11de897db733edcd20e4e664eed4e --extensions ,h -- libcxx/include/__cxx03/string libcxx/include/__cxx03/vector libcxx/include/__vector/vector_bool.h libcxx/include/string
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__cxx03/string b/libcxx/include/__cxx03/string
index 77bc7efe61..c29f74290b 100644
--- a/libcxx/include/__cxx03/string
+++ b/libcxx/include/__cxx03/string
@@ -2483,7 +2483,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__
__throw_length_error();
pointer __old_p = __get_pointer();
size_type __cap =
- __old_cap < __ms / 2 - __alignment ? __recommend(std::max<size_type>(__old_cap + __delta_cap, 2 * __old_cap)) : __ms - 1;
+ __old_cap < __ms / 2 - __alignment
+ ? __recommend(std::max<size_type>(__old_cap + __delta_cap, 2 * __old_cap))
+ : __ms - 1;
__annotate_delete();
auto __allocation = std::__allocate_at_least(__alloc(), __cap + 1);
pointer __p = __allocation.ptr;
@@ -2526,7 +2528,9 @@ _LIBCPP_DEPRECATED_("use __grow_by_without_replace") basic_string<_CharT, _Trait
__throw_length_error();
pointer __old_p = __get_pointer();
size_type __cap =
- __old_cap < __ms / 2 - __alignment ? __recommend(std::max<size_type>(__old_cap + __delta_cap, 2 * __old_cap)) : __ms - 1;
+ __old_cap < __ms / 2 - __alignment
+ ? __recommend(std::max<size_type>(__old_cap + __delta_cap, 2 * __old_cap))
+ : __ms - 1;
__annotate_delete();
auto __allocation = std::__allocate_at_least(__alloc(), __cap + 1);
pointer __p = __allocation.ptr;
diff --git a/libcxx/include/string b/libcxx/include/string
index 20fbe3dda2..911b67cfcf 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -2518,7 +2518,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__
__throw_length_error();
pointer __old_p = __get_pointer();
size_type __cap =
- __old_cap < __ms / 2 - __alignment ? __recommend(std::max<size_type>(__old_cap + __delta_cap, 2 * __old_cap)) : __ms - 1;
+ __old_cap < __ms / 2 - __alignment
+ ? __recommend(std::max<size_type>(__old_cap + __delta_cap, 2 * __old_cap))
+ : __ms - 1;
__annotate_delete();
auto __guard = std::__make_scope_guard(__annotate_new_size(*this));
auto __allocation = std::__allocate_at_least(__alloc_, __cap + 1);
``````````
</details>
https://github.com/llvm/llvm-project/pull/119801
More information about the libcxx-commits
mailing list