[libcxx-commits] [libcxx] [libc++] Remove _LIBCPP_COMPRESSED_PAIR/TRIPLE from shared_ptr (PR #200401)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri May 29 06:48:55 PDT 2026
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 origin/main HEAD --extensions h,cpp -- libcxx/include/__configuration/attributes.h libcxx/include/__memory/compressed_pair.h libcxx/include/__memory/shared_ptr.h libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.lwg2070.pass.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index a77dcdbb4..58f8a301d 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -131,7 +131,7 @@ struct __for_overwrite_tag {};
template <class _Tp, class _Alloc>
struct _LIBCPP_HIDE_STRUCT_FROM_ABI __shared_ptr_emplace : __shared_weak_count {
- using __alloc_t _LIBCPP_NODEBUG = __allocator_traits_rebind_t<_Alloc, __shared_ptr_emplace>;
+ using __alloc_t _LIBCPP_NODEBUG = __allocator_traits_rebind_t<_Alloc, __shared_ptr_emplace>;
using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<__alloc_t>;
using __value_type _LIBCPP_NODEBUG = __remove_cv_t<_Tp>;
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.lwg2070.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.lwg2070.pass.cpp
index 31a98870c..9dc4dd0dc 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.lwg2070.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared.lwg2070.pass.cpp
@@ -51,8 +51,8 @@ public:
void deallocate(pointer p, std::ptrdiff_t) { return ::operator delete(p); }
- template <class U, typename ...Args>
- void construct(U* p, Args&& ...args) {
+ template <class U, typename... Args>
+ void construct(U* p, Args&&... args) {
construct_called = true;
destroy_called = false;
allocator_id = id;
@@ -101,10 +101,14 @@ struct FactoryAllocator : std::allocator<T> {
};
template <class U>
- void construct(U* p, int id) { ::new (p) U(id); }
+ void construct(U* p, int id) {
+ ::new (p) U(id);
+ }
template <class U>
- void destroy(U* p) { p->~U(); }
+ void destroy(U* p) {
+ p->~U();
+ }
};
std::shared_ptr<Private> Factory::allocate() {
``````````
</details>
https://github.com/llvm/llvm-project/pull/200401
More information about the libcxx-commits
mailing list