From d42db7e083ee0edda327782aa122ad6474c126d1 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 27 Nov 2017 19:43:28 +0000 Subject: [PATCH] Implement LWG#2921 and LWG#2976 - removing allocator support from packaged_task. llvm-svn: 319080 --- libcxx/include/future | 34 ------------------- .../futures.task.members/ctor2.fail.cpp | 34 ------------------- .../ctor_func_alloc.pass.cpp | 3 -- libcxx/www/cxx1z_status.html | 2 +- libcxx/www/cxx2a_status.html | 2 +- 5 files changed, 2 insertions(+), 73 deletions(-) delete mode 100644 libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor2.fail.cpp diff --git a/libcxx/include/future b/libcxx/include/future index a7c28a4746cf..1bc47996e9d4 100644 --- a/libcxx/include/future +++ b/libcxx/include/future @@ -328,8 +328,6 @@ public: packaged_task() noexcept; template explicit packaged_task(F&& f); - template - packaged_task(allocator_arg_t, const Allocator& a, F&& f); ~packaged_task(); // no copy @@ -356,8 +354,6 @@ public: template void swap(packaged_task&) noexcept; -template struct uses_allocator, Alloc>; - } // std */ @@ -2028,19 +2024,6 @@ public: > _LIBCPP_INLINE_VISIBILITY explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {} - template ::type, - packaged_task - >::value - >::type - > - _LIBCPP_INLINE_VISIBILITY - packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f) - : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)), - __p_(allocator_arg, __a) {} // ~packaged_task() = default; // no copy @@ -2157,19 +2140,6 @@ public: > _LIBCPP_INLINE_VISIBILITY explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {} - template ::type, - packaged_task - >::value - >::type - > - _LIBCPP_INLINE_VISIBILITY - packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f) - : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)), - __p_(allocator_arg, __a) {} // ~packaged_task() = default; // no copy @@ -2271,10 +2241,6 @@ swap(packaged_task<_Callable>& __x, packaged_task<_Callable>& __y) _NOEXCEPT __x.swap(__y); } -template -struct _LIBCPP_TEMPLATE_VIS uses_allocator, _Alloc> - : public true_type {}; - template future<_Rp> #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES diff --git a/libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor2.fail.cpp b/libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor2.fail.cpp deleted file mode 100644 index 212a12084e79..000000000000 --- a/libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor2.fail.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: libcpp-has-no-threads -// UNSUPPORTED: c++98, c++03 - -// - -// class packaged_task -// template -// packaged_task(allocator_arg_t, const Allocator& a, F&& f); -// These constructors shall not participate in overload resolution if -// decay::type is the same type as std::packaged_task. - -#include -#include - -#include "test_allocator.h" - -struct A {}; -typedef std::packaged_task PT; -typedef volatile std::packaged_task VPT; - -int main() -{ - PT p { std::allocator_arg_t{}, test_allocator{}, VPT {}}; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task')}} - // expected-note-re@future:* 1 {{candidate template ignored: {{(disabled by 'enable_if')|(requirement '.*' was not satisfied)}}}} -} diff --git a/libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp b/libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp index 14b29715ef4f..1feda977cd4f 100644 --- a/libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp @@ -16,9 +16,6 @@ // class packaged_task -// template -// explicit packaged_task(allocator_arg_t, const Allocator& a, F&& f); - #include #include diff --git a/libcxx/www/cxx1z_status.html b/libcxx/www/cxx1z_status.html index 664856992929..26a1bc988ed3 100644 --- a/libcxx/www/cxx1z_status.html +++ b/libcxx/www/cxx1z_status.html @@ -487,7 +487,7 @@ 2905is_constructible_v<unique_ptr<P, D>, P, D const &> should be false when D is not copy constructibleKonaComplete 2908The less-than operator for shared pointers could do moreKona 2911An is_aggregate type trait is neededKonaComplete - 2921packaged_task and type-erased allocatorsKona + 2921packaged_task and type-erased allocatorsKonaComplete 2934optional<const T> doesn't compare with TKonaComplete 2901Variants cannot properly support allocatorsTorontoComplete diff --git a/libcxx/www/cxx2a_status.html b/libcxx/www/cxx2a_status.html index d7b584c196e5..92ed9a5d9ce2 100644 --- a/libcxx/www/cxx2a_status.html +++ b/libcxx/www/cxx2a_status.html @@ -114,7 +114,7 @@ 2964Apparently redundant requirement for dynamic_pointer_castAlbuquerque 2965Non-existing path::native_string() in filesystem_error::what() specificationAlbuquerque 2972What is is_trivially_destructible_v?AlbuquerqueComplete - 2976Dangling uses_allocator specialization for packaged_taskAlbuquerque + 2976Dangling uses_allocator specialization for packaged_taskAlbuquerqueComplete 2977unordered_meow::merge() has incorrect Throws: clauseAlbuquerque 2978Hash support for pmr::string and friendsAlbuquerque 2979aligned_union should require complete object typesAlbuquerqueComplete