Skip to content

Commit

Permalink
Revert "[libc++] Implement P0591R4 (Utility functions to implement us…
Browse files Browse the repository at this point in the history
…es-allocator construction)"

Breaks ubsan tests https://lab.llvm.org/buildbot/#/builders/85/builds/11131

This reverts commit 099384d.
  • Loading branch information
vitalybuka committed Oct 3, 2022
1 parent 2dc68b5 commit 71410fd
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 947 deletions.
1 change: 0 additions & 1 deletion libcxx/docs/ReleaseNotes.rst
Expand Up @@ -41,7 +41,6 @@ Implemented Papers
- P2417R2 - A more constexpr bitset
- P2445R1 - ``std::forward_like``
- P2273R3 - Making ``std::unique_ptr`` constexpr
- P0591R4 - Utility functions to implement uses-allocator construction

Improvements and New Features
-----------------------------
Expand Down
1 change: 0 additions & 1 deletion libcxx/docs/Status/Cxx20.rst
Expand Up @@ -40,7 +40,6 @@ Paper Status

.. note::

.. [#note-P0591] P0591: The changes in [mem.poly.allocator.mem] are missing.
.. [#note-P0600] P0600: The missing bits in P0600 are in |sect|\ [mem.res.class] and |sect|\ [mem.poly.allocator.class].
.. [#note-P0645] P0645: The paper is implemented but still marked as an incomplete feature
(the feature-test macro is not set and the libary is only available when built with ``-fexperimental-library``).
Expand Down
4 changes: 2 additions & 2 deletions libcxx/docs/Status/Cxx20Issues.csv
Expand Up @@ -149,7 +149,7 @@
"`3169 <https://wg21.link/LWG3169>`__","``ranges``\ permutation generators discard useful information","Cologne","|Complete|","15.0","|ranges|"
"`3183 <https://wg21.link/LWG3183>`__","Normative permission to specialize Ranges variable templates","Cologne","|Nothing To Do|","","|ranges|"
"`3184 <https://wg21.link/LWG3184>`__","Inconsistencies in ``bind_front``\ wording","Cologne","|Complete|","13.0"
"`3185 <https://wg21.link/LWG3185>`__","Uses-allocator construction functions missing ``constexpr``\ and ``noexcept``\ ","Cologne","|Complete|","16.0"
"`3185 <https://wg21.link/LWG3185>`__","Uses-allocator construction functions missing ``constexpr``\ and ``noexcept``\ ","Cologne","",""
"`3186 <https://wg21.link/LWG3186>`__","``ranges``\ removal, partition, and ``partial_sort_copy``\ algorithms discard useful information","Cologne","|Complete|","15.0","|ranges|"
"`3187 <https://wg21.link/LWG3187>`__","`P0591R4 <https://wg21.link/p0591r4>`__ reverted DR 2586 fixes to ``scoped_allocator_adaptor::construct()``\ ","Cologne","",""
"`3191 <https://wg21.link/LWG3191>`__","``std::ranges::shuffle``\ synopsis does not match algorithm definition","Cologne","|Complete|","15.0","|ranges|"
Expand Down Expand Up @@ -243,7 +243,7 @@
"`3318 <https://wg21.link/LWG3318>`__","Clarify whether clocks can represent time before their epoch","Prague","","","|chrono|"
"`3319 <https://wg21.link/LWG3319>`__","Properly reference specification of IANA time zone database","Prague","","","|chrono|"
"`3320 <https://wg21.link/LWG3320>`__","``span::cbegin/cend``\ methods produce different results than ``std::[ranges::]cbegin/cend``\ ","Prague","|Complete|",""
"`3321 <https://wg21.link/LWG3321>`__","``uninitialized_construct_using_allocator``\ should use ``construct_at``\ ","Prague","|Complete|","16.0"
"`3321 <https://wg21.link/LWG3321>`__","``uninitialized_construct_using_allocator``\ should use ``construct_at``\ ","Prague","",""
"`3323 <https://wg21.link/LWG3323>`__","``*has-tuple-element*``\ helper concept needs ``convertible_to``\ ","Prague","","","|ranges|"
"`3324 <https://wg21.link/LWG3324>`__","Special-case ``std::strong/weak/partial_order``\ for pointers","Prague","|Complete|","14.0","|spaceship|"
"`3325 <https://wg21.link/LWG3325>`__","Constrain return type of transformation function for ``transform_view``\ ","Prague","|Complete|","15.0","|ranges|"
Expand Down
4 changes: 2 additions & 2 deletions libcxx/docs/Status/Cxx20Papers.csv
Expand Up @@ -55,8 +55,8 @@
"`P0357R3 <https://wg21.link/P0357R3>`__","LWG","reference_wrapper for incomplete types","San Diego","|Complete|","8.0"
"`P0482R6 <https://wg21.link/P0482R6>`__","CWG","char8_t: A type for UTF-8 characters and strings","San Diego","|Partial| [#note-P0482]_","16.0"
"`P0487R1 <https://wg21.link/P0487R1>`__","LWG","Fixing ``operator>>(basic_istream&, CharT*)``\ (LWG 2499)","San Diego","|Complete|","8.0"
"`P0591R4 <https://wg21.link/P0591R4>`__","LWG","Utility functions to implement uses-allocator construction","San Diego","|Partial| [#note-P0591]_",""
"`P0595R2 <https://wg21.link/P0595R2>`__","CWG","std::is_constant_evaluated()","San Diego","|Complete|","9.0"
"`P0591R4 <https://wg21.link/P0591R4>`__","LWG","Utility functions to implement uses-allocator construction","San Diego","* *",""
"`P0595R2 <https://wg21.link/P0595R2>`__","CWG","P0595R2 std::is_constant_evaluated()","San Diego","|Complete|","9.0"
"`P0602R4 <https://wg21.link/P0602R4>`__","LWG","variant and optional should propagate copy/move triviality","San Diego","|Complete|","8.0"
"`P0608R3 <https://wg21.link/P0608R3>`__","LWG","A sane variant converting constructor","San Diego","|Complete|","9.0"
"`P0655R1 <https://wg21.link/P0655R1>`__","LWG","visit<R>: Explicit Return Type for visit","San Diego","|Complete|","12.0"
Expand Down
2 changes: 1 addition & 1 deletion libcxx/docs/Status/ZipProjects.csv
Expand Up @@ -4,7 +4,7 @@ Section,Description,Dependencies,Assignee,Complete
| `[utility.syn] <https://wg21.link/utility.syn>`_, "[pair] basic_common_reference, common_type", None, Nikolas Klauser, |Complete|
| `[pairs.pair] <https://wg21.link/pairs.pair>`_, "`[pair] constructor, assignment and swap overloads <https://reviews.llvm.org/D131495>`_", None, Hui Xie, |Complete|
"| `[memory.syn] <https://wg21.link/memory.syn>`_
| `[allocator.uses.construction] <https://wg21.link/allocator.uses.construction>`_", "[pair] uses_allocator_construction_args overloads", None, Nikolas Klauser, |Complete|
| `[allocator.uses.construction] <https://wg21.link/allocator.uses.construction>`_", "[pair] uses_allocator_construction_args overloads", None, Unassigned, |Not Started|
| `[vector.bool] <https://wg21.link/vector.bool>`_, "[vector<bool>::reference] add const operator= overload", None, Hui Xie, |Not Started|
| `[iterator.concept.winc] <https://wg21.link/iterator.concept.winc>`_, "Update weakly_comparable", None, Hui Xie, |Not Started|
| `[range.zip] <https://wg21.link/ranges.syn>`_, "`zip_view <https://reviews.llvm.org/D122806>`_", "| `zip_view::iterator`
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/CMakeLists.txt
Expand Up @@ -412,7 +412,6 @@ set(files
__memory/uninitialized_algorithms.h
__memory/unique_ptr.h
__memory/uses_allocator.h
__memory/uses_allocator_construction.h
__memory/voidify.h
__mutex_base
__node_handle
Expand Down
219 changes: 0 additions & 219 deletions libcxx/include/__memory/uses_allocator_construction.h

This file was deleted.

1 change: 0 additions & 1 deletion libcxx/include/memory
Expand Up @@ -883,7 +883,6 @@ template<size_t N, class T>
#include <__memory/uninitialized_algorithms.h>
#include <__memory/unique_ptr.h>
#include <__memory/uses_allocator.h>
#include <__memory/uses_allocator_construction.h>
#include <version>

// standard-mandated includes
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/module.modulemap.in
Expand Up @@ -878,7 +878,6 @@ module std [system] {
module uninitialized_algorithms { private header "__memory/uninitialized_algorithms.h" }
module unique_ptr { private header "__memory/unique_ptr.h" }
module uses_allocator { private header "__memory/uses_allocator.h" }
module uses_allocator_construction { private header "__memory/uses_allocator_construction.h" }
module voidify { private header "__memory/voidify.h" }
}
}
Expand Down
14 changes: 0 additions & 14 deletions libcxx/include/scoped_allocator
Expand Up @@ -112,7 +112,6 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__memory/allocator_traits.h>
#include <__memory/uses_allocator_construction.h>
#include <__type_traits/common_type.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/integral_constant.h>
Expand Down Expand Up @@ -524,18 +523,6 @@ public:
size_type max_size() const
{return allocator_traits<outer_allocator_type>::max_size(outer_allocator());}

#if _LIBCPP_STD_VER >= 20
template <class _Type, class... _Args>
_LIBCPP_HIDE_FROM_ABI void construct(_Type* __ptr, _Args&&... __args) {
using _OM = __outermost<outer_allocator_type>;
std::apply(
[__ptr, this](auto&&... __newargs) {
allocator_traits<typename _OM::type>::construct(
_OM()(outer_allocator()), __ptr, std::forward<decltype(__newargs)>(__newargs)...);
},
std::uses_allocator_construction_args<_Type>(inner_allocator(), std::forward<_Args>(__args)...));
}
#else
template <class _Tp, class... _Args>
_LIBCPP_INLINE_VISIBILITY
void construct(_Tp* __p, _Args&& ...__args)
Expand Down Expand Up @@ -590,7 +577,6 @@ public:
_VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x.first)),
_VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__x.second)));
}
#endif

