aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
AgeCommit message (Collapse)AuthorFilesLines
2016-10-10Minor simplification to std::_Bind_result helpersJonathan Wakely2-26/+28
* include/std/functional (_Bind_result::__enable_if_void): Use alias template instead of class template. (_Bind_result::__disable_if_void): Likewise. (_Bind_result::__call): Adjust uses of __enable_if_void and __disable_if_void. From-SVN: r240940
2016-10-10Implement constexpr std::addressof for C++17Jonathan Wakely7-10/+82
* doc/xml/manual/intro.xml: Document DR 2296 status. * doc/xml/manual/status_cxx2017.xml: Update status. * include/bits/move.h (__addressof): Add _GLIBCXX_CONSTEXPR and call __builtin_addressof. (addressof): Add _GLIBCXX17_CONSTEXPR. * testsuite/20_util/addressof/requirements/constexpr.cc: New test. * testsuite/20_util/forward/c_neg.cc: Adjust dg-error lineno. * testsuite/20_util/forward/f_neg.cc: Likewise. From-SVN: r240929
2016-10-10Define std::allocator<T>::is_always_equalJonathan Wakely4-1/+15
* include/bits/allocator.h (allocator<T>::is_always_equal): Define. * testsuite/20_util/allocator/requirements/typedefs.cc: Test for is_always_equal. * testsuite/util/testsuite_allocator.h (uneq_allocator::is_always_equal): Define as false_type. From-SVN: r240920
2016-10-10LWG 2733, LWG 2759 reject bool in gcd and lcmJonathan Wakely5-8/+102
* include/experimental/numeric (gcd, lcm): Make bool arguments ill-formed. * include/std/numeric (gcd, lcm): Likewise. * testsuite/26_numerics/gcd/gcd_neg.cc: New test. * testsuite/26_numerics/lcm/lcm_neg.cc: New test. From-SVN: r240919
2016-10-10Add noexcept to enable_shared_from_this::weak_from_thisJonathan Wakely4-4/+16
* include/bits/shared_ptr.h (enable_shared_from_this::weak_from_this): Add noexcept. * include/bits/shared_ptr_base.h (__enable_shared_from_this::weak_from_this): Likewise. * testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc: Test exception-specification of weak_from_this. From-SVN: r240917
2016-10-08Further P0135 refinement.Jason Merrill1-2/+2
* call.c (build_user_type_conversion_1): Consider conversions from a single element in an initializer-list. (build_temp): Undo early_elide_copy change. (build_over_call): Check that we don't try to copy a TARGET_EXPR in C++17 mode. Set user_conv_p here. (convert_like_real): Not here. (check_self_delegation): Split out from... (build_special_member_call): ...here. Handle C++17 copy elision. * cvt.c (early_elide_copy): Remove. (ocp_convert): Undo early_elide_copy change. * except.c (build_throw): Likewise. * init.c (expand_default_init): Likewise. * typeck.c (cp_build_modify_expr): Likewise. From-SVN: r240889
2016-10-07Improve implementation-defined docs for libstdc++Jonathan Wakely4-13/+198
* doc/xml/manual/status_cxx1998.xml: Improve documentation of implementation-defined properties. * doc/xml/manual/status_cxx2011.xml: Likewise. * doc/xml/manual/status_cxx2017.xml: Likewise. From-SVN: r240869
2016-10-07Implement std::has_unique_object_representationsJonathan Wakely6-2/+192
* doc/xml/manual/status_cxx2017.xml: Update status. * include/std/type_traits (has_unique_object_representations): Define. * testsuite/20_util/has_unique_object_representations/value.cc: New. * testsuite/20_util/has_unique_object_representations/requirements/ explicit_instantiation.cc: New. * testsuite/20_util/has_unique_object_representations/requirements/ typedefs.cc: New. From-SVN: r240868
2016-10-06Make std::scoped_allocator_adaptor's OUTERMOST recursiveJonathan Wakely5-21/+208
* doc/xml/manual/status_cxx2011.xml: Update status. * include/std/scoped_allocator (__outer_allocator_t, __outermost_type): New helpers for recursive OUTERMOST. (__outermost): Use __outermost_type::_S_outermost. (__do_outermost, scoped_allocator_adaptor::__outermost_type): Remove. (scoped_allocator_adaptor::__outermost_alloc_traits): Use new __outermost_type helper. * testsuite/20_util/scoped_allocator/outermost.cc: New test. From-SVN: r240844
2016-10-0570564 fix newly-added tests for not_fnJonathan Wakely3-2/+8
PR libstdc++/70564 * testsuite/20_util/not_fn/1.cc: Fix test. * testsuite/experimental/functional/not_fn.cc: Likewise. From-SVN: r240784
2016-10-05PR 70101 fix allocator-extended ctors for std::priority_queueJonathan Wakely3-6/+73
PR libstdc++/70101 * include/bits/stl_queue.h (priority_queue): Fix allocator-extended constructors. * testsuite/23_containers/priority_queue/allocator.cc: New test. From-SVN: r240781
2016-10-0577864 Fix noexcept conditions for map/set default constructorsJonathan Wakely9-12/+155
PR libstdc++/77864 * include/bits/stl_map.h (map::map()): Use nothrow constructibility of comparison function in conditional noexcept. * include/bits/stl_multimap.h (multimap::multimap()): Likewise. * include/bits/stl_multiset.h (multiset::multiset()): Likewise. * include/bits/stl_set.h (set::set()): Likewise. * testsuite/23_containers/map/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/multimap/cons/noexcept_default_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/noexcept_default_construct.cc: Likewise. * testsuite/23_containers/set/cons/noexcept_default_construct.cc: Likewise. From-SVN: r240780
2016-10-05Remove invalid alias declaration from _Node_handleJonathan Wakely2-4/+5
* include/bits/node_handle.h (_Node_handle): Remove invalid and unused alias declaration. From-SVN: r240779
2016-10-05PR 70564 disambiguate constructors for not_fn call wrapperJonathan Wakely5-66/+40
PR libstdc++/70564 * include/experimental/functional (_Not_fn): Remove. (not_fn): Use std::_Not_fn. * include/std/functional (_Not_fn): Add second parameter to disambiguate copying from initialization by not_fn. Define for C++14. (not_fn): Add second argument to initialization. * testsuite/20_util/not_fn/1.cc: Copy call wrapper using direct-initialization. From-SVN: r240778
2016-10-03shared_ptr.cc (mask, [...]): Move declaration...François Dumont4-29/+72
2016-10-03 François Dumont <fdumont@gcc.gnu.org> * src/c++11/shared_ptr.cc (mask, invalid, get_mutex): Move declaration... * src/c++11/mutex_pool.h: ... here. New. * src/c++11/debug.cc: Use latter. From-SVN: r240732
2016-10-03Define std::gcd and std::lcm for C++17Jonathan Wakely9-47/+202
* doc/xml/manual/status_cxx2017.xml: Update gcd/lcm status. * doc/html/*: Regenerate. * include/experimental/numeric (__abs): Move to <numeric>. (gcd, lcm): Use __detail::gcd and __detail::lcm. * include/std/numeric (__detail::__abs_integral) (__detail::__gcd, __detail::__lcm): Define. (gcd, lcm): Define for C++17. * testsuite/26_numerics/gcd/1.cc: New test. * testsuite/26_numerics/lcm/1.cc: New test. * testsuite/experimental/numeric/gcd.cc: Swap contents with ... * testsuite/experimental/numeric/lcd.cc: ... this. From-SVN: r240723
2016-10-03Fix libstdc++ versioned namespace buildJonathan Wakely40-49/+283
PR libstdc++/68323 PR libstdc++/77794 * config/abi/pre/gnu-versioned-namespace.ver: Add exports for __cxa_thread_atexit and __gnu_cxx::__freeres. * include/Makefile.am: Add <experimental/bits/lfts_config.h> * include/Makefile.in: Regenerate. * include.bits/basic_string.h: Fix nesting of versioned namespaces. * include/bits/c++config: Declare versioned namespaces for literals. * include/bits/regex.h (basic_regex, match_results): Add workarounds for PR c++/59256. * include/bits/uniform_int_dist.h: Fix nesting of versioned namespace. * include/std/chrono: Likewise. * include/std/complex: Likewise. * include/std/string_view: Likewise. * include/std/variant: Likewise. Add workaround for PR c++/59256. * include/experimental/bits/fs_fwd.h: Declare versioned namespace. * include/experimental/bits/lfts_config.h: Declare versioned namespaces. * include/experimental/algorithm: Include <experimental/bits/lfts_config.h>. * include/experimental/any: Likewise. * include/experimental/bits/erase_if.h: Likewise. * include/experimental/chrono: Likewise. * include/experimental/functional: Likewise. * include/experimental/memory_resource: Likewise. * include/experimental/optional: Likewise. * include/experimental/propagate_const: Likewise. * include/experimental/random: Likewise. * include/experimental/ratio: Likewise. * include/experimental/system_error: Likewise. * include/experimental/tuple: Likewise. * include/experimental/type_traits: Likewise. * include/experimental/utility: Likewise. * include/experimental/string_view: Likewise. Fix nesting of versioned namespaces. * include/experimental/bits/string_view.tcc: Reopen inline namespace for non-inline function definitions. * testsuite/17_intro/using_namespace_std_exp_neg.cc: New test. * testsuite/20_util/duration/literals/range.cc: Adjust dg-error line. * testsuite/experimental/any/misc/any_cast_neg.cc: Likewise. * testsuite/experimental/propagate_const/assignment/move_neg.cc: Likewise. * testsuite/experimental/propagate_const/cons/move_neg.cc: Likewise. * testsuite/experimental/propagate_const/requirements2.cc: Likewise. * testsuite/experimental/propagate_const/requirements3.cc: Likewise. * testsuite/experimental/propagate_const/requirements4.cc: Likewise. * testsuite/experimental/propagate_const/requirements5.cc: Likewise. * testsuite/ext/profile/mutex_extensions_neg.cc: Likewise. From-SVN: r240714
2016-10-03Ensure "C++" language linkage for std::abs overloadsJonathan Wakely3-3/+20
PR libstdc++/77814 * include/bits/std_abs.h: Use "C++" language linkage. * testsuite/17_intro/headers/c++2011/linkage.cc: Move <complex.h> to the end. Add <stdalign.h>. From-SVN: r240710
2016-10-03re PR libstdc++/77802 (Boost Fiber doesn't compile)Ville Voutilainen5-324/+97
PR libstdc++/77802 * testsuite/20_util/tuple/77802.cc: New. Revert: 2016-09-21 Ville Voutilainen <ville.voutilainen@gmail.com> Implement LWG 2729 for tuple. * include/std/tuple (_Tuple_impl(_Tuple_impl&&)): Suppress conditionally. (_Tuple_impl(_Tuple_impl<_Idx, _UHead, _UTails...>&&)): Likewise. (__is_tuple_impl_trait_impl, __is_tuple_impl_trait): New. (_Tuple_impl(const _Head&)): Constrain. (_Tuple_impl(_UHead&&)): Likewise. (_Tuple_impl(_Tuple_impl&&)): Suppress conditionally. (_Tuple_impl(const _Tuple_impl<_Idx, _UHead>&)): Constrain. (_Tuple_impl(_Tuple_impl<_Idx, _UHead>&&)): Likewise. (operator=(const tuple&)): Enable conditionally. (operator=(tuple&&)): Suppress conditionally. (operator=(const tuple<_UElements...>&)): Constrain. (operator=(tuple<_UElements...>&&)): Likewise. (operator=(const tuple&)): Enable conditionally (2-param tuple). (operator=(tuple&&)): Suppress conditionally (2-param tuple). (operator=(const tuple<_U1, _U2>&)): Constrain. (operator=(tuple<_U1, _U2>&&)): Likewise. (operator=(const pair<_U1, _U2>&)): Likewise. (operator=(pair<_U1, _U2>&&)): Likewise. * testsuite/20_util/tuple/element_access/get_neg.cc: Adjust. * testsuite/20_util/tuple/tuple_traits.cc: New. From-SVN: r240709
2016-09-30libstdc++/77795 Only declare ::gets for C++98 and C++11Jonathan Wakely7-4/+49
PR libstdc++/77795 * acinclude.m4 (GLIBCXX_CHECK_STDIO_PROTO): Use -std=gnu++11 to check for gets. * config.h.in: Regenerate. * configure: Regenerate. * include/c_global/cstdio [!_GLIBCXX_HAVE_GETS] (gets): Only declare for C++98 and C++11. * include/c_std/cstdio [!_GLIBCXX_HAVE_GETS] (gets): Likewise. * testsuite/27_io/headers/cstdio/functions_neg.cc: New test. From-SVN: r240672
2016-09-30Implement LWG 2192 and LWG 2294 for std::absJonathan Wakely12-51/+269
* doc/xml/manual/intro.xml: Document LWG 2192 changes. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/std_abs.h. * include/Makefile.in: Regenerate. * include/bits/std_abs.h: New header defining all required overloads of std::abs in one place (LWG 2294). * include/c_global/cmath (abs(double), abs(float), abs(long double)): Move to bits/std_abs.h. (abs<_Tp>(_Tp)): Remove. * include/c_global/cstdlib (abs(long), abs(long long), abs(__int<N>)): Move to bits/std_abs.h. * testsuite/26_numerics/headers/cmath/dr2192.cc: New test. * testsuite/26_numerics/headers/cmath/dr2192_neg.cc: New test. * testsuite/26_numerics/headers/cstdlib/dr2192.cc: New test. * testsuite/26_numerics/headers/cstdlib/dr2192_neg.cc: New test. From-SVN: r240660
2016-09-30Remove use of std::abs in experimental::{gcd,lcm}Jonathan Wakely5-4/+57
PR libstdc++/77801 * include/experimental/numeric: Include <numeric>. (__abs): Define. (gcd, lcm): Use __abs instead of std::abs. * testsuite/experimental/numeric/77801.cc: New test. * testsuite/experimental/numeric/gcd.cc: Test unsigned inputs. * testsuite/experimental/numeric/lcm.cc: Likewise. From-SVN: r240656
2016-09-29Make optional::reset noexcept, make optional::value work in constant ↵Ville Voutilainen4-2/+81
expressions. Make optional::reset noexcept, make optional::value work in constant expressions. * include/std/optional (_M_get): Make constexpr. (reset): Make noexcept. * testsuite/20_util/optional/assignment/7.cc: New. * testsuite/20_util/optional/observers/6.cc: New. From-SVN: r240623
2016-09-29Define C++17 std::hypot without _GLIBCXX_USE_C99_MATH_TR1Jonathan Wakely2-40/+52
* include/c_global/cmath (hypot, __hypot3): Move C++17 overloads outside _GLIBCXX_USE_C99_MATH_TR1 condition. From-SVN: r240620
2016-09-29Disable .gnu.attributes tags in compatibility-ldbl.oAlan Modra15-13/+55
compatibility-ldbl.o is compiled with -mlong-double-64. When long double .gnu.attributes tags are checked by the linker, it complains about the mismatch between this file and others in libstdc++. * configure.ac (LONG_DOUBLE_COMPAT_FLAGS): New ACSUBST. * src/Makefile.am (compatibility-ldbl.o, compatibility-ldbl.lo): Use LONG_DOUBLE_COMPAT_FLAGS. * Makefile.in: Regenerate. * configure: Regenerate. * doc/Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * libsupc++/Makefile.in: Regenerate. * po/Makefile.in: Regenerate. * python/Makefile.in: Regenerate. * src/Makefile.in: Regenerate. * src/c++11/Makefile.in: Regenerate. * src/c++98/Makefile.in: Regenerate. * src/filesystem/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. From-SVN: r240602
2016-09-28* include/std/chrono (system_clock): Fix typo in comment.Jonathan Wakely2-1/+3
From-SVN: r240589
2016-09-28Check for overflow in filesystem::last_write_timeJonathan Wakely5-14/+159
* include/experimental/bits/fs_fwd.h (file_time_type): Simplify definition. * src/filesystem/ops.cc (file_time): Take error_code parameter and check for overflow. (do_copy_file, last_write_time): Pass error_code in file_time calls. * testsuite/experimental/filesystem/operations/last_write_time.cc: New. * testsuite/util/testsuite_fs.h (scoped_file): Define RAII helper. From-SVN: r240587
2016-09-28libstdc++/77686 use may_alias for std::function storageJonathan Wakely2-1/+6
PR libstdc++/77686 * include/std/functional (_Any_data): Add may_alias attribute. From-SVN: r240567
2016-09-27Define feature macro and update C++17 library statusJonathan Wakely5-16/+24
* doc/xml/manual/status_cxx2017.xml: Update status. * doc/html/*: Regenerate. * include/std/functional (__cpp_lib_boyer_moore_searcher): Define. * testsuite/20_util/function_objects/searchers.cc: Test feature macro. From-SVN: r240550
2016-09-27Define 3-argument overloads of std::hypot for C++17 (P0030R1)Jonathan Wakely4-2/+185
* doc/xml/manual/status_cxx2017.xml: Update status. * include/c_global/cmath (hypot): Add three-dimensional overloads. * testsuite/26_numerics/headers/cmath/hypot.cc: New. From-SVN: r240547
2016-09-26re PR libstdc++/77727 (Unwrapping std::optional constructor is not working ↵Ville Voutilainen3-4/+75
for non-transferable object) PR libstdc++/77727 * include/std/optional (optional(const optional<_Up>&)): Default-initialize the base and use emplace. (optional(optional<_Up>&&)): Likewise. * testsuite/20_util/optional/cons/77727.cc: New. From-SVN: r240511
2016-09-262016-09-26 François Dumont <fdumont@gcc.gnu.org>François Dumont2-1/+6
* include/debug/safe_base.h (_Safe_iterator_base::_M_detach_single): Make public. From-SVN: r240510
2016-09-26Remove redefinition of __cpp_lib_array_constexprJonathan Wakely2-4/+3
* include/bits/range_access.h (__cpp_lib_array_constexpr): Do not redefine macro defined in <bits/stl_iterator.h>. From-SVN: r240488
2016-09-26Add assertions to extract(const_iterator) functionsJonathan Wakely7-8/+46
* include/bits/stl_map.h (map::extract(const_iterator)): Assert that iterator is not past-the-end. * include/bits/stl_multimap.h (multimap::extract(const_iterator)): Likewise. * include/bits/stl_multiset.h (multiset::extract(const_iterator)): Likewise. * include/bits/stl_set.h (set::extract(const_iterator)): Likewise. * include/bits/unordered_map.h (unordered_map::extract(const_iterator)) (unordered_multimap::extract(const_iterator)): Likewise. * include/bits/unordered_set.h (unordered_set::extract(const_iterator)) (unordered_multiset::extract(const_iterator)): Likewise. From-SVN: r240487
2016-09-26re PR libstdc++/77717 ↵Ville Voutilainen2-2/+8
(testsuite/21_strings/basic_string_view/operations/compare/char/1.cc makes undefined memcmp call) PR libstdc++/77717 * testsuite/21_strings/basic_string_view/operations/compare/char/1.cc: Fix an out-of-bounds access. From-SVN: r240486
2016-09-26Implement -Wimplicit-fallthrough.Marek Polacek2-0/+7
Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r240485
2016-09-25debug.cc: Include debug/vector.François Dumont3-47/+105
2016-09-25 François Dumont <fdumont@gcc.gnu.org> * src/c++11/debug.cc: Include debug/vector. Include cctype. Remove functional. (get_safe_base_mutex): Get mutex based on address lowest non nil bits. * testsuite/23_containers/vector/debug/mutex_association.cc: New. From-SVN: r240479
2016-09-25bitset (bitset::reference::reference(const _Base_ref&, bitset*)): Remove ↵François Dumont7-23/+63
__unused__ attribute. 2016-09-25 François Dumont <fdumont@gcc.gnu.org> * include/debug/bitset (bitset::reference::reference(const _Base_ref&, bitset*)): Remove __unused__ attribute. * include/debug/safe_base.h (_Safe_iterator_base): Make _Safe_sequence_base a friend. (_Safe_iterator_base::_M_attach): Make protected. (_Safe_iterator_base::_M_attach_single): Likewise. (_Safe_iterator_base::_M_detach): Likewise. (_Safe_iterator_base::_M_detach_single): Likewise. (_Safe_sequence_base): Make _Safe_iterator_base a friend. (_Safe_sequence_base::_Safe_sequence_base(_Safe_sequence_base&&)): New. (_Safe_sequence_base::_M_swap): Make protected. (_Safe_sequence_base::_M_attach): Make private. (_Safe_sequence_base::_M_attach_single): Likewise. (_Safe_sequence_base::_M_detach): Likewise. (_Safe_sequence_base::_M_detach_single): Likewise. * include/debug/safe_container.h (_Safe_container::_Safe_container(_Safe_container&&)): Make default. * include/debug/safe_iterator.h (_Safe_iterator::operator++()): Name __scoped_lock instance. * include/debug/safe_iterator.tcc: Remove trailing line. * include/debug/safe_unordered_base.h (_Safe_local_iterator_base::_M_attach): Make protected. (_Safe_local_iterator_base::_M_attach_single): Likewise. (_Safe_local_iterator_base::_M_detach): Likewise. (_Safe_local_iterator_base::_M_detach_single): Likewise. (_Safe_unordered_container_base): Make _Safe_local_iterator_base friend. (_Safe_unordered_container_base::_M_attach_local): Make private. (_Safe_unordered_container_base::_M_attach_local_single): Likewise. (_Safe_unordered_container_base::_M_detach_local): Likewise. (_Safe_unordered_container_base::_M_detach_local_single): Likewise. From-SVN: r240478
2016-09-25algo.h: Generalize usage of std::__iterator_category.François Dumont2-1163/+1009
2016-09-25 François Dumont <fdumont@gcc.gnu.org> * include/parallel/algo.h: Generalize usage of std::__iterator_category. Adjust whitespaces. From-SVN: r240473
2016-09-23Avoid reallocation for basic_string::clear()Jonathan Wakely5-1/+216
PR libstdc++/56166 PR libstdc++/77582 * include/bits/basic_string.h (basic_string::clear()): Drop reference and use empty rep. * include/ext/rc_string_base.h (__rc_string_base::_M_clear()): Likewise. * testsuite/21_strings/basic_string/56166.cc: New. * testsuite/ext/vstring/modifiers/clear/56166.cc: New. From-SVN: r240447
2016-09-23Optimize truncating a basic_stringJonathan Wakely3-4/+19
* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI] (basic_string::erase(size_type, size_type)): Add fast path for truncating the string, by calling _M_set_length directly. (basic_string::erase(__const_iterator, __const_iterator)): Likewise. * include/bits/basic_string.tcc [_GLIBCXX_USE_CXX11_ABI] (basic_string::resize(size_type, _CharT)): Likewise. From-SVN: r240446
2016-09-23* configure.ac: Define HAVE_MEMALIGN for newlib.Jason Merrill3-0/+7
From-SVN: r240435
2016-09-23[RTEMS] Always use atomic builtins for libstdc++Sebastian Huber5-9/+28
libstdc++-v3/ * config/cpu/m68k/atomicity.h: Adjust comment. * acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Honor explicit atomicity_dir setup via configure.host. * configure.host (rtems-*): Set atomicity_dir. * configure: Regenerate. From-SVN: r240387
2016-09-22Implement C++17 node extraction and insertion (P0083R5)Jonathan Wakely40-22/+4019
* doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22Fix tests on old arm platforms for optional.Ville Voutilainen2-3/+7
* testsuite/20_util/optional/77288.cc: Don't use exception_ptr. From-SVN: r240347
2016-09-22Update pretty printer for std::variantJonathan Wakely3-1/+9
* python/libstdcxx/v6/printers.py (StdVariantPrinter): Adjust for recent change to _Variant_storage. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test variant with reference type. From-SVN: r240345
2016-09-22Always qualify std::forward in <variant>Jonathan Wakely4-32/+91
* include/bits/uses_allocator.h (__uses_allocator_construct): Qualify std::forward and ::new. Cast pointer to void*. * include/std/variant (_Variant_storage, _Union, _Variant_base) (__access, __visit_invoke, variant, visit): Qualify std::forward. * testsuite/20_util/variant/compile.cc: Test for ADL problems. From-SVN: r240344
2016-09-22variant (variant::operator=): Fix assignment on references.Tim Shen3-2/+13
* libstdc++-v3/include/std/variant (variant::operator=): Fix assignment on references. * libstdc++-v3/testsuite/20_util/variant/compile.cc: Add test. From-SVN: r240343
2016-09-22re PR libstdc++/77641 (std::variant copy-initialization fails for type with ↵Tim Shen3-11/+34
non-trivial constexpr ctor) PR libstdc++/77641 * include/std/variant (_Variant_storage::_Variant_storage): Change _Variant_storage's union to be default constructible. * testsuite/20_util/variant/compile.cc: New test. From-SVN: r240340
2016-09-21re PR libstdc++/77288 (Std::experimental::optional::operator= implementation ↵Ville Voutilainen4-27/+470
is broken in gcc 6.1) PR libstdc++/77288 * include/std/optional (__is_optional_impl, __is_optional): Remove. (__converts_from_optional, __assigns_from_optional): New. (optional(_Up&&)): Use is_same instead of __is_optional. (optional(const optional<_Up>&)): Constrain with __converts_from_optional. (optional(optional<_Up>&&)): Likewise. (operator=(_Up&&)): Use is_same instead of __is_optional, check is_same and is_scalar. (operator=(const optional<_Up>&)): Constrain with __converts_from_optional and __assigns_from_optional. (operator=(optional<_Up>&&)): Likewise. * testsuite/20_util/optional/77288.cc: New. * testsuite/20_util/optional/cons/value.cc: Adjust. From-SVN: r240324