-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "[libc++] LWG3870: Remove voidify
(#110355)"
#110587
Revert "[libc++] LWG3870: Remove voidify
(#110355)"
#110587
Conversation
@llvm/pr-subscribers-libcxx Author: Michael Buch (Michael137) ChangesThis reverts commit 78f9a8b. This caused the LLDB test
Will need a bit more time to look into a solution Patch is 126.67 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/110587.diff 21 Files Affected:
diff --git a/libcxx/docs/Status/Cxx23Issues.csv b/libcxx/docs/Status/Cxx23Issues.csv
index 63e4176ecba1d7..1c8bb057b09660 100644
--- a/libcxx/docs/Status/Cxx23Issues.csv
+++ b/libcxx/docs/Status/Cxx23Issues.csv
@@ -296,7 +296,7 @@
"`LWG3862 <https://wg21.link/LWG3862>`__","``basic_const_iterator``'s ``common_type`` specialization is underconstrained","2023-02 (Issaquah)","","",""
"`LWG3865 <https://wg21.link/LWG3865>`__","Sorting a range of ``pairs``","2023-02 (Issaquah)","|Complete|","17.0",""
"`LWG3869 <https://wg21.link/LWG3869>`__","Deprecate ``std::errc`` constants related to UNIX STREAMS","2023-02 (Issaquah)","|Complete|","19.0",""
-"`LWG3870 <https://wg21.link/LWG3870>`__","Remove ``voidify``","2023-02 (Issaquah)","|Complete|","20.0",""
+"`LWG3870 <https://wg21.link/LWG3870>`__","Remove ``voidify``","2023-02 (Issaquah)","","",""
"`LWG3871 <https://wg21.link/LWG3871>`__","Adjust note about ``terminate``","2023-02 (Issaquah)","","",""
"`LWG3872 <https://wg21.link/LWG3872>`__","``basic_const_iterator`` should have custom ``iter_move``","2023-02 (Issaquah)","","",""
"`LWG3875 <https://wg21.link/LWG3875>`__","``std::ranges::repeat_view<T, IntegerClass>::iterator`` may be ill-formed","2023-02 (Issaquah)","|Complete|","17.0",""
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 9bd1b41b8bfac4..8a63280053340f 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -560,6 +560,7 @@ set(files
__memory/unique_temporary_buffer.h
__memory/uses_allocator.h
__memory/uses_allocator_construction.h
+ __memory/voidify.h
__memory_resource/memory_resource.h
__memory_resource/monotonic_buffer_resource.h
__memory_resource/polymorphic_allocator.h
diff --git a/libcxx/include/__memory/construct_at.h b/libcxx/include/__memory/construct_at.h
index d8c97467f54b9f..eb021324800644 100644
--- a/libcxx/include/__memory/construct_at.h
+++ b/libcxx/include/__memory/construct_at.h
@@ -14,6 +14,7 @@
#include <__config>
#include <__iterator/access.h>
#include <__memory/addressof.h>
+#include <__memory/voidify.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/is_array.h>
#include <__utility/declval.h>
@@ -37,7 +38,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>
_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
_LIBCPP_ASSERT_NON_NULL(__location != nullptr, "null pointer given to construct_at");
- return ::new (static_cast<void*>(__location)) _Tp(std::forward<_Args>(__args)...);
+ return ::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
}
#endif
@@ -48,7 +49,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* __construct_at(_Tp* __l
return std::construct_at(__location, std::forward<_Args>(__args)...);
#else
return _LIBCPP_ASSERT_NON_NULL(__location != nullptr, "null pointer given to construct_at"),
- ::new (static_cast<void*>(__location)) _Tp(std::forward<_Args>(__args)...);
+ ::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
#endif
}
diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index 20c1b69f45ae66..70964e6122d5a6 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -248,35 +248,33 @@ struct __for_overwrite_tag {};
template <class _Tp, class _Alloc>
struct __shared_ptr_emplace : __shared_weak_count {
- using __value_type = __remove_cv_t<_Tp>;
-
template <class... _Args,
class _Allocator = _Alloc,
__enable_if_t<is_same<typename _Allocator::value_type, __for_overwrite_tag>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit __shared_ptr_emplace(_Alloc __a, _Args&&...) : __storage_(std::move(__a)) {
static_assert(
sizeof...(_Args) == 0, "No argument should be provided to the control block when using _for_overwrite");
- ::new (static_cast<void*>(__get_elem())) __value_type;
+ ::new ((void*)__get_elem()) _Tp;
}
template <class... _Args,
class _Allocator = _Alloc,
__enable_if_t<!is_same<typename _Allocator::value_type, __for_overwrite_tag>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit __shared_ptr_emplace(_Alloc __a, _Args&&... __args) : __storage_(std::move(__a)) {
- using _TpAlloc = typename __allocator_traits_rebind<_Alloc, __value_type>::type;
+ using _TpAlloc = typename __allocator_traits_rebind<_Alloc, __remove_cv_t<_Tp> >::type;
_TpAlloc __tmp(*__get_alloc());
allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), std::forward<_Args>(__args)...);
}
_LIBCPP_HIDE_FROM_ABI _Alloc* __get_alloc() _NOEXCEPT { return __storage_.__get_alloc(); }
- _LIBCPP_HIDE_FROM_ABI __value_type* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); }
+ _LIBCPP_HIDE_FROM_ABI _Tp* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); }
private:
template <class _Allocator = _Alloc,
__enable_if_t<is_same<typename _Allocator::value_type, __for_overwrite_tag>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI void __on_zero_shared_impl() _NOEXCEPT {
- __get_elem()->~__value_type();
+ __get_elem()->~_Tp();
}
template <class _Allocator = _Alloc,
@@ -302,7 +300,7 @@ struct __shared_ptr_emplace : __shared_weak_count {
// through `std::allocate_shared` and `std::make_shared`.
struct _Storage {
struct _Data {
- _LIBCPP_COMPRESSED_PAIR(_Alloc, __alloc_, __value_type, __elem_);
+ _LIBCPP_COMPRESSED_PAIR(_Alloc, __alloc_, _Tp, __elem_);
};
_ALIGNAS_TYPE(_Data) char __buffer_[sizeof(_Data)];
@@ -314,7 +312,7 @@ struct __shared_ptr_emplace : __shared_weak_count {
return std::addressof(reinterpret_cast<_Data*>(__buffer_)->__alloc_);
}
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI __value_type* __get_elem() _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _Tp* __get_elem() _NOEXCEPT {
return std::addressof(reinterpret_cast<_Data*>(__buffer_)->__elem_);
}
};
diff --git a/libcxx/include/__memory/uninitialized_algorithms.h b/libcxx/include/__memory/uninitialized_algorithms.h
index dd72f3c10cf15a..8ff87e28b3bb51 100644
--- a/libcxx/include/__memory/uninitialized_algorithms.h
+++ b/libcxx/include/__memory/uninitialized_algorithms.h
@@ -21,6 +21,7 @@
#include <__memory/allocator_traits.h>
#include <__memory/construct_at.h>
#include <__memory/pointer_traits.h>
+#include <__memory/voidify.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/extent.h>
#include <__type_traits/is_array.h>
@@ -63,7 +64,7 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali
try {
#endif
for (; __ifirst != __ilast && !__stop_copying(__idx); ++__ifirst, (void)++__idx)
- ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(*__ifirst);
+ ::new (std::__voidify(*__idx)) _ValueType(*__ifirst);
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
std::__destroy(__ofirst, __idx);
@@ -93,7 +94,7 @@ __uninitialized_copy_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __of
try {
#endif
for (; __n > 0 && !__stop_copying(__idx); ++__ifirst, (void)++__idx, (void)--__n)
- ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(*__ifirst);
+ ::new (std::__voidify(*__idx)) _ValueType(*__ifirst);
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
std::__destroy(__ofirst, __idx);
@@ -123,7 +124,7 @@ __uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x)
try {
#endif
for (; __idx != __last; ++__idx)
- ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__x);
+ ::new (std::__voidify(*__idx)) _ValueType(__x);
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
std::__destroy(__first, __idx);
@@ -151,7 +152,7 @@ __uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {
try {
#endif
for (; __n > 0; ++__idx, (void)--__n)
- ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__x);
+ ::new (std::__voidify(*__idx)) _ValueType(__x);
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
std::__destroy(__first, __idx);
@@ -181,7 +182,7 @@ __uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {
try {
# endif
for (; __idx != __last; ++__idx)
- ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType;
+ ::new (std::__voidify(*__idx)) _ValueType;
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
std::__destroy(__first, __idx);
@@ -207,7 +208,7 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_default_construct_
try {
# endif
for (; __n > 0; ++__idx, (void)--__n)
- ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType;
+ ::new (std::__voidify(*__idx)) _ValueType;
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
std::__destroy(__first, __idx);
@@ -234,7 +235,7 @@ __uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {
try {
# endif
for (; __idx != __last; ++__idx)
- ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType();
+ ::new (std::__voidify(*__idx)) _ValueType();
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
std::__destroy(__first, __idx);
@@ -260,7 +261,7 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_value_construct_n(
try {
# endif
for (; __n > 0; ++__idx, (void)--__n)
- ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType();
+ ::new (std::__voidify(*__idx)) _ValueType();
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
std::__destroy(__first, __idx);
@@ -296,7 +297,7 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali
try {
# endif
for (; __ifirst != __ilast && !__stop_moving(__idx); ++__idx, (void)++__ifirst) {
- ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__iter_move(__ifirst));
+ ::new (std::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
}
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
@@ -334,7 +335,7 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali
try {
# endif
for (; __n > 0 && !__stop_moving(__idx); ++__idx, (void)++__ifirst, --__n)
- ::new (static_cast<void*>(std::addressof(*__idx))) _ValueType(__iter_move(__ifirst));
+ ::new (std::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
std::__destroy(__ofirst, __idx);
diff --git a/libcxx/include/__memory/voidify.h b/libcxx/include/__memory/voidify.h
new file mode 100644
index 00000000000000..dbd083bd8c1e9a
--- /dev/null
+++ b/libcxx/include/__memory/voidify.h
@@ -0,0 +1,30 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MEMORY_VOIDIFY_H
+#define _LIBCPP___MEMORY_VOIDIFY_H
+
+#include <__config>
+#include <__memory/addressof.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <typename _Tp>
+_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void* __voidify(_Tp& __from) {
+ // Cast away cv-qualifiers to allow modifying elements of a range through const iterators.
+ return const_cast<void*>(static_cast<const volatile void*>(std::addressof(__from)));
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___MEMORY_VOIDIFY_H
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index dee9b0b88b7948..71218bdf3b2b14 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -2237,3 +2237,1470 @@ module std_private_mbstate_t [system] {
header "__mbstate_t.h"
export *
}
+module std_private_node_handle [system] {
+ header "__node_handle"
+ export *
+}
+module std_private_split_buffer [system] {
+ header "__split_buffer"
+ export *
+}
+module std_private_std_mbstate_t [system] {
+ header "__std_mbstate_t.h"
+ export *
+}
+module std_private_tree [system] {
+ header "__tree"
+ export *
+}
+module std_private_undef_macros [system] {
+ textual header "__undef_macros"
+ export *
+}
+module std_private_verbose_abort [system] {
+ header "__verbose_abort"
+ export *
+}
+
+module std_private_algorithm_adjacent_find [system] { header "__algorithm/adjacent_find.h" }
+module std_private_algorithm_all_of [system] { header "__algorithm/all_of.h" }
+module std_private_algorithm_any_of [system] { header "__algorithm/any_of.h" }
+module std_private_algorithm_binary_search [system] { header "__algorithm/binary_search.h" }
+module std_private_algorithm_clamp [system] { header "__algorithm/clamp.h" }
+module std_private_algorithm_comp [system] { header "__algorithm/comp.h" }
+module std_private_algorithm_comp_ref_type [system] { header "__algorithm/comp_ref_type.h" }
+module std_private_algorithm_copy [system] {
+ header "__algorithm/copy.h"
+ export std_private_algorithm_copy_move_common
+}
+module std_private_algorithm_copy_backward [system] { header "__algorithm/copy_backward.h" }
+module std_private_algorithm_copy_if [system] { header "__algorithm/copy_if.h" }
+module std_private_algorithm_copy_move_common [system] {
+ header "__algorithm/copy_move_common.h"
+ export std_private_type_traits_is_trivially_copyable
+}
+module std_private_algorithm_copy_n [system] { header "__algorithm/copy_n.h" }
+module std_private_algorithm_count [system] { header "__algorithm/count.h" }
+module std_private_algorithm_count_if [system] { header "__algorithm/count_if.h" }
+module std_private_algorithm_equal [system] { header "__algorithm/equal.h" }
+module std_private_algorithm_equal_range [system] { header "__algorithm/equal_range.h" }
+module std_private_algorithm_fill [system] { header "__algorithm/fill.h" }
+module std_private_algorithm_fill_n [system] { header "__algorithm/fill_n.h" }
+module std_private_algorithm_find [system] {
+ header "__algorithm/find.h"
+ export std_private_algorithm_unwrap_iter
+}
+module std_private_algorithm_find_end [system] { header "__algorithm/find_end.h" }
+module std_private_algorithm_find_first_of [system] { header "__algorithm/find_first_of.h" }
+module std_private_algorithm_find_if [system] { header "__algorithm/find_if.h" }
+module std_private_algorithm_find_if_not [system] { header "__algorithm/find_if_not.h" }
+module std_private_algorithm_find_segment_if [system] { header "__algorithm/find_segment_if.h" }
+module std_private_algorithm_for_each [system] { header "__algorithm/for_each.h" }
+module std_private_algorithm_for_each_n [system] { header "__algorithm/for_each_n.h" }
+module std_private_algorithm_for_each_segment [system] { header "__algorithm/for_each_segment.h" }
+module std_private_algorithm_generate [system] { header "__algorithm/generate.h" }
+module std_private_algorithm_generate_n [system] { header "__algorithm/generate_n.h" }
+module std_private_algorithm_half_positive [system] { header "__algorithm/half_positive.h" }
+module std_private_algorithm_in_found_result [system] { header "__algorithm/in_found_result.h" }
+module std_private_algorithm_in_fun_result [system] { header "__algorithm/in_fun_result.h" }
+module std_private_algorithm_in_in_out_result [system] { header "__algorithm/in_in_out_result.h" }
+module std_private_algorithm_in_in_result [system] { header "__algorithm/in_in_result.h" }
+module std_private_algorithm_in_out_out_result [system] { header "__algorithm/in_out_out_result.h" }
+module std_private_algorithm_in_out_result [system] { header "__algorithm/in_out_result.h" }
+module std_private_algorithm_includes [system] { header "__algorithm/includes.h" }
+module std_private_algorithm_inplace_merge [system] { header "__algorithm/inplace_merge.h" }
+module std_private_algorithm_is_heap [system] { header "__algorithm/is_heap.h" }
+module std_private_algorithm_is_heap_until [system] { header "__algorithm/is_heap_until.h" }
+module std_private_algorithm_is_partitioned [system] { header "__algorithm/is_partitioned.h" }
+module std_private_algorithm_is_permutation [system] { header "__algorithm/is_permutation.h" }
+module std_private_algorithm_is_sorted [system] { header "__algorithm/is_sorted.h" }
+module std_private_algorithm_is_sorted_until [system] { header "__algorithm/is_sorted_until.h" }
+module std_private_algorithm_iter_swap [system] { header "__algorithm/iter_swap.h" }
+module std_private_algorithm_iterator_operations [system] {
+ header "__algorithm/iterator_operations.h"
+ export *
+}
+module std_private_algorithm_lexicographical_compare [system] { header "__algorithm/lexicographical_compare.h" }
+module std_private_algorithm_lexicographical_compare_three_way [system] { header "__algorithm/lexicographical_compare_three_way.h" }
+module std_private_algorithm_lower_bound [system] { header "__algorithm/lower_bound.h" }
+module std_private_algorithm_make_heap [system] { header "__algorithm/make_heap.h" }
+module std_private_algorithm_make_projected [system] { header "__algorithm/make_projected.h" }
+module std_private_algorithm_max [system] { header "__algorithm/max.h" }
+module std_private_algorithm_max_element [system] { header "__algorithm/max_element.h" }
+module std_private_algorithm_merge [system] { header "__algorithm/merge.h" }
+module std_private_algorithm_min [system] { header "__algorithm/min.h" }
+module std_private_algorithm_min_element [system] { header "__algorithm/min_element.h" }
+module std_private_algorithm_min_max_result [system] { header "__algorithm/min_max_result.h" }
+module std_private_algorithm_minmax [system] {
+ header "__algorithm/minmax.h"
+ export *
+}
+module std_private_algorithm_minmax_element [system] { header "__algorithm/minmax_element.h" }
+module std_priv...
[truncated]
|
@ldionne let me know if the modulemap doesn't look right |
You can test this locally with the following command:git-clang-format --diff 725eb6bb12e7471149fb7362093deb6a710fe258 8cc0886f9467ae0753d67adbff61e8796243ffef --extensions ,h,cpp -- libcxx/include/__memory/voidify.h libcxx/include/__memory/construct_at.h libcxx/include/__memory/shared_ptr.h libcxx/include/__memory/uninitialized_algorithms.h libcxx/include/optional libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/ranges_construct_at.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/ranges_uninitialized_default_construct.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/ranges_uninitialized_default_construct_n.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/ranges_uninitialized_value_construct.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/ranges_uninitialized_value_construct_n.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/ranges_uninitialized_fill.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move.pass.cpp libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp View the diff from clang-format here.diff --git a/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp b/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp
index 13442df9db..7e0e55b0e2 100644
--- a/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp
+++ b/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp
@@ -81,18 +81,18 @@ constexpr bool test()
}
{
- std::allocator<Counted> a;
- Counted const* p = a.allocate(2);
- int count = 0;
- std::construct_at(p, count);
- assert(count == 1);
- std::construct_at(p+1, count);
- assert(count == 2);
- (p+1)->~Counted();
- assert(count == 1);
- p->~Counted();
- assert(count == 0);
- a.deallocate(const_cast<Counted*>(p), 2);
+ std::allocator<Counted> a;
+ Counted const* p = a.allocate(2);
+ int count = 0;
+ std::construct_at(p, count);
+ assert(count == 1);
+ std::construct_at(p + 1, count);
+ assert(count == 2);
+ (p + 1)->~Counted();
+ assert(count == 1);
+ p->~Counted();
+ assert(count == 0);
+ a.deallocate(const_cast<Counted*>(p), 2);
}
return true;
diff --git a/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/ranges_construct_at.pass.cpp b/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/ranges_construct_at.pass.cpp
index 396fed7cc3..c50a0973ec 100644
--- a/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/ranges_construct_at.pass.cpp
+++ b/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/ranges_construct_at.pass.cpp
@@ -101,7 +101,7 @@ constexpr bool test() {
// Works with const pointers.
{
- int x = 1;
+ int x = 1;
const int* ptr = &x;
const int* result = std::ranges::construct_at(ptr, 42);
diff --git a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy.pass.cpp b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy.pass.cpp
index 92dc380728..1fca1e24f0 100644
--- a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy.pass.cpp
+++ b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy.pass.cpp
@@ -281,7 +281,7 @@ int main(int, char**) {
// Works with const iterators, (iter, sentinel) overload.
{
constexpr int N = 5;
- Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
+ Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
Buffer<Counted, N> out;
Counted::reset();
@@ -297,7 +297,7 @@ int main(int, char**) {
// Works with const iterators, (range) overload.
{
constexpr int N = 5;
- Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
+ Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
Buffer<Counted, N> out;
Counted::reset();
diff --git a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
index 80082eb3b9..a29a0074c0 100644
--- a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
+++ b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
@@ -107,7 +107,7 @@ int main(int, char**) {
// Works with const iterators.
{
constexpr int N = 5;
- Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
+ Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
Buffer<Counted, N> out;
Counted::reset();
diff --git a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move.pass.cpp b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move.pass.cpp
index 56dd25c66e..93e947a34d 100644
--- a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move.pass.cpp
+++ b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move.pass.cpp
@@ -285,7 +285,7 @@ int main(int, char**) {
// Works with const iterators, (iter, sentinel) overload.
{
constexpr int N = 5;
- Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
+ Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
Buffer<Counted, N> out;
Counted::reset();
@@ -301,11 +301,11 @@ int main(int, char**) {
// Works with const iterators, (range) overload.
{
constexpr int N = 5;
- Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
+ Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
Buffer<Counted, N> out;
Counted::reset();
- std::ranges::subrange out_range (out.cbegin(), out.cend());
+ std::ranges::subrange out_range(out.cbegin(), out.cend());
std::ranges::uninitialized_move(in, out_range);
assert(Counted::current_objects == N);
assert(Counted::total_objects == N);
diff --git a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
index 162b4a4853..f15a47d5d9 100644
--- a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
+++ b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
@@ -108,7 +108,7 @@ int main(int, char**) {
// Works with const iterators.
{
constexpr int N = 5;
- Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
+ Counted in[N] = {Counted(1), Counted(2), Counted(3), Counted(4), Counted(5)};
Buffer<Counted, N> out;
Counted::reset();
|
libcxx/include/module.modulemap
Outdated
} | ||
module std_private_memory_uses_allocator [system] { header "__memory/uses_allocator.h" } | ||
module std_private_memory_uses_allocator_construction [system] { header "__memory/uses_allocator_construction.h" } | ||
module std_private_memory_voidify [system] { header "__memory/voidify.h" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think only module voidify { header "__memory/voidify.h" }
should be added back after this line:
llvm-project/libcxx/include/module.modulemap
Line 1530 in eea5e7e
module uses_allocator_construction { header "__memory/uses_allocator_construction.h" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah thanks for the correction, fixed
This reverts commit 78f9a8b.
dc24075
to
628c67f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge conflict resolution LGTM. @Michael137 Please let us know once you've had time to look into this.
Yup will do, should be able to get to it today. Turned out hairier than expected |
This reverts commit 78f9a8b. This caused the LLDB test `TestDataFormatterGenericOptional.py` to fail, and we need a bit more time to look into it.
This reverts commit 78f9a8b. This caused the LLDB test `TestDataFormatterGenericOptional.py` to fail, and we need a bit more time to look into it.
…vm#110587)" This reverts commit f3d58f4.
…vm#110587)" This reverts commit f3d58f4.
This reverts commit 78f9a8b. This caused the LLDB test `TestDataFormatterGenericOptional.py` to fail, and we need a bit more time to look into it.
This reverts commit 78f9a8b. This caused the LLDB test `TestDataFormatterGenericOptional.py` to fail, and we need a bit more time to look into it.
This reverts commit 78f9a8b.
This caused the LLDB test
TestDataFormatterGenericOptional.py
to fail with:Will need a bit more time to look into a solution