template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
Expand Down
1 change: 0 additions & 1 deletion libcxx/test/libcxx/private_headers.verify.cpp
Expand Up @@ -443,7 +443,6 @@ END-SCRIPT
#include <__memory/uninitialized_algorithms.h> // expected-error@*:* {{use of private header from outside its module: '__memory/uninitialized_algorithms.h'}}
#include <__memory/unique_ptr.h> // expected-error@*:* {{use of private header from outside its module: '__memory/unique_ptr.h'}}
#include <__memory/uses_allocator.h> // expected-error@*:* {{use of private header from outside its module: '__memory/uses_allocator.h'}}
#include <__memory/uses_allocator_construction.h> // expected-error@*:* {{use of private header from outside its module: '__memory/uses_allocator_construction.h'}}
#include <__memory/voidify.h> // expected-error@*:* {{use of private header from outside its module: '__memory/voidify.h'}}
#include <__mutex_base> // expected-error@*:* {{use of private header from outside its module: '__mutex_base'}}
#include <__node_handle> // expected-error@*:* {{use of private header from outside its module: '__node_handle'}}
Expand Down
Expand Up @@ -115,10 +115,10 @@ struct G
{
static bool constructed;

typedef std::scoped_allocator_adaptor<std::allocator<G>> allocator_type;
typedef std::allocator<G> allocator_type;

G(std::allocator_arg_t, allocator_type&&) { assert(false); }
G(const allocator_type&) { constructed = true; }
G(allocator_type&) { constructed = true; }
};

bool G::constructed = false;
Expand Down Expand Up @@ -202,7 +202,7 @@ int main(int, char**)
// Test that is_constructible uses an lvalue ref so the correct constructor
// is picked.
{
G::allocator_type sa;
std::scoped_allocator_adaptor<G::allocator_type> sa;
G* ptr = sa.allocate(1);
sa.construct(ptr);
assert(G::constructed);
Expand Down

0 comments on commit 71410fd

Please sign in to comment.