[libcxx-commits] [libcxx] [libc++][vector] Fixes shrink_to_fit. (PR #97895)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jul 7 09:44:36 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 f90bac99e19d4243ac52cf6e18aa374f9a8754cb 78dedd788a276f18201e1d5c827fb453bb1755a3 -- libcxx/include/vector libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
index a2f0900cf8..181509678d 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
@@ -85,7 +85,7 @@ struct increasing_allocator {
if (allocation_amount < min_bytes)
allocation_amount = min_bytes;
min_bytes += 1000;
- return {static_cast<T*>(::operator new(allocation_amount)), allocation_amount/sizeof(T)};
+ return {static_cast<T*>(::operator new(allocation_amount)), allocation_amount / sizeof(T)};
}
T* allocate(std::size_t n) { return allocate_at_least(n).ptr; }
void deallocate(T* p, std::size_t) noexcept { ::operator delete(static_cast<void*>(p)); }
``````````
</details>
https://github.com/llvm/llvm-project/pull/97895
More information about the libcxx-commits
mailing list