+2016-10-21 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/Makefile.am: Add <bits/refwrap.h> and <bits/std_function.h>.
+ Order alphabetically.
+ * include/Makefile.in: Regenerate.
+ * include/bits/refwrap.h: New header.
+ (_Maybe_get_result_type,_Weak_result_type_impl, _Weak_result_type)
+ (_Reference_wrapper_base_impl, _Reference_wrapper_base)
+ (reference_wrapper, ref, cref): Move here from <functional>.
+ * include/bits/shared_ptr_base.h: Include <bits/refwrap.h> and
+ <bits/stl_function.h> instead of <functional>.
+ * include/bits/std_function.h: New header.
+ (_Maybe_unary_or_binary_function, bad_function_call)
+ (__is_location_invariant, _Nocopy_types, _Any_data)
+ (_Simple_type_wrapper, _Function_base, _Function_handler, function):
+ Move here from <functional>.
+ * include/bits/unique_ptr.h: Include <bits/stl_function.h>.
+ * include/std/functional: Include new headers and move components to
+ them.
+ * include/std/future: Include <bits/std_function.h> instead of
+ <functional>.
+ * include/std/mutex: Likewise.
+ * include/std/regex: Likewise.
+ * src/c++11/compatibility-thread-c++0x.cc: Include <functional>.
+ * testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error line.
+ * testsuite/20_util/default_delete/void_neg.cc: Likewise.
+ * testsuite/20_util/unique_ptr/assign/48635_neg.cc: Adjust dg-error
+ lines.
+ * testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: Likewise.
+ * testsuite/30_threads/packaged_task/49668.cc: Include <functional>.
+
+ * libsupc++/exception_ptr.h (make_exception_ptr): Qualify new.
+ * testsuite/18_support/exception_ptr/make_exception_ptr_2.cc: New
+ test.
+
+2016-10-20 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/backward/auto_ptr.h (__shared_ptr(auto_ptr&&))
+ (shared_ptr(auto_ptr&&)): Adjust template parameter lists.
+ * include/bits/shared_ptr.h (__sp_compatible_with)
+ (__sp_is_constructible): New helper traits for shared_ptr.
+ (shared_ptr::_Convertible): Replace with _Constructible.
+ (shared_ptr::_Constructible, shared_ptr::_Assignable): Forward checks
+ to base class.
+ (shared_ptr::shared_ptr, shared_ptr::operator=): Constrain template
+ with _Constructible and _Assignable.
+ (shared_ptr::shared_ptr(shared_ptr<_Tp1>, _Tp*)): Use element_type
+ instead of _Tp.
+ (operator<): Likewise.
+ (operator>): Define in terms of operator<.
+ (static_pointer_cast, const_pointer_cast, dynamic_pointer_cast): Use
+ element_type instead of _Tp.
+ (reinterpret_pointer_cast): Define for C++17.
+ (weak_ptr::_Convertible): Replace with _Constructible.
+ (weak_ptr::_Constructible, weak_ptr::_Assignable): Forward checks
+ to base class.
+ (weak_ptr::weak_ptr, weak_ptr::operator=): Constrain templates
+ with _Constructible and _Assignable.
+ * include/bits/shared_ptr_base.h (__shared_ptr::_Convertible): Replace
+ with _Compatible.
+ (__shared_ptr::_SafeConv): New constraint for incoming raw pointers.
+ (__shared_ptr::_Compatible): New constraint for converting from
+ other types of shared_ptr and weak_ptr.
+ (__shared_ptr::_Assignable): Define in terms of _Compatible.
+ (__shared_ptr::_UniqCompatible, __shared_ptr::_UniqAssignable): New
+ constraints for converting from unique_ptr.
+ (__shared_ptr::__shared_ptr, __shared_ptr::operator=): Constrain
+ template with _SaveConf, _Compatible and _Assignable. Remove
+ __glibcxx_function_requires concept checks. Add static assertion for
+ deleter expression being well-formed.
+ (__shared_ptr::__shared_ptr(__shared_ptr<_Tp1>, _Tp*))
+ (__shared_ptr::operator*, __shared_ptr::operator->)
+ (__shared_ptr::get, __shared_ptr::_M_ptr): Use element_type instead
+ of _Tp.
+ (operator<): Likewise.
+ (operator>): Define in terms of operator<.
+ (static_pointer_cast, const_pointer_cast, dynamic_pointer_cast): Use
+ element_type instead of _Tp.
+ (reinterpret_pointer_cast): Define for C++17.
+ (weak_ptr::_Convertible): Replace with _Compatible.
+ (weak_ptr::_Compatible, weak_ptr::_Assignable): New constraints for
+ conversions from other types of weak_ptr and shared_ptr.
+ (__weak_ptr::__weak_ptr, __weak_ptr::operator=): Constrain templates
+ with _Constructible and _Assignable.
+ (__weak_ptr::_M_ptr): Use element_type instead of _Tp.
+ * testsuite/20_util/shared_ptr/assign/auto_ptr_neg.cc: Adjust
+ dg-error pattern.
+ * testsuite/20_util/shared_ptr/cons/auto_ptr.cc: Test conversions.
+ * testsuite/20_util/shared_ptr/cons/unique_ptr.cc: Likewise.
+ * testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise.
+ * testsuite/20_util/shared_ptr/casts/reinterpret.cc: New test.
+
+2016-10-20 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ Do the operator= SFINAE in the return type for optional,
+ not in the template parameters.
+ * include/std/optional (operator=(_Up&&)): Move SFINAE
+ from template parameters to the return type.
+ (operator=(const optional<_Up>&)): Likewise.
+ (operator=(optional<_Up>&&)): Likewise.
+
+2016-10-20 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/allocator.h: Remove trailing whitespace, tab-indent.
+ * include/ext/new_allocator.h: Likewise.
+
+ PR libstdc++/78052
+ * include/bits/allocator.h (allocator<void>::construct)
+ (allocator<void>::destroy): Define.
+ * testsuite/20_util/allocator/void.cc: New test.
+
+ * testsuite/20_util/enable_shared_from_this/56383.cc: Add tests for
+ additional ambiguous cases.
+
+2016-10-19 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/backward/auto_ptr.h (__shared_ptr(auto_ptr&&)): Call
+ _M_enable_shared_from_this_with instead of
+ __enable_shared_from_this_helper.
+ * include/bits/shared_ptr.h (__enable_shared_from_this_helper):
+ Remove overload for std::enable_shared_from_this..
+ (__enable_shared_from_this_base): Define friend function to select a
+ std::enable_shared_from_this base class.
+ * include/bits/shared_ptr_base.h (__enable_shared_from_this_helper):
+ Remove all overloads.
+ (__shared_ptr): Change all relevant constructors to call
+ _M_enable_shared_from_this_with instead of
+ __enable_shared_from_this_helper.
+ (__shared_ptr::__efst_base_t, __shared_ptr::__has_efst_base): Helpers
+ to detect accessible and unambiguous enable_shared_from_this bases.
+ (__shared_ptr::_M_enable_shared_from_this_with): New function to
+ replace __enable_shared_from_this_helper overloads.
+ (__enable_shared_from_this_helper): Remove overload for
+ std::__enable_shared_from_this.
+ (__enable_shared_from_this_base): Define friend function to select a
+ std::__enable_shared_from_this base class.
+ * include/experimental/bits/shared_ptr.h (experimental::shared_ptr):
+ Change relevant constructors to call _M_enable_shared_from_this_with.
+ (experimental::shared_ptr::__efst_base_t)
+ (experimental::shared_ptr::__has_efst_base): Helpers to detect
+ accessible and unambiguous enable_shared_from_this bases.
+ (experimental::shared_ptr::_M_enable_shared_from_this_with): Define.
+ (experimental::__enable_shared_from_this_helper): Remove overload for
+ std::experimental::enable_shared_from_this.
+ (experimental::__expt_enable_shared_from_this_base): Define friend
+ function to select a std::experimental::enable_shared_from_this base.
+ * testsuite/experimental/memory/shared_ptr/cons/
+ enable_shared_from_this.cc: New test.
+ * testsuite/experimental/memory/shared_ptr/cons/unique_ptr_ctor.cc:
+ Adjust expected behaviour for shared_ptr<A[]>.
+
+ * include/debug/vector (__gnu_debug::vector::emplace_back): Fix return
+ type.
+
+ * include/backward/auto_ptr.h (dauto_ptr): Correct comment about
+ conversions from auto_ptr<Derived> rvalues to auto_ptr<Base>.
+ * testsuite/20_util/auto_ptr/assign_neg.cc: Remove redundant dg-error
+ directives that only match notes, not errors.
+
+ * testsuite/experimental/memory/shared_ptr/cons/unique_ptr_ctor.cc:
+ Add tests for valid and invalid conversions.
+ * testsuite/experimental/memory/shared_ptr/cons/weak_ptr_ctor.cc:
+ Likewise.
+
+ * testsuite/20_util/unique_ptr/cons/cv_qual.cc: Move negative tests
+ to new file.
+ * testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: New file. Fix
+ test for incompatible deleters to not also use incompatible types.
+ Add tests for incompatible array types.
+
+ * include/experimental/bits/shared_ptr.h
+ (__shared_ptr<__libfund_v1<_Tp, false>, _Lp>::_Compatible): Just use
+ is_convertible for non-array specialization.
+ (__shared_ptr<__libfund_v1<_Tp, false>, _Lp>::_UniqCompatible): New
+ constraint for conversions from unique_ptr.
+ (__shared_ptr<__libfund_v1<_Tp, false>, _Lp>::__shared_ptr): Constrain.
+ (__shared_ptr<__libfund_v1<_Tp, false>, _Lp>::reset): Likewise.
+ (__sp_compatible_v): New variable template for trait.
+ (__sp_is_constructible): New trait to check shared_ptr constraints.
+ (__sp_is_constructible_v): New variable template for trait.
+ (__shared_ptr<__libfund_v1<_Tp, true>, _Lp>::_SafeConv): New
+ constraint for construction/reset, using __sp_is_constructible_v.
+ (__shared_ptr<__libfund_v1<_Tp, true>, _Lp>::_UniqCompatible): New
+ constraint for conversions from unique_ptr.
+ (__shared_ptr<__libfund_v1<_Tp, true>, _Lp>::__shared_ptr): Constrain.
+ (__shared_ptr<__libfund_v1<_Tp, true>, _Lp>::reset): Likewise.
+ (shared_ptr::_SafeConv): Constraint for checking constructors.
+ (shared_ptr(Tp1*), shared_ptr(_Tp1, _Deleter))
+ (shared_ptr(_Tp1, _Deleter, _Alloc)): Constrain with _SafeConv.
+ (shared_ptr(const weak_ptr<_Tp1>&)): Constrain with _Compatible.
+ (shared_ptr(auto_ptr<_Tp1>&&)): Fix, remove TODO.
+ * testsuite/experimental/memory/shared_ptr/cons/pointer_ctor.cc:
+ Remove tests using invalid conversions.
+ * testsuite/experimental/memory/shared_ptr/cons/pointer_ctor_neg.cc:
+ New test.
+ * testsuite/experimental/memory/shared_ptr/cons/torture.cc: New test.
+ * testsuite/experimental/memory/shared_ptr/modifiers/reset.cc: Remove
+ tests using invalid conversions.
+ * testsuite/experimental/memory/shared_ptr/modifiers/reset_neg.cc: New
+ test.
+ * testsuite/experimental/memory/shared_ptr/observers/use_count.cc:
+ Remove tests using invalid conversions.
+
+ PR libstdc++/77990
+ * include/bits/unique_ptr.h (__uniq_ptr_impl): New type to
+ encapsulate implementation details.
+ (unique_ptr::unique_ptr(_Up)): Don't copy deleter object.
+ (unique_ptr::get, unique_ptr::get_deleter, unique_ptr::release):
+ Call member functions of implementation object.
+ (unique_ptr<T[], D>): Likewise.
+ * python/libstdcxx/v6/printers.py (UniquePointerPrinter): Adjust for
+ new implementation.
+ * python/libstdcxx/v6/xmethods.py (UniquePtrGetWorker): Likewise.
+ * testsuite/20_util/unique_ptr/assign/48635_neg.cc: Adjust dg-error
+ lines.
+ * testsuite/20_util/unique_ptr/assign/cv_qual.cc: Likewise.
+ * testsuite/20_util/unique_ptr/cons/cv_qual.cc: Likewise.
+ * testsuite/20_util/unique_ptr/cons/77990.cc: New test.
+
+2016-10-18 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/experimental/bits/shared_ptr.h: Fix indentation.
+
+ * include/experimental/bits/shared_ptr.h (shared_ptr(shared_ptr&&)):
+ Remove const from parameter.
+ (operator<(const shared_ptr<T>&, nullptr_t)): Use correct
+ specialization of std::less.
+ * testsuite/experimental/memory/shared_ptr/comparison/comparison.cc:
+ Test comparison with nullptr and actually call test functions.
+
+ * include/bits/uses_allocator.h (__is_uses_allocator_constructible_v)
+ (__is_nothrow_uses_allocator_constructible_v): Only define for C++14
+ and later.
+
2016-10-17 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/27_io/basic_filebuf/close/12790-1.cc: Remove 'test'
- variables.
+ variables.
* testsuite/27_io/basic_filebuf/close/char/1.cc: Likewise.
* testsuite/27_io/basic_filebuf/close/char/12790-1.cc: Likewise.
* testsuite/27_io/basic_filebuf/close/char/12790-2.cc: Likewise.
* include/std/future: Include <functional>.
* include/std/memory: Do not include <functional>.
* include/std/mutex: [_GLIBCXX_HAVE_TLS]: Likewise.
+ * src/c++11/compatibility-thread-c++0x.cc: Include <functional>.
* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc: Add
missing includes.
* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise.