[libcxx-commits] [libcxx] [libc++] LWG3187: P0591R4 reverted DR 2586 fixes to `scoped_allocator_adaptor::construct()` (PR #152424)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 27 01:55:12 PST 2025


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/__memory/allocator_arg_t.h libcxx/include/__memory/uses_allocator_construction.h libcxx/include/__memory_resource/polymorphic_allocator.h libcxx/include/scoped_allocator libcxx/include/tuple libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair_evil.pass.cpp libcxx/test/support/uses_alloc_types.h --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/uses_allocator_construction.h b/libcxx/include/__memory/uses_allocator_construction.h
index 0adea4689..7a18795d5 100644
--- a/libcxx/include/__memory/uses_allocator_construction.h
+++ b/libcxx/include/__memory/uses_allocator_construction.h
@@ -135,7 +135,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple(_Tp&& __t) {
 #  endif
 }
 
-template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>
+template <class _Tp, class... _Args, class = decltype(::new (std::declval<void*>()) _Tp(std::declval<_Args>()...))>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* __construct_nocv_at(_Tp* __location, _Args&&... __args) {
   return std::__construct_at(const_cast<remove_cv_t<_Tp>*>(__location), std::forward<_Args>(__args)...);
 }
@@ -195,8 +195,8 @@ struct __uses_allocator_construction_args<_Pair, __enable_if_t<__is_cv_std_pair<
 #  endif
 
   template <class _Alloc, class _Up, class _Vp>
-  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto
-  __apply(const _Alloc& __alloc, const pair<_Up, _Vp>& __pair) noexcept {
+  static _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_CONSTEXPR_SINCE_CXX17 auto __apply(const _Alloc& __alloc, const pair<_Up, _Vp>& __pair) noexcept {
     return __uses_allocator_construction_args<_Pair>::__apply(
         __alloc, piecewise_construct, std::forward_as_tuple(__pair.first), std::forward_as_tuple(__pair.second));
   }
@@ -235,8 +235,8 @@ struct __uses_allocator_construction_args<_Pair, __enable_if_t<__is_cv_std_pair<
   template <class _Alloc,
             class _Type,
             __enable_if_t<__uses_allocator_detail::__uses_allocator_constraints<_Pair, _Type>, int> = 0>
-  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto
-  __apply(const _Alloc& __alloc, _Type&& __value) noexcept {
+  static _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_CONSTEXPR_SINCE_CXX17 auto __apply(const _Alloc& __alloc, _Type&& __value) noexcept {
     struct __pair_constructor {
       using _PairMutable = remove_cv_t<_Pair>;
 

``````````

</details>


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


More information about the libcxx-commits mailing list