[libcxx-commits] [libcxx] [libc++] Fix throwing away smaller allocations in string::shrink_to_fit (PR #115659)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 10 05:30:32 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 6b21cf8ccad84e2670e458d8bdaccbd0ae37b46b 0de7f619eddd25eb38c6c06d4ffd1eb851eb584b --extensions ,cpp -- libcxx/test/libcxx/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp libcxx/include/string
``````````

</details>

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

``````````diff
diff --git a/libcxx/test/libcxx/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp
index 04a3f4cb2f..73b70d6f10 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp
@@ -40,7 +40,7 @@ bool operator==(oversizing_allocator<T>, oversizing_allocator<U>) {
 void test_oversizing_allocator() {
   std::basic_string<char, std::char_traits<char>, oversizing_allocator<char>> s{
       "String does not fit in the internal buffer and is a bit longer"};
-  s = "String does not fit in the internal buffer";
+  s                    = "String does not fit in the internal buffer";
   std::size_t capacity = s.capacity();
   std::size_t size     = s.size();
   s.shrink_to_fit();

``````````

</details>


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


More information about the libcxx-commits mailing list