From 51072bd6bf79ef2bc6a922079bff57c31c1effbc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:47:26 +0000 Subject: [PATCH 1/3] Vendor import of libc++ release_39 branch r276489: https://llvm.org/svn/llvm-project/libcxx/branches/release_39@276489 --- .arcconfig | 2 +- CMakeLists.txt | 89 +- CREDITS.TXT | 4 + LICENSE.TXT | 2 +- Makefile | 56 - benchmarks/unordered_set_operations.bench.cpp | 44 + cmake/Modules/CheckLibcxxAtomic.cmake | 41 + cmake/Modules/HandleLibCXXABI.cmake | 6 +- cmake/Modules/HandleLibcxxFlags.cmake | 25 + cmake/Modules/HandleOutOfTreeLLVM.cmake | 10 +- cmake/config-ix.cmake | 1 + docs/BuildingLibcxx.rst | 114 +- docs/TestingLibcxx.rst | 35 +- docs/UsingLibcxx.rst | 36 + docs/conf.py | 6 +- include/CMakeLists.txt | 15 +- include/__bsd_locale_defaults.h | 33 + include/__bsd_locale_fallbacks.h | 138 ++ include/__config | 104 +- include/__config_site.in | 1 + include/__functional_base | 68 +- include/__hash_table | 621 +++-- include/__mutex_base | 84 +- include/__threading_support | 205 ++ include/__tree | 1339 +++++++---- include/__tuple | 349 +-- include/__undef___deallocate | 2 + include/__undef_min_max | 4 + include/algorithm | 101 +- include/array | 18 +- include/atomic | 63 +- include/bitset | 2 +- include/cctype | 57 + include/cmath | 28 + include/complex | 20 +- include/cstring | 17 - include/cwchar | 19 - include/deque | 8 +- include/exception | 19 + include/experimental/__config | 18 + include/experimental/__memory | 90 + include/experimental/algorithm | 2 +- include/experimental/any | 12 +- include/experimental/deque | 47 + include/experimental/dynarray | 15 +- include/experimental/filesystem | 2052 +++++++++++++++++ include/experimental/forward_list | 47 + include/experimental/functional | 39 +- include/experimental/iterator | 114 + include/experimental/list | 47 + include/experimental/map | 57 + include/experimental/memory_resource | 422 ++++ include/experimental/optional | 8 + include/experimental/propagate_const | 576 +++++ include/experimental/regex | 62 + include/experimental/set | 57 + include/experimental/string | 62 + include/experimental/string_view | 45 +- include/experimental/tuple | 3 +- include/experimental/unordered_map | 65 + include/experimental/unordered_set | 59 + include/experimental/vector | 47 + include/ext/hash_map | 8 +- include/ext/hash_set | 6 +- include/forward_list | 278 ++- include/fstream | 94 +- include/functional | 178 +- include/future | 10 +- include/iomanip | 33 +- include/ios | 2 +- include/iosfwd | 5 + include/istream | 37 +- include/iterator | 163 +- include/list | 47 +- include/locale | 316 +-- include/map | 516 ++--- include/memory | 142 +- include/mutex | 113 +- include/queue | 67 +- include/shared_mutex | 12 +- include/stack | 10 +- include/stdbool.h | 39 + include/stdexcept | 6 +- include/streambuf | 14 +- include/string | 63 +- include/string.h | 110 + include/support/android/locale_bionic.h | 4 +- include/support/ibm/locale_mgmt_aix.h | 85 + include/support/ibm/xlocale.h | 57 +- include/support/newlib/xlocale.h | 44 +- include/support/solaris/xlocale.h | 20 +- include/support/win32/locale_mgmt_win32.h | 33 + include/support/win32/locale_win32.h | 20 +- include/support/xlocale/__nop_locale_mgmt.h | 52 + include/support/xlocale/__posix_l_fallback.h | 165 ++ include/support/xlocale/__strtonum_fallback.h | 67 + include/support/xlocale/xlocale.h | 194 -- include/thread | 93 +- include/tuple | 453 +++- include/type_traits | 626 +++-- include/unordered_map | 610 ++--- include/unordered_set | 27 +- include/utility | 116 +- include/vector | 8 +- include/wchar.h | 41 +- lib/CMakeLists.txt | 54 +- lib/buildit | 2 +- src/algorithm.cpp | 6 +- src/bind.cpp | 21 +- src/condition_variable.cpp | 10 +- .../filesystem/directory_iterator.cpp | 256 ++ src/experimental/filesystem/operations.cpp | 794 +++++++ src/experimental/filesystem/path.cpp | 391 ++++ src/experimental/memory_resource.cpp | 144 ++ src/locale.cpp | 233 +- src/memory.cpp | 14 +- src/mutex.cpp | 74 +- src/regex.cpp | 18 - src/strstream.cpp | 9 +- src/system_error.cpp | 57 +- src/thread.cpp | 24 +- test/CMakeLists.txt | 20 +- .../algorithms/version.pass.cpp | 0 .../atomics/atomics.flag/init_bool.pass.cpp} | 10 +- test/{std => libcxx}/atomics/version.pass.cpp | 0 test/libcxx/compiler.py | 26 +- .../associative/map/version.pass.cpp | 0 .../associative/set/version.pass.cpp | 0 .../tree_balance_after_insert.pass.cpp | 3 + .../tree_key_value_traits.pass.cpp | 59 + .../associative/tree_left_rotate.pass.cpp | 3 + .../associative/tree_remove.pass.cpp | 3 + .../associative/tree_right_rotate.pass.cpp | 3 + .../container.adaptors/queue/version.pass.cpp | 0 .../container.adaptors/stack/version.pass.cpp | 0 .../containers/gnu_cxx/hash_map.pass.cpp | 26 + .../containers/gnu_cxx/hash_set.pass.cpp | 26 + .../sequences/array/version.pass.cpp | 0 .../sequences/deque/version.pass.cpp | 0 .../sequences/forwardlist/version.pass.cpp | 0 .../sequences/list/db_back.pass.cpp | 26 +- .../sequences/list/db_cback.pass.cpp | 24 +- .../sequences/list/db_cfront.pass.cpp | 24 +- .../sequences/list/db_front.pass.cpp | 26 +- .../sequences/list/db_iterators_6.pass.cpp | 27 +- .../sequences/list/db_iterators_7.pass.cpp | 27 +- .../sequences/list/db_iterators_8.pass.cpp | 25 +- .../sequences/list/db_iterators_9.pass.cpp | 18 +- .../sequences/list/list.cons/db_copy.pass.cpp | 29 + .../sequences/list/list.cons/db_move.pass.cpp | 32 + .../list/list.modifiers/emplace_db1.pass.cpp | 44 + .../list.modifiers/erase_iter_db1.pass.cpp | 25 +- .../list.modifiers/erase_iter_db2.pass.cpp | 26 +- .../erase_iter_iter_db1.pass.cpp | 24 +- .../erase_iter_iter_db2.pass.cpp | 25 +- .../erase_iter_iter_db3.pass.cpp | 25 +- .../erase_iter_iter_db4.pass.cpp | 24 +- .../insert_iter_iter_iter_db1.pass.cpp | 36 + .../insert_iter_rvalue_db1.pass.cpp | 27 + .../insert_iter_size_value_db1.pass.cpp | 27 + .../insert_iter_value_db1.pass.cpp | 29 + .../list/list.modifiers/pop_back_db1.pass.cpp | 33 + .../list/list.ops/db_splice_pos_list.pass.cpp | 29 + .../list.ops/db_splice_pos_list_iter.pass.cpp | 29 + .../db_splice_pos_list_iter_iter.pass.cpp | 29 + .../list/list.special/db_swap_1.pass.cpp | 36 + .../list/list.special/db_swap_2.pass.cpp | 36 + .../sequences/list/version.pass.cpp | 0 .../vector/const_value_type.pass.cpp | 4 +- .../sequences/vector/db_back.pass.cpp | 0 .../sequences/vector/db_cback.pass.cpp | 0 .../sequences/vector/db_cfront.pass.cpp | 0 .../sequences/vector/db_cindex.pass.cpp | 0 .../sequences/vector/db_front.pass.cpp | 0 .../sequences/vector/db_index.pass.cpp | 0 .../sequences/vector/db_iterators_2.pass.cpp | 0 .../sequences/vector/db_iterators_3.pass.cpp | 0 .../sequences/vector/db_iterators_4.pass.cpp | 0 .../sequences/vector/db_iterators_5.pass.cpp | 0 .../sequences/vector/db_iterators_6.pass.cpp | 0 .../sequences/vector/db_iterators_7.pass.cpp | 0 .../sequences/vector/db_iterators_8.pass.cpp | 0 .../sequences/vector/version.pass.cpp | 0 .../unord/key_value_traits.pass.cpp | 59 + .../containers/unord/next_prime.pass.cpp | 0 .../unord/unord.map/db_iterators_7.pass.cpp | 0 .../unord/unord.map/db_iterators_8.pass.cpp | 0 .../unord.map/db_local_iterators_7.pass.cpp | 0 .../unord.map/db_local_iterators_8.pass.cpp | 0 .../unord/unord.map/version.pass.cpp | 0 .../unord/unord.set/insert_dup_alloc.pass.cpp | 48 - .../unord/unord.set/version.pass.cpp | 0 .../depr/depr.c.headers/extern_c.pass.cpp | 0 .../depr/depr.str.strstreams/version.pass.cpp | 0 .../assertions/version_cassert.pass.cpp | 20 + .../diagnostics/errno/version_cerrno.pass.cpp | 19 + .../std.exceptions/version.pass.cpp | 0 .../diagnostics/syserr/version.pass.cpp | 0 .../dynarray/dynarray.cons/alloc.pass.cpp | 19 +- .../dynarray/dynarray.cons/default.pass.cpp | 10 +- .../dynarray/dynarray.data/default.pass.cpp | 4 +- .../dynarray/dynarray.mutate/default.pass.cpp | 15 +- .../dynarray/dynarray.overview/at.pass.cpp | 13 +- .../dynarray.overview/begin_end.pass.cpp | 15 +- .../dynarray.overview/capacity.pass.cpp | 13 +- .../dynarray.overview/front_back.pass.cpp | 2 +- .../dynarray.overview/indexing.pass.cpp | 13 +- .../dynarray/dynarray.traits/default.pass.cpp | 9 +- .../dynarray/dynarray.zero/default.pass.cpp | 15 +- .../class.path/path.req/is_pathable.pass.cpp | 101 + .../experimental/filesystem/lit.local.cfg | 3 + .../experimental/filesystem/version.pass.cpp | 22 + .../construct_piecewise_pair.pass.cpp | 178 ++ .../db_deallocate.pass.cpp | 42 + .../max_size.pass.cpp | 65 + .../db_deallocate.pass.cpp | 45 + .../header_deque_libcpp_version.pass.cpp | 22 + ...eader_forward_list_libcpp_version.pass.cpp | 22 + .../header_list_libcpp_version.pass.cpp | 22 + .../header_map_libcpp_version.pass.cpp | 22 + .../header_regex_libcpp_version.pass.cpp | 22 + .../header_set_libcpp_version.pass.cpp | 22 + .../header_string_libcpp_version.pass.cpp | 22 + ...ader_unordered_map_libcpp_version.pass.cpp | 22 + ...ader_unordered_set_libcpp_version.pass.cpp | 22 + .../header_vector_libcpp_version.pass.cpp | 22 + .../global_memory_resource_lifetime.pass.cpp | 61 + .../new_delete_resource_lifetime.pass.cpp | 53 + .../memory.resource.synop/version.pass.cpp | 22 + .../experimental/optional/version.pass.cpp | 0 .../utilities/meta/version.pass.cpp | 0 .../header.ratio.synop/includes.pass.cpp | 7 +- .../includes.pass.cpp | 7 +- .../header.chrono.synop/includes.pass.cpp | 7 +- .../header.tuple.synop/includes.pass.cpp | 9 +- .../utilities/utility/version.pass.cpp | 0 .../extensions/hash/specializations.fail.cpp | 0 .../extensions/hash/specializations.pass.cpp | 0 .../hash_map/const_iterator.fail.cpp | 0 .../extensions/nothing_to_do.pass.cpp | 0 .../c.files/version_ccstdio.pass.cpp | 0 .../c.files/version_cinttypes.pass.cpp | 0 .../file.streams/fstreams/version.pass.cpp | 0 .../input.streams/version.pass.cpp | 0 .../output.streams/version.pass.cpp | 0 .../std.manip/version.pass.cpp | 0 .../iostream.forward/version.pass.cpp | 0 .../iostream.objects/version.pass.cpp | 0 .../iostreams.base/version.pass.cpp | 0 .../stream.buffers/version.pass.cpp | 0 .../string.streams/version.pass.cpp | 0 .../iterators/trivial_iterators.pass.cpp | 24 +- .../iterators/version.pass.cpp | 0 .../language.support/cstdint/version.pass.cpp | 0 .../new.badlength/bad_array_length.pass.cpp | 3 +- .../support.dynamic/version.pass.cpp | 0 .../support.exception/version.pass.cpp | 0 .../support.initlist/version.pass.cpp | 0 .../c.limits/version_cfloat.pass.cpp | 0 .../c.limits/version_climits.pass.cpp | 0 .../support.limits/limits/version.pass.cpp | 0 .../support.rtti/version.pass.cpp | 0 .../support.runtime/version_csetjmp.pass.cpp | 0 .../support.runtime/version_csignal.pass.cpp | 0 .../support.runtime/version_cstdarg.pass.cpp | 0 .../support.runtime/version_cstdbool.pass.cpp | 0 .../support.runtime/version_cstdlib.pass.cpp | 0 .../support.runtime/version_ctime.pass.cpp | 0 .../support.types/version.pass.cpp | 0 .../localization/c.locales/version.pass.cpp | 0 .../locale.categories/__scan_keyword.pass.cpp | 0 .../locale.stdcvt/version.pass.cpp | 0 .../conversions.string/ctor_move.pass.cpp | 35 + .../locale.types/locale.facet/facet.pass.cpp | 0 .../locale/locale.types/locale.id/id.pass.cpp | 0 .../localization/version.pass.cpp | 0 .../numerics/cfenv/version.pass.cpp | 0 .../numerics/complex.number/version.pass.cpp | 0 .../numerics/numarray/version.pass.cpp | 0 .../numerics/numeric.ops/version.pass.cpp | 0 .../rand/rand.synopsis/version.pass.cpp | 0 test/libcxx/selftest/test_macros.pass.cpp | 54 +- .../string.modifiers}/erase_iter_db1.pass.cpp | 0 .../string.modifiers}/erase_iter_db2.pass.cpp | 0 .../erase_iter_iter_db1.pass.cpp | 0 .../erase_iter_iter_db2.pass.cpp | 0 .../erase_iter_iter_db3.pass.cpp | 0 .../erase_iter_iter_db4.pass.cpp | 0 .../erase_pop_back_db1.pass.cpp} | 25 +- .../insert_iter_char_db1.pass.cpp | 34 + .../insert_iter_size_char_db1.pass.cpp} | 24 +- .../strings/c.strings/version_cctype.pass.cpp | 0 .../c.strings/version_cstring.pass.cpp | 0 .../strings/c.strings/version_cuchar.pass.cpp | 0 .../strings/c.strings/version_cwchar.pass.cpp | 0 .../c.strings/version_cwctype.pass.cpp | 0 .../strings/iterators.exceptions.pass.cpp | 17 +- .../strings/iterators.noexcept.pass.cpp | 12 +- test/{std => libcxx}/strings/version.pass.cpp | 0 test/libcxx/test/config.py | 117 +- test/libcxx/test/format.py | 11 +- test/libcxx/test/target_info.py | 22 +- .../futures.promise/set_exception.pass.cpp | 53 + .../set_exception_at_thread_exit.pass.cpp | 53 + .../futures/futures.task}/types.pass.cpp | 4 +- .../native_handle.pass.cpp | 0 .../thread/thread.condition/version.pass.cpp | 0 .../variadic_mutex_mangling.pass.cpp | 35 + .../thread.mutex.class/native_handle.pass.cpp | 0 .../native_handle.pass.cpp | 0 ...ad_safety_annotations_not_enabled.pass.cpp | 26 + .../thread_safety_lock_guard.pass.cpp | 25 + .../thread_safety_lock_unlock.pass.cpp | 26 + .../thread_safety_missing_unlock.fail.cpp | 23 + ...thread_safety_requires_capability.pass.cpp | 30 + .../thread/thread.mutex/version.pass.cpp | 0 .../native_handle.pass.cpp | 0 .../thread.thread.class/types.pass.cpp | 0 .../thread/thread.threads/version.pass.cpp | 0 .../func.require/bullet_1_2_3.pass.cpp} | 82 +- .../func.require/bullet_4_5_6.pass.cpp} | 98 +- .../func.require/bullet_7.pass.cpp} | 4 +- .../func.require/invoke.pass.cpp | 15 +- .../func.require/invoke_helpers.h | 230 +- .../function.objects/version.pass.cpp | 0 .../utilities/memory/version.pass.cpp | 0 .../utilities/meta/is_referenceable.pass.cpp | 193 ++ .../__has_operator_addressof.pass.cpp | 0 .../utilities/meta/version.pass.cpp | 0 .../utilities/ratio/version.pass.cpp | 0 .../template.bitset/version.pass.cpp | 0 .../utilities/time/version.pass.cpp | 0 .../utilities/tuple/version.pass.cpp | 0 .../utilities/type.index/version.pass.cpp | 0 .../non_trivial_copy_move_ABI.pass.cpp | 55 + .../pairs.pair/trivial_copy_move_ABI.pass.cpp | 147 ++ .../utilities/utility/version.pass.cpp | 0 test/lit.site.cfg.in | 6 + .../alg.fill/fill_n.pass.cpp | 2 +- .../alg.nonmodifying/alg.equal/equal.pass.cpp | 2 +- .../mismatch/mismatch_pred.pass.cpp | 4 +- .../alg.sorting/alg.clamp/clamp.comp.pass.cpp | 127 + .../alg.sorting/alg.clamp/clamp.pass.cpp | 125 + .../make.heap/make_heap_comp.pass.cpp | 2 +- .../alg.merge/inplace_merge.pass.cpp | 8 +- .../alg.merge/inplace_merge_comp.pass.cpp | 8 +- .../alg.min.max/max_element.pass.cpp | 6 +- .../alg.min.max/max_element_comp.pass.cpp | 6 +- .../alg.min.max/min_element.pass.cpp | 4 +- .../alg.min.max/min_element_comp.pass.cpp | 6 +- .../alg.sorting/alg.min.max/minmax.pass.cpp | 2 +- .../alg.min.max/minmax_comp.pass.cpp | 2 +- .../alg.min.max/minmax_element.pass.cpp | 6 +- .../alg.min.max/minmax_element_comp.pass.cpp | 6 +- .../minmax_init_list_comp.pass.cpp | 2 +- .../partial.sort/partial_sort.pass.cpp | 4 + .../partial.sort/partial_sort_comp.pass.cpp | 6 + .../atomics.flag/atomic_flag_clear.pass.cpp | 6 +- .../atomic_flag_clear_explicit.pass.cpp | 30 +- test/std/atomics/atomics.flag/clear.pass.cpp | 40 +- .../isalwayslockfree.pass.cpp | 101 + .../atomics.lockfree/lockfree.pass.cpp | 8 + .../atomics.types.generic/address.pass.cpp | 8 +- .../atomics.types.generic/bool.pass.cpp | 4 +- .../cstdint_typedefs.pass.cpp | 4 +- .../atomics.types.generic/integral.pass.cpp | 26 +- .../integral_typedefs.pass.cpp | 25 + .../trivially_copyable.fail.cpp | 2 +- .../trivially_copyable.pass.cpp | 2 +- .../atomic_compare_exchange_strong.pass.cpp | 2 +- ..._compare_exchange_strong_explicit.pass.cpp | 2 +- .../atomic_compare_exchange_weak.pass.cpp | 2 +- ...ic_compare_exchange_weak_explicit.pass.cpp | 2 +- .../atomic_exchange.pass.cpp | 2 +- .../atomic_exchange_explicit.pass.cpp | 2 +- .../atomic_fetch_add.pass.cpp | 6 +- .../atomic_fetch_and.pass.cpp | 2 +- .../atomic_fetch_and_explicit.pass.cpp | 2 +- .../atomic_fetch_or.pass.cpp | 2 +- .../atomic_fetch_or_explicit.pass.cpp | 2 +- .../atomic_fetch_sub.pass.cpp | 6 +- .../atomic_fetch_sub_explicit.pass.cpp | 2 +- .../atomic_fetch_xor.pass.cpp | 2 +- .../atomic_fetch_xor_explicit.pass.cpp | 2 +- .../atomic_helpers.h | 14 +- .../atomic_init.pass.cpp | 2 +- .../atomic_is_lock_free.pass.cpp | 2 +- .../atomic_load.pass.cpp | 2 +- .../atomic_load_explicit.pass.cpp | 2 +- .../atomic_store.pass.cpp | 2 +- .../atomic_store_explicit.pass.cpp | 2 +- .../associative/iterator_types.pass.cpp | 131 ++ ...PR28469_undefined_behavior_segfault.sh.cpp | 31 + .../associative/map/compare.pass.cpp | 2 +- .../associative/map/incomplete_type.pass.cpp | 29 + .../associative/map/map.access/at.pass.cpp | 2 +- .../associative/map/map.access/empty.pass.cpp | 2 +- .../map/map.access/index_key.pass.cpp | 43 +- .../map/map.access/index_rv_key.pass.cpp | 29 +- .../map/map.access/iterator.pass.cpp | 2 +- .../map/map.access/max_size.pass.cpp | 2 +- .../associative/map/map.access/size.pass.cpp | 2 +- .../associative/map/map.cons/alloc.pass.cpp | 2 +- .../map.cons/assign_initializer_list.pass.cpp | 2 +- .../associative/map/map.cons/compare.pass.cpp | 2 +- .../map/map.cons/compare_alloc.pass.cpp | 2 +- .../compare_copy_constructible.fail.cpp | 29 + .../associative/map/map.cons/copy.pass.cpp | 2 +- .../map/map.cons/copy_alloc.pass.cpp | 2 +- .../map/map.cons/copy_assign.pass.cpp | 2 +- .../associative/map/map.cons/default.pass.cpp | 2 +- .../map/map.cons/default_noexcept.pass.cpp | 10 +- .../map/map.cons/dtor_noexcept.pass.cpp | 9 +- .../map/map.cons/initializer_list.pass.cpp | 2 +- .../initializer_list_compare.pass.cpp | 2 +- .../initializer_list_compare_alloc.pass.cpp | 2 +- .../map/map.cons/iter_iter.pass.cpp | 2 +- .../map/map.cons/iter_iter_comp.pass.cpp | 2 +- .../map.cons/iter_iter_comp_alloc.pass.cpp | 2 +- .../associative/map/map.cons/move.pass.cpp | 2 +- .../map/map.cons/move_alloc.pass.cpp | 6 +- .../map/map.cons/move_assign.pass.cpp | 2 +- .../map.cons/move_assign_noexcept.pass.cpp | 5 +- .../map/map.cons/move_noexcept.pass.cpp | 5 +- .../map/map.modifiers/clear.pass.cpp | 2 +- .../map/map.modifiers/emplace.pass.cpp | 2 +- .../map/map.modifiers/emplace_hint.pass.cpp | 6 +- .../map/map.modifiers/erase_iter.pass.cpp | 4 +- .../map.modifiers/erase_iter_iter.pass.cpp | 2 +- .../map/map.modifiers/erase_key.pass.cpp | 2 +- ...nd_emplace_allocator_requirements.pass.cpp | 31 + .../map/map.modifiers/insert_cv.pass.cpp | 107 +- .../insert_initializer_list.pass.cpp | 2 +- .../map/map.modifiers/insert_iter_cv.pass.cpp | 95 +- .../map.modifiers/insert_iter_iter.pass.cpp | 2 +- .../map/map.modifiers/insert_iter_rv.pass.cpp | 98 +- .../map.modifiers/insert_or_assign.pass.cpp | 11 +- .../map/map.modifiers/insert_rv.pass.cpp | 110 +- .../map/map.modifiers/try.emplace.pass.cpp | 13 +- .../associative/map/map.ops/count.pass.cpp | 2 +- .../associative/map/map.ops/count0.pass.cpp | 8 +- .../associative/map/map.ops/count1.fail.cpp | 6 +- .../associative/map/map.ops/count2.fail.cpp | 6 +- .../associative/map/map.ops/count3.fail.cpp | 6 +- .../map/map.ops/equal_range.pass.cpp | 2 +- .../map/map.ops/equal_range0.pass.cpp | 8 +- .../map/map.ops/equal_range1.fail.cpp | 6 +- .../map/map.ops/equal_range2.fail.cpp | 6 +- .../map/map.ops/equal_range3.fail.cpp | 6 +- .../associative/map/map.ops/find.pass.cpp | 2 +- .../associative/map/map.ops/find0.pass.cpp | 8 +- .../associative/map/map.ops/find1.fail.cpp | 6 +- .../associative/map/map.ops/find2.fail.cpp | 6 +- .../associative/map/map.ops/find3.fail.cpp | 6 +- .../map/map.ops/lower_bound.pass.cpp | 4 +- .../map/map.ops/lower_bound0.pass.cpp | 8 +- .../map/map.ops/lower_bound1.fail.cpp | 6 +- .../map/map.ops/lower_bound2.fail.cpp | 6 +- .../map/map.ops/lower_bound3.fail.cpp | 6 +- .../map/map.ops/upper_bound.pass.cpp | 4 +- .../map/map.ops/upper_bound0.pass.cpp | 8 +- .../map/map.ops/upper_bound1.fail.cpp | 6 +- .../map/map.ops/upper_bound2.fail.cpp | 6 +- .../map/map.ops/upper_bound3.fail.cpp | 6 +- .../map/map.special/member_swap.pass.cpp | 2 +- .../map/map.special/non_member_swap.pass.cpp | 6 +- .../map/map.special/swap_noexcept.pass.cpp | 24 +- .../containers/associative/map/types.pass.cpp | 2 +- .../associative/multimap/empty.pass.cpp | 2 +- .../multimap/incomplete_type.pass.cpp | 29 + .../associative/multimap/iterator.pass.cpp | 2 +- .../associative/multimap/max_size.pass.cpp | 2 +- .../multimap/multimap.cons/alloc.pass.cpp | 2 +- .../assign_initializer_list.pass.cpp | 2 +- .../multimap/multimap.cons/compare.pass.cpp | 2 +- .../multimap.cons/compare_alloc.pass.cpp | 2 +- .../compare_copy_constructible.fail.cpp | 29 + .../multimap/multimap.cons/copy.pass.cpp | 2 +- .../multimap.cons/copy_alloc.pass.cpp | 2 +- .../multimap.cons/copy_assign.pass.cpp | 2 +- .../multimap/multimap.cons/default.pass.cpp | 2 +- .../multimap.cons/default_noexcept.pass.cpp | 10 +- .../multimap.cons/dtor_noexcept.pass.cpp | 9 +- .../multimap.cons/initializer_list.pass.cpp | 2 +- .../initializer_list_compare.pass.cpp | 2 +- .../initializer_list_compare_alloc.pass.cpp | 2 +- .../multimap/multimap.cons/iter_iter.pass.cpp | 2 +- .../multimap.cons/iter_iter_comp.pass.cpp | 2 +- .../iter_iter_comp_alloc.pass.cpp | 2 +- .../multimap/multimap.cons/move.pass.cpp | 2 +- .../multimap.cons/move_alloc.pass.cpp | 6 +- .../multimap.cons/move_assign.pass.cpp | 2 +- .../move_assign_noexcept.pass.cpp | 5 +- .../multimap.cons/move_noexcept.pass.cpp | 5 +- .../multimap.modifiers/clear.pass.cpp | 2 +- .../multimap.modifiers/emplace.pass.cpp | 2 +- .../multimap.modifiers/emplace_hint.pass.cpp | 2 +- .../multimap.modifiers/erase_iter.pass.cpp | 4 +- .../erase_iter_iter.pass.cpp | 2 +- .../multimap.modifiers/erase_key.pass.cpp | 2 +- .../insert_allocator_requirements.pass.cpp | 28 + .../multimap.modifiers/insert_cv.pass.cpp | 94 +- .../insert_initializer_list.pass.cpp | 2 +- .../insert_iter_cv.pass.cpp | 94 +- .../insert_iter_iter.pass.cpp | 2 +- .../insert_iter_rv.pass.cpp | 98 +- .../multimap.modifiers/insert_rv.pass.cpp | 95 +- .../multimap/multimap.ops/count.pass.cpp | 2 +- .../multimap/multimap.ops/count0.pass.cpp | 8 +- .../multimap/multimap.ops/count1.fail.cpp | 6 +- .../multimap/multimap.ops/count2.fail.cpp | 6 +- .../multimap/multimap.ops/count3.fail.cpp | 6 +- .../multimap.ops/equal_range.pass.cpp | 2 +- .../multimap.ops/equal_range0.pass.cpp | 8 +- .../multimap.ops/equal_range1.fail.cpp | 6 +- .../multimap.ops/equal_range2.fail.cpp | 6 +- .../multimap.ops/equal_range3.fail.cpp | 6 +- .../multimap/multimap.ops/find.pass.cpp | 2 +- .../multimap/multimap.ops/find0.pass.cpp | 8 +- .../multimap/multimap.ops/find1.fail.cpp | 6 +- .../multimap/multimap.ops/find2.fail.cpp | 6 +- .../multimap/multimap.ops/find3.fail.cpp | 6 +- .../multimap.ops/lower_bound.pass.cpp | 2 +- .../multimap.ops/lower_bound0.pass.cpp | 8 +- .../multimap.ops/lower_bound1.fail.cpp | 6 +- .../multimap.ops/lower_bound2.fail.cpp | 6 +- .../multimap.ops/lower_bound3.fail.cpp | 6 +- .../multimap.ops/upper_bound.pass.cpp | 2 +- .../multimap.ops/upper_bound0.pass.cpp | 8 +- .../multimap.ops/upper_bound1.fail.cpp | 6 +- .../multimap.ops/upper_bound2.fail.cpp | 6 +- .../multimap.ops/upper_bound3.fail.cpp | 6 +- .../multimap.special/member_swap.pass.cpp | 2 +- .../multimap.special/non_member_swap.pass.cpp | 6 +- .../multimap.special/swap_noexcept.pass.cpp | 25 +- .../associative/multimap/size.pass.cpp | 2 +- .../associative/multimap/types.pass.cpp | 2 +- .../associative/multiset/clear.pass.cpp | 2 +- .../associative/multiset/count.pass.cpp | 2 +- .../associative/multiset/emplace.pass.cpp | 2 +- .../multiset/emplace_hint.pass.cpp | 2 +- .../associative/multiset/empty.pass.cpp | 2 +- .../associative/multiset/equal_range.pass.cpp | 2 +- .../associative/multiset/erase_iter.pass.cpp | 4 +- .../multiset/erase_iter_iter.pass.cpp | 2 +- .../associative/multiset/erase_key.pass.cpp | 2 +- .../associative/multiset/find.pass.cpp | 2 +- .../multiset/incomplete_type.pass.cpp | 29 + .../insert_allocator_requirements.pass.cpp | 26 + .../associative/multiset/insert_cv.pass.cpp | 2 +- .../multiset/insert_initializer_list.pass.cpp | 2 +- .../multiset/insert_iter_cv.pass.cpp | 2 +- .../multiset/insert_iter_iter.pass.cpp | 2 +- .../multiset/insert_iter_rv.pass.cpp | 2 +- .../associative/multiset/insert_rv.pass.cpp | 2 +- .../associative/multiset/iterator.pass.cpp | 6 +- .../associative/multiset/lower_bound.pass.cpp | 2 +- .../associative/multiset/max_size.pass.cpp | 2 +- .../assign_initializer_list.pass.cpp | 2 +- .../compare_copy_constructible.fail.cpp | 29 + .../multiset/multiset.cons/default.pass.cpp | 2 +- .../multiset.cons/default_noexcept.pass.cpp | 10 +- .../multiset.cons/dtor_noexcept.pass.cpp | 9 +- .../multiset.cons/initializer_list.pass.cpp | 2 +- .../multiset/multiset.cons/iter_iter.pass.cpp | 2 +- .../multiset.cons/iter_iter_alloc.pass.cpp | 2 + .../multiset/multiset.cons/move.pass.cpp | 2 +- .../multiset.cons/move_alloc.pass.cpp | 4 +- .../multiset.cons/move_assign.pass.cpp | 2 +- .../move_assign_noexcept.pass.cpp | 5 +- .../multiset.cons/move_noexcept.pass.cpp | 5 +- .../multiset.special/member_swap.pass.cpp | 2 +- .../multiset.special/non_member_swap.pass.cpp | 2 + .../multiset.special/swap_noexcept.pass.cpp | 25 +- .../associative/multiset/size.pass.cpp | 2 +- .../associative/multiset/types.pass.cpp | 2 +- .../associative/multiset/upper_bound.pass.cpp | 2 +- .../containers/associative/set/clear.pass.cpp | 2 +- .../containers/associative/set/count.pass.cpp | 2 +- .../associative/set/emplace.pass.cpp | 2 +- .../associative/set/emplace_hint.pass.cpp | 2 +- .../containers/associative/set/empty.pass.cpp | 2 +- .../associative/set/equal_range.pass.cpp | 2 +- .../associative/set/erase_iter.pass.cpp | 4 +- .../associative/set/erase_iter_iter.pass.cpp | 2 +- .../associative/set/erase_key.pass.cpp | 2 +- .../containers/associative/set/find.pass.cpp | 2 +- .../associative/set/incomplete_type.pass.cpp | 29 + ...nd_emplace_allocator_requirements.pass.cpp | 29 + .../associative/set/insert_cv.pass.cpp | 2 +- .../set/insert_initializer_list.pass.cpp | 2 +- .../associative/set/insert_iter_cv.pass.cpp | 2 +- .../associative/set/insert_iter_iter.pass.cpp | 2 +- .../associative/set/insert_iter_rv.pass.cpp | 2 +- .../associative/set/insert_rv.pass.cpp | 2 +- .../associative/set/iterator.pass.cpp | 2 +- .../associative/set/lower_bound.pass.cpp | 4 +- .../associative/set/max_size.pass.cpp | 2 +- .../set.cons/assign_initializer_list.pass.cpp | 2 +- .../compare_copy_constructible.fail.cpp | 29 + .../associative/set/set.cons/default.pass.cpp | 2 +- .../set/set.cons/default_noexcept.pass.cpp | 10 +- .../set/set.cons/dtor_noexcept.pass.cpp | 9 +- .../set/set.cons/initializer_list.pass.cpp | 2 +- .../set/set.cons/iter_iter.pass.cpp | 2 +- .../set/set.cons/iter_iter_alloc.pass.cpp | 2 + .../associative/set/set.cons/move.pass.cpp | 2 +- .../set/set.cons/move_alloc.pass.cpp | 4 +- .../set/set.cons/move_assign.pass.cpp | 2 +- .../set.cons/move_assign_noexcept.pass.cpp | 5 +- .../set/set.cons/move_noexcept.pass.cpp | 5 +- .../set/set.special/member_swap.pass.cpp | 2 +- .../set/set.special/non_member_swap.pass.cpp | 2 + .../set/set.special/swap_noexcept.pass.cpp | 24 +- .../containers/associative/set/size.pass.cpp | 2 +- .../containers/associative/set/types.pass.cpp | 2 +- .../associative/set/upper_bound.pass.cpp | 4 +- .../ctor_comp_cont_alloc.pass.cpp | 5 +- .../ctor_comp_rcont_alloc.pass.cpp | 5 +- .../priqueue.cons/default_noexcept.pass.cpp | 7 +- .../priqueue.cons/dtor_noexcept.pass.cpp | 4 +- .../move_assign_noexcept.pass.cpp | 4 +- .../priqueue.cons/move_noexcept.pass.cpp | 4 +- .../priqueue.special/swap_noexcept.pass.cpp | 4 +- .../priority.queue/types.fail.cpp | 35 + .../priority.queue/types.pass.cpp | 22 +- .../queue.cons/default_noexcept.pass.cpp | 7 +- .../queue/queue.cons/dtor_noexcept.pass.cpp | 4 +- .../queue.cons/move_assign_noexcept.pass.cpp | 4 +- .../queue/queue.cons/move_noexcept.pass.cpp | 4 +- .../queue/queue.defn/types.fail.cpp | 20 + .../queue/queue.defn/types.pass.cpp | 14 +- .../queue.special/swap_noexcept.pass.cpp | 4 +- .../stack.cons/default_noexcept.pass.cpp | 7 +- .../stack/stack.cons/dtor_noexcept.pass.cpp | 4 +- .../stack.cons/move_assign_noexcept.pass.cpp | 4 +- .../stack/stack.cons/move_noexcept.pass.cpp | 4 +- .../stack/stack.defn/types.fail.cpp | 35 + .../stack/stack.defn/types.pass.cpp | 14 +- .../stack.special/swap_noexcept.pass.cpp | 4 +- ...map_allocator_requirement_test_templates.h | 743 ++++++ .../array.cons/initializer_list.pass.cpp | 14 + .../array/array.special/swap.pass.cpp | 38 + .../sequences/array/array.swap/swap.pass.cpp | 48 +- .../containers/sequences/array/at.pass.cpp | 4 +- .../sequences/array/front_back.pass.cpp | 2 +- .../sequences/array/indexing.pass.cpp | 2 +- .../sequences/array/iterators.pass.cpp | 2 +- .../containers/sequences/array/types.pass.cpp | 43 +- .../deque/deque.capacity/access.pass.cpp | 2 +- .../deque/deque.capacity/resize_size.pass.cpp | 2 + .../deque.capacity/resize_size_value.pass.cpp | 2 + .../sequences/deque/deque.cons/alloc.pass.cpp | 2 +- .../assign_initializer_list.pass.cpp | 2 +- .../sequences/deque/deque.cons/copy.pass.cpp | 2 +- .../deque/deque.cons/copy_alloc.pass.cpp | 2 +- .../deque/deque.cons/default.pass.cpp | 4 +- .../deque.cons/default_noexcept.pass.cpp | 9 +- .../deque/deque.cons/dtor_noexcept.pass.cpp | 8 +- .../deque.cons/initializer_list.pass.cpp | 2 +- .../initializer_list_alloc.pass.cpp | 2 +- .../deque/deque.cons/iter_iter.pass.cpp | 2 +- .../deque/deque.cons/iter_iter_alloc.pass.cpp | 2 +- .../sequences/deque/deque.cons/move.pass.cpp | 2 +- .../deque/deque.cons/move_alloc.pass.cpp | 2 +- .../deque/deque.cons/move_assign.pass.cpp | 2 +- .../deque.cons/move_assign_noexcept.pass.cpp | 4 +- .../deque/deque.cons/move_noexcept.pass.cpp | 4 +- .../deque/deque.cons/op_equal.pass.cpp | 2 +- .../op_equal_initializer_list.pass.cpp | 2 +- .../sequences/deque/deque.cons/size.pass.cpp | 2 +- .../deque/deque.cons/size_value.pass.cpp | 2 +- .../deque.cons/size_value_alloc.pass.cpp | 2 +- .../deque.modifiers/emplace_back.pass.cpp | 14 +- .../deque.modifiers/emplace_front.pass.cpp | 2 +- .../erase_iter.invalidation.pass.cpp | 8 +- .../deque/deque.modifiers/erase_iter.pass.cpp | 4 +- .../erase_iter_iter.invalidation.pass.cpp | 8 +- .../deque.modifiers/erase_iter_iter.pass.cpp | 4 +- .../pop_back.invalidation.pass.cpp | 6 +- .../deque/deque.modifiers/pop_back.pass.cpp | 2 +- .../pop_front.invalidation.pass.cpp | 6 +- .../deque/deque.modifiers/pop_front.pass.cpp | 2 +- .../deque/deque.modifiers/push_back.pass.cpp | 2 +- .../push_back_exception_safety.pass.cpp | 6 +- .../deque.modifiers/push_back_rvalue.pass.cpp | 2 +- .../deque/deque.modifiers/push_front.pass.cpp | 2 +- .../push_front_exception_safety.pass.cpp | 4 +- .../push_front_rvalue.pass.cpp | 2 +- .../deque/deque.special/copy.pass.cpp | 2 +- .../deque.special/copy_backward.pass.cpp | 2 +- .../deque/deque.special/move.pass.cpp | 2 +- .../deque.special/move_backward.pass.cpp | 2 +- .../deque/deque.special/swap.pass.cpp | 2 +- .../deque.special/swap_noexcept.pass.cpp | 9 +- .../sequences/deque/iterators.pass.cpp | 4 +- .../containers/sequences/deque/types.pass.cpp | 16 +- .../forwardlist.access/front.pass.cpp | 2 +- .../forwardlist.cons/alloc.pass.cpp | 2 +- .../forwardlist.cons/assign_copy.pass.cpp | 2 +- .../forwardlist.cons/assign_init.pass.cpp | 2 +- .../forwardlist.cons/assign_move.pass.cpp | 2 +- .../forwardlist.cons/assign_op_init.pass.cpp | 2 +- .../forwardlist.cons/assign_range.pass.cpp | 2 +- .../assign_size_value.pass.cpp | 2 +- .../forwardlist.cons/copy.pass.cpp | 2 +- .../forwardlist.cons/copy_alloc.pass.cpp | 2 +- .../forwardlist.cons/default.pass.cpp | 2 +- .../default_noexcept.pass.cpp | 9 +- .../forwardlist.cons/dtor_noexcept.pass.cpp | 8 +- .../forwardlist.cons/init.pass.cpp | 2 +- .../forwardlist.cons/init_alloc.pass.cpp | 2 +- .../forwardlist.cons/move.pass.cpp | 2 +- .../forwardlist.cons/move_alloc.pass.cpp | 2 +- .../move_assign_noexcept.pass.cpp | 4 +- .../forwardlist.cons/move_noexcept.pass.cpp | 4 +- .../forwardlist.cons/range.pass.cpp | 2 +- .../forwardlist.cons/range_alloc.pass.cpp | 2 +- .../forwardlist.cons/size.pass.cpp | 2 +- .../forwardlist.cons/size_value.pass.cpp | 2 +- .../size_value_alloc.pass.cpp | 2 +- .../forwardlist.iter/before_begin.pass.cpp | 2 +- .../forwardlist.iter/iterators.pass.cpp | 4 +- .../forwardlist.modifiers/clear.pass.cpp | 2 +- .../emplace_after.pass.cpp | 2 +- .../emplace_front.pass.cpp | 2 +- .../erase_after_many.pass.cpp | 2 +- .../erase_after_one.pass.cpp | 2 +- .../insert_after_const.pass.cpp | 2 +- .../insert_after_init.pass.cpp | 2 +- .../insert_after_range.pass.cpp | 2 +- .../insert_after_rv.pass.cpp | 2 +- .../insert_after_size_value.pass.cpp | 2 +- .../forwardlist.modifiers/pop_front.pass.cpp | 2 +- .../push_front_const.pass.cpp | 2 +- .../push_front_rv.pass.cpp | 2 +- .../resize_size.pass.cpp | 2 +- .../resize_size_value.pass.cpp | 21 +- .../forwardlist.ops/merge.pass.cpp | 2 +- .../forwardlist.ops/merge_pred.pass.cpp | 2 +- .../forwardlist.ops/remove.pass.cpp | 2 +- .../forwardlist.ops/remove_if.pass.cpp | 2 +- .../forwardlist.ops/reverse.pass.cpp | 2 +- .../forwardlist/forwardlist.ops/sort.pass.cpp | 2 +- .../forwardlist.ops/sort_pred.pass.cpp | 2 +- .../splice_after_flist.pass.cpp | 2 +- .../splice_after_range.pass.cpp | 2 +- .../forwardlist.ops/unique.pass.cpp | 2 +- .../forwardlist.ops/unique_pred.pass.cpp | 2 +- .../forwardlist.spec/member_swap.pass.cpp | 2 +- .../forwardlist.spec/non_member_swap.pass.cpp | 2 +- .../forwardlist.spec/swap_noexcept.pass.cpp | 10 +- .../sequences/forwardlist/incomplete.pass.cpp | 53 + .../sequences/forwardlist/max_size.pass.cpp | 2 +- .../sequences/forwardlist/types.pass.cpp | 16 +- .../sequences/list/iterators.pass.cpp | 2 +- .../list/list.capacity/resize_size.pass.cpp | 2 +- .../list.capacity/resize_size_value.pass.cpp | 2 +- .../list/list.cons/assign_copy.pass.cpp | 2 +- .../assign_initializer_list.pass.cpp | 2 +- .../list/list.cons/assign_move.pass.cpp | 2 +- .../sequences/list/list.cons/copy.pass.cpp | 2 +- .../list/list.cons/copy_alloc.pass.cpp | 2 +- .../sequences/list/list.cons/default.pass.cpp | 2 +- .../list/list.cons/default_noexcept.pass.cpp | 9 +- .../list.cons/default_stack_alloc.pass.cpp | 2 +- .../list/list.cons/dtor_noexcept.pass.cpp | 8 +- .../list/list.cons/initializer_list.pass.cpp | 2 +- .../list.cons/initializer_list_alloc.pass.cpp | 2 +- .../list/list.cons/input_iterator.pass.cpp | 2 +- .../sequences/list/list.cons/move.pass.cpp | 15 +- .../list/list.cons/move_alloc.pass.cpp | 2 +- .../list.cons/move_assign_noexcept.pass.cpp | 4 +- .../list/list.cons/move_noexcept.pass.cpp | 4 +- .../op_equal_initializer_list.pass.cpp | 2 +- .../list/list.cons/size_type.pass.cpp | 2 +- .../list/list.cons/size_value_alloc.pass.cpp | 2 +- .../list/list.modifiers/clear.pass.cpp | 2 +- .../list/list.modifiers/emplace.pass.cpp | 29 +- .../list/list.modifiers/emplace_back.pass.cpp | 2 +- .../list.modifiers/emplace_front.pass.cpp | 2 +- .../list/list.modifiers/erase_iter.pass.cpp | 2 +- .../list.modifiers/erase_iter_iter.pass.cpp | 2 +- .../insert_iter_initializer_list.pass.cpp | 2 +- .../insert_iter_iter_iter.pass.cpp | 223 +- .../insert_iter_rvalue.pass.cpp | 28 +- .../insert_iter_size_value.pass.cpp | 103 +- .../list.modifiers/insert_iter_value.pass.cpp | 115 +- .../list/list.modifiers/pop_back.pass.cpp | 15 +- .../list/list.modifiers/pop_front.pass.cpp | 2 +- .../list/list.modifiers/push_back.pass.cpp | 2 +- .../list.modifiers/push_back_rvalue.pass.cpp | 2 +- .../list/list.modifiers/push_front.pass.cpp | 2 +- .../list.modifiers/push_front_rvalue.pass.cpp | 2 +- .../sequences/list/list.ops/merge.pass.cpp | 2 +- .../list/list.ops/merge_comp.pass.cpp | 2 +- .../sequences/list/list.ops/remove.pass.cpp | 2 +- .../list/list.ops/remove_if.pass.cpp | 2 +- .../sequences/list/list.ops/reverse.pass.cpp | 2 +- .../sequences/list/list.ops/sort.pass.cpp | 2 +- .../list/list.ops/sort_comp.pass.cpp | 2 +- .../list/list.ops/splice_pos_list.pass.cpp | 23 +- .../list.ops/splice_pos_list_iter.pass.cpp | 23 +- .../splice_pos_list_iter_iter.pass.cpp | 23 +- .../sequences/list/list.ops/unique.pass.cpp | 2 +- .../list/list.ops/unique_pred.pass.cpp | 2 +- .../list/list.special/db_swap_1.pass.cpp | 59 - .../sequences/list/list.special/swap.pass.cpp | 12 +- .../list/list.special/swap_noexcept.pass.cpp | 9 +- .../containers/sequences/list/types.pass.cpp | 47 +- .../vector.bool/assign_copy.pass.cpp | 8 +- .../assign_initializer_list.pass.cpp | 2 +- .../vector.bool/assign_move.pass.cpp | 2 +- .../sequences/vector.bool/capacity.pass.cpp | 2 +- .../vector.bool/construct_default.pass.cpp | 6 +- .../vector.bool/construct_iter_iter.pass.cpp | 5 +- .../construct_iter_iter_alloc.pass.cpp | 5 +- .../vector.bool/construct_size.pass.cpp | 14 +- .../vector.bool/construct_size_value.pass.cpp | 9 +- .../construct_size_value_alloc.pass.cpp | 9 +- .../sequences/vector.bool/copy.pass.cpp | 14 +- .../sequences/vector.bool/copy_alloc.pass.cpp | 20 +- .../vector.bool/default_noexcept.pass.cpp | 9 +- .../vector.bool/dtor_noexcept.pass.cpp | 8 +- .../sequences/vector.bool/emplace.pass.cpp | 5 +- .../vector.bool/emplace_back.pass.cpp | 5 +- .../sequences/vector.bool/erase_iter.pass.cpp | 2 +- .../vector.bool/erase_iter_iter.pass.cpp | 2 +- .../vector.bool/initializer_list.pass.cpp | 2 +- .../initializer_list_alloc.pass.cpp | 2 +- .../insert_iter_initializer_list.pass.cpp | 2 +- .../insert_iter_iter_iter.pass.cpp | 2 +- .../insert_iter_size_value.pass.cpp | 2 +- .../vector.bool/insert_iter_value.pass.cpp | 2 +- .../sequences/vector.bool/iterators.pass.cpp | 2 +- .../sequences/vector.bool/move.pass.cpp | 2 +- .../sequences/vector.bool/move_alloc.pass.cpp | 2 +- .../vector.bool/move_assign_noexcept.pass.cpp | 9 +- .../vector.bool/move_noexcept.pass.cpp | 4 +- .../op_equal_initializer_list.pass.cpp | 2 +- .../sequences/vector.bool/push_back.pass.cpp | 2 +- .../vector.bool/reference.swap.pass.cpp | 39 + .../sequences/vector.bool/reserve.pass.cpp | 2 +- .../vector.bool/resize_size.pass.cpp | 2 +- .../vector.bool/resize_size_value.pass.cpp | 2 +- .../vector.bool/shrink_to_fit.pass.cpp | 2 +- .../sequences/vector.bool/swap.pass.cpp | 2 +- .../vector.bool/swap_noexcept.pass.cpp | 10 +- .../sequences/vector.bool/types.pass.cpp | 12 +- .../vector.bool/vector_bool.pass.cpp | 8 +- .../sequences/vector/contiguous.pass.cpp | 2 +- .../sequences/vector/iterators.pass.cpp | 2 +- .../sequences/vector/types.pass.cpp | 36 +- .../vector/vector.capacity/capacity.pass.cpp | 10 +- .../vector/vector.capacity/reserve.pass.cpp | 12 +- .../vector.capacity/resize_size.pass.cpp | 22 +- .../resize_size_value.pass.cpp | 14 +- .../vector.capacity/shrink_to_fit.pass.cpp | 20 +- .../vector/vector.capacity/swap.pass.cpp | 18 +- .../vector/vector.cons/assign_copy.pass.cpp | 2 +- .../assign_initializer_list.pass.cpp | 4 +- .../vector/vector.cons/assign_move.pass.cpp | 38 +- .../vector.cons/assign_size_value.pass.cpp | 4 +- .../vector.cons/construct_default.pass.cpp | 12 +- .../vector.cons/construct_iter_iter.pass.cpp | 7 +- .../construct_iter_iter_alloc.pass.cpp | 11 +- .../vector.cons/construct_size.pass.cpp | 19 +- .../vector.cons/construct_size_value.pass.cpp | 7 +- .../construct_size_value_alloc.pass.cpp | 8 +- .../vector/vector.cons/copy.pass.cpp | 34 +- .../vector/vector.cons/copy_alloc.pass.cpp | 8 +- .../vector.cons/default_noexcept.pass.cpp | 4 +- .../vector/vector.cons/dtor_noexcept.pass.cpp | 8 +- .../vector.cons/initializer_list.pass.cpp | 6 +- .../initializer_list_alloc.pass.cpp | 6 +- .../vector/vector.cons/move.pass.cpp | 44 +- .../vector/vector.cons/move_alloc.pass.cpp | 42 +- .../vector.cons/move_assign_noexcept.pass.cpp | 9 +- .../vector/vector.cons/move_noexcept.pass.cpp | 4 +- .../op_equal_initializer_list.pass.cpp | 6 +- .../vector/vector.data/data.pass.cpp | 33 +- .../vector/vector.data/data_const.pass.cpp | 31 +- .../vector/vector.modifiers/emplace.pass.cpp | 14 +- .../vector.modifiers/emplace_back.pass.cpp | 23 +- .../vector.modifiers/emplace_extra.pass.cpp | 18 +- .../vector.modifiers/erase_iter.pass.cpp | 18 +- .../vector.modifiers/erase_iter_db1.pass.cpp | 2 +- .../vector.modifiers/erase_iter_db2.pass.cpp | 2 +- .../vector.modifiers/erase_iter_iter.pass.cpp | 58 +- .../erase_iter_iter_db1.pass.cpp | 2 +- .../erase_iter_iter_db2.pass.cpp | 2 +- .../erase_iter_iter_db3.pass.cpp | 2 +- .../erase_iter_iter_db4.pass.cpp | 2 +- .../insert_iter_initializer_list.pass.cpp | 6 +- .../insert_iter_iter_iter.pass.cpp | 14 +- .../insert_iter_rvalue.pass.cpp | 8 +- .../insert_iter_size_value.pass.cpp | 14 +- .../insert_iter_value.pass.cpp | 12 +- .../vector/vector.modifiers/pop_back.pass.cpp | 8 +- .../vector.modifiers/push_back.pass.cpp | 32 +- .../push_back_exception_safety.pass.cpp | 8 +- .../push_back_rvalue.pass.cpp | 32 +- .../vector/vector.special/db_swap_1.pass.cpp | 2 +- .../vector/vector.special/swap.pass.cpp | 82 +- .../vector.special/swap_noexcept.pass.cpp | 10 +- ...set_allocator_requirement_test_templates.h | 354 +++ .../unord/iterator_difference_type.pass.cpp | 154 ++ .../unord/unord.map/bucket.pass.cpp | 2 +- .../unord/unord.map/bucket_size.pass.cpp | 2 +- .../containers/unord/unord.map/count.pass.cpp | 2 +- .../containers/unord/unord.map/eq.pass.cpp | 2 +- .../unord.map/equal_range_const.pass.cpp | 2 +- .../unord.map/equal_range_non_const.pass.cpp | 2 +- .../unord/unord.map/find_const.pass.cpp | 2 +- .../unord/unord.map/find_non_const.pass.cpp | 2 +- .../unord/unord.map/incomplete_type.pass.cpp | 37 + .../unord/unord.map/iterators.pass.cpp | 4 +- .../unord/unord.map/local_iterators.pass.cpp | 2 +- .../unord/unord.map/max_load_factor.pass.cpp | 5 + .../unord/unord.map/max_size.pass.cpp | 2 +- .../unord/unord.map/rehash.pass.cpp | 2 +- .../unord/unord.map/reserve.pass.cpp | 2 +- .../containers/unord/unord.map/types.pass.cpp | 2 +- .../unord.map.cnstr/allocator.pass.cpp | 4 +- .../unord.map.cnstr/assign_copy.pass.cpp | 2 +- .../unord.map.cnstr/assign_init.pass.cpp | 2 +- .../unord.map.cnstr/assign_move.pass.cpp | 2 +- .../compare_copy_constructible.fail.cpp | 32 + .../unord.map/unord.map.cnstr/copy.pass.cpp | 2 +- .../unord.map.cnstr/copy_alloc.pass.cpp | 2 +- .../unord.map.cnstr/default.pass.cpp | 2 +- .../unord.map.cnstr/default_noexcept.pass.cpp | 10 +- .../unord.map.cnstr/dtor_noexcept.pass.cpp | 9 +- .../hash_copy_constructible.fail.cpp | 32 + .../unord.map/unord.map.cnstr/init.pass.cpp | 2 +- .../unord.map.cnstr/init_size.pass.cpp | 2 +- .../unord.map.cnstr/init_size_hash.pass.cpp | 2 +- .../init_size_hash_equal.pass.cpp | 2 +- .../init_size_hash_equal_allocator.pass.cpp | 2 +- .../unord.map.cnstr/move_alloc.pass.cpp | 2 +- .../move_assign_noexcept.pass.cpp | 5 +- .../unord.map.cnstr/move_noexcept.pass.cpp | 5 +- .../unord.map/unord.map.cnstr/range.pass.cpp | 2 +- .../unord.map.cnstr/range_size.pass.cpp | 2 +- .../unord.map.cnstr/range_size_hash.pass.cpp | 2 +- .../range_size_hash_equal.pass.cpp | 2 +- .../range_size_hash_equal_allocator.pass.cpp | 2 +- .../unord.map/unord.map.cnstr/size.fail.cpp | 2 +- .../unord.map/unord.map.cnstr/size.pass.cpp | 2 +- .../unord.map.cnstr/size_hash.pass.cpp | 2 +- .../unord.map.cnstr/size_hash_equal.pass.cpp | 2 +- .../size_hash_equal_allocator.pass.cpp | 2 +- .../unord.map/unord.map.elem/at.pass.cpp | 2 +- .../unord.map/unord.map.elem/index.pass.cpp | 59 +- .../unord.map.elem/index_tuple.pass.cpp | 9 +- .../unord.map.modifiers/clear.pass.cpp | 2 +- .../unord.map.modifiers/emplace.pass.cpp | 2 +- .../unord.map.modifiers/emplace_hint.pass.cpp | 2 +- .../unord.map.modifiers/erase_range.pass.cpp | 2 +- ...nd_emplace_allocator_requirements.pass.cpp | 31 + .../insert_const_lvalue.pass.cpp | 105 +- .../insert_hint_const_lvalue.pass.cpp | 2 +- .../insert_hint_rvalue.pass.cpp | 33 +- .../unord.map.modifiers/insert_init.pass.cpp | 2 +- .../unord.map.modifiers/insert_range.pass.cpp | 2 +- .../insert_rvalue.pass.cpp | 36 +- .../unord.map.modifiers/try.emplace.pass.cpp | 1 - .../unord.map.swap/swap_noexcept.pass.cpp | 19 +- .../unord/unord.multimap/bucket.pass.cpp | 2 +- .../unord/unord.multimap/bucket_size.pass.cpp | 2 +- .../unord/unord.multimap/count.pass.cpp | 2 +- .../unord.multimap/db_iterators_7.pass.cpp | 2 +- .../unord.multimap/db_iterators_8.pass.cpp | 2 +- .../db_local_iterators_7.pass.cpp | 2 +- .../db_local_iterators_8.pass.cpp | 2 +- .../unord/unord.multimap/eq.pass.cpp | 2 +- .../unord.multimap/equal_range_const.pass.cpp | 2 +- .../equal_range_non_const.pass.cpp | 2 +- .../unord/unord.multimap/find_const.pass.cpp | 2 +- .../unord.multimap/find_non_const.pass.cpp | 2 +- .../unord/unord.multimap/incomplete.pass.cpp | 37 + .../unord/unord.multimap/iterators.pass.cpp | 2 +- .../unord/unord.multimap/load_factor.pass.cpp | 2 +- .../unord.multimap/local_iterators.pass.cpp | 2 +- .../unord.multimap/max_bucket_count.pass.cpp | 2 +- .../unord.multimap/max_load_factor.pass.cpp | 2 +- .../unord/unord.multimap/max_size.pass.cpp | 2 +- .../unord/unord.multimap/rehash.pass.cpp | 2 +- .../unord/unord.multimap/reserve.pass.cpp | 2 +- .../unord/unord.multimap/swap_member.pass.cpp | 2 +- .../unord/unord.multimap/types.pass.cpp | 2 +- .../unord.multimap.cnstr/allocator.pass.cpp | 4 +- .../unord.multimap.cnstr/assign_copy.pass.cpp | 2 +- .../unord.multimap.cnstr/assign_init.pass.cpp | 2 +- .../unord.multimap.cnstr/assign_move.pass.cpp | 2 +- .../compare_copy_constructible.fail.cpp | 32 + .../unord.multimap.cnstr/copy.pass.cpp | 2 +- .../unord.multimap.cnstr/copy_alloc.pass.cpp | 2 +- .../unord.multimap.cnstr/default.pass.cpp | 2 +- .../default_noexcept.pass.cpp | 10 +- .../dtor_noexcept.pass.cpp | 9 +- .../hash_copy_constructible.fail.cpp | 32 + .../unord.multimap.cnstr/init.pass.cpp | 2 +- .../unord.multimap.cnstr/init_size.pass.cpp | 2 +- .../init_size_hash.pass.cpp | 2 +- .../init_size_hash_equal.pass.cpp | 2 +- .../init_size_hash_equal_allocator.pass.cpp | 2 +- .../unord.multimap.cnstr/move.pass.cpp | 2 +- .../unord.multimap.cnstr/move_alloc.pass.cpp | 2 +- .../move_assign_noexcept.pass.cpp | 5 +- .../move_noexcept.pass.cpp | 5 +- .../unord.multimap.cnstr/range.pass.cpp | 2 +- .../unord.multimap.cnstr/range_size.pass.cpp | 2 +- .../range_size_hash.pass.cpp | 2 +- .../range_size_hash_equal.pass.cpp | 2 +- .../range_size_hash_equal_allocator.pass.cpp | 2 +- .../unord.multimap.cnstr/size.fail.cpp | 2 +- .../unord.multimap.cnstr/size.pass.cpp | 2 +- .../unord.multimap.cnstr/size_hash.pass.cpp | 2 +- .../size_hash_equal.pass.cpp | 2 +- .../size_hash_equal_allocator.pass.cpp | 2 +- .../unord.multimap.modifiers/clear.pass.cpp | 2 +- .../unord.multimap.modifiers/emplace.pass.cpp | 2 +- .../emplace_hint.pass.cpp | 2 +- .../erase_const_iter.pass.cpp | 4 +- .../erase_key.pass.cpp | 8 +- .../erase_range.pass.cpp | 2 +- .../insert_allocator_requirements.pass.cpp | 27 + .../insert_const_lvalue.pass.cpp | 2 +- .../insert_hint_const_lvalue.pass.cpp | 2 +- .../insert_hint_rvalue.pass.cpp | 33 +- .../insert_init.pass.cpp | 2 +- .../insert_range.pass.cpp | 2 +- .../insert_rvalue.pass.cpp | 32 +- .../swap_noexcept.pass.cpp | 20 +- .../swap_non_member.pass.cpp | 2 +- .../unord/unord.multiset/bucket.pass.cpp | 2 +- .../unord.multiset/bucket_count.pass.cpp | 2 +- .../unord/unord.multiset/bucket_size.pass.cpp | 2 +- .../unord/unord.multiset/clear.pass.cpp | 2 +- .../unord/unord.multiset/count.pass.cpp | 2 +- .../unord.multiset/db_iterators_7.pass.cpp | 2 +- .../unord.multiset/db_iterators_8.pass.cpp | 2 +- .../db_local_iterators_7.pass.cpp | 2 +- .../db_local_iterators_8.pass.cpp | 2 +- .../unord/unord.multiset/emplace.pass.cpp | 2 +- .../unord.multiset/emplace_hint.pass.cpp | 2 +- .../unord/unord.multiset/eq.pass.cpp | 2 +- .../unord.multiset/equal_range_const.pass.cpp | 2 +- .../equal_range_non_const.pass.cpp | 2 +- .../unord.multiset/erase_const_iter.pass.cpp | 4 +- .../unord/unord.multiset/erase_key.pass.cpp | 8 +- .../unord/unord.multiset/erase_range.pass.cpp | 2 +- .../unord/unord.multiset/find_const.pass.cpp | 2 +- .../unord.multiset/find_non_const.pass.cpp | 2 +- .../unord/unord.multiset/incomplete.pass.cpp | 38 + .../insert_allocator_requirements.pass.cpp | 25 + .../insert_const_lvalue.pass.cpp | 2 +- .../insert_hint_const_lvalue.pass.cpp | 2 +- .../insert_hint_rvalue.pass.cpp | 2 +- .../unord/unord.multiset/insert_init.pass.cpp | 2 +- .../unord.multiset/insert_range.pass.cpp | 2 +- .../unord.multiset/insert_rvalue.pass.cpp | 2 +- .../unord/unord.multiset/iterators.pass.cpp | 2 +- .../unord/unord.multiset/load_factor.pass.cpp | 2 +- .../unord.multiset/local_iterators.pass.cpp | 2 +- .../unord.multiset/max_bucket_count.pass.cpp | 2 +- .../unord.multiset/max_load_factor.pass.cpp | 2 +- .../unord/unord.multiset/max_size.pass.cpp | 2 +- .../unord/unord.multiset/rehash.pass.cpp | 2 +- .../unord/unord.multiset/reserve.pass.cpp | 2 +- .../unord/unord.multiset/swap_member.pass.cpp | 2 +- .../unord/unord.multiset/types.pass.cpp | 2 +- .../unord.multiset.cnstr/allocator.pass.cpp | 2 +- .../unord.multiset.cnstr/assign_copy.pass.cpp | 2 +- .../unord.multiset.cnstr/assign_init.pass.cpp | 2 +- .../unord.multiset.cnstr/assign_move.pass.cpp | 2 +- .../compare_copy_constructible.fail.cpp | 29 + .../unord.multiset.cnstr/copy.pass.cpp | 2 +- .../unord.multiset.cnstr/copy_alloc.pass.cpp | 2 +- .../unord.multiset.cnstr/default.pass.cpp | 2 +- .../default_noexcept.pass.cpp | 10 +- .../dtor_noexcept.pass.cpp | 9 +- .../hash_copy_constructible.fail.cpp | 29 + .../unord.multiset.cnstr/init.pass.cpp | 2 +- .../unord.multiset.cnstr/init_size.pass.cpp | 2 +- .../init_size_hash.pass.cpp | 2 +- .../init_size_hash_equal.pass.cpp | 2 +- .../init_size_hash_equal_allocator.pass.cpp | 2 +- .../unord.multiset.cnstr/move.pass.cpp | 2 +- .../unord.multiset.cnstr/move_alloc.pass.cpp | 2 +- .../move_assign_noexcept.pass.cpp | 5 +- .../move_noexcept.pass.cpp | 5 +- .../unord.multiset.cnstr/range.pass.cpp | 2 +- .../unord.multiset.cnstr/range_size.pass.cpp | 2 +- .../range_size_hash.pass.cpp | 2 +- .../range_size_hash_equal.pass.cpp | 2 +- .../range_size_hash_equal_allocator.pass.cpp | 2 +- .../unord.multiset.cnstr/size.fail.cpp | 2 +- .../unord.multiset.cnstr/size.pass.cpp | 2 +- .../unord.multiset.cnstr/size_hash.pass.cpp | 2 +- .../size_hash_equal.pass.cpp | 2 +- .../size_hash_equal_allocator.pass.cpp | 2 +- .../swap_noexcept.pass.cpp | 22 +- .../swap_non_member.pass.cpp | 2 +- .../unord/unord.set/bucket.pass.cpp | 2 +- .../unord/unord.set/bucket_count.pass.cpp | 2 +- .../unord/unord.set/bucket_size.pass.cpp | 2 +- .../containers/unord/unord.set/clear.pass.cpp | 2 +- .../containers/unord/unord.set/count.pass.cpp | 2 +- .../unord/unord.set/db_iterators_7.pass.cpp | 2 +- .../unord/unord.set/db_iterators_8.pass.cpp | 2 +- .../unord.set/db_local_iterators_7.pass.cpp | 2 +- .../unord.set/db_local_iterators_8.pass.cpp | 2 +- .../unord/unord.set/emplace.pass.cpp | 2 +- .../unord/unord.set/emplace_hint.pass.cpp | 2 +- .../containers/unord/unord.set/eq.pass.cpp | 2 +- .../unord.set/equal_range_const.pass.cpp | 2 +- .../unord.set/equal_range_non_const.pass.cpp | 2 +- .../unord/unord.set/erase_const_iter.pass.cpp | 4 +- .../unord/unord.set/erase_key.pass.cpp | 8 +- .../unord/unord.set/erase_range.pass.cpp | 2 +- .../unord/unord.set/find_const.pass.cpp | 2 +- .../unord/unord.set/find_non_const.pass.cpp | 2 +- .../unord/unord.set/incomplete.pass.cpp | 38 + ...nd_emplace_allocator_requirements.pass.cpp | 29 + .../unord.set/insert_const_lvalue.pass.cpp | 2 +- .../insert_hint_const_lvalue.pass.cpp | 2 +- .../unord.set/insert_hint_rvalue.pass.cpp | 2 +- .../unord/unord.set/insert_init.pass.cpp | 2 +- .../unord/unord.set/insert_range.pass.cpp | 2 +- .../unord/unord.set/insert_rvalue.pass.cpp | 2 +- .../unord/unord.set/iterators.pass.cpp | 2 +- .../unord/unord.set/load_factor.pass.cpp | 2 +- .../unord/unord.set/local_iterators.pass.cpp | 2 +- .../unord/unord.set/max_bucket_count.pass.cpp | 2 +- .../unord/unord.set/max_load_factor.pass.cpp | 2 +- .../unord/unord.set/max_size.pass.cpp | 2 +- .../unord/unord.set/rehash.pass.cpp | 2 +- .../unord/unord.set/reserve.pass.cpp | 2 +- .../unord/unord.set/swap_member.pass.cpp | 2 +- .../containers/unord/unord.set/types.pass.cpp | 2 +- .../unord.set.cnstr/allocator.pass.cpp | 2 +- .../unord.set.cnstr/assign_copy.pass.cpp | 2 +- .../unord.set.cnstr/assign_init.pass.cpp | 2 +- .../unord.set.cnstr/assign_move.pass.cpp | 2 +- .../compare_copy_constructible.fail.cpp | 29 + .../unord.set/unord.set.cnstr/copy.pass.cpp | 2 +- .../unord.set.cnstr/copy_alloc.pass.cpp | 2 +- .../unord.set.cnstr/default.pass.cpp | 2 +- .../unord.set.cnstr/default_noexcept.pass.cpp | 10 +- .../unord.set.cnstr/dtor_noexcept.pass.cpp | 9 +- .../hash_copy_constructible.fail.cpp | 29 + .../unord.set/unord.set.cnstr/init.pass.cpp | 2 +- .../unord.set.cnstr/init_size.pass.cpp | 2 +- .../unord.set.cnstr/init_size_hash.pass.cpp | 2 +- .../init_size_hash_equal.pass.cpp | 2 +- .../init_size_hash_equal_allocator.pass.cpp | 2 +- .../unord.set/unord.set.cnstr/move.pass.cpp | 2 +- .../unord.set.cnstr/move_alloc.pass.cpp | 2 +- .../move_assign_noexcept.pass.cpp | 5 +- .../unord.set.cnstr/move_noexcept.pass.cpp | 5 +- .../unord.set/unord.set.cnstr/range.pass.cpp | 2 +- .../unord.set.cnstr/range_size.pass.cpp | 2 +- .../unord.set.cnstr/range_size_hash.pass.cpp | 2 +- .../range_size_hash_equal.pass.cpp | 2 +- .../range_size_hash_equal_allocator.pass.cpp | 2 +- .../unord.set/unord.set.cnstr/size.pass.cpp | 2 +- .../unord.set.cnstr/size_hash.pass.cpp | 2 +- .../unord.set.cnstr/size_hash_equal.pass.cpp | 2 +- .../size_hash_equal_allocator.pass.cpp | 2 +- .../unord.set.swap/swap_noexcept.pass.cpp | 22 +- .../unord.set.swap/swap_non_member.pass.cpp | 2 +- test/std/depr/depr.c.headers/fenv_h.pass.cpp | 2 +- .../depr/depr.c.headers/inttypes_h.pass.cpp | 2 +- test/std/depr/depr.c.headers/math_h.pass.cpp | 51 +- .../depr/depr.c.headers/math_h_isinf.pass.cpp | 30 - .../depr/depr.c.headers/math_h_isnan.pass.cpp | 30 - .../std/depr/depr.c.headers/setjmp_h.pass.cpp | 1 + .../std/depr/depr.c.headers/stdarg_h.pass.cpp | 4 +- .../std/depr/depr.c.headers/stdint_h.pass.cpp | 8 +- test/std/depr/depr.c.headers/stdio_h.pass.cpp | 12 +- .../std/depr/depr.c.headers/string_h.pass.cpp | 11 + test/std/depr/depr.c.headers/time_h.pass.cpp | 2 +- test/std/depr/depr.c.headers/wchar_h.pass.cpp | 39 +- .../depr.istrstream.cons/ccp.pass.cpp | 1 + .../depr.istrstream.cons/ccp_size.pass.cpp | 1 + .../depr.istrstream.cons/cp.pass.cpp | 1 + .../depr.istrstream.cons/cp_size.pass.cpp | 1 + .../cp_size_mode.pass.cpp | 1 + .../depr.ostrstream.cons/default.pass.cpp | 1 + .../depr.strstream.cons/cp_size_mode.pass.cpp | 1 + .../depr.strstream.cons/default.pass.cpp | 1 + .../custom_alloc.pass.cpp | 2 +- .../overflow.pass.cpp | 32 + .../set.unexpected/get_unexpected.pass.cpp | 2 +- .../diagnostics/assertions/cassert.pass.cpp | 4 - test/std/diagnostics/errno/cerrno.pass.cpp | 4 - .../default_ctor.pass.cpp | 9 +- .../generic_category.pass.cpp | 14 + .../system_category.pass.cpp | 14 + .../syserr/syserr.hash/error_code.pass.cpp | 8 +- .../alg.random.sample/sample.pass.cpp | 12 +- .../algorithms/alg.search/search.pass.cpp | 7 +- .../Inputs/static_test_env/bad_symlink | 1 + .../Inputs/static_test_env/dir1/dir2/afile3 | 0 .../static_test_env/dir1/dir2/dir3/file5 | 0 .../Inputs/static_test_env/dir1/dir2/file4 | 0 .../static_test_env/dir1/dir2/symlink_to_dir3 | 1 + .../Inputs/static_test_env/dir1/file1 | 0 .../Inputs/static_test_env/dir1/file2 | 1 + .../Inputs/static_test_env/empty_file | 0 .../Inputs/static_test_env/non_empty_file | 1 + .../Inputs/static_test_env/symlink_to_dir | 1 + .../static_test_env/symlink_to_empty_file | 1 + .../directory_entry.cons.pass.cpp | 97 + .../directory_entry.mods.pass.cpp | 113 + .../directory_entry.obs/comparisons.pass.cpp | 82 + .../directory_entry.obs/path.pass.cpp | 89 + .../directory_entry.obs/status.pass.cpp | 51 + .../symlink_status.pass.cpp | 50 + .../directory_iterator.members/copy.pass.cpp | 59 + .../copy_assign.pass.cpp | 98 + .../directory_iterator.members/ctor.pass.cpp | 246 ++ .../default_ctor.pass.cpp | 36 + .../increment.pass.cpp | 117 + .../directory_iterator.members/move.pass.cpp | 62 + .../move_assign.pass.cpp | 116 + .../begin_end.pass.cpp | 61 + .../class.directory_iterator/types.pass.cpp | 38 + .../file_status.cons.pass.cpp | 61 + .../file_status.mods.pass.cpp | 50 + .../file_status.obs.pass.cpp | 46 + .../filesystem_error.members.pass.cpp | 103 + .../class.path/path.itr/iterator.pass.cpp | 106 + .../path.member/path.append.pass.cpp | 241 ++ .../path.member/path.assign/copy.pass.cpp | 37 + .../path.member/path.assign/move.pass.cpp | 43 + .../path.member/path.assign/source.pass.cpp | 153 ++ .../path.member/path.compare.pass.cpp | 126 + .../path.member/path.concat.pass.cpp | 277 +++ .../path.member/path.construct/copy.pass.cpp | 35 + .../path.construct/default.pass.cpp | 31 + .../path.member/path.construct/move.pass.cpp | 41 + .../path.construct/source.pass.cpp | 83 + .../path.decompose/path.decompose.pass.cpp | 198 ++ .../generic_string_alloc.pass.cpp | 57 + .../path.generic.obs/named_overloads.pass.cpp | 63 + .../path.member/path.modifiers/clear.pass.cpp | 45 + .../path.modifiers/make_preferred.pass.cpp | 55 + .../path.modifiers/remove_filename.pass.cpp | 72 + .../path.modifiers/replace_extension.pass.cpp | 73 + .../path.modifiers/replace_filename.pass.cpp | 69 + .../path.member/path.modifiers/swap.pass.cpp | 81 + .../path.native.obs/c_str.pass.cpp | 43 + .../path.native.obs/named_overloads.pass.cpp | 63 + .../path.native.obs/native.pass.cpp | 40 + .../path.native.obs/operator_string.pass.cpp | 47 + .../path.native.obs/string_alloc.pass.cpp | 138 ++ .../tested_in_path_decompose.pass.cpp | 32 + .../path.nonmember/append_op.pass.cpp | 33 + .../comparison_ops_tested_elsewhere.pass.cpp | 14 + .../hash_value_tested_elswhere.pass.cpp | 14 + .../path.nonmember/path.factory.pass.cpp | 53 + .../path.nonmember/path.io.pass.cpp | 66 + .../path.io.unicode_bug.pass.cpp | 69 + .../class.path/path.nonmember/swap.pass.cpp | 50 + .../filesystem/class.path/synop.pass.cpp | 39 + .../rec.dir.itr.members/copy.pass.cpp | 79 + .../rec.dir.itr.members/copy_assign.pass.cpp | 158 ++ .../rec.dir.itr.members/ctor.pass.cpp | 240 ++ .../rec.dir.itr.members/depth.pass.cpp | 66 + .../disable_recursion_pending.pass.cpp | 43 + .../rec.dir.itr.members/increment.pass.cpp | 240 ++ .../rec.dir.itr.members/move.pass.cpp | 80 + .../rec.dir.itr.members/move_assign.pass.cpp | 169 ++ .../rec.dir.itr.members/pop.pass.cpp | 93 + .../recursion_pending.pass.cpp | 162 ++ .../rec.dir.itr.nonmembers/begin_end.pass.cpp | 61 + .../fs.enum/check_bitmask_types.hpp | 75 + .../fs.enum/enum.copy_options.pass.cpp | 64 + .../fs.enum/enum.directory_options.pass.cpp | 46 + .../fs.enum/enum.file_type.pass.cpp | 48 + .../filesystem/fs.enum/enum.perms.pass.cpp | 68 + .../fs.error.report/tested_elsewhere.pass.cpp | 12 + .../file_time_type.pass.cpp | 31 + .../fs.op.absolute/absolute.pass.cpp | 117 + .../fs.op.canonical/canonical.pass.cpp | 120 + .../fs.op.funcs/fs.op.copy/copy.pass.cpp | 251 ++ .../fs.op.copy_file/copy_file.pass.cpp | 164 ++ .../fs.op.copy_symlink/copy_symlink.pass.cpp | 108 + .../create_directories.pass.cpp | 70 + .../create_directory.pass.cpp | 104 + .../create_directory_with_attributes.pass.cpp | 104 + .../create_directory_symlink.pass.cpp | 81 + .../create_hard_link.pass.cpp | 90 + .../create_symlink.pass.cpp | 92 + .../fs.op.current_path/current_path.pass.cpp | 93 + .../fs.op.equivalent/equivalent.pass.cpp | 88 + .../fs.op.funcs/fs.op.exists/exists.pass.cpp | 88 + .../fs.op.file_size/file_size.pass.cpp | 79 + .../fs.op.hard_lk_ct/hard_link_count.pass.cpp | 86 + .../is_block_file.pass.cpp | 84 + .../is_character_file.pass.cpp | 84 + .../fs.op.is_directory/is_directory.pass.cpp | 91 + .../fs.op.is_empty/is_empty.pass.cpp | 80 + .../fs.op.is_fifo/is_fifo.pass.cpp | 84 + .../fs.op.is_other/is_other.pass.cpp | 84 + .../is_regular_file.pass.cpp | 87 + .../fs.op.is_socket/is_socket.pass.cpp | 84 + .../fs.op.is_symlink/is_symlink.pass.cpp | 105 + .../last_write_time.pass.cpp | 361 +++ .../fs.op.permissions/permissions.pass.cpp | 158 ++ .../fs.op.read_symlink/read_symlink.pass.cpp | 100 + .../fs.op.funcs/fs.op.remove/remove.pass.cpp | 97 + .../fs.op.remove_all/remove_all.pass.cpp | 141 ++ .../fs.op.funcs/fs.op.rename/rename.pass.cpp | 125 + .../fs.op.resize_file/resize_file.pass.cpp | 109 + .../fs.op.funcs/fs.op.space/space.pass.cpp | 127 + .../fs.op.funcs/fs.op.status/status.pass.cpp | 159 ++ .../fs.op.status_known/status_known.pass.cpp | 59 + .../symlink_status.pass.cpp | 192 ++ .../system_complete.pass.cpp | 58 + .../temp_directory_path.pass.cpp | 110 + .../fs.req.macros/feature_macro.pass.cpp | 24 + .../fs.req.namespace/namespace.pass.cpp | 24 + .../std/experimental/filesystem/lit.local.cfg | 3 + .../default.pass.cpp | 6 +- .../func.searchers.boyer_moore/hash.pass.cpp | 8 +- .../hash.pred.pass.cpp | 8 +- .../func.searchers.boyer_moore/pred.pass.cpp | 8 +- .../default.pass.cpp | 6 +- .../hash.pass.cpp | 8 +- .../hash.pred.pass.cpp | 8 +- .../pred.pass.cpp | 8 +- .../func.searchers.default/default.pass.cpp | 9 +- .../default.pred.pass.cpp | 9 +- .../make_default_searcher.pass.cpp | 2 +- .../make_default_searcher.pred.pass.cpp | 2 +- .../iterator/nothing_to_do.pass.cpp | 12 + .../ostream_joiner.cons.pass.cpp | 58 + .../make_ostream_joiner.pass.cpp | 53 + .../ostream_joiner.op.assign.pass.cpp | 120 + .../ostream_joiner.op.postincrement.pass.cpp | 46 + .../ostream_joiner.op.pretincrement.pass.cpp | 46 + .../ostream_joiner.op.star.pass.cpp | 46 + .../assign.pass.cpp | 29 + .../copy.pass.cpp | 48 + .../default.pass.cpp | 49 + .../memory_resource_convert.pass.cpp | 45 + .../other_alloc.pass.cpp | 57 + .../equal.pass.cpp | 134 ++ .../not_equal.pass.cpp | 105 + .../allocate.pass.cpp | 112 + .../construct_pair.pass.cpp | 53 + .../construct_pair_const_lvalue_pair.pass.cpp | 112 + .../construct_pair_rvalue.pass.cpp | 109 + .../construct_pair_values.pass.cpp | 110 + .../construct_piecewise_pair.pass.cpp | 130 ++ .../construct_types.pass.cpp | 190 ++ .../deallocate.pass.cpp | 62 + .../destroy.pass.cpp | 52 + .../resource.pass.cpp | 57 + ...ct_on_container_copy_construction.pass.cpp | 53 + .../nothing_to_do.pass.cpp | 10 + .../nothing_to_do.pass.cpp | 10 + .../alloc_copy.pass.cpp | 53 + .../alloc_move.pass.cpp | 44 + .../default.pass.cpp | 40 + .../do_allocate_and_deallocate.pass.cpp | 115 + .../do_is_equal.pass.cpp | 83 + .../overview.pass.cpp | 39 + .../header_deque_synop.pass.cpp | 37 + .../header_forward_list_synop.pass.cpp | 37 + .../header_list_synop.pass.cpp | 37 + .../header_map_synop.pass.cpp | 69 + .../header_regex_synop.pass.cpp | 57 + .../header_set_synop.pass.cpp | 67 + .../header_string_synop.pass.cpp | 73 + .../header_unordered_map_synop.pass.cpp | 87 + .../header_unordered_set_synop.pass.cpp | 85 + .../header_vector_synop.pass.cpp | 37 + .../default_resource.pass.cpp | 74 + .../new_delete_resource.pass.cpp | 102 + .../null_memory_resource.pass.cpp | 118 + .../nothing_to_do.pass.cpp | 13 + .../memory/memory.resource/construct.fail.cpp | 25 + .../memory.resource.eq/equal.pass.cpp | 76 + .../memory.resource.eq/not_equal.pass.cpp | 75 + .../nothing_to_do.pass.cpp | 10 + .../protected_members.fail.cpp | 27 + .../memory.resource.public/allocate.pass.cpp | 89 + .../deallocate.pass.cpp | 74 + .../memory.resource.public/dtor.pass.cpp | 59 + .../memory.resource.public/is_equal.pass.cpp | 93 + .../memory/nothing_to_do.pass.cpp | 13 + .../default.pass.cpp | 4 +- .../derive.pass.cpp | 6 +- .../optional.comp_with_t/equal.pass.cpp | 11 +- .../optional.comp_with_t/greater.pass.cpp | 8 +- .../greater_equal.pass.cpp | 8 +- .../optional.comp_with_t/less_equal.pass.cpp | 8 +- .../optional.comp_with_t/less_than.pass.cpp | 8 +- .../optional.comp_with_t/not_equal.pass.cpp | 11 +- .../optional/optional.hash/hash.pass.cpp | 3 +- .../optional.inplace/in_place_t.pass.cpp | 10 +- .../optional/optional.nullops/equal.pass.cpp | 8 +- .../optional.nullops/greater.pass.cpp | 6 +- .../optional.nullops/greater_equal.pass.cpp | 6 +- .../optional.nullops/less_equal.pass.cpp | 2 +- .../optional.nullops/less_than.pass.cpp | 6 +- .../optional.nullops/not_equal.pass.cpp | 8 +- .../optional.nullopt/nullopt_t.pass.cpp | 9 +- .../assign_value.pass.cpp | 7 +- .../optional.object.assign/copy.pass.cpp | 7 +- .../optional.object.assign/emplace.pass.cpp | 7 +- .../emplace_initializer_list.pass.cpp | 9 +- .../optional.object.assign/move.pass.cpp | 7 +- .../optional.object.assign/nullopt_t.pass.cpp | 7 +- .../optional.object.ctor/copy.pass.cpp | 7 +- .../optional.object.ctor/default.pass.cpp | 7 +- .../optional.object.ctor/in_place_t.pass.cpp | 8 +- .../initializer_list.pass.cpp | 22 +- .../optional.object.ctor/move.pass.cpp | 8 +- .../optional.object.ctor/nullopt_t.pass.cpp | 7 +- .../optional.object.dtor/dtor.pass.cpp | 7 +- .../optional.object.observe/bool.pass.cpp | 3 +- .../dereference.pass.cpp | 7 +- .../dereference_const.pass.cpp | 7 +- .../optional.object.observe/op_arrow.pass.cpp | 7 +- .../op_arrow_const.pass.cpp | 7 +- .../optional.object.observe/value.pass.cpp | 7 +- .../value_const.fail.cpp | 9 +- .../value_const.pass.cpp | 7 +- .../optional.object.observe/value_or.pass.cpp | 7 +- .../value_or_const.pass.cpp | 7 +- .../optional.object.swap/swap.pass.cpp | 8 +- .../optional_const_void.fail.cpp | 5 +- .../optional_not_destructible.fail.cpp | 9 +- ...ptional_not_noexcept_destructible.fail.cpp | 9 +- .../optional.object/optional_void.fail.cpp | 5 +- .../optional/optional.object/types.pass.cpp | 7 +- .../optional/optional.relops/equal.pass.cpp | 9 +- .../optional.relops/greater_equal.pass.cpp | 11 +- .../optional.relops/greater_than.pass.cpp | 11 +- .../optional.relops/less_equal.pass.cpp | 11 +- .../optional.relops/less_than.pass.cpp | 11 +- .../optional.relops/not_equal.pass.cpp | 9 +- .../optional.specalg/make_optional.pass.cpp | 7 +- .../optional/optional.specalg/swap.pass.cpp | 8 +- .../optional_const_in_place_t.fail.cpp | 5 +- .../optional_const_lvalue_ref.fail.cpp | 5 +- .../optional_const_nullopt_t.fail.cpp | 7 +- .../optional.syn/optional_in_place_t.fail.cpp | 5 +- ...ptional_includes_initializer_list.pass.cpp | 3 +- .../optional.syn/optional_lvalue_ref.fail.cpp | 5 +- .../optional.syn/optional_nullopt_t.fail.cpp | 7 +- .../optional.syn/optional_rvalue_ref.fail.cpp | 5 +- .../string.view.access/at.pass.cpp | 16 +- .../string.view.access/back.pass.cpp | 8 +- .../string.view.access/data.pass.cpp | 6 +- .../string.view.access/front.pass.cpp | 8 +- .../string.view.access/index.pass.cpp | 6 +- .../string.view.capacity/capacity.pass.cpp | 6 +- .../opeq.string_view.pointer.pass.cpp | 2 +- .../opeq.string_view.string.pass.cpp | 6 +- .../opge.string_view.pointer.pass.cpp | 2 +- .../opgt.string_view.pointer.pass.cpp | 2 +- .../ople.string_view.pointer.pass.cpp | 2 +- .../oplt.string_view.pointer.pass.cpp | 2 +- .../opne.string_view.pointer.pass.cpp | 2 +- .../string.view.cons/default.pass.cpp | 2 +- .../string.view.cons/from_literal.pass.cpp | 4 +- .../string.view.cons/from_ptr_len.pass.cpp | 4 +- .../string.view.cons/from_string.pass.cpp | 8 +- .../string.view.cons/from_string1.fail.cpp | 2 +- .../string.view.cons/from_string2.fail.cpp | 2 +- .../string.view.iterators/begin.pass.cpp | 8 +- .../string.view.iterators/end.pass.cpp | 8 +- .../string.view.iterators/rbegin.pass.cpp | 6 +- .../string.view.iterators/rend.pass.cpp | 8 +- .../string.view.modifiers/clear.pass.cpp | 4 +- .../remove_prefix.pass.cpp | 8 +- .../remove_suffix.pass.cpp | 8 +- .../string.view.modifiers/swap.pass.cpp | 6 +- .../string.view.nonmem/quoted.pass.cpp | 14 +- .../string.view.ops/basic_string.pass.cpp | 6 +- .../string.view.ops/compare.pointer.pass.cpp | 2 +- .../compare.pointer_size.pass.cpp | 24 +- .../compare.size_size_sv.pass.cpp | 25 +- ...compare.size_size_sv_pointer_size.pass.cpp | 34 +- .../compare.size_size_sv_size_size.pass.cpp | 33 +- .../string.view.ops/compare.sv.pass.cpp | 10 +- .../string.view/string.view.ops/copy.pass.cpp | 30 +- .../string.view.ops/substr.pass.cpp | 32 +- .../string.view.ops/to_string.pass.cpp | 8 +- .../meta/meta.type.synop/includes.pass.cpp | 7 +- .../meta/meta.type.synop/meta.rel.pass.cpp | 7 +- .../meta.type.synop/meta.unary.cat.pass.cpp | 7 +- .../meta.type.synop/meta.unary.comp.pass.cpp | 7 +- .../meta.type.synop/meta.unary.prop.pass.cpp | 7 +- .../meta.unary.prop.query.pass.cpp | 6 +- .../assign.pass.cpp | 24 + .../assign_convertible_element_type.pass.cpp | 34 + ...ssign_convertible_propagate_const.pass.cpp | 25 + .../assign_element_type.pass.cpp | 34 + .../move_assign.pass.cpp | 32 + .../move_assign_convertible.pass.cpp | 33 + ...ssign_convertible_propagate_const.pass.cpp | 33 + ...rtible_element_type.explicit.ctor.pass.cpp | 28 + ...le_element_type.non-explicit.ctor.pass.cpp | 32 + ...ertible_propagate_const.copy_ctor.pass.cpp | 26 + ...ropagate_const.explicit.move_ctor.pass.cpp | 28 + ...ertible_propagate_const.move_ctor.pass.cpp | 31 + .../propagate_const.ctors/copy_ctor.pass.cpp | 24 + .../element_type.explicit.ctor.pass.cpp | 28 + .../element_type.non-explicit.ctor.pass.cpp} | 23 +- .../propagate_const.ctors/move_ctor.pass.cpp} | 25 +- .../dereference.pass.cpp | 34 + ...xplicit_operator_element_type_ptr.pass.cpp | 24 + .../get.pass.cpp | 34 + .../op_arrow.pass.cpp | 34 + .../operator_element_type_ptr.pass.cpp | 35 + .../dereference.pass.cpp | 29 + ...xplicit_operator_element_type_ptr.pass.cpp | 26 + .../propagate_const.observers/get.pass.cpp | 29 + .../op_arrow.pass.cpp | 29 + .../operator_element_type_ptr.pass.cpp | 28 + .../propagate_const.class/swap.pass.cpp | 32 + .../propagate_const.nonmembers/hash.pass.cpp | 44 + .../equal_to.pass.cpp | 36 + .../greater.pass.cpp | 38 + .../greater_equal.pass.cpp | 38 + .../less.pass.cpp | 38 + .../less_equal.pass.cpp | 38 + .../not_equal_to.pass.cpp | 36 + .../propagate_const.relops/equal.pass.cpp | 64 + .../greater_equal.pass.cpp | 54 + .../greater_than.pass.cpp | 50 + .../less_equal.pass.cpp | 55 + .../propagate_const.relops/less_than.pass.cpp | 50 + .../propagate_const.relops/not_equal.pass.cpp | 62 + .../propagate_const.nonmembers/swap.pass.cpp | 31 + .../tuple.apply/constexpr_types.pass.cpp | 5 - .../tuple/tuple.apply/return_type.pass.cpp | 56 +- .../file.streams/c.files/cinttypes.pass.cpp | 2 +- .../file.streams/c.files/cstdio.pass.cpp | 9 +- .../file.streams/c.files/gets.fail.cpp | 7 +- .../ext.manip/get_time.pass.cpp | 4 +- .../ext.manip/put_time.pass.cpp | 4 +- .../istream.unformatted/ignore_0xff.pass.cpp | 4 +- .../istream.unformatted/seekg_off.pass.cpp | 2 +- .../{minus1.pass => minus1.pass.cpp} | 41 +- .../quoted.manip/quoted.pass.cpp | 167 +- .../quoted.manip/quoted_char.fail.cpp | 8 +- .../quoted.manip/quoted_traits.fail.cpp | 8 +- .../ios/basic.ios.members/move.pass.cpp | 10 +- .../{narow.pass.cpp => narrow.pass.cpp} | 0 .../ios/basic.ios.members/swap.pass.cpp | 10 +- .../streambuf.pub.get/sgetn.pass.cpp | 2 +- .../streambuf.pub.pback/sputbackc.pass.cpp | 2 +- .../streambuf.pub.pback/sungetc.pass.cpp | 2 +- .../streambuf.pub.put/sputc.pass.cpp | 2 +- .../streambuf.pub.put/sputn.pass.cpp | 2 +- .../iterator.container/data.pass.cpp | 10 +- .../iterator.container/empty.pass.cpp | 10 +- .../iterator.container/size.pass.cpp | 10 +- .../bidirectional_iterator_tag.pass.cpp | 1 + .../forward_iterator_tag.pass.cpp | 1 + .../input_iterator_tag.pass.cpp | 1 + .../output_iterator_tag.pass.cpp | 1 + .../random_access_iterator_tag.pass.cpp | 1 + .../iterator.range/begin-end.pass.cpp | 10 +- .../back.insert.iterator/types.pass.cpp | 4 +- .../front.insert.iterator/types.pass.cpp | 4 +- .../insert.iterator/types.pass.cpp | 4 +- .../move.iterator/types.pass.cpp | 45 +- .../make_reverse_iterator.pass.cpp | 7 +- .../reverse.iter.opref/op_arrow.pass.cpp | 6 +- .../istream.iterator.cons/default.fail.cpp | 6 +- .../istream.iterator.cons/default.pass.cpp | 6 +- .../istream.iterator.ops/arrow.pass.cpp | 2 + .../istream.iterator/types.pass.cpp | 3 + .../istreambuf.iterator.cons/default.pass.cpp | 8 +- .../istreambuf.iterator/types.pass.cpp | 23 +- .../ostream.pass.cpp | 20 +- ..._delem.pass.cpp => ostream_delim.pass.cpp} | 13 + .../cstdint/cstdint.syn/cstdint.pass.cpp | 8 +- .../new_array_nothrow_replace.pass.cpp | 8 +- .../new_array_replace.pass.cpp | 8 +- .../new.delete.placement/new_array.pass.cpp | 12 +- .../new.delete/new.delete.single/new.pass.cpp | 1 + .../new_nothrow_replace.pass.cpp | 7 +- .../new.delete.single/new_replace.pass.cpp | 4 +- ...sized_delete_calls_unsized_delete.pass.cpp | 4 + .../sized_delete_fsizeddeallocation.sh.cpp | 3 + .../except.nested/rethrow_if_nested.pass.cpp | 4 +- .../except.nested/throw_with_nested.pass.cpp | 8 +- .../propagation/current_exception.pass.cpp | 4 +- .../const_data_members.pass.cpp | 4 +- .../denorm_min.pass.cpp | 11 + .../support.runtime/csetjmp.pass.cpp | 1 + .../support.runtime/cstdarg.pass.cpp | 4 +- .../support.runtime/ctime.pass.cpp | 9 +- .../support.types/nullptr_t.pass.cpp | 4 + .../support.types/offsetof.pass.cpp | 6 +- .../localization/c.locales/clocale.pass.cpp | 1 + .../locale.collate.byname/compare.pass.cpp | 17 - .../locale.collate.byname/transform.pass.cpp | 15 - .../classic_table.pass.cpp | 6 +- .../locale.ctype.byname/types.pass.cpp | 13 - .../locale.moneypunct/money_base.pass.cpp | 14 +- .../facet.num.put.members/put_double.pass.cpp | 3 + .../put_long_double.pass.cpp | 8 +- .../facet.num.get.members/get_double.pass.cpp | 24 + .../facet.num.get.members/get_float.pass.cpp | 26 + .../get_long_double.pass.cpp | 25 + .../test_min_max.pass.cpp | 8 +- .../get_monthname.pass.cpp | 17 - .../get_monthname_wide.pass.cpp | 17 - .../get_one_wide.pass.cpp | 16 +- .../conversions.string/ctor_copy.pass.cpp | 31 + .../locale/locale.cons/assign.pass.cpp | 18 +- .../locale/locale.cons/char_pointer.pass.cpp | 17 +- .../locales/locale/locale.cons/copy.pass.cpp | 18 +- .../locale_char_pointer_cat.pass.cpp | 18 +- .../locale.cons/locale_facetptr.pass.cpp | 23 +- .../locale.cons/locale_locale_cat.pass.cpp | 18 +- .../locale.cons/locale_string_cat.pass.cpp | 19 +- .../locale/locale.cons/string.pass.cpp | 18 +- .../locale.facet/tested_elsewhere.pass.cpp | 12 + .../locale.id/tested_elsewhere.pass.cpp | 12 + test/std/numerics/c.math/cmath.pass.cpp | 75 +- test/std/numerics/c.math/cmath_isinf.pass.cpp | 30 - test/std/numerics/c.math/cmath_isnan.pass.cpp | 30 - .../numerics/cfenv/cfenv.syn/cfenv.pass.cpp | 2 + test/std/numerics/complex.number/cases.h | 2 +- .../complex.number/cmplx.over/imag.pass.cpp | 4 +- .../complex.number/cmplx.over/real.pass.cpp | 4 +- .../complex.literals/literals.pass.cpp | 8 +- .../complex.literals/literals1.fail.cpp | 6 +- .../complex.literals/literals1.pass.cpp | 6 +- .../complex.literals/literals2.pass.cpp | 6 +- .../divide_equal_complex.pass.cpp | 6 +- .../plus_equal_complex.pass.cpp | 2 +- .../times_equal_complex.pass.cpp | 2 +- .../complex_divide_complex.pass.cpp | 16 +- .../complex_times_complex.pass.cpp | 16 +- .../complex.transcendentals/acos.pass.cpp | 50 +- .../complex.transcendentals/acosh.pass.cpp | 44 +- .../complex.transcendentals/asin.pass.cpp | 50 +- .../complex.transcendentals/asinh.pass.cpp | 48 +- .../complex.transcendentals/atan.pass.cpp | 6 +- .../complex.transcendentals/atanh.pass.cpp | 58 +- .../complex.transcendentals/cos.pass.cpp | 6 +- .../complex.transcendentals/cosh.pass.cpp | 36 +- .../complex.transcendentals/exp.pass.cpp | 36 +- .../complex.transcendentals/log.pass.cpp | 44 +- .../complex.transcendentals/log10.pass.cpp | 6 +- .../pow_complex_complex.pass.cpp | 6 +- .../pow_complex_scalar.pass.cpp | 6 +- .../pow_scalar_complex.pass.cpp | 6 +- .../complex.transcendentals/sin.pass.cpp | 6 +- .../complex.transcendentals/sinh.pass.cpp | 42 +- .../complex.transcendentals/sqrt.pass.cpp | 30 +- .../complex.transcendentals/tan.pass.cpp | 6 +- .../complex.transcendentals/tanh.pass.cpp | 30 +- .../complex.value.ops/abs.pass.cpp | 6 +- .../complex.value.ops/arg.pass.cpp | 46 +- .../complex.value.ops/norm.pass.cpp | 6 +- .../complex.value.ops/polar.pass.cpp | 6 +- .../complex.value.ops/proj.pass.cpp | 16 +- .../valarray.unary/not.pass.cpp | 2 +- .../numerics/rand/rand.device/ctor.pass.cpp | 63 +- .../numerics/rand/rand.device/eval.pass.cpp | 6 +- .../rand.dist.bern.bernoulli/eval.pass.cpp | 12 +- .../eval_param.pass.cpp | 12 +- .../rand.dist.bern.bin/eval.pass.cpp | 926 ++++---- .../rand.dist.bern.bin/eval_param.pass.cpp | 18 +- .../rand.dist.bern.geo/eval.pass.cpp | 504 ++-- .../rand.dist.bern.geo/eval_param.pass.cpp | 18 +- .../rand.dist.bern.negbin/eval.pass.cpp | 500 ++-- .../rand.dist.bern.negbin/eval_param.pass.cpp | 18 +- .../rand.dist.norm.chisq/eval.pass.cpp | 18 +- .../rand.dist.norm.chisq/eval_param.pass.cpp | 18 +- .../rand.dist.norm.lognormal/eval.pass.cpp | 440 ++-- .../eval_param.pass.cpp | 451 ++-- .../rand.dist.norm.normal/eval.pass.cpp | 6 +- .../rand.dist.norm.normal/eval_param.pass.cpp | 6 +- .../rand.dist.norm.t/eval.pass.cpp | 18 +- .../rand.dist.norm.t/eval_param.pass.cpp | 18 +- .../rand.dist.pois.exp/eval.pass.cpp | 18 +- .../rand.dist.pois.exp/eval_param.pass.cpp | 6 +- .../rand.dist.pois.extreme/eval.pass.cpp | 328 +-- .../eval_param.pass.cpp | 336 +-- .../rand.dist.pois.gamma/eval.pass.cpp | 18 +- .../rand.dist.pois.gamma/eval_param.pass.cpp | 18 +- .../rand.dist.pois.poisson/eval.pass.cpp | 18 +- .../eval_param.pass.cpp | 18 +- .../rand.dist.pois.weibull/eval.pass.cpp | 18 +- .../eval_param.pass.cpp | 18 +- .../rand.dist.samp.pconst/eval.pass.cpp | 1351 +++++------ .../rand.dist.samp.pconst/eval_param.pass.cpp | 7 +- .../rand.dist.samp.plinear/eval.pass.cpp | 615 ++--- .../eval_param.pass.cpp | 10 +- .../rand.dist.uni.int/eval.pass.cpp | 60 +- .../rand.dist.uni.int/eval_param.pass.cpp | 6 +- .../rand.dist.uni.real/eval.pass.cpp | 66 +- .../rand.dist.uni.real/eval_param.pass.cpp | 6 +- test/std/re/re.alg/re.alg.match/awk.pass.cpp | 1 + .../std/re/re.alg/re.alg.match/basic.fail.cpp | 22 +- .../std/re/re.alg/re.alg.match/basic.pass.cpp | 1 + test/std/re/re.alg/re.alg.match/ecma.pass.cpp | 1 + .../std/re/re.alg/re.alg.match/egrep.pass.cpp | 1 + .../re/re.alg/re.alg.match/extended.pass.cpp | 1 + test/std/re/re.alg/re.alg.match/grep.pass.cpp | 1 + .../re.alg.match/lookahead_capture.pass.cpp | 3 +- .../parse_curly_brackets.pass.cpp | 1 + .../re/re.alg/re.alg.replace/test1.pass.cpp | 1 + .../re/re.alg/re.alg.replace/test2.pass.cpp | 1 + .../re/re.alg/re.alg.replace/test3.pass.cpp | 1 + .../re/re.alg/re.alg.replace/test4.pass.cpp | 1 + .../re/re.alg/re.alg.replace/test5.pass.cpp | 1 + .../re/re.alg/re.alg.replace/test6.pass.cpp | 1 + test/std/re/re.alg/re.alg.search/awk.pass.cpp | 1 + .../re/re.alg/re.alg.search/backup.pass.cpp | 1 + .../re/re.alg/re.alg.search/basic.fail.cpp | 22 +- .../re/re.alg/re.alg.search/basic.pass.cpp | 1 + .../std/re/re.alg/re.alg.search/ecma.pass.cpp | 1 + .../re/re.alg/re.alg.search/egrep.pass.cpp | 1 + .../re/re.alg/re.alg.search/extended.pass.cpp | 1 + .../std/re/re.alg/re.alg.search/grep.pass.cpp | 6 +- .../re.alg/re.alg.search/lookahead.pass.cpp | 3 +- .../re.alg.search/no_update_pos.pass.cpp | 1 + test/std/re/re.badexp/regex_error.pass.cpp | 1 + .../re/re.const/re.err/error_type.pass.cpp | 1 + .../re.matchflag/match_flag_type.pass.cpp | 1 + .../re.matchflag/match_not_bol.pass.cpp | 5 +- .../re.matchflag/match_not_eol.pass.cpp | 5 +- .../re.synopt/syntax_option_type.pass.cpp | 1 + .../re.regiter.cnstr/cnstr.fail.cpp | 12 +- .../re.regiter.cnstr/cnstr.pass.cpp | 1 + .../re.regiter.cnstr/default.pass.cpp | 1 + .../re.regiter.deref/deref.pass.cpp | 1 + .../re.regiter/re.regiter.incr/post.pass.cpp | 1 + test/std/re/re.iter/re.regiter/types.pass.cpp | 1 + .../re.tokiter.cnstr/array.fail.cpp | 10 +- .../re.tokiter.cnstr/array.pass.cpp | 1 + .../re.tokiter.cnstr/default.pass.cpp | 1 + .../re.tokiter/re.tokiter.cnstr/init.fail.cpp | 10 +- .../re.tokiter/re.tokiter.cnstr/init.pass.cpp | 1 + .../re.tokiter/re.tokiter.cnstr/int.fail.cpp | 10 +- .../re.tokiter/re.tokiter.cnstr/int.pass.cpp | 1 + .../re.tokiter.cnstr/vector.fail.cpp | 10 +- .../re.tokiter.cnstr/vector.pass.cpp | 1 + .../re.tokiter/re.tokiter.comp/equal.pass.cpp | 1 + .../re.tokiter.deref/deref.pass.cpp | 1 + .../re.tokiter/re.tokiter.incr/post.pass.cpp | 1 + test/std/re/re.iter/re.tokiter/types.pass.cpp | 1 + .../re.regex.assign/assign.il.pass.cpp | 1 + .../re.regex/re.regex.assign/assign.pass.cpp | 3 +- .../assign_iter_iter_flag.pass.cpp | 1 + .../re.regex.assign/assign_ptr_flag.pass.cpp | 1 + .../assign_ptr_size_flag.pass.cpp | 1 + .../assign_string_flag.pass.cpp | 1 + .../re/re.regex/re.regex.assign/copy.pass.cpp | 1 + .../re/re.regex/re.regex.assign/il.pass.cpp | 1 + .../re/re.regex/re.regex.assign/ptr.pass.cpp | 1 + .../re.regex/re.regex.assign/string.pass.cpp | 1 + .../re.regex.const/constants.pass.cpp | 1 + .../re.regex.construct/awk_oct.pass.cpp | 5 +- .../re.regex.construct/bad_escape.pass.cpp | 5 +- .../re.regex.construct/bad_repeat.pass.cpp | 5 +- .../re.regex/re.regex.construct/copy.pass.cpp | 1 + .../re.regex.construct/default.pass.cpp | 1 + .../re.regex.construct/il_flg.pass.cpp | 1 + .../re.regex.construct/iter_iter.pass.cpp | 1 + .../re.regex.construct/iter_iter_flg.pass.cpp | 1 + .../re.regex/re.regex.construct/ptr.pass.cpp | 1 + .../re.regex.construct/ptr_flg.pass.cpp | 1 + .../re.regex.construct/ptr_size_flg.pass.cpp | 1 + .../re.regex.construct/string.pass.cpp | 1 + .../re.regex.construct/string_flg.pass.cpp | 1 + .../re.regex/re.regex.locale/imbue.pass.cpp | 1 + .../re.regex.nmswap/swap.pass.cpp | 1 + .../re/re.regex/re.regex.swap/swap.pass.cpp | 1 + test/std/re/re.regex/types.pass.cpp | 1 + .../re.results.acc/begin_end.pass.cpp | 1 + .../re.results.acc/cbegin_cend.pass.cpp | 1 + .../re.results/re.results.acc/index.pass.cpp | 1 + .../re.results/re.results.acc/length.pass.cpp | 1 + .../re.results.acc/position.pass.cpp | 1 + .../re.results/re.results.acc/prefix.pass.cpp | 1 + .../re/re.results/re.results.acc/str.pass.cpp | 1 + .../re.results/re.results.acc/suffix.pass.cpp | 1 + .../re.results.all/get_allocator.pass.cpp | 1 + .../re.results.const/allocator.pass.cpp | 1 + .../re.results.const/default.pass.cpp | 1 + .../re.results/re.results.form/form1.pass.cpp | 1 + .../re.results/re.results.form/form2.pass.cpp | 1 + .../re.results/re.results.form/form3.pass.cpp | 1 + .../re.results/re.results.form/form4.pass.cpp | 1 + .../re.results.nonmember/equal.pass.cpp | 1 + .../re.results/re.results.size/empty.pass.cpp | 1 + .../re.results.size/max_size.pass.cpp | 1 + .../re.results.state/ready.pass.cpp | 1 + .../re.results.swap/member_swap.pass.cpp | 1 + .../re.results.swap/non_member_swap.pass.cpp | 1 + test/std/re/re.results/types.pass.cpp | 1 + .../compare_string_type.pass.cpp | 1 + .../compare_sub_match.pass.cpp | 1 + .../compare_value_type_ptr.pass.cpp | 1 + .../re.submatch.members/default.pass.cpp | 1 + .../re.submatch.members/length.pass.cpp | 1 + .../operator_string.pass.cpp | 1 + .../re.submatch.members/str.pass.cpp | 1 + .../re.submatch.op/compare.pass.cpp | 5 +- .../re.submatch.op/stream.pass.cpp | 1 + test/std/re/re.submatch/types.pass.cpp | 1 + test/std/re/re.syn/cmatch.pass.cpp | 1 + test/std/re/re.syn/cregex_iterator.pass.cpp | 1 + .../re/re.syn/cregex_token_iterator.pass.cpp | 1 + test/std/re/re.syn/csub_match.pass.cpp | 1 + test/std/re/re.syn/regex.pass.cpp | 1 + test/std/re/re.syn/smatch.pass.cpp | 1 + test/std/re/re.syn/sregex_iterator.pass.cpp | 1 + .../re/re.syn/sregex_token_iterator.pass.cpp | 1 + test/std/re/re.syn/ssub_match.pass.cpp | 1 + test/std/re/re.syn/wcmatch.pass.cpp | 1 + test/std/re/re.syn/wcregex_iterator.pass.cpp | 1 + .../re/re.syn/wcregex_token_iterator.pass.cpp | 1 + test/std/re/re.syn/wcsub_match.pass.cpp | 1 + test/std/re/re.syn/wregex.pass.cpp | 1 + test/std/re/re.syn/wsmatch.pass.cpp | 1 + test/std/re/re.syn/wsregex_iterator.pass.cpp | 1 + .../re/re.syn/wsregex_token_iterator.pass.cpp | 1 + test/std/re/re.syn/wssub_match.pass.cpp | 1 + test/std/re/re.traits/default.pass.cpp | 1 + test/std/re/re.traits/getloc.pass.cpp | 1 + test/std/re/re.traits/imbue.pass.cpp | 1 + test/std/re/re.traits/isctype.pass.cpp | 5 + test/std/re/re.traits/length.pass.cpp | 1 + .../re/re.traits/lookup_classname.pass.cpp | 14 + .../re/re.traits/lookup_collatename.pass.cpp | 3 +- test/std/re/re.traits/transform.pass.cpp | 2 +- .../re/re.traits/transform_primary.pass.cpp | 3 +- test/std/re/re.traits/translate.pass.cpp | 1 + .../re/re.traits/translate_nocase.pass.cpp | 1 + test/std/re/re.traits/types.pass.cpp | 1 + test/std/re/re.traits/value.pass.cpp | 1 + .../basic.string.literals/literal.pass.cpp | 13 +- .../basic.string.literals/literal1.fail.cpp | 7 +- .../basic.string.literals/literal1.pass.cpp | 5 +- .../basic.string.literals/literal2.fail.cpp | 7 +- .../basic.string.literals/literal2.pass.cpp | 5 +- .../basic.string.literals/literal3.pass.cpp | 5 +- .../basic.string/string.access/at.pass.cpp | 2 +- .../basic.string/string.access/back.pass.cpp | 2 +- .../string.access/db_back.pass.cpp | 2 +- .../string.access/db_cback.pass.cpp | 2 +- .../string.access/db_cfront.pass.cpp | 2 +- .../string.access/db_cindex.pass.cpp | 2 +- .../string.access/db_front.pass.cpp | 2 +- .../string.access/db_index.pass.cpp | 2 +- .../basic.string/string.access/front.pass.cpp | 2 +- .../basic.string/string.access/index.pass.cpp | 2 +- .../string.capacity/capacity.pass.cpp | 2 +- .../string.capacity/clear.pass.cpp | 2 +- .../string.capacity/empty.pass.cpp | 2 +- .../string.capacity/length.pass.cpp | 2 +- .../string.capacity/max_size.pass.cpp | 2 +- .../string.capacity/over_max_size.pass.cpp | 2 +- .../string.capacity/reserve.pass.cpp | 5 +- .../string.capacity/resize_size.pass.cpp | 5 +- .../string.capacity/resize_size_char.pass.cpp | 5 +- .../string.capacity/shrink_to_fit.pass.cpp | 5 +- .../string.capacity/size.pass.cpp | 2 +- .../basic.string/string.cons/alloc.pass.cpp | 8 +- .../string.cons/char_assignment.pass.cpp | 5 +- .../basic.string/string.cons/copy.pass.cpp | 5 +- .../string.cons/copy_alloc.pass.cpp | 5 +- .../string.cons/copy_assignment.pass.cpp | 5 +- .../string.cons/default_noexcept.pass.cpp | 4 +- .../string.cons/dtor_noexcept.pass.cpp | 8 +- .../string.cons/initializer_list.pass.cpp | 6 +- .../initializer_list_assignment.pass.cpp | 6 +- .../string.cons/iter_alloc.pass.cpp | 7 +- .../basic.string/string.cons/move.pass.cpp | 15 +- .../string.cons/move_alloc.pass.cpp | 19 +- .../string.cons/move_assign_noexcept.pass.cpp | 9 +- .../string.cons/move_assignment.pass.cpp | 15 +- .../string.cons/move_noexcept.pass.cpp | 4 +- .../string.cons/pointer_alloc.pass.cpp | 7 +- .../string.cons/pointer_assignment.pass.cpp | 5 +- .../string.cons/pointer_size_alloc.pass.cpp | 7 +- .../string.cons/size_char_alloc.pass.cpp | 11 +- .../basic.string/string.cons/substr.pass.cpp | 33 +- .../string.iterators/begin.pass.cpp | 2 +- .../string.iterators/cbegin.pass.cpp | 2 +- .../string.iterators/cend.pass.cpp | 2 +- .../string.iterators/crbegin.pass.cpp | 2 +- .../string.iterators/crend.pass.cpp | 2 +- .../string.iterators/db_iterators_2.pass.cpp | 2 +- .../string.iterators/db_iterators_3.pass.cpp | 2 +- .../string.iterators/db_iterators_4.pass.cpp | 2 +- .../string.iterators/db_iterators_5.pass.cpp | 2 +- .../string.iterators/db_iterators_6.pass.cpp | 2 +- .../string.iterators/db_iterators_7.pass.cpp | 2 +- .../string.iterators/db_iterators_8.pass.cpp | 2 +- .../string.iterators/end.pass.cpp | 2 +- .../string.iterators/iterators.pass.cpp | 6 +- .../string.iterators/rbegin.pass.cpp | 2 +- .../string.iterators/rend.pass.cpp | 2 +- .../string_append/initializer_list.pass.cpp | 7 +- .../string_append/iterator.pass.cpp | 8 +- .../string_append/pointer.pass.cpp | 3 +- .../string_append/pointer_size.pass.cpp | 3 +- .../string_append/push_back.pass.cpp | 3 +- .../string_append/size_char.pass.cpp | 3 +- .../string_append/string.pass.cpp | 3 +- .../string_append/string_size_size.pass.cpp | 5 +- .../string_assign/initializer_list.pass.cpp | 7 +- .../string_assign/iterator.pass.cpp | 13 +- .../string_assign/pointer.pass.cpp | 3 +- .../string_assign/pointer_size.pass.cpp | 3 +- .../string_assign/rv_string.pass.cpp | 3 +- .../string_assign/size_char.pass.cpp | 3 +- .../string_assign/string.pass.cpp | 36 +- .../string_assign/string_size_size.pass.cpp | 5 +- .../string_copy/copy.pass.cpp | 3 +- .../string_erase/iter.pass.cpp | 5 +- .../string_erase/iter_iter.pass.cpp | 5 +- .../string_erase/pop_back.pass.cpp | 16 +- .../string_erase/size_size.pass.cpp | 9 +- .../string_insert/iter_char.pass.cpp | 16 +- .../string_insert/iter_iter_iter.pass.cpp | 8 +- .../string_insert/iter_size_char.pass.cpp | 15 +- .../string_insert/size_pointer.pass.cpp | 3 +- .../string_insert/size_pointer_size.pass.cpp | 3 +- .../string_insert/size_size_char.pass.cpp | 3 +- .../string_insert/size_string.pass.cpp | 3 +- .../size_string_size_size.pass.cpp | 5 +- .../string_op_plus_equal/char.pass.cpp | 5 +- .../initializer_list.pass.cpp | 6 +- .../string_op_plus_equal/pointer.pass.cpp | 5 +- .../string_op_plus_equal/string.pass.cpp | 5 +- .../iter_iter_iter_iter.pass.cpp | 8 +- .../string_replace/iter_iter_pointer.pass.cpp | 2 +- .../iter_iter_pointer_size.pass.cpp | 5 +- .../iter_iter_size_char.pass.cpp | 5 +- .../string_replace/iter_iter_string.pass.cpp | 5 +- .../string_replace/size_size_pointer.pass.cpp | 5 +- .../size_size_pointer_size.pass.cpp | 5 +- .../size_size_size_char.pass.cpp | 3 +- .../string_replace/size_size_string.pass.cpp | 3 +- .../size_size_string_size_size.pass.cpp | 5 +- .../string_swap/swap.pass.cpp | 7 +- .../string.io/get_line.pass.cpp | 2 +- .../string.io/get_line_delim.pass.cpp | 2 +- .../string.io/get_line_delim_rv.pass.cpp | 2 +- .../string.io/get_line_rv.pass.cpp | 2 +- .../string.io/stream_extract.pass.cpp | 2 +- .../string.io/stream_insert.pass.cpp | 2 +- .../string.special/swap.pass.cpp | 7 +- .../string.special/swap_noexcept.pass.cpp | 10 +- .../string_op!=/pointer_string.pass.cpp | 2 +- .../string_op!=/string_pointer.pass.cpp | 2 +- .../string_op!=/string_string.pass.cpp | 2 +- .../string_op+/char_string.pass.cpp | 6 +- .../string_op+/pointer_string.pass.cpp | 2 +- .../string_op+/string_char.pass.cpp | 2 +- .../string_op+/string_pointer.pass.cpp | 2 +- .../string_op+/string_string.pass.cpp | 2 +- .../string_operator==/pointer_string.pass.cpp | 2 +- .../string_operator==/string_pointer.pass.cpp | 2 +- .../string_operator==/string_string.pass.cpp | 2 +- .../string_opgt/pointer_string.pass.cpp | 2 +- .../string_opgt/string_pointer.pass.cpp | 2 +- .../string_opgt/string_string.pass.cpp | 2 +- .../string_opgt=/pointer_string.pass.cpp | 2 +- .../string_opgt=/string_pointer.pass.cpp | 2 +- .../string_opgt=/string_string.pass.cpp | 2 +- .../string_oplt/pointer_string.pass.cpp | 2 +- .../string_oplt/string_pointer.pass.cpp | 2 +- .../string_oplt/string_string.pass.cpp | 2 +- .../string_oplt=/pointer_string.pass.cpp | 2 +- .../string_oplt=/string_pointer.pass.cpp | 2 +- .../string_oplt=/string_string.pass.cpp | 2 +- .../string.accessors/c_str.pass.cpp | 2 +- .../string.ops/string.accessors/data.pass.cpp | 46 +- .../string.accessors/get_allocator.pass.cpp | 2 +- .../string_compare/pointer.pass.cpp | 2 +- .../string_compare/size_size_pointer.pass.cpp | 2 +- .../size_size_pointer_size.pass.cpp | 2 +- .../string_compare/size_size_string.pass.cpp | 2 +- .../size_size_string_size_size.pass.cpp | 2 +- .../string.ops/string_compare/string.pass.cpp | 2 +- .../char_size.pass.cpp | 2 +- .../pointer_size.pass.cpp | 2 +- .../pointer_size_size.pass.cpp | 2 +- .../string_size.pass.cpp | 2 +- .../string_find.first.of/char_size.pass.cpp | 2 +- .../pointer_size.pass.cpp | 2 +- .../pointer_size_size.pass.cpp | 2 +- .../string_find.first.of/string_size.pass.cpp | 2 +- .../char_size.pass.cpp | 2 +- .../pointer_size.pass.cpp | 2 +- .../pointer_size_size.pass.cpp | 2 +- .../string_size.pass.cpp | 2 +- .../string_find.last.of/char_size.pass.cpp | 2 +- .../string_find.last.of/pointer_size.pass.cpp | 2 +- .../pointer_size_size.pass.cpp | 2 +- .../string_find.last.of/string_size.pass.cpp | 2 +- .../string.ops/string_find/char_size.pass.cpp | 2 +- .../string_find/pointer_size.pass.cpp | 2 +- .../string_find/pointer_size_size.pass.cpp | 2 +- .../string_find/string_size.pass.cpp | 2 +- .../string_rfind/char_size.pass.cpp | 2 +- .../string_rfind/pointer_size.pass.cpp | 2 +- .../string_rfind/pointer_size_size.pass.cpp | 2 +- .../string_rfind/string_size.pass.cpp | 2 +- .../string.ops/string_substr/substr.pass.cpp | 5 +- .../string.require/contiguous.pass.cpp | 2 +- test/std/strings/basic.string/types.pass.cpp | 2 +- test/std/strings/c.strings/cstring.pass.cpp | 16 +- test/std/strings/c.strings/cwchar.pass.cpp | 34 +- .../lt.pass.cpp | 21 +- .../assign2.pass.cpp | 4 +- .../compare.pass.cpp | 4 +- .../eq.pass.cpp | 4 +- .../eq_int_type.pass.cpp | 4 +- .../length.pass.cpp | 4 +- .../lt.pass.cpp | 4 +- .../not_eof.pass.cpp | 4 +- .../to_char_type.pass.cpp | 4 +- .../to_int_type.pass.cpp | 4 +- .../assign2.pass.cpp | 4 +- .../compare.pass.cpp | 4 +- .../eq.pass.cpp | 4 +- .../eq_int_type.pass.cpp | 4 +- .../length.pass.cpp | 4 +- .../lt.pass.cpp | 4 +- .../not_eof.pass.cpp | 4 +- .../to_char_type.pass.cpp | 4 +- .../to_int_type.pass.cpp | 4 +- .../futures/futures.async/async.pass.cpp | 187 +- .../futures.overview/future_errc.pass.cpp | 26 +- .../futures/futures.overview/launch.pass.cpp | 14 +- .../futures.promise/copy_assign.fail.cpp | 2 + .../futures.promise/copy_ctor.fail.cpp | 2 + .../futures.promise/set_rvalue.pass.cpp | 3 +- .../futures.task.members/assign_copy.fail.cpp | 3 +- .../futures.task.members/assign_move.pass.cpp | 0 .../futures.task.members/ctor1.fail.cpp | 5 +- .../futures.task.members/ctor2.fail.cpp | 5 +- .../futures.task.members/ctor_copy.fail.cpp | 3 +- .../ctor_default.pass.cpp | 0 .../futures.task.members/ctor_func.pass.cpp | 0 .../ctor_func_alloc.pass.cpp | 0 .../futures.task.members/ctor_move.pass.cpp | 0 .../futures.task.members/dtor.pass.cpp | 0 .../futures.task.members/get_future.pass.cpp | 0 .../make_ready_at_thread_exit.pass.cpp | 0 .../futures.task.members/operator.pass.cpp | 0 .../futures.task.members/reset.pass.cpp | 0 .../futures.task.members/swap.pass.cpp | 0 .../futures.task.nonmembers/swap.pass.cpp | 0 .../uses_allocator.pass.cpp | 0 .../copy_assign.fail.cpp | 2 + .../futures.unique_future/copy_ctor.fail.cpp | 2 + .../thread.lock.guard/mutex.fail.cpp | 32 +- .../variadic_adopt_lock.pass.cpp | 62 + .../variadic_assign.fail.cpp | 44 + .../thread.lock.guard/variadic_copy.fail.cpp | 41 + .../thread.lock.guard/variadic_mutex.fail.cpp | 47 + .../thread.lock.guard/variadic_mutex.pass.cpp | 115 + .../variadic_mutex_cxx03.pass.cpp | 21 + .../thread.lock.guard/variadic_types.pass.cpp | 78 + .../copy_assign.fail.cpp | 9 +- .../copy_ctor.fail.cpp | 7 +- .../move_assign.pass.cpp | 26 +- .../move_ctor.pass.cpp | 22 +- .../mutex_adopt_lock.pass.cpp | 20 +- .../mutex_defer_lock.pass.cpp | 17 +- .../copy_assign.fail.cpp | 12 +- .../copy_ctor.fail.cpp | 10 +- .../move_assign.pass.cpp | 27 +- .../move_ctor.pass.cpp | 23 +- .../mutex_adopt_lock.pass.cpp | 18 +- .../mutex_defer_lock.pass.cpp | 17 +- .../thread.shared_mutex.class/assign.fail.cpp | 1 + .../thread.shared_mutex.class/copy.fail.cpp | 1 + .../assign.fail.cpp | 5 +- .../copy.fail.cpp | 5 +- .../thread.once.callonce/call_once.pass.cpp | 6 +- .../thread.thread.constr/F.pass.cpp | 70 +- .../thread.thread.constr/constr.fail.cpp | 2 +- .../thread.thread.member/detach.pass.cpp | 17 + .../thread.thread.member/join.pass.cpp | 23 + .../allocator_pointers.pass.cpp | 18 +- .../is_always_equal.pass.cpp | 10 +- .../scoped.adaptor.operators/eq.pass.cpp | 2 +- .../arithmetic.operations/plus.pass.cpp | 2 +- .../transparent.pass.cpp | 10 +- .../PR23141_invoke_not_constexpr.pass.cpp | 35 + .../func.bind.bind/bind_return_type.pass.cpp | 131 ++ .../invoke_function_object.pass.cpp | 4 +- .../func.bind.bind/invoke_lvalue.pass.cpp | 1 + .../func.bind.place/placeholders.pass.cpp | 28 + .../bitwise.operations/bit_not.pass.cpp | 3 +- .../bitwise.operations/transparent.pass.cpp | 7 +- .../comparisons/equal_to.pass.cpp | 4 +- .../comparisons/greater.pass.cpp | 10 +- .../comparisons/greater_equal.pass.cpp | 10 +- .../comparisons/less.pass.cpp | 9 +- .../comparisons/less_equal.pass.cpp | 10 +- .../comparisons/not_equal_to.pass.cpp | 4 +- .../pointer_comparison_test_helper.hpp | 39 + .../comparisons/transparent.pass.cpp | 10 +- .../func.invoke/invoke.pass.cpp | 80 + .../func.memfn/member_function.pass.cpp | 4 +- .../func.not_fn/not_fn.pass.cpp | 589 +++++ .../INVOKE_tested_elsewhere.pass.cpp | 16 + .../alloc_rfunction.pass.cpp | 66 +- .../{copy.pass.cpp => copy_move.pass.cpp} | 62 +- .../assign_F_alloc.pass.cpp | 4 + .../func.wrap/func.wrap.func/types.pass.cpp | 2 +- .../logical.operations/transparent.pass.cpp | 10 +- .../refwrap/type_properties.pass.cpp | 7 +- .../function.objects/unord.hash/enum.pass.cpp | 6 +- .../unord.hash/floating.pass.cpp | 2 +- .../unord.hash/integral.pass.cpp | 21 +- .../intseq.general/integer_seq.pass.cpp | 22 +- .../intseq/intseq.intseq/integer_seq.fail.cpp | 2 +- .../intseq/intseq.intseq/integer_seq.pass.cpp | 15 +- .../max_size.pass.cpp | 4 +- .../const_pointer.pass.cpp | 12 + .../const_void_pointer.pass.cpp | 14 + .../difference_type.pass.cpp | 18 +- .../allocator.traits.types/pointer.pass.cpp | 12 + ...gate_on_container_copy_assignment.pass.cpp | 14 + ...gate_on_container_move_assignment.pass.cpp | 15 + .../propagate_on_container_swap.pass.cpp | 13 + .../rebind_alloc.pass.cpp | 28 +- .../allocator.traits.types/size_type.pass.cpp | 13 + .../void_pointer.pass.cpp | 13 + .../uses_allocator.pass.cpp | 20 + .../allocator.members/allocate.size.pass.cpp | 49 + .../allocator_pointers.pass.cpp | 20 +- .../difference_type.pass.cpp | 18 + .../element_type.pass.cpp | 19 + .../pointer.traits.types/rebind.pass.cpp | 46 +- .../constexpr_addressof.pass.cpp | 42 + .../uninitialized_copy.pass.cpp | 4 +- .../uninitialized_copy_n.pass.cpp | 2 +- .../uninitialized_fill_n.pass.cpp | 2 +- .../uninitialized_fill.pass.cpp | 2 +- ...cpp => raw_storage_iterator.base.pass.cpp} | 4 +- ...pass.cpp => raw_storage_iterator.pass.cpp} | 0 .../make_unique.array.pass.cpp | 7 +- .../make_unique.array4.fail.cpp | 2 +- .../make_unique.single.pass.cpp | 5 +- .../convert_ctor.pass.cpp | 27 + .../pointer_deleter01.pass.cpp | 6 + .../pointer_deleter02.pass.cpp | 6 + .../pointer_deleter03.pass.cpp | 5 + .../pointer_deleter04.pass.cpp | 5 + .../unique.ptr.single/pointer_type.pass.cpp | 21 + .../unique.ptr.special/swap.pass.cpp | 25 + .../enable_shared_from_this.pass.cpp | 109 + .../atomic_compare_exchange_strong.pass.cpp | 6 +- ..._compare_exchange_strong_explicit.pass.cpp | 6 +- .../atomic_compare_exchange_weak.pass.cpp | 6 +- ...ic_compare_exchange_weak_explicit.pass.cpp | 6 +- .../atomic_exchange.pass.cpp | 6 +- .../atomic_exchange_explicit.pass.cpp | 6 +- .../atomic_is_lock_free.pass.cpp | 6 +- .../atomic_load.pass.cpp | 6 +- .../atomic_load_explicit.pass.cpp | 6 +- .../atomic_store.pass.cpp | 6 +- .../atomic_store_explicit.pass.cpp | 6 +- .../util.smartptr.shared/test_deleter.h | 2 +- .../util.smartptr.shared/types.pass.cpp | 6 + .../auto_ptr.pass.cpp | 91 +- .../nullptr_t_deleter_allocator.pass.cpp | 2 +- .../nullptr_t_deleter_throw.pass.cpp | 23 +- .../pointer_deleter_allocator.pass.cpp | 2 +- .../pointer_deleter_throw.pass.cpp | 23 +- .../pointer_throw.pass.cpp | 23 +- .../unique_ptr.pass.cpp | 89 +- .../allocate_shared.pass.cpp | 4 +- ...ass.cpp => allocate_shared_cxx03.pass.cpp} | 4 +- .../make_shared.volatile.pass.cpp | 4 +- .../owner_less.pass.cpp | 6 +- .../bool_constant.pass.cpp | 4 +- .../integral_constant.pass.cpp | 0 .../meta/meta.logical/conjunction.pass.cpp | 4 +- .../meta/meta.logical/disjunction.pass.cpp | 4 +- .../meta/meta.logical/negation.pass.cpp | 2 +- .../meta/meta.rel/is_callable.pass.cpp | 160 ++ .../meta/meta.rel/is_convertible.pass.cpp | 62 +- .../meta.rel/is_nothrow_callable.pass.cpp | 115 + .../meta.trans.other/aligned_storage.pass.cpp | 2 +- .../meta.trans.other/enable_if2.fail.cpp | 5 +- .../meta.trans.other/result_of.pass.cpp | 86 +- .../meta.trans.other/result_of11.pass.cpp | 70 + .../meta.trans.other/underlying_type.pass.cpp | 6 +- .../meta.trans.ptr/add_pointer.pass.cpp | 48 +- .../meta.trans.ptr/remove_pointer.pass.cpp | 3 +- .../meta.trans.ref/add_lvalue_ref.pass.cpp | 25 +- .../meta.trans.ref/add_rvalue_ref.pass.cpp | 48 +- .../meta.trans.ref/remove_ref.pass.cpp | 3 +- .../meta.unary.prop.query/void_t.pass.cpp | 2 +- .../meta.unary/meta.unary.cat/array.pass.cpp | 8 +- .../meta.unary/meta.unary.cat/class.pass.cpp | 9 +- .../meta.unary/meta.unary.cat/enum.pass.cpp | 7 +- .../meta.unary.cat/floating_point.pass.cpp | 8 +- .../meta.unary.cat/function.pass.cpp | 11 +- .../meta.unary.cat/integral.pass.cpp | 8 +- .../meta.unary.cat/is_array.pass.cpp | 5 +- .../meta.unary.cat/is_class.pass.cpp | 2 + .../meta.unary.cat/is_enum.pass.cpp | 2 + .../meta.unary.cat/is_floating_point.pass.cpp | 2 + .../meta.unary.cat/is_function.pass.cpp | 4 +- .../meta.unary.cat/is_integral.pass.cpp | 2 + .../is_lvalue_reference.pass.cpp | 2 + .../is_member_object_pointer.pass.cpp | 2 + .../meta.unary.cat/is_member_pointer.pass.cpp | 2 + .../meta.unary.cat/is_null_pointer.pass.cpp | 2 + .../meta.unary.cat/is_pointer.pass.cpp | 2 + .../is_rvalue_reference.pass.cpp | 2 + .../meta.unary.cat/is_union.pass.cpp | 2 + .../meta.unary.cat/is_void.pass.cpp | 2 + .../meta.unary.cat/lvalue_ref.pass.cpp | 5 + .../member_function_pointer.pass.cpp | 5 + ...ber_function_pointer_no_variadics.pass.cpp | 5 + .../member_object_pointer.pass.cpp | 8 +- .../meta.unary.cat/nullptr.pass.cpp | 8 +- .../meta.unary.cat/pointer.pass.cpp | 9 +- .../meta.unary.cat/rvalue_ref.pass.cpp | 8 +- .../meta.unary/meta.unary.cat/union.pass.cpp | 8 +- .../meta.unary/meta.unary.cat/void.pass.cpp | 8 +- .../meta.unary/meta.unary.comp/array.pass.cpp | 3 + .../meta.unary/meta.unary.comp/class.pass.cpp | 3 + .../meta.unary.comp/is_arithmetic.pass.cpp | 3 + .../meta.unary.comp/is_compound.pass.cpp | 3 + .../meta.unary.comp/is_fundamental.pass.cpp | 5 +- .../is_member_pointer.pass.cpp | 9 +- .../meta.unary.comp/is_object.pass.cpp | 8 +- .../meta.unary.comp/is_reference.pass.cpp | 3 + .../meta.unary.comp/is_scalar.pass.cpp | 9 +- .../has_virtual_destructor.pass.cpp | 2 + .../meta.unary.prop/is_assignable.pass.cpp | 2 +- .../meta.unary.prop/is_const.pass.cpp | 4 + .../meta.unary.prop/is_constructible.pass.cpp | 15 +- .../is_copy_assignable.pass.cpp | 2 +- .../is_copy_constructible.pass.cpp | 2 +- .../is_default_constructible.pass.cpp | 2 +- .../meta.unary.prop/is_destructible.pass.cpp | 6 + .../meta.unary.prop/is_final.pass.cpp | 14 +- .../is_nothrow_constructible.pass.cpp | 2 +- .../is_nothrow_destructible.pass.cpp | 5 + .../is_nothrow_swappable.pass.cpp | 83 + .../is_nothrow_swappable_with.pass.cpp | 81 + .../meta.unary.prop/is_polymorphic.pass.cpp | 2 +- .../meta.unary.prop/is_signed.pass.cpp | 3 + .../meta.unary.prop/is_swappable.pass.cpp | 98 + .../is_swappable_include_order.pass.cpp | 43 + .../is_swappable_with.pass.cpp | 78 + .../is_trivially_assignable.pass.cpp | 2 + .../is_trivially_copy_assignable.pass.cpp | 2 + .../is_trivially_copy_constructible.pass.cpp | 2 + .../is_trivially_copyable.pass.cpp | 2 + .../is_trivially_destructible.pass.cpp | 5 + .../is_trivially_move_assignable.pass.cpp | 2 + .../is_trivially_move_constructible.pass.cpp | 6 +- .../meta.unary.prop/is_unsigned.pass.cpp | 3 + .../meta.unary.prop/is_volatile.pass.cpp | 4 + .../bitset.cons/char_ptr_ctor.pass.cpp | 18 +- .../bitset.cons/default.pass.cpp | 17 +- .../bitset.cons/string_ctor.pass.cpp | 94 +- .../bitset.cons/ull_ctor.pass.cpp | 22 +- .../bitset.hash/bitset.pass.cpp | 8 +- .../bitset.members/count.pass.cpp | 2 + .../bitset.members/flip_all.pass.cpp | 2 + .../bitset.members/flip_one.pass.cpp | 2 - .../bitset.members/index.pass.cpp | 2 + .../bitset.members/index_const.pass.cpp | 2 + .../bitset.members/left_shift.pass.cpp | 2 + .../bitset.members/left_shift_eq.pass.cpp | 2 + .../bitset.members/not_all.pass.cpp | 2 + .../bitset.members/op_and_eq.pass.cpp | 2 + .../bitset.members/op_eq_eq.pass.cpp | 2 + .../bitset.members/op_or_eq.pass.cpp | 2 + .../bitset.members/op_xor_eq.pass.cpp | 2 + .../bitset.members/reset_all.pass.cpp | 2 + .../bitset.members/reset_one.pass.cpp | 3 - .../bitset.members/right_shift.pass.cpp | 2 + .../bitset.members/right_shift_eq.pass.cpp | 2 + .../bitset.members/set_all.pass.cpp | 2 + .../bitset.members/test.pass.cpp | 2 - .../bitset.members/to_string.pass.cpp | 2 + .../bitset.operators/op_and.pass.cpp | 2 + .../bitset.operators/op_not.pass.cpp | 2 + .../bitset.operators/op_or.pass.cpp | 2 + .../utilities/time/date.time/ctime.pass.cpp | 8 +- .../time.clock.hires/consistency.pass.cpp | 4 + .../time.clock.steady/consistency.pass.cpp | 4 + .../time.clock.system/consistency.pass.cpp | 4 + .../time.duration.alg/abs.pass.cpp | 2 +- .../time.duration.cast/ceil.pass.cpp | 2 +- .../time.duration.cast/floor.pass.cpp | 2 +- .../time.duration.cast/round.pass.cpp | 2 +- .../time.duration.literals/literals.pass.cpp | 7 +- .../time.duration.literals/literals1.fail.cpp | 6 +- .../time.duration.literals/literals1.pass.cpp | 6 +- .../time.duration.literals/literals2.fail.cpp | 6 +- .../time.duration.literals/literals2.pass.cpp | 5 +- .../time.point/time.point.cast/ceil.pass.cpp | 2 +- .../time.point/time.point.cast/floor.pass.cpp | 2 +- .../time.point/time.point.cast/round.pass.cpp | 2 +- .../time.point.comparisons/op_equal.pass.cpp | 2 +- .../treat_as_floating_point.pass.cpp | 6 +- .../tuple.general/tuple.smartptr.pass.cpp | 13 +- .../tuple/tuple.tuple/TupleFunction.pass.cpp | 4 +- .../tuple.tuple/tuple.apply/apply.pass.cpp | 275 +++ .../tuple.apply/apply_extended_types.pass.cpp | 426 ++++ .../tuple.apply/apply_large_arity.pass.cpp | 144 ++ .../tuple.apply/make_from_tuple.pass.cpp | 214 ++ .../tuple.assign/convert_copy.pass.cpp | 12 + .../tuple.assign/convert_move.pass.cpp | 19 + ...PR22806_constrain_tuple_like_ctor.pass.cpp | 178 ++ .../PR23256_constrain_UTypes_ctor.pass.cpp | 96 + ...4_contains_ref_to_incomplete_type.pass.cpp | 51 + .../tuple.tuple/tuple.cnstr/UTypes.pass.cpp | 7 +- .../tuple.tuple/tuple.cnstr/alloc.pass.cpp | 28 +- .../tuple.cnstr/alloc_UTypes.pass.cpp | 121 +- .../tuple.cnstr/alloc_const_Types.fail.cpp | 43 + .../tuple.cnstr/alloc_const_Types.pass.cpp | 22 + .../tuple.cnstr/alloc_convert_copy.fail.cpp | 43 + .../tuple.cnstr/alloc_convert_copy.pass.cpp | 21 + .../tuple.cnstr/alloc_convert_move.fail.cpp | 36 + .../tuple.cnstr/alloc_convert_move.pass.cpp | 20 + .../tuple.cnstr/alloc_copy.pass.cpp | 3 + .../tuple.cnstr/alloc_move.pass.cpp | 3 + .../tuple.cnstr/const_Types.fail.cpp | 27 +- .../tuple.cnstr/const_Types.pass.cpp | 35 +- .../tuple.cnstr/const_pair.pass.cpp | 2 +- .../tuple.cnstr/convert_copy.pass.cpp | 24 +- .../tuple.cnstr/convert_move.pass.cpp | 20 + .../tuple.tuple/tuple.cnstr/move.pass.cpp | 6 +- .../tuple.cnstr/test_lazy_sfinae.pass.cpp | 102 + .../tuple.creation/forward_as_tuple.pass.cpp | 6 +- .../tuple.creation/make_tuple.pass.cpp | 2 +- .../tuple.tuple/tuple.elem/get_const.pass.cpp | 2 +- .../tuple.elem/get_non_const.pass.cpp | 6 +- .../tuple.elem/tuple.by.type.fail.cpp | 38 + .../tuple.elem/tuple.by.type.pass.cpp | 1 + .../tuple.helper/tuple.include.array.pass.cpp | 2 +- .../tuple.include.utility.pass.cpp | 3 +- .../tuple.helper/tuple_element.fail.cpp | 34 + .../tuple.helper/tuple_size.fail.cpp | 27 + .../tuple.helper/tuple_size_v.fail.cpp | 26 + .../tuple.helper/tuple_size_v.pass.cpp | 43 + .../tuple/tuple.tuple/tuple.rel/eq.pass.cpp | 2 +- .../tuple/tuple.tuple/tuple.rel/lt.pass.cpp | 2 +- .../utility/as_const/as_const.pass.cpp | 2 +- .../utility/exchange/exchange.pass.cpp | 8 +- .../utility/forward/forward.pass.cpp | 3 + .../pairs/pair.astuple/get_const.pass.cpp | 4 +- .../pairs/pair.astuple/get_non_const.pass.cpp | 6 +- .../pair.astuple/pairs.by.type1.fail.cpp | 5 +- .../pair.astuple/pairs.by.type2.fail.cpp | 5 +- .../pair.astuple/pairs.by.type3.fail.cpp | 5 +- .../pairs/pairs.pair/copy_ctor.pass.cpp | 7 +- .../utility/pairs/pairs.pair/default.pass.cpp | 6 + .../pairs/pairs.pair/move_ctor.pass.cpp | 44 + .../utility/pairs/pairs.pair/swap.pass.cpp | 2 +- .../pairs.pair/trivial_copy_move.pass.cpp | 50 + .../pairs/pairs.spec/make_pair.pass.cpp | 2 +- test/std/utilities/utility/synopsis.pass.cpp | 21 + .../utility/utility.swap/swap.pass.cpp | 106 +- .../utility/utility.swap/swap_array.pass.cpp | 114 +- test/support/Counter.h | 4 +- test/support/MoveOnly.h | 2 + test/support/allocators.h | 2 +- test/support/asan_testing.h | 10 +- test/support/assert_checkpoint.h | 73 + test/support/constexpr_char_traits.hpp | 42 +- test/support/container_test_types.h | 492 ++++ test/support/count_new.hpp | 78 +- test/support/counting_predicates.hpp | 6 +- test/support/disable_missing_braces_warning.h | 2 + .../support/filesystem_dynamic_test_helper.py | 85 + test/support/filesystem_test_helper.hpp | 403 ++++ test/support/hexfloat.h | 20 +- test/support/is_transparent.h | 4 +- test/support/min_allocator.h | 58 +- test/support/nasty_containers.hpp | 51 +- test/support/platform_support.h | 23 +- test/support/propagate_const_helpers.h | 119 + test/support/rapid-cxx-test.hpp | 847 +++++++ .../test_convertible_header.pass.cpp | 68 + .../test_macros_header_exceptions.fail.cpp | 24 + .../test_macros_header_exceptions.pass.cpp | 24 + .../test_macros_header_rtti.fail.cpp | 29 + .../test_macros_header_rtti.pass.cpp | 28 + test/support/test_allocator.h | 113 +- test/support/test_convertible.hpp | 42 + test/support/test_iterators.h | 322 +-- test/support/test_macros.h | 81 +- test/support/test_memory_resource.hpp | 507 ++++ test/support/type_id.h | 57 + test/support/uses_alloc_types.hpp | 298 +++ test/ubsan_blacklist.txt | 1 + www/cxx1z_status.html | 331 ++- www/index.html | 292 +-- www/kona.html | 154 -- www/lit_usage.html | 207 -- www/ts1z_status.html | 14 +- www/upcoming_meeting.html | 137 ++ 2421 files changed, 50894 insertions(+), 13944 deletions(-) delete mode 100644 Makefile create mode 100644 benchmarks/unordered_set_operations.bench.cpp create mode 100644 cmake/Modules/CheckLibcxxAtomic.cmake create mode 100644 include/__bsd_locale_defaults.h create mode 100644 include/__bsd_locale_fallbacks.h create mode 100644 include/__threading_support create mode 100644 include/experimental/__memory create mode 100644 include/experimental/deque create mode 100644 include/experimental/filesystem create mode 100644 include/experimental/forward_list create mode 100644 include/experimental/iterator create mode 100644 include/experimental/list create mode 100644 include/experimental/map create mode 100644 include/experimental/memory_resource create mode 100644 include/experimental/propagate_const create mode 100644 include/experimental/regex create mode 100644 include/experimental/set create mode 100644 include/experimental/string create mode 100644 include/experimental/unordered_map create mode 100644 include/experimental/unordered_set create mode 100644 include/experimental/vector create mode 100644 include/stdbool.h create mode 100644 include/string.h create mode 100644 include/support/ibm/locale_mgmt_aix.h create mode 100644 include/support/win32/locale_mgmt_win32.h create mode 100644 include/support/xlocale/__nop_locale_mgmt.h create mode 100644 include/support/xlocale/__posix_l_fallback.h create mode 100644 include/support/xlocale/__strtonum_fallback.h create mode 100644 src/experimental/filesystem/directory_iterator.cpp create mode 100644 src/experimental/filesystem/operations.cpp create mode 100644 src/experimental/filesystem/path.cpp create mode 100644 src/experimental/memory_resource.cpp rename test/{std => libcxx}/algorithms/version.pass.cpp (100%) rename test/{std/atomics/atomics.flag/init03.pass.cpp => libcxx/atomics/atomics.flag/init_bool.pass.cpp} (75%) rename test/{std => libcxx}/atomics/version.pass.cpp (100%) rename test/{std => libcxx}/containers/associative/map/version.pass.cpp (100%) rename test/{std => libcxx}/containers/associative/set/version.pass.cpp (100%) rename test/{std => libcxx}/containers/associative/tree_balance_after_insert.pass.cpp (99%) create mode 100644 test/libcxx/containers/associative/tree_key_value_traits.pass.cpp rename test/{std => libcxx}/containers/associative/tree_left_rotate.pass.cpp (95%) rename test/{std => libcxx}/containers/associative/tree_remove.pass.cpp (99%) rename test/{std => libcxx}/containers/associative/tree_right_rotate.pass.cpp (95%) rename test/{std => libcxx}/containers/container.adaptors/queue/version.pass.cpp (100%) rename test/{std => libcxx}/containers/container.adaptors/stack/version.pass.cpp (100%) create mode 100644 test/libcxx/containers/gnu_cxx/hash_map.pass.cpp create mode 100644 test/libcxx/containers/gnu_cxx/hash_set.pass.cpp rename test/{std => libcxx}/containers/sequences/array/version.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/deque/version.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/forwardlist/version.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/list/db_back.pass.cpp (70%) rename test/{std => libcxx}/containers/sequences/list/db_cback.pass.cpp (72%) rename test/{std => libcxx}/containers/sequences/list/db_cfront.pass.cpp (72%) rename test/{std => libcxx}/containers/sequences/list/db_front.pass.cpp (70%) rename test/{std => libcxx}/containers/sequences/list/db_iterators_6.pass.cpp (70%) rename test/{std => libcxx}/containers/sequences/list/db_iterators_7.pass.cpp (69%) rename test/{std => libcxx}/containers/sequences/list/db_iterators_8.pass.cpp (71%) rename test/{std => libcxx}/containers/sequences/list/db_iterators_9.pass.cpp (94%) create mode 100644 test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp rename test/{std => libcxx}/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp (66%) rename test/{std => libcxx}/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp (65%) rename test/{std => libcxx}/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp (65%) rename test/{std => libcxx}/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp (65%) rename test/{std => libcxx}/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp (65%) rename test/{std => libcxx}/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp (67%) create mode 100644 test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.special/db_swap_1.pass.cpp create mode 100644 test/libcxx/containers/sequences/list/list.special/db_swap_2.pass.cpp rename test/{std => libcxx}/containers/sequences/list/version.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/const_value_type.pass.cpp (90%) rename test/{std => libcxx}/containers/sequences/vector/db_back.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_cback.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_cfront.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_cindex.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_front.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_index.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_iterators_2.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_iterators_3.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_iterators_4.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_iterators_5.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_iterators_6.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_iterators_7.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/db_iterators_8.pass.cpp (100%) rename test/{std => libcxx}/containers/sequences/vector/version.pass.cpp (100%) create mode 100644 test/libcxx/containers/unord/key_value_traits.pass.cpp rename test/{std => libcxx}/containers/unord/next_prime.pass.cpp (100%) rename test/{std => libcxx}/containers/unord/unord.map/db_iterators_7.pass.cpp (100%) rename test/{std => libcxx}/containers/unord/unord.map/db_iterators_8.pass.cpp (100%) rename test/{std => libcxx}/containers/unord/unord.map/db_local_iterators_7.pass.cpp (100%) rename test/{std => libcxx}/containers/unord/unord.map/db_local_iterators_8.pass.cpp (100%) rename test/{std => libcxx}/containers/unord/unord.map/version.pass.cpp (100%) delete mode 100644 test/libcxx/containers/unord/unord.set/insert_dup_alloc.pass.cpp rename test/{std => libcxx}/containers/unord/unord.set/version.pass.cpp (100%) rename test/{std => libcxx}/depr/depr.c.headers/extern_c.pass.cpp (100%) rename test/{std => libcxx}/depr/depr.str.strstreams/version.pass.cpp (100%) create mode 100644 test/libcxx/diagnostics/assertions/version_cassert.pass.cpp create mode 100644 test/libcxx/diagnostics/errno/version_cerrno.pass.cpp rename test/{std => libcxx}/diagnostics/std.exceptions/version.pass.cpp (100%) rename test/{std => libcxx}/diagnostics/syserr/version.pass.cpp (100%) create mode 100644 test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp create mode 100644 test/libcxx/experimental/filesystem/lit.local.cfg create mode 100644 test/libcxx/experimental/filesystem/version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/db_deallocate.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/max_size.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/db_deallocate.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.aliases/header_deque_libcpp_version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.aliases/header_forward_list_libcpp_version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.aliases/header_list_libcpp_version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.aliases/header_map_libcpp_version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.aliases/header_regex_libcpp_version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.aliases/header_set_libcpp_version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.aliases/header_string_libcpp_version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.aliases/header_unordered_map_libcpp_version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.aliases/header_unordered_set_libcpp_version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.aliases/header_vector_libcpp_version.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp create mode 100644 test/libcxx/experimental/memory/memory.resource.synop/version.pass.cpp rename test/{std => libcxx}/experimental/optional/version.pass.cpp (100%) rename test/{std => libcxx}/experimental/utilities/meta/version.pass.cpp (100%) rename test/{std => libcxx}/experimental/utilities/utility/version.pass.cpp (100%) rename test/{std => libcxx}/extensions/hash/specializations.fail.cpp (100%) rename test/{std => libcxx}/extensions/hash/specializations.pass.cpp (100%) rename test/{std => libcxx}/extensions/hash_map/const_iterator.fail.cpp (100%) rename test/{std => libcxx}/extensions/nothing_to_do.pass.cpp (100%) rename test/{std => libcxx}/input.output/file.streams/c.files/version_ccstdio.pass.cpp (100%) rename test/{std => libcxx}/input.output/file.streams/c.files/version_cinttypes.pass.cpp (100%) rename test/{std => libcxx}/input.output/file.streams/fstreams/version.pass.cpp (100%) rename test/{std => libcxx}/input.output/iostream.format/input.streams/version.pass.cpp (100%) rename test/{std => libcxx}/input.output/iostream.format/output.streams/version.pass.cpp (100%) rename test/{std => libcxx}/input.output/iostream.format/std.manip/version.pass.cpp (100%) rename test/{std => libcxx}/input.output/iostream.forward/version.pass.cpp (100%) rename test/{std => libcxx}/input.output/iostream.objects/version.pass.cpp (100%) rename test/{std => libcxx}/input.output/iostreams.base/version.pass.cpp (100%) rename test/{std => libcxx}/input.output/stream.buffers/version.pass.cpp (100%) rename test/{std => libcxx}/input.output/string.streams/version.pass.cpp (100%) rename test/{std => libcxx}/iterators/version.pass.cpp (100%) rename test/{std => libcxx}/language.support/cstdint/version.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.pass.cpp (96%) rename test/{std => libcxx}/language.support/support.dynamic/version.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.exception/version.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.initlist/version.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.limits/c.limits/version_cfloat.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.limits/c.limits/version_climits.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.limits/limits/version.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.rtti/version.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.runtime/version_csetjmp.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.runtime/version_csignal.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.runtime/version_cstdarg.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.runtime/version_cstdbool.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.runtime/version_cstdlib.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.runtime/version_ctime.pass.cpp (100%) rename test/{std => libcxx}/language.support/support.types/version.pass.cpp (100%) rename test/{std => libcxx}/localization/c.locales/version.pass.cpp (100%) rename test/{std => libcxx}/localization/locale.categories/__scan_keyword.pass.cpp (100%) rename test/{std => libcxx}/localization/locale.stdcvt/version.pass.cpp (100%) create mode 100644 test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp rename test/{std => libcxx}/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp (100%) rename test/{std => libcxx}/localization/locales/locale/locale.types/locale.id/id.pass.cpp (100%) rename test/{std => libcxx}/localization/version.pass.cpp (100%) rename test/{std => libcxx}/numerics/cfenv/version.pass.cpp (100%) rename test/{std => libcxx}/numerics/complex.number/version.pass.cpp (100%) rename test/{std => libcxx}/numerics/numarray/version.pass.cpp (100%) rename test/{std => libcxx}/numerics/numeric.ops/version.pass.cpp (100%) rename test/{std => libcxx}/numerics/rand/rand.synopsis/version.pass.cpp (100%) rename test/{std/strings/basic.string/string.modifiers/string_erase => libcxx/strings/basic.string/string.modifiers}/erase_iter_db1.pass.cpp (100%) rename test/{std/strings/basic.string/string.modifiers/string_erase => libcxx/strings/basic.string/string.modifiers}/erase_iter_db2.pass.cpp (100%) rename test/{std/strings/basic.string/string.modifiers/string_erase => libcxx/strings/basic.string/string.modifiers}/erase_iter_iter_db1.pass.cpp (100%) rename test/{std/strings/basic.string/string.modifiers/string_erase => libcxx/strings/basic.string/string.modifiers}/erase_iter_iter_db2.pass.cpp (100%) rename test/{std/strings/basic.string/string.modifiers/string_erase => libcxx/strings/basic.string/string.modifiers}/erase_iter_iter_db3.pass.cpp (100%) rename test/{std/strings/basic.string/string.modifiers/string_erase => libcxx/strings/basic.string/string.modifiers}/erase_iter_iter_db4.pass.cpp (100%) rename test/{std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type4.fail.cpp => libcxx/strings/basic.string/string.modifiers/erase_pop_back_db1.pass.cpp} (62%) create mode 100644 test/libcxx/strings/basic.string/string.modifiers/insert_iter_char_db1.pass.cpp rename test/{std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type3.fail.cpp => libcxx/strings/basic.string/string.modifiers/insert_iter_size_char_db1.pass.cpp} (57%) rename test/{std => libcxx}/strings/c.strings/version_cctype.pass.cpp (100%) rename test/{std => libcxx}/strings/c.strings/version_cstring.pass.cpp (100%) rename test/{std => libcxx}/strings/c.strings/version_cuchar.pass.cpp (100%) rename test/{std => libcxx}/strings/c.strings/version_cwchar.pass.cpp (100%) rename test/{std => libcxx}/strings/c.strings/version_cwctype.pass.cpp (100%) rename test/{std => libcxx}/strings/version.pass.cpp (100%) create mode 100644 test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp create mode 100644 test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp rename test/{std/thread/futures/futures.tas => libcxx/thread/futures/futures.task}/types.pass.cpp (90%) rename test/{std => libcxx}/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp (100%) rename test/{std => libcxx}/thread/thread.condition/version.pass.cpp (100%) create mode 100644 test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp rename test/{std => libcxx}/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/native_handle.pass.cpp (100%) rename test/{std => libcxx}/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/native_handle.pass.cpp (100%) create mode 100644 test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp create mode 100644 test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp create mode 100644 test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp create mode 100644 test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp create mode 100644 test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp rename test/{std => libcxx}/thread/thread.mutex/version.pass.cpp (100%) rename test/{std => libcxx}/thread/thread.threads/thread.thread.class/thread.thread.member/native_handle.pass.cpp (100%) rename test/{std => libcxx}/thread/thread.threads/thread.thread.class/types.pass.cpp (100%) rename test/{std => libcxx}/thread/thread.threads/version.pass.cpp (100%) rename test/{std/utilities/function.objects/func.require/bullet_1_and_2.pass.cpp => libcxx/utilities/function.objects/func.require/bullet_1_2_3.pass.cpp} (85%) rename test/{std/utilities/function.objects/func.require/bullet_3_and_4.pass.cpp => libcxx/utilities/function.objects/func.require/bullet_4_5_6.pass.cpp} (60%) rename test/{std/utilities/function.objects/func.require/bullet_5.pass.cpp => libcxx/utilities/function.objects/func.require/bullet_7.pass.cpp} (99%) rename test/{std => libcxx}/utilities/function.objects/func.require/invoke.pass.cpp (87%) rename test/{std => libcxx}/utilities/function.objects/func.require/invoke_helpers.h (56%) rename test/{std => libcxx}/utilities/function.objects/version.pass.cpp (100%) rename test/{std => libcxx}/utilities/memory/version.pass.cpp (100%) create mode 100644 test/libcxx/utilities/meta/is_referenceable.pass.cpp rename test/{std => libcxx}/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp (100%) rename test/{std => libcxx}/utilities/meta/version.pass.cpp (100%) rename test/{std => libcxx}/utilities/ratio/version.pass.cpp (100%) rename test/{std => libcxx}/utilities/template.bitset/version.pass.cpp (100%) rename test/{std => libcxx}/utilities/time/version.pass.cpp (100%) rename test/{std => libcxx}/utilities/tuple/version.pass.cpp (100%) rename test/{std => libcxx}/utilities/type.index/version.pass.cpp (100%) create mode 100644 test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp create mode 100644 test/libcxx/utilities/utility/pairs/pairs.pair/trivial_copy_move_ABI.pass.cpp rename test/{std => libcxx}/utilities/utility/version.pass.cpp (100%) create mode 100644 test/std/algorithms/alg.sorting/alg.clamp/clamp.comp.pass.cpp create mode 100644 test/std/algorithms/alg.sorting/alg.clamp/clamp.pass.cpp create mode 100644 test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp create mode 100644 test/std/containers/associative/iterator_types.pass.cpp create mode 100644 test/std/containers/associative/map/PR28469_undefined_behavior_segfault.sh.cpp create mode 100644 test/std/containers/associative/map/incomplete_type.pass.cpp create mode 100644 test/std/containers/associative/map/map.cons/compare_copy_constructible.fail.cpp create mode 100644 test/std/containers/associative/map/map.modifiers/insert_and_emplace_allocator_requirements.pass.cpp create mode 100644 test/std/containers/associative/multimap/incomplete_type.pass.cpp create mode 100644 test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp create mode 100644 test/std/containers/associative/multimap/multimap.modifiers/insert_allocator_requirements.pass.cpp create mode 100644 test/std/containers/associative/multiset/incomplete_type.pass.cpp create mode 100644 test/std/containers/associative/multiset/insert_allocator_requirements.pass.cpp create mode 100644 test/std/containers/associative/multiset/multiset.cons/compare_copy_constructible.fail.cpp create mode 100644 test/std/containers/associative/set/incomplete_type.pass.cpp create mode 100644 test/std/containers/associative/set/insert_and_emplace_allocator_requirements.pass.cpp create mode 100644 test/std/containers/associative/set/set.cons/compare_copy_constructible.fail.cpp create mode 100644 test/std/containers/container.adaptors/priority.queue/types.fail.cpp create mode 100644 test/std/containers/container.adaptors/queue/queue.defn/types.fail.cpp create mode 100644 test/std/containers/container.adaptors/stack/stack.defn/types.fail.cpp create mode 100644 test/std/containers/map_allocator_requirement_test_templates.h create mode 100644 test/std/containers/sequences/forwardlist/incomplete.pass.cpp delete mode 100644 test/std/containers/sequences/list/list.special/db_swap_1.pass.cpp create mode 100644 test/std/containers/sequences/vector.bool/reference.swap.pass.cpp create mode 100644 test/std/containers/set_allocator_requirement_test_templates.h create mode 100644 test/std/containers/unord/iterator_difference_type.pass.cpp create mode 100644 test/std/containers/unord/unord.map/incomplete_type.pass.cpp create mode 100644 test/std/containers/unord/unord.map/unord.map.cnstr/compare_copy_constructible.fail.cpp create mode 100644 test/std/containers/unord/unord.map/unord.map.cnstr/hash_copy_constructible.fail.cpp create mode 100644 test/std/containers/unord/unord.map/unord.map.modifiers/insert_and_emplace_allocator_requirements.pass.cpp create mode 100644 test/std/containers/unord/unord.multimap/incomplete.pass.cpp create mode 100644 test/std/containers/unord/unord.multimap/unord.multimap.cnstr/compare_copy_constructible.fail.cpp create mode 100644 test/std/containers/unord/unord.multimap/unord.multimap.cnstr/hash_copy_constructible.fail.cpp create mode 100644 test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_allocator_requirements.pass.cpp create mode 100644 test/std/containers/unord/unord.multiset/incomplete.pass.cpp create mode 100644 test/std/containers/unord/unord.multiset/insert_allocator_requirements.pass.cpp create mode 100644 test/std/containers/unord/unord.multiset/unord.multiset.cnstr/compare_copy_constructible.fail.cpp create mode 100644 test/std/containers/unord/unord.multiset/unord.multiset.cnstr/hash_copy_constructible.fail.cpp create mode 100644 test/std/containers/unord/unord.set/incomplete.pass.cpp create mode 100644 test/std/containers/unord/unord.set/insert_and_emplace_allocator_requirements.pass.cpp create mode 100644 test/std/containers/unord/unord.set/unord.set.cnstr/compare_copy_constructible.fail.cpp create mode 100644 test/std/containers/unord/unord.set/unord.set.cnstr/hash_copy_constructible.fail.cpp delete mode 100644 test/std/depr/depr.c.headers/math_h_isinf.pass.cpp delete mode 100644 test/std/depr/depr.c.headers/math_h_isnan.pass.cpp create mode 100644 test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp create mode 120000 test/std/experimental/filesystem/Inputs/static_test_env/bad_symlink create mode 100644 test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/afile3 create mode 100644 test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/dir3/file5 create mode 100644 test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/file4 create mode 120000 test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/symlink_to_dir3 create mode 100644 test/std/experimental/filesystem/Inputs/static_test_env/dir1/file1 create mode 100644 test/std/experimental/filesystem/Inputs/static_test_env/dir1/file2 create mode 100644 test/std/experimental/filesystem/Inputs/static_test_env/empty_file create mode 100644 test/std/experimental/filesystem/Inputs/static_test_env/non_empty_file create mode 120000 test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_dir create mode 120000 test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_empty_file create mode 100644 test/std/experimental/filesystem/class.directory_entry/directory_entry.cons.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_entry/directory_entry.mods.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/comparisons.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/path.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/status.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/increment.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp create mode 100644 test/std/experimental/filesystem/class.directory_iterator/types.pass.cpp create mode 100644 test/std/experimental/filesystem/class.file_status/file_status.cons.pass.cpp create mode 100644 test/std/experimental/filesystem/class.file_status/file_status.mods.pass.cpp create mode 100644 test/std/experimental/filesystem/class.file_status/file_status.obs.pass.cpp create mode 100644 test/std/experimental/filesystem/class.filesystem_error/filesystem_error.members.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.itr/iterator.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.assign/copy.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.assign/move.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.construct/copy.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.construct/default.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.construct/move.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.generic.obs/named_overloads.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.modifiers/make_preferred.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_extension.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_filename.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.modifiers/swap.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.native.obs/named_overloads.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.native.obs/string_alloc.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.nonmember/append_op.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.nonmember/path.factory.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.nonmember/path.io.unicode_bug.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/path.nonmember/swap.pass.cpp create mode 100644 test/std/experimental/filesystem/class.path/synop.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp create mode 100644 test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.enum/check_bitmask_types.hpp create mode 100644 test/std/experimental/filesystem/fs.enum/enum.copy_options.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.enum/enum.directory_options.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.enum/enum.file_type.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.enum/enum.perms.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.error.report/tested_elsewhere.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.filesystem.synopsis/file_time_type.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.absolute/absolute.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.canonical/canonical.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.current_path/current_path.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.file_size/file_size.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.is_other/is_other.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.status/status.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.status_known/status_known.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.system_complete/system_complete.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp create mode 100644 test/std/experimental/filesystem/fs.req.namespace/namespace.pass.cpp create mode 100644 test/std/experimental/filesystem/lit.local.cfg create mode 100644 test/std/experimental/iterator/nothing_to_do.pass.cpp create mode 100644 test/std/experimental/iterator/ostream.joiner/ostream.joiner.cons/ostream_joiner.cons.pass.cpp create mode 100644 test/std/experimental/iterator/ostream.joiner/ostream.joiner.creation/make_ostream_joiner.pass.cpp create mode 100644 test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp create mode 100644 test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.postincrement.pass.cpp create mode 100644 test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.pretincrement.pass.cpp create mode 100644 test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.star.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/copy.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/memory_resource_convert.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/other_alloc.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.overview/nothing_to_do.pass.cpp create mode 100644 test/std/experimental/memory/memory.polymorphic.allocator.class/nothing_to_do.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_copy.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_move.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/default.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_allocate_and_deallocate.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_is_equal.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.overview/overview.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource.synop/nothing_to_do.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource/construct.fail.cpp create mode 100644 test/std/experimental/memory/memory.resource/memory.resource.eq/equal.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource/memory.resource.eq/not_equal.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource/memory.resource.overview/nothing_to_do.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource/memory.resource.priv/protected_members.fail.cpp create mode 100644 test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource/memory.resource.public/deallocate.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource/memory.resource.public/dtor.pass.cpp create mode 100644 test/std/experimental/memory/memory.resource/memory.resource.public/is_equal.pass.cpp create mode 100644 test/std/experimental/memory/nothing_to_do.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.assignment/assign.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.assignment/assign_convertible_element_type.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.assignment/assign_convertible_propagate_const.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.assignment/assign_element_type.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.assignment/move_assign.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.assignment/move_assign_convertible.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.assignment/move_assign_convertible_propagate_const.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/convertible_element_type.explicit.ctor.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/convertible_element_type.non-explicit.ctor.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/convertible_propagate_const.copy_ctor.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/convertible_propagate_const.explicit.move_ctor.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/convertible_propagate_const.move_ctor.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/copy_ctor.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/element_type.explicit.ctor.pass.cpp rename test/std/{utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type1.fail.cpp => experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/element_type.non-explicit.ctor.pass.cpp} (60%) rename test/std/{utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type2.fail.cpp => experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/move_ctor.pass.cpp} (59%) create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.non-const_observers/dereference.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.non-const_observers/explicit_operator_element_type_ptr.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.non-const_observers/get.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.non-const_observers/op_arrow.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.non-const_observers/operator_element_type_ptr.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.observers/dereference.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.observers/explicit_operator_element_type_ptr.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.observers/get.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.observers/op_arrow.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.observers/operator_element_type_ptr.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.class/swap.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.comparison_function_objects/equal_to.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.comparison_function_objects/greater.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.comparison_function_objects/greater_equal.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.comparison_function_objects/less.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.comparison_function_objects/less_equal.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.comparison_function_objects/not_equal_to.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.relops/equal.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.relops/greater_equal.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.relops/greater_than.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.relops/less_equal.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.relops/less_than.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/propagate_const.relops/not_equal.pass.cpp create mode 100644 test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/swap.pass.cpp rename test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/{minus1.pass => minus1.pass.cpp} (66%) rename test/std/input.output/iostreams.base/ios/basic.ios.members/{narow.pass.cpp => narrow.pass.cpp} (100%) rename test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/{ostream_delem.pass.cpp => ostream_delim.pass.cpp} (70%) create mode 100644 test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp create mode 100644 test/std/localization/locales/locale/locale.types/locale.facet/tested_elsewhere.pass.cpp create mode 100644 test/std/localization/locales/locale/locale.types/locale.id/tested_elsewhere.pass.cpp delete mode 100644 test/std/numerics/c.math/cmath_isinf.pass.cpp delete mode 100644 test/std/numerics/c.math/cmath_isnan.pass.cpp rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/assign_copy.fail.cpp (94%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/assign_move.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/ctor1.fail.cpp (95%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/ctor2.fail.cpp (96%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/ctor_copy.fail.cpp (94%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/ctor_default.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/ctor_func.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/ctor_func_alloc.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/ctor_move.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/dtor.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/get_future.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/make_ready_at_thread_exit.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/operator.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/reset.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.members/swap.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.nonmembers/swap.pass.cpp (100%) rename test/std/thread/futures/{futures.tas => futures.task}/futures.task.nonmembers/uses_allocator.pass.cpp (100%) create mode 100644 test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_adopt_lock.pass.cpp create mode 100644 test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp create mode 100644 test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp create mode 100644 test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp create mode 100644 test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp create mode 100644 test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp create mode 100644 test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp create mode 100644 test/std/utilities/function.objects/bind/func.bind/func.bind.bind/PR23141_invoke_not_constexpr.pass.cpp create mode 100644 test/std/utilities/function.objects/bind/func.bind/func.bind.bind/bind_return_type.pass.cpp create mode 100644 test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp create mode 100644 test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp create mode 100644 test/std/utilities/function.objects/func.require/INVOKE_tested_elsewhere.pass.cpp rename test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/{copy.pass.cpp => copy_move.pass.cpp} (58%) create mode 100644 test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp create mode 100644 test/std/utilities/memory/specialized.algorithms/specialized.addressof/constexpr_addressof.pass.cpp rename test/std/utilities/memory/storage.iterator/{raw_storag_iterator.base.pass.cpp => raw_storage_iterator.base.pass.cpp} (96%) rename test/std/utilities/memory/storage.iterator/{raw_storag_iterator.pass.cpp => raw_storage_iterator.pass.cpp} (100%) create mode 100644 test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp rename test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/{allocate_shared_no_variadics.pass.cpp => allocate_shared_cxx03.pass.cpp} (97%) rename test/std/utilities/meta/{meta.hel => meta.help}/bool_constant.pass.cpp (95%) rename test/std/utilities/meta/{meta.hel => meta.help}/integral_constant.pass.cpp (100%) create mode 100644 test/std/utilities/meta/meta.rel/is_callable.pass.cpp create mode 100644 test/std/utilities/meta/meta.rel/is_nothrow_callable.pass.cpp create mode 100644 test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_swappable.pass.cpp create mode 100644 test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_swappable_with.pass.cpp create mode 100644 test/std/utilities/meta/meta.unary/meta.unary.prop/is_swappable.pass.cpp create mode 100644 test/std/utilities/meta/meta.unary/meta.unary.prop/is_swappable_include_order.pass.cpp create mode 100644 test/std/utilities/meta/meta.unary/meta.unary.prop/is_swappable_with.pass.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.apply/apply_extended_types.pass.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.apply/apply_large_arity.pass.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR27684_contains_ref_to_incomplete_type.pass.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.fail.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.fail.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.fail.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.cnstr/test_lazy_sfinae.pass.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp create mode 100644 test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.pass.cpp create mode 100644 test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp create mode 100644 test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp create mode 100644 test/std/utilities/utility/synopsis.pass.cpp create mode 100644 test/support/assert_checkpoint.h create mode 100644 test/support/container_test_types.h create mode 100644 test/support/filesystem_dynamic_test_helper.py create mode 100644 test/support/filesystem_test_helper.hpp create mode 100644 test/support/propagate_const_helpers.h create mode 100644 test/support/rapid-cxx-test.hpp create mode 100644 test/support/test.support/test_convertible_header.pass.cpp create mode 100644 test/support/test.support/test_macros_header_exceptions.fail.cpp create mode 100644 test/support/test.support/test_macros_header_exceptions.pass.cpp create mode 100644 test/support/test.support/test_macros_header_rtti.fail.cpp create mode 100644 test/support/test.support/test_macros_header_rtti.pass.cpp create mode 100644 test/support/test_convertible.hpp create mode 100644 test/support/test_memory_resource.hpp create mode 100644 test/support/type_id.h create mode 100644 test/support/uses_alloc_types.hpp create mode 100644 test/ubsan_blacklist.txt delete mode 100644 www/kona.html delete mode 100644 www/lit_usage.html create mode 100644 www/upcoming_meeting.html diff --git a/.arcconfig b/.arcconfig index 6d07e827fcb8..c96fbc1b4e6c 100644 --- a/.arcconfig +++ b/.arcconfig @@ -1,4 +1,4 @@ { "project_id" : "libcxx", - "conduit_uri" : "http://reviews.llvm.org/" + "conduit_uri" : "https://reviews.llvm.org/" } diff --git a/CMakeLists.txt b/CMakeLists.txt index e6c96f64711b..d618e8358cae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ #=============================================================================== # Setup Project #=============================================================================== -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.4.3) if(POLICY CMP0042) cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default @@ -12,13 +12,6 @@ if(POLICY CMP0022) cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang endif() -project(libcxx CXX C) - -set(PACKAGE_NAME libcxx) -set(PACKAGE_VERSION trunk-svn) -set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") -set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") - # Add path for custom modules set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" @@ -26,6 +19,25 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ) +# Find the LLVM sources and simulate LLVM CMake options. +include(HandleOutOfTreeLLVM) + +if (LIBCXX_BUILT_STANDALONE) + project(libcxx CXX C) + + set(PACKAGE_NAME libcxx) + set(PACKAGE_VERSION trunk-svn) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") + set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") +endif () + +if (LIBCXX_BUILT_STANDALONE AND NOT LLVM_FOUND) + message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: " + "llvm-config not found and LLVM_PATH not defined.\n" + "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config " + "or -DLLVM_PATH=path/to/llvm-source-root.") +endif() + # Require out of source build. include(MacroEnsureOutOfSourceBuild) MACRO_ENSURE_OUT_OF_SOURCE_BUILD( @@ -33,15 +45,6 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD( build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there." ) -# Find the LLVM sources and simulate LLVM CMake options. -include(HandleOutOfTreeLLVM) -if (LIBCXX_BUILT_STANDALONE AND NOT LLVM_FOUND) - message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: " - "llvm-config not found and LLVM_PATH not defined.\n" - "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config " - "or -DLLVM_PATH=path/to/llvm-source-root.") -endif() - #=============================================================================== # Setup CMake Options #=============================================================================== @@ -49,7 +52,9 @@ endif() # Basic options --------------------------------------------------------------- option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON) option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON) - +option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON) +option(LIBCXX_ENABLE_FILESYSTEM + "Build filesystem as part of libc++experimental.a" ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY}) option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS}) option(LIBCXX_INCLUDE_DOCS "Build the libc++ documentation." ${LLVM_INCLUDE_DOCS}) set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING @@ -57,6 +62,7 @@ set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON) option(LIBCXX_INSTALL_LIBRARY "Install the libc++ library." ON) option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON) +option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY "Install libc++experimental.a" OFF) set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.") option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF) @@ -92,7 +98,8 @@ option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF) set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF) if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "none" - AND PYTHONINTERP_FOUND) + AND PYTHONINTERP_FOUND + AND LIBCXX_ENABLE_SHARED) set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE ON) endif() @@ -121,12 +128,14 @@ option(LIBCXX_ENABLE_MONOTONIC_CLOCK "Build libc++ with support for a monotonic clock. This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON) option(LIBCXX_HAS_MUSL_LIBC "Build libc++ with support for the Musl C library" OFF) +option(LIBCXX_HAS_PTHREAD_API "Ignore auto-detection and force use of pthread API" OFF) # Misc options ---------------------------------------------------------------- # FIXME: Turn -pedantic back ON. It is currently off because it warns # about #include_next which is used everywhere. option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." OFF) option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) +option(LIBCXX_DISABLE_MACRO_CONFLICT_WARNINGS "Disable #warnings about conflicting macros." OFF) option(LIBCXX_GENERATE_COVERAGE "Enable generating code coverage." OFF) set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING @@ -160,6 +169,11 @@ option(LIBCXX_CONFIGURE_IDE "Configure libcxx for use within an IDE" # Check option configurations #=============================================================================== +if (LIBCXX_ENABLE_FILESYSTEM AND NOT LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY) + message(FATAL_ERROR + "LIBCXX_ENABLE_FILESYSTEM cannot be turned on when LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF") +endif() + # Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is set to ON only when # LIBCXX_ENABLE_THREADS is on. if(LIBCXX_ENABLE_THREADS AND NOT LIBCXX_ENABLE_MONOTONIC_CLOCK) @@ -167,6 +181,11 @@ if(LIBCXX_ENABLE_THREADS AND NOT LIBCXX_ENABLE_MONOTONIC_CLOCK) " when LIBCXX_ENABLE_THREADS is also set to OFF.") endif() +if(LIBCXX_HAS_PTHREAD_API AND NOT LIBCXX_ENABLE_THREADS) + message(FATAL_ERROR "LIBCXX_HAS_PTHREAD_API can only be set to ON" + " when LIBCXX_ENABLE_THREADS is also set to ON.") +endif() + # Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE # is ON. if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE) @@ -199,6 +218,9 @@ if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT) if (NOT PYTHONINTERP_FOUND) message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT requires python but it was not found.") endif() + if (NOT LIBCXX_ENABLE_SHARED) + message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT is only available for shared library builds.") + endif() endif() if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT) @@ -233,6 +255,18 @@ set(LIBCXX_COMPILE_FLAGS "") set(LIBCXX_LINK_FLAGS "") set(LIBCXX_LIBRARIES "") +# Include macros for adding and removing libc++ flags. +include(HandleLibcxxFlags) + +# Target flags ================================================================ +# These flags get added to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS so that +# 'config-ix' use them during feature checks. It also adds them to both +# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS' +add_target_flags_if(LIBCXX_BUILD_32_BITS "-m32") +add_target_flags_if(LIBCXX_TARGET_TRIPLE "-target ${LIBCXX_TARGET_TRIPLE}") +add_target_flags_if(LIBCXX_SYSROOT "--sysroot=${LIBCXX_SYSROOT}") +add_target_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}") + # Configure compiler. include(config-ix) @@ -248,10 +282,7 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) # Setup Compiler Flags #=============================================================================== -include(HandleLibCXXABI) # Steup the ABI library flags - -# Include macros for adding and removing libc++ flags. -include(HandleLibcxxFlags) +include(HandleLibCXXABI) # Setup the ABI library flags # Remove flags that may have snuck in. remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG @@ -274,17 +305,13 @@ endif() # headers add_compile_flags_if_supported(-nostdinc++) -# Target flags ================================================================ -add_flags_if(LIBCXX_BUILD_32_BITS -m32) -add_flags_if(LIBCXX_TARGET_TRIPLE "-target ${LIBCXX_TARGET_TRIPLE}") -add_flags_if(LIBCXX_SYSROOT "--sysroot ${LIBCXX_SYSROOT}") -add_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}") # Warning flags =============================================================== add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) add_compile_flags_if_supported( -Wall -W -Wwrite-strings - -Wno-unused-parameter -Wno-long-long + -Wno-unused-parameter -Wno-long-long -Wno-user-defined-literals + -Wno-covered-switch-default -Werror=return-type) if (LIBCXX_ENABLE_WERROR) add_compile_flags_if_supported(-Werror) @@ -297,6 +324,9 @@ endif() if (LIBCXX_ENABLE_PEDANTIC) add_compile_flags_if_supported(-pedantic) endif() +if (LIBCXX_DISABLE_MACRO_CONFLICT_WARNINGS) + add_definitions(-D_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) +endif() # Exception flags ============================================================= if (LIBCXX_ENABLE_EXCEPTIONS) @@ -376,6 +406,7 @@ config_define_if_not(LIBCXX_ENABLE_THREADS _LIBCPP_HAS_NO_THREADS) config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCPP_HAS_NO_MONOTONIC_CLOCK) config_define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS) +config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCPP_HAS_THREAD_API_PTHREAD) config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC) if (LIBCXX_NEEDS_SITE_CONFIG) diff --git a/CREDITS.TXT b/CREDITS.TXT index 1cf713a68842..ceb12c42b965 100644 --- a/CREDITS.TXT +++ b/CREDITS.TXT @@ -37,6 +37,10 @@ E: mclow.lists@gmail.com E: marshall@idio.com D: C++14 support, patches and bug fixes. +N: Jonathan B Coe +E: jbcoe@me.com +D: Implementation of propagate_const. + N: Eric Fiselier E: eric@efcs.ca D: LFTS support, patches and bug fixes. diff --git a/LICENSE.TXT b/LICENSE.TXT index 53352e42dd1f..339e232c68fd 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -14,7 +14,7 @@ Full text of the relevant licenses is included below. University of Illinois/NCSA Open Source License -Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2016 by the contributors listed in CREDITS.TXT All rights reserved. diff --git a/Makefile b/Makefile deleted file mode 100644 index ab7b5b603a04..000000000000 --- a/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -## -# libc++ Makefile -## - -SRCDIRS = . -DESTDIR = $(DSTROOT) - -OBJROOT=. -SYMROOT=. -export TRIPLE=-apple- - -ifeq (,$(RC_INDIGO)) - INSTALL_PREFIX="" -else - INSTALL_PREFIX="$(SDKROOT)" -endif -INSTALL_DIR=$(DSTROOT)/$(INSTALL_PREFIX) - -.PHONY: help installsrc clean installheaders install - -help:: - @echo "Use make install DSTROOT=" - -installsrc:: $(SRCROOT) - - ditto $(SRCDIRS)/include $(SRCROOT)/include - ditto $(SRCDIRS)/lib $(SRCROOT)/lib - ditto $(SRCDIRS)/src $(SRCROOT)/src - ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile - -clean:: - -# The installheaders target is used by clang's runtime/libcxx makefile. -installheaders:: - mkdir -p $(HEADER_DIR)/c++/v1/ext - (cd $(SRCDIRS)/include && \ - tar cf - --exclude=".*" --exclude=support \ - --exclude=CMakeLists.txt *) | \ - (cd $(HEADER_DIR)/c++/v1 && tar xf -) - chmod 755 $(HEADER_DIR)/c++/v1 - chmod 644 $(HEADER_DIR)/c++/v1/* - chmod 755 $(HEADER_DIR)/c++/v1/ext - chmod 644 $(HEADER_DIR)/c++/v1/ext/* - chmod 755 $(HEADER_DIR)/c++/v1/experimental - chmod 644 $(HEADER_DIR)/c++/v1/experimental/* - -install:: - - cd lib && ./buildit - ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib - cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM \ - $(SYMROOT)/usr/lib/libc++.1.dylib - mkdir -p $(INSTALL_DIR)/usr/lib - strip -S -o $(INSTALL_DIR)/usr/lib/libc++.1.dylib \ - $(SYMROOT)/usr/lib/libc++.1.dylib - cd $(INSTALL_DIR)/usr/lib && ln -s libc++.1.dylib libc++.dylib diff --git a/benchmarks/unordered_set_operations.bench.cpp b/benchmarks/unordered_set_operations.bench.cpp new file mode 100644 index 000000000000..c9ee689f69d3 --- /dev/null +++ b/benchmarks/unordered_set_operations.bench.cpp @@ -0,0 +1,44 @@ +#include +#include +#include + +#include "benchmark/benchmark_api.h" + +template +std::vector getInputs(size_t N) { + std::vector inputs; + for (size_t i=0; i < N; ++i) { + inputs.push_back(i); + } + return inputs; +} + +template +void BM_SetInsert(benchmark::State& st, Container c, Inputs const& in) { + const auto end = in.end(); + while (st.KeepRunning()) { + c.clear(); + for (auto it = in.begin(); it != end; ++it) { + benchmark::DoNotOptimize(c.insert(*it)); + } + benchmark::DoNotOptimize(c); + } +} +BENCHMARK_CAPTURE(BM_SetInsert, uint32_insert, + std::unordered_set{}, getInputs(1024)); + +template +void BM_SetFind(benchmark::State& st, Container c, Inputs const& in) { + c.insert(in.begin(), in.end()); + const auto end = in.end(); + while (st.KeepRunning()) { + for (auto it = in.begin(); it != end; ++it) { + benchmark::DoNotOptimize(c.find(*it)); + } + } +} +BENCHMARK_CAPTURE(BM_SetFind, uint32_lookup, + std::unordered_set{}, getInputs(1024)); + + +BENCHMARK_MAIN() diff --git a/cmake/Modules/CheckLibcxxAtomic.cmake b/cmake/Modules/CheckLibcxxAtomic.cmake new file mode 100644 index 000000000000..4ff343236fea --- /dev/null +++ b/cmake/Modules/CheckLibcxxAtomic.cmake @@ -0,0 +1,41 @@ +INCLUDE(CheckCXXSourceCompiles) + +# Sometimes linking against libatomic is required for atomic ops, if +# the platform doesn't support lock-free atomics. +# +# We could modify LLVM's CheckAtomic module and have it check for 64-bit +# atomics instead. However, we would like to avoid careless uses of 64-bit +# atomics inside LLVM over time on 32-bit platforms. + +function(check_cxx_atomics varname) + set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + set(CMAKE_REQUIRED_FLAGS "-std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include") + if (${LIBCXX_GCC_TOOLCHAIN}) + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}") + endif() + check_cxx_source_compiles(" +#include +#include +std::atomic x; +std::atomic y; +int main() { + return x + y; +} +" ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) +endfunction(check_cxx_atomics) + +check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB) +check_library_exists(atomic __atomic_fetch_add_8 "" LIBCXX_HAS_ATOMIC_LIB) +# If not, check if the library exists, and atomics work with it. +if(NOT LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB) + if(LIBCXX_HAS_ATOMIC_LIB) + list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") + check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB) + if (NOT LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB) + message(WARNING "Host compiler must support std::atomic!") + endif() + else() + message(WARNING "Host compiler appears to require libatomic, but cannot find it.") + endif() +endif() diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake index d9c652d87bad..c655adff718e 100644 --- a/cmake/Modules/HandleLibCXXABI.cmake +++ b/cmake/Modules/HandleLibCXXABI.cmake @@ -21,9 +21,11 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs) CACHE PATH "Paths to C++ ABI header directories separated by ';'." FORCE ) - + set(LIBCXX_CXX_ABI_LIBRARY_PATH "${LIBCXX_CXX_ABI_LIBRARY_PATH}" + CACHE PATH + "Paths to C++ ABI library directory" + ) set(LIBCXX_CXX_ABI_LIBRARY ${abilib}) - set(LIBCXX_ABILIB_FILES ${abifiles}) file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include") diff --git a/cmake/Modules/HandleLibcxxFlags.cmake b/cmake/Modules/HandleLibcxxFlags.cmake index bb886fa8a01f..325c1bdf7bcb 100644 --- a/cmake/Modules/HandleLibcxxFlags.cmake +++ b/cmake/Modules/HandleLibcxxFlags.cmake @@ -35,6 +35,11 @@ macro(remove_flags) endforeach() endmacro(remove_flags) +macro(check_flag_supported flag) + mangle_name("${flag}" flagname) + check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") +endmacro() + # Add a macro definition if condition is true. macro(define_if condition def) if (${condition}) @@ -71,6 +76,26 @@ macro(config_define value def) set(LIBCXX_NEEDS_SITE_CONFIG ON) endmacro() +# Add a list of flags to all of 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS', +# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS'. +macro(add_target_flags) + foreach(value ${ARGN}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${value}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${value}") + list(APPEND LIBCXX_COMPILE_FLAGS ${value}) + list(APPEND LIBCXX_LINK_FLAGS ${value}) + endforeach() +endmacro() + +# If the specified 'condition' is true then add a list of flags to +# all of 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS', 'LIBCXX_COMPILE_FLAGS' +# and 'LIBCXX_LINK_FLAGS'. +macro(add_target_flags_if condition) + if (${condition}) + add_target_flags(${ARGN}) + endif() +endmacro() + # Add a specified list of flags to both 'LIBCXX_COMPILE_FLAGS' and # 'LIBCXX_LINK_FLAGS'. macro(add_flags) diff --git a/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake index 6215be7f586a..9c5dd8109261 100644 --- a/cmake/Modules/HandleOutOfTreeLLVM.cmake +++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake @@ -35,7 +35,7 @@ macro(find_llvm_parts) set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include") set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree") set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") - set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake") + set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") else() set(LLVM_FOUND OFF) return() @@ -93,14 +93,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) endif() set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit") - # Make sure we can use the console pool for recent cmake and ninja > 1.5 - # Needed for add_lit_testsuite - if(CMAKE_VERSION VERSION_LESS 3.1.20141117) - set(cmake_3_2_USES_TERMINAL) - else() - set(cmake_3_2_USES_TERMINAL USES_TERMINAL) - endif() - # Required doc configuration if (LLVM_ENABLE_SPHINX) message(STATUS "Sphinx enabled.") diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index c05597ea73dd..3e6c3599d23d 100644 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -1,5 +1,6 @@ include(CheckLibraryExists) include(CheckCXXCompilerFlag) +include(CheckLibcxxAtomic) # Check compiler flags diff --git a/docs/BuildingLibcxx.rst b/docs/BuildingLibcxx.rst index f00ce4f9cff1..36866b13ef7b 100644 --- a/docs/BuildingLibcxx.rst +++ b/docs/BuildingLibcxx.rst @@ -1,3 +1,4 @@ +.. _BuildingLibcxx: =============== Building libc++ @@ -6,6 +7,8 @@ Building libc++ .. contents:: :local: +.. _build instructions: + Getting Started =============== @@ -34,8 +37,7 @@ The basic steps needed to build libc++ are: #. Configure and build libc++ with libc++abi: - CMake is the only supported configuration system. Unlike other LLVM - projects autotools is not supported for either libc++ or libc++abi. + CMake is the only supported configuration system. Clang is the preferred compiler when building and using libc++. @@ -120,6 +122,18 @@ CMake docs or execute ``cmake --help-variable VARIABLE_NAME``. libc++ specific options ----------------------- +.. option:: LIBCXX_INSTALL_LIBRARY:BOOL + + **Default**: ``ON`` + + Toggle the installation of the library portion of libc++. + +.. option:: LIBCXX_INSTALL_HEADERS:BOOL + + **Default**: ``ON`` + + Toggle the installation of the libc++ headers. + .. option:: LIBCXX_ENABLE_ASSERTIONS:BOOL **Default**: ``ON`` @@ -144,6 +158,33 @@ libc++ specific options Extra suffix to append to the directory where libraries are to be installed. This option overrides :option:`LLVM_LIBDIR_SUFFIX`. + +.. _libc++experimental options: + +libc++experimental Specific Options +------------------------------------ + +.. option:: LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL + + **Default**: ``ON`` + + Build and test libc++experimental.a. + +.. option:: LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY:BOOL + + **Default**: ``OFF`` + + Install libc++experimental.a alongside libc++. + + +.. option:: LIBCXX_ENABLE_FILESYSTEM:BOOL + + **Default**: ``LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY`` + + Build filesystem as part of libc++experimental.a. This allows filesystem + to be disabled without turning off the entire experimental library. + + .. _ABI Library Specific Options: ABI Library Specific Options @@ -304,3 +345,72 @@ own copy of libsupc++ and this can lead to subtle problems. $ make install You can now run clang with -stdlib=libc++. + + +.. _libcxxrt_ref: + +Using libcxxrt on Linux +------------------------ + +You will need to keep the source tree of `libcxxrt`_ available +on your build machine and your copy of the libcxxrt shared library must +be placed where your linker will find it. + +We can now run CMake like: + +.. code-block:: bash + + $ CC=clang CXX=clang++ cmake -G "Unix Makefiles" \ + -DLIBCXX_CXX_ABI=libcxxrt \ + -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxrt-sources/src \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + + $ make cxx + $ make install + +Unfortunately you can't simply run clang with "-stdlib=libc++" at this point, as +clang is set up to link for libc++ linked to libsupc++. To get around this +you'll have to set up your linker yourself (or patch clang). For example, + +.. code-block:: bash + + $ clang++ -stdlib=libc++ helloworld.cpp \ + -nodefaultlibs -lc++ -lcxxrt -lm -lc -lgcc_s -lgcc + +Alternately, you could just add libcxxrt to your libraries list, which in most +situations will give the same result: + +.. code-block:: bash + + $ clang++ -stdlib=libc++ helloworld.cpp -lcxxrt + +.. _`libcxxrt`: https://github.com/pathscale/libcxxrt/ + + +Using a local ABI library installation +--------------------------------------- + +.. warning:: + This is not recommended in almost all cases. + +These instructions should only be used when you can't install your ABI library. + +Normally you must link libc++ against a ABI shared library that the +linker can find. If you want to build and test libc++ against an ABI +library not in the linker's path you needq to set +``-DLIBCXX_CXX_ABI_LIBRARY_PATH=/path/to/abi/lib`` when configuring CMake. + +An example build using libc++abi would look like: + +.. code-block:: bash + + $ CC=clang CXX=clang++ cmake \ + -DLIBCXX_CXX_ABI=libc++abi \ + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/path/to/libcxxabi/include" \ + -DLIBCXX_CXX_ABI_LIBRARY_PATH="/path/to/libcxxabi-build/lib" \ + path/to/libcxx + $ make + +When testing libc++ LIT will automatically link against the proper ABI +library. diff --git a/docs/TestingLibcxx.rst b/docs/TestingLibcxx.rst index 98162d9c2e05..9226ae17023e 100644 --- a/docs/TestingLibcxx.rst +++ b/docs/TestingLibcxx.rst @@ -98,7 +98,7 @@ configuration. Passing the option on the command line will override the default. .. program:: lit -.. option:: cxx_under_test= +.. option:: --cxx_under_test= Specify the compiler used to build the tests. @@ -108,37 +108,46 @@ configuration. Passing the option on the command line will override the default. Change the standard version used when building the tests. -.. option:: libcxx_site_config= +.. option:: --libcxx_site_config= Specify the site configuration to use when running the tests. This option overrides the enviroment variable LIBCXX_SITE_CONFIG. -.. option:: libcxx_headers= +.. option:: --libcxx_headers= Specify the libc++ headers that are tested. By default the headers in the source tree are used. -.. option:: libcxx_library= +.. option:: --cxx_library_root= - Specify the libc++ library that is tested. By default the library in the - build directory is used. This option cannot be used when use_system_lib is - provided. + Specify the directory of the libc++ library to be tested. By default the + library folder of the build directory is used. This option cannot be used + when use_system_lib is provided. -.. option:: use_system_lib= + +.. option:: --cxx_runtime_root= + + Specify the directory of the libc++ library to use at runtime. This directory + is not added to the linkers search path. This can be used to compile tests + against one version of libc++ and run them using another. The default value + for this option is `cxx_library_root`. This option cannot be used + when use_system_lib is provided. + +.. option:: --use_system_lib= **Default**: False Enable or disable testing against the installed version of libc++ library. Note: This does not use the installed headers. -.. option:: use_lit_shell= +.. option:: --use_lit_shell= Enable or disable the use of LIT's internal shell in ShTests. If the environment variable LIT_USE_INTERNAL_SHELL is present then that is used as the default value. Otherwise the default value is True on Windows and False on every other platform. -.. option:: no_default_flags= +.. option:: --no_default_flags= **Default**: False @@ -146,16 +155,16 @@ configuration. Passing the option on the command line will override the default. option is used only flags specified using the compile_flags and link_flags will be used. -.. option:: compile_flags="" +.. option:: --compile_flags="" Specify additional compile flags as a space delimited string. Note: This options should not be used to change the standard version used. -.. option:: link_flags="" +.. option:: --link_flags="" Specify additional link flags as a space delimited string. -.. option:: debug_level= +.. option:: --debug_level= **Values**: 0, 1 diff --git a/docs/UsingLibcxx.rst b/docs/UsingLibcxx.rst index 2a117917638c..514ed14b7464 100644 --- a/docs/UsingLibcxx.rst +++ b/docs/UsingLibcxx.rst @@ -49,7 +49,30 @@ An example of using ``LD_LIBRARY_PATH``: $ export LD_LIBRARY_PATH=/lib $ ./a.out # Searches for libc++ along LD_LIBRARY_PATH +Using libc++experimental and ```` +===================================================== +Libc++ provides implementations of experimental technical specifications +in a separate library, ``libc++experimental.a``. Users of ```` +headers may be required to link ``-lc++experimental``. + +.. code-block:: bash + + $ clang++ -std=c++14 -stdlib=libc++ test.cpp -lc++experimental + +Libc++experimental.a may not always be available, even when libc++ is already +installed. For information on building libc++experimental from source see +:ref:`Building Libc++ ` and +:ref:`libc++experimental CMake Options `. + +Also see the `Experimental Library Implementation Status `__ +page. + +.. warning:: + Experimental libraries are Experimental. + * The contents of the ```` headers and ``libc++experimental.a`` + library will not remain compatible between versions. + * No guarantees of API or ABI stability are provided. Using libc++ on Linux ===================== @@ -87,3 +110,16 @@ not just libstdc++ so they must be manually linked. For example: $ g++ -nostdinc++ -I/include/c++/v1 \ test.cpp -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc + + +GDB Pretty printers for libc++ +------------------------------ + +GDB does not support pretty-printing of libc++ symbols by default. Unfortunately +libc++ does not provide pretty-printers itself. However there are 3rd +party implementations available and although they are not officially +supported by libc++ they may be useful to users. + +Known 3rd Party Implementations Include: + +* `Koutheir's libc++ pretty-printers `_. diff --git a/docs/conf.py b/docs/conf.py index 915daa47a514..e385406b9923 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,16 +40,16 @@ master_doc = 'index' # General information about the project. project = u'libc++' -copyright = u'2011-2015, LLVM Project' +copyright = u'2011-2016, LLVM Project' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '3.8' +version = '3.9' # The full version, including alpha/beta/rc tags. -release = '3.8' +release = '3.9' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index e16dc8b4de63..219d1b730839 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -19,7 +19,7 @@ file(COPY . if (LIBCXX_INSTALL_HEADERS) install(DIRECTORY . DESTINATION include/c++/v1 - COMPONENT libcxx + COMPONENT libcxx-headers FILES_MATCHING ${LIBCXX_HEADER_PATTERN} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ @@ -41,12 +41,23 @@ if (LIBCXX_INSTALL_HEADERS) # Add a target that executes the generation commands. add_custom_target(generate_config_header ALL DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config) + set(generated_config_deps generate_config_header) # Install the generated header as __config. install(FILES ${LIBCXX_BINARY_DIR}/__generated_config DESTINATION include/c++/v1 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ RENAME __config - COMPONENT libcxx) + COMPONENT libcxx-headers) + endif() + + if (NOT CMAKE_CONFIGURATION_TYPES) + # this target is just needed as a placeholder for the distribution target + add_custom_target(libcxx-headers) + add_custom_target(install-libcxx-headers + DEPENDS libcxx-headers ${generated_config_deps} + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT=libcxx-headers + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") endif() endif() diff --git a/include/__bsd_locale_defaults.h b/include/__bsd_locale_defaults.h new file mode 100644 index 000000000000..f315ca2949e3 --- /dev/null +++ b/include/__bsd_locale_defaults.h @@ -0,0 +1,33 @@ +// -*- C++ -*- +//===---------------------- __bsd_locale_defaults.h -----------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// +// The BSDs have lots of *_l functions. We don't want to define those symbols +// on other platforms though, for fear of conflicts with user code. So here, +// we will define the mapping from an internal macro to the real BSD symbol. +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_BSD_LOCALE_DEFAULTS_H +#define _LIBCPP_BSD_LOCALE_DEFAULTS_H + +#define __libcpp_mb_cur_max_l(loc) MB_CUR_MAX_L(loc) +#define __libcpp_btowc_l(ch, loc) btowc_l(ch, loc) +#define __libcpp_wctob_l(wch, loc) wctob_l(wch, loc) +#define __libcpp_wcsnrtombs_l(dst, src, nwc, len, ps, loc) wcsnrtombs_l(dst, src, nwc, len, ps, loc) +#define __libcpp_wcrtomb_l(src, wc, ps, loc) wcrtomb_l(src, wc, ps, loc) +#define __libcpp_mbsnrtowcs_l(dst, src, nms, len, ps, loc) mbsnrtowcs_l(dst, src, nms, len, ps, loc) +#define __libcpp_mbrtowc_l(pwc, s, n, ps, l) mbrtowc_l(pwc, s, n, ps, l) +#define __libcpp_mbtowc_l(pwc, pmb, max, l) mbtowc_l(pwc, pmb, max, l) +#define __libcpp_mbrlen_l(s, n, ps, l) mbrlen_l(s, n, ps, l) +#define __libcpp_localeconv_l(l) localeconv_l(l) +#define __libcpp_mbsrtowcs_l(dest, src, len, ps, l) mbsrtowcs_l(dest, src, len, ps, l) +#define __libcpp_snprintf_l(...) snprintf_l(__VA_ARGS__) +#define __libcpp_asprintf_l(...) asprintf_l(__VA_ARGS__) +#define __libcpp_sscanf_l(...) sscanf_l(__VA_ARGS__) + +#endif // _LIBCPP_BSD_LOCALE_DEFAULTS_H diff --git a/include/__bsd_locale_fallbacks.h b/include/__bsd_locale_fallbacks.h new file mode 100644 index 000000000000..cbc8ad226fd2 --- /dev/null +++ b/include/__bsd_locale_fallbacks.h @@ -0,0 +1,138 @@ +// -*- C++ -*- +//===---------------------- __bsd_locale_fallbacks.h ----------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// +// The BSDs have lots of *_l functions. This file provides reimplementations +// of those functions for non-BSD platforms. +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H +#define _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H + +#include +#include + +_LIBCPP_BEGIN_NAMESPACE_STD + +typedef _VSTD::remove_pointer::type __use_locale_struct; +typedef _VSTD::unique_ptr<__use_locale_struct, decltype(&uselocale)> __locale_raii; + +inline _LIBCPP_ALWAYS_INLINE +decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return MB_CUR_MAX; +} + +inline _LIBCPP_ALWAYS_INLINE +wint_t __libcpp_btowc_l(int __c, locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return btowc(__c); +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_wctob_l(wint_t __c, locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return wctob(__c); +} + +inline _LIBCPP_ALWAYS_INLINE +size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc, + size_t __len, mbstate_t *__ps, locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return wcsnrtombs(__dest, __src, __nwc, __len, __ps); +} + +inline _LIBCPP_ALWAYS_INLINE +size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return wcrtomb(__s, __wc, __ps); +} + +inline _LIBCPP_ALWAYS_INLINE +size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms, + size_t __len, mbstate_t *__ps, locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return mbsnrtowcs(__dest, __src, __nms, __len, __ps); +} + +inline _LIBCPP_ALWAYS_INLINE +size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n, + mbstate_t *__ps, locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return mbrtowc(__pwc, __s, __n, __ps); +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return mbtowc(__pwc, __pmb, __max); +} + +inline _LIBCPP_ALWAYS_INLINE +size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return mbrlen(__s, __n, __ps); +} + +inline _LIBCPP_ALWAYS_INLINE +lconv *__libcpp_localeconv_l(locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return localeconv(); +} + +inline _LIBCPP_ALWAYS_INLINE +size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len, + mbstate_t *__ps, locale_t __l) +{ + __locale_raii __current( uselocale(__l), uselocale ); + return mbsrtowcs(__dest, __src, __len, __ps); +} + +inline +int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) { + va_list __va; + va_start(__va, __format); + __locale_raii __current( uselocale(__l), uselocale ); + int __res = vsnprintf(__s, __n, __format, __va); + va_end(__va); + return __res; +} + +inline +int __libcpp_asprintf_l(char **__s, locale_t __l, const char *__format, ...) { + va_list __va; + va_start(__va, __format); + __locale_raii __current( uselocale(__l), uselocale ); + int __res = vasprintf(__s, __format, __va); + va_end(__va); + return __res; +} + +inline +int __libcpp_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) { + va_list __va; + va_start(__va, __format); + __locale_raii __current( uselocale(__l), uselocale ); + int __res = vsscanf(__s, __format, __va); + va_end(__va); + return __res; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H diff --git a/include/__config b/include/__config index db5a832b6cd1..3edb9de017ab 100644 --- a/include/__config +++ b/include/__config @@ -27,7 +27,7 @@ #define _GNUC_VER 0 #endif -#define _LIBCPP_VERSION 3800 +#define _LIBCPP_VERSION 3900 #ifndef _LIBCPP_ABI_VERSION #define _LIBCPP_ABI_VERSION 1 @@ -41,6 +41,22 @@ #define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE // Fix undefined behavior in how std::list stores it's linked nodes. #define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB +// Fix undefined behavior in how __tree stores its end and parent nodes. +#define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB +#define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB +#define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE +#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD +#elif _LIBCPP_ABI_VERSION == 1 +// Feature macros for disabling pre ABI v1 features. All of these options +// are deprecated. +#if defined(__FreeBSD__) +#define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR +#endif +#endif + +#ifdef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR +#error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \ + use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead #endif #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y @@ -178,6 +194,12 @@ # endif #endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) +#if __has_attribute(__no_sanitize__) +#define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi"))) +#else +#define _LIBCPP_NO_CFI +#endif + #ifdef _WIN32 // only really useful for a DLL @@ -236,6 +258,12 @@ # endif #endif +#ifndef _LIBCPP_PREFERRED_OVERLOAD +# if __has_attribute(__enable_if__) +# define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, ""))) +# endif +#endif + #ifndef _LIBCPP_TYPE_VIS_ONLY # define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS #endif @@ -283,7 +311,7 @@ typedef __char16_t char16_t; typedef __char32_t char32_t; #endif -#if !(__has_feature(cxx_exceptions)) +#if !(__has_feature(cxx_exceptions)) && !defined(_LIBCPP_NO_EXCEPTIONS) #define _LIBCPP_NO_EXCEPTIONS #endif @@ -305,8 +333,6 @@ typedef __char32_t char32_t; # define _LIBCPP_NORETURN __attribute__ ((noreturn)) #endif -#define _LIBCPP_UNUSED __attribute__((__unused__)) - #if !(__has_feature(cxx_default_function_template_args)) #define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS #endif @@ -434,8 +460,8 @@ namespace std { #endif // Allow for build-time disabling of unsigned integer sanitization -#ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK -#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute((no_sanitize("unsigned-integer-overflow"))) +#if !defined(_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK) && __has_attribute(no_sanitize) +#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow"))) #endif #elif defined(__GNUC__) @@ -445,8 +471,6 @@ namespace std { #define _LIBCPP_NORETURN __attribute__((noreturn)) -#define _LIBCPP_UNUSED __attribute__((__unused__)) - #if _GNUC_VER >= 407 #define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) #define _LIBCPP_IS_LITERAL(T) __is_literal_type(T) @@ -461,8 +485,6 @@ namespace std { #define _LIBCPP_NO_EXCEPTIONS #endif -#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES - // constexpr was added to GCC in 4.6. #if _GNUC_VER < 406 #define _LIBCPP_HAS_NO_CONSTEXPR @@ -494,6 +516,7 @@ namespace std { #define _LIBCPP_HAS_NO_VARIADICS #define _LIBCPP_HAS_NO_RVALUE_REFERENCES #define _LIBCPP_HAS_NO_STRONG_ENUMS +#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES #define _LIBCPP_HAS_NO_NOEXCEPT #else // __GXX_EXPERIMENTAL_CXX0X__ @@ -517,6 +540,7 @@ namespace std { #if _GNUC_VER < 406 #define _LIBCPP_HAS_NO_NOEXCEPT #define _LIBCPP_HAS_NO_NULLPTR +#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES #endif #if _GNUC_VER < 407 @@ -552,7 +576,6 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__)); #define _LIBCPP_HAS_NO_NOEXCEPT #define __alignof__ __alignof #define _LIBCPP_NORETURN __declspec(noreturn) -#define _LIBCPP_UNUSED #define _ALIGNAS(x) __declspec(align(x)) #define _LIBCPP_HAS_NO_VARIADICS @@ -574,7 +597,6 @@ namespace std { #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) #define _ATTRIBUTE(x) __attribute__((x)) #define _LIBCPP_NORETURN __attribute__((noreturn)) -#define _LIBCPP_UNUSED #define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES @@ -655,6 +677,12 @@ template struct __static_assert_check {}; #define _LIBCPP_DEFAULT = default; #endif +#ifdef _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#define _LIBCPP_EQUAL_DELETE +#else +#define _LIBCPP_EQUAL_DELETE = delete +#endif + #ifdef __GNUC__ #define _NOALIAS __attribute__((__malloc__)) #else @@ -712,10 +740,12 @@ template struct __static_assert_check {}; #define _LIBCPP_LOCALE__L_EXTENSIONS 1 #endif -#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) && \ - !defined(__CloudABI__) +#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) +// Most unix variants have catopen. These are the specific ones that don't. +#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) #define _LIBCPP_HAS_CATOPEN 1 #endif +#endif #ifdef __FreeBSD__ #define _DECLARE_C99_LDBL_MATH 1 @@ -729,17 +759,13 @@ template struct __static_assert_check {}; #define _LIBCPP_WCTYPE_IS_MASK #endif -#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR -# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1 -#endif - #ifndef _LIBCPP_STD_VER # if __cplusplus <= 201103L # define _LIBCPP_STD_VER 11 # elif __cplusplus <= 201402L # define _LIBCPP_STD_VER 14 # else -# define _LIBCPP_STD_VER 15 // current year, or date of c++17 ratification +# define _LIBCPP_STD_VER 16 // current year, or date of c++17 ratification # endif #endif // _LIBCPP_STD_VER @@ -763,6 +789,12 @@ template struct __static_assert_check {}; #define _LIBCPP_CONSTEXPR_AFTER_CXX11 #endif +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) +#define _LIBCPP_CONSTEXPR_AFTER_CXX14 constexpr +#else +#define _LIBCPP_CONSTEXPR_AFTER_CXX14 +#endif + #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES # define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x) #else @@ -790,6 +822,25 @@ extern "C" void __sanitizer_annotate_contiguous_container( # define _LIBCPP_WEAK __attribute__((__weak__)) #endif +// Thread API +#if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) +# if defined(__FreeBSD__) || \ + defined(__NetBSD__) || \ + defined(__linux__) || \ + defined(__APPLE__) || \ + defined(__CloudABI__) || \ + defined(__sun__) +# define _LIBCPP_HAS_THREAD_API_PTHREAD +# else +# error "No thread API" +# endif // _LIBCPP_HAS_THREAD_API +#endif // _LIBCPP_HAS_NO_THREADS + +#if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD) +# error _LIBCPP_HAS_THREAD_API_PTHREAD may only be defined when \ + _LIBCPP_HAS_NO_THREADS is not defined. +#endif + #if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS) # error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \ _LIBCPP_HAS_NO_THREADS is defined. @@ -833,7 +884,20 @@ extern "C" void __sanitizer_annotate_contiguous_container( #ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK -#endif +#endif + +#if __cplusplus < 201103L +#define _LIBCPP_CXX03_LANG +#else +#if defined(_LIBCPP_HAS_NO_VARIADIC_TEMPLATES) || defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) +#error Libc++ requires a feature complete C++11 compiler in C++11 or greater. +#endif +#endif + +#if (defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS) && defined(__clang__) \ + && __has_attribute(acquire_capability)) +#define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS +#endif #endif // __cplusplus diff --git a/include/__config_site.in b/include/__config_site.in index ec64485289fa..6c2b7bb446d7 100644 --- a/include/__config_site.in +++ b/include/__config_site.in @@ -19,5 +19,6 @@ #cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK #cmakedefine _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS #cmakedefine _LIBCPP_HAS_MUSL_LIBC +#cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD #endif // _LIBCPP_CONFIG_SITE diff --git a/include/__functional_base b/include/__functional_base index 52c535aa3ea1..1a08ea29deea 100644 --- a/include/__functional_base +++ b/include/__functional_base @@ -38,8 +38,6 @@ struct _LIBCPP_TYPE_VIS_ONLY binary_function typedef _Result result_type; }; -template struct _LIBCPP_TYPE_VIS_ONLY hash; - template struct __has_result_type { @@ -306,75 +304,19 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> #endif // _LIBCPP_HAS_NO_VARIADICS -// __invoke +#ifndef _LIBCPP_CXX03_LANG -#ifndef _LIBCPP_HAS_NO_VARIADICS - -// bullets 1 and 2 - -template -inline _LIBCPP_INLINE_VISIBILITY -auto -__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) - -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...)) -{ - return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...); -} - -template -inline _LIBCPP_INLINE_VISIBILITY -auto -__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) - -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...)) -{ - return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...); -} - -// bullets 3 and 4 - -template -inline _LIBCPP_INLINE_VISIBILITY -auto -__invoke(_Fp&& __f, _A0&& __a0) - -> decltype(_VSTD::forward<_A0>(__a0).*__f) -{ - return _VSTD::forward<_A0>(__a0).*__f; -} - -template -inline _LIBCPP_INLINE_VISIBILITY -auto -__invoke(_Fp&& __f, _A0&& __a0) - -> decltype((*_VSTD::forward<_A0>(__a0)).*__f) -{ - return (*_VSTD::forward<_A0>(__a0)).*__f; -} - -// bullet 5 - -template -inline _LIBCPP_INLINE_VISIBILITY -auto -__invoke(_Fp&& __f, _Args&& ...__args) - -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...)) -{ - return _VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...); -} template struct __invoke_return { typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type; }; -#else // _LIBCPP_HAS_NO_VARIADICS +#else // defined(_LIBCPP_CXX03_LANG) #include <__functional_base_03> -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // !defined(_LIBCPP_CXX03_LANG) template @@ -577,10 +519,6 @@ public: #endif // _LIBCPP_HAS_NO_VARIADICS }; -template struct __is_reference_wrapper_impl : public false_type {}; -template struct __is_reference_wrapper_impl > : public true_type {}; -template struct __is_reference_wrapper - : public __is_reference_wrapper_impl::type> {}; template inline _LIBCPP_INLINE_VISIBILITY diff --git a/include/__hash_table b/include/__hash_table index c7d1ef3d082f..08bc519ae17f 100644 --- a/include/__hash_table +++ b/include/__hash_table @@ -17,6 +17,7 @@ #include #include #include +#include #include <__undef_min_max> #include <__undef___deallocate> @@ -29,6 +30,29 @@ _LIBCPP_BEGIN_NAMESPACE_STD + +#ifndef _LIBCPP_CXX03_LANG +template +union __hash_value_type; +#else +template +struct __hash_value_type; +#endif + +#ifndef _LIBCPP_CXX03_LANG +template +struct __is_hash_value_type_imp : false_type {}; + +template +struct __is_hash_value_type_imp<__hash_value_type<_Key, _Value>> : true_type {}; + +template +struct __is_hash_value_type : false_type {}; + +template +struct __is_hash_value_type<_One> : __is_hash_value_type_imp::type> {}; +#endif + _LIBCPP_FUNC_VIS size_t __next_prime(size_t __n); @@ -49,10 +73,10 @@ struct __hash_node typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type > { - typedef _Tp value_type; + typedef _Tp __node_value_type; size_t __hash_; - value_type __value_; + __node_value_type __value_; }; inline _LIBCPP_INLINE_VISIBILITY @@ -66,7 +90,8 @@ inline _LIBCPP_INLINE_VISIBILITY size_t __constrain_hash(size_t __h, size_t __bc) { - return !(__bc & (__bc - 1)) ? __h & (__bc - 1) : __h % __bc; + return !(__bc & (__bc - 1)) ? __h & (__bc - 1) : + (__h < __bc ? __h : __h % __bc); } inline _LIBCPP_INLINE_VISIBILITY @@ -76,24 +101,173 @@ __next_hash_pow2(size_t __n) return size_t(1) << (std::numeric_limits::digits - __clz(__n-1)); } + template class __hash_table; + +template class _LIBCPP_TYPE_VIS_ONLY __hash_iterator; template class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator; +template class _LIBCPP_TYPE_VIS_ONLY __hash_local_iterator; +template class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator; template class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator; template class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator; +template +struct __hash_key_value_types { + static_assert(!is_reference<_Tp>::value && !is_const<_Tp>::value, ""); + typedef _Tp key_type; + typedef _Tp __node_value_type; + typedef _Tp __container_value_type; + static const bool __is_map = false; + + _LIBCPP_INLINE_VISIBILITY + static key_type const& __get_key(_Tp const& __v) { + return __v; + } + _LIBCPP_INLINE_VISIBILITY + static __container_value_type const& __get_value(__node_value_type const& __v) { + return __v; + } + _LIBCPP_INLINE_VISIBILITY + static __container_value_type* __get_ptr(__node_value_type& __n) { + return _VSTD::addressof(__n); + } +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + static __container_value_type&& __move(__node_value_type& __v) { + return _VSTD::move(__v); + } +#endif +}; + +template +struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > { + typedef _Key key_type; + typedef _Tp mapped_type; + typedef __hash_value_type<_Key, _Tp> __node_value_type; + typedef pair __container_value_type; + typedef pair<_Key, _Tp> __nc_value_type; + typedef __container_value_type __map_value_type; + static const bool __is_map = true; + + _LIBCPP_INLINE_VISIBILITY + static key_type const& __get_key(__container_value_type const& __v) { + return __v.first; + } + + template + _LIBCPP_INLINE_VISIBILITY + static typename enable_if<__is_same_uncvref<_Up, __node_value_type>::value, + __container_value_type const&>::type + __get_value(_Up& __t) { + return __t.__cc; + } + + template + _LIBCPP_INLINE_VISIBILITY + static typename enable_if<__is_same_uncvref<_Up, __container_value_type>::value, + __container_value_type const&>::type + __get_value(_Up& __t) { + return __t; + } + + _LIBCPP_INLINE_VISIBILITY + static __container_value_type* __get_ptr(__node_value_type& __n) { + return _VSTD::addressof(__n.__cc); + } +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + static __nc_value_type&& __move(__node_value_type& __v) { + return _VSTD::move(__v.__nc); + } +#endif + +}; + +template , + bool = _KVTypes::__is_map> +struct __hash_map_pointer_types {}; + +template +struct __hash_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> { + typedef typename _KVTypes::__map_value_type _Mv; + typedef typename __rebind_pointer<_AllocPtr, _Mv>::type + __map_value_type_pointer; + typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type + __const_map_value_type_pointer; +}; + +template ::element_type> +struct __hash_node_types; + +template +struct __hash_node_types<_NodePtr, __hash_node<_Tp, _VoidPtr> > + : public __hash_key_value_types<_Tp>, __hash_map_pointer_types<_Tp, _VoidPtr> + +{ + typedef __hash_key_value_types<_Tp> __base; + +public: + typedef ptrdiff_t difference_type; + typedef size_t size_type; + + typedef typename __rebind_pointer<_NodePtr, void>::type __void_pointer; + + typedef typename pointer_traits<_NodePtr>::element_type __node_type; + typedef _NodePtr __node_pointer; + + typedef __hash_node_base<__node_pointer> __node_base_type; + typedef typename __rebind_pointer<_NodePtr, __node_base_type>::type + __node_base_pointer; + + typedef _Tp __node_value_type; + typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type + __node_value_type_pointer; + typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type + __const_node_value_type_pointer; +private: + static_assert(!is_const<__node_type>::value, + "_NodePtr should never be a pointer to const"); + static_assert((is_same::element_type, void>::value), + "_VoidPtr does not point to unqualified void type"); + static_assert((is_same::type, + _NodePtr>::value), "_VoidPtr does not rebind to _NodePtr."); +}; + + + +template +struct __hash_node_types_from_iterator; +template +struct __hash_node_types_from_iterator<__hash_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {}; +template +struct __hash_node_types_from_iterator<__hash_const_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {}; +template +struct __hash_node_types_from_iterator<__hash_local_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {}; +template +struct __hash_node_types_from_iterator<__hash_const_local_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {}; + + +template +struct __make_hash_node_types { + typedef __hash_node<_NodeValueTp, _VoidPtr> _NodeTp; + typedef typename __rebind_pointer<_VoidPtr, _NodeTp>::type _NodePtr; + typedef __hash_node_types<_NodePtr> type; +}; + template class _LIBCPP_TYPE_VIS_ONLY __hash_iterator { - typedef _NodePtr __node_pointer; + typedef __hash_node_types<_NodePtr> _NodeTypes; + typedef _NodePtr __node_pointer; __node_pointer __node_; public: - typedef forward_iterator_tag iterator_category; - typedef typename pointer_traits<__node_pointer>::element_type::value_type value_type; - typedef typename pointer_traits<__node_pointer>::difference_type difference_type; - typedef value_type& reference; - typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer; + typedef forward_iterator_tag iterator_category; + typedef typename _NodeTypes::__node_value_type value_type; + typedef typename _NodeTypes::difference_type difference_type; + typedef value_type& reference; + typedef typename _NodeTypes::__node_value_type_pointer pointer; _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT #if _LIBCPP_STD_VER > 11 @@ -202,25 +376,24 @@ private: template friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap; }; -template +template class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator { - typedef _ConstNodePtr __node_pointer; + static_assert(!is_const::element_type>::value, ""); + typedef __hash_node_types<_NodePtr> _NodeTypes; + typedef _NodePtr __node_pointer; - __node_pointer __node_; - - typedef typename remove_const< - typename pointer_traits<__node_pointer>::element_type - >::type __node; + __node_pointer __node_; public: - typedef forward_iterator_tag iterator_category; - typedef typename __node::value_type value_type; - typedef typename pointer_traits<__node_pointer>::difference_type difference_type; - typedef const value_type& reference; - typedef typename __rebind_pointer<__node_pointer, const value_type>::type pointer; - typedef typename __rebind_pointer<__node_pointer, __node>::type __non_const_node_pointer; - typedef __hash_iterator<__non_const_node_pointer> __non_const_iterator; + typedef __hash_iterator<_NodePtr> __non_const_iterator; + + typedef forward_iterator_tag iterator_category; + typedef typename _NodeTypes::__node_value_type value_type; + typedef typename _NodeTypes::difference_type difference_type; + typedef const value_type& reference; + typedef typename _NodeTypes::__const_node_value_type_pointer pointer; + _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT #if _LIBCPP_STD_VER > 11 @@ -336,24 +509,22 @@ private: template friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap; }; -template class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator; - template class _LIBCPP_TYPE_VIS_ONLY __hash_local_iterator { - typedef _NodePtr __node_pointer; + typedef __hash_node_types<_NodePtr> _NodeTypes; + typedef _NodePtr __node_pointer; __node_pointer __node_; size_t __bucket_; size_t __bucket_count_; - typedef pointer_traits<__node_pointer> __pointer_traits; public: typedef forward_iterator_tag iterator_category; - typedef typename __pointer_traits::element_type::value_type value_type; - typedef typename __pointer_traits::difference_type difference_type; + typedef typename _NodeTypes::__node_value_type value_type; + typedef typename _NodeTypes::difference_type difference_type; typedef value_type& reference; - typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer; + typedef typename _NodeTypes::__node_value_type_pointer pointer; _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT { @@ -476,7 +647,8 @@ private: template class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator { - typedef _ConstNodePtr __node_pointer; + typedef __hash_node_types<_ConstNodePtr> _NodeTypes; + typedef _ConstNodePtr __node_pointer; __node_pointer __node_; size_t __bucket_; @@ -487,18 +659,15 @@ class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator typedef typename remove_const<__node>::type __non_const_node; typedef typename __rebind_pointer<__node_pointer, __non_const_node>::type __non_const_node_pointer; - +public: typedef __hash_local_iterator<__non_const_node_pointer> __non_const_iterator; -public: - typedef forward_iterator_tag iterator_category; - typedef typename remove_const< - typename __pointer_traits::element_type::value_type - >::type value_type; - typedef typename __pointer_traits::difference_type difference_type; - typedef const value_type& reference; - typedef typename __rebind_pointer<__node_pointer, const value_type>::type - pointer; + + typedef forward_iterator_tag iterator_category; + typedef typename _NodeTypes::__node_value_type value_type; + typedef typename _NodeTypes::difference_type difference_type; + typedef const value_type& reference; + typedef typename _NodeTypes::__const_node_value_type_pointer pointer; _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT @@ -686,10 +855,11 @@ class __hash_node_destructor { typedef _Alloc allocator_type; typedef allocator_traits __alloc_traits; - typedef typename __alloc_traits::value_type::value_type value_type; + public: typedef typename __alloc_traits::pointer pointer; private: + typedef __hash_node_types _NodeTypes; allocator_type& __na_; @@ -709,7 +879,7 @@ public: void operator()(pointer __p) _NOEXCEPT { if (__value_constructed) - __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_)); + __alloc_traits::destroy(__na_, _NodeTypes::__get_ptr(__p->__value_)); if (__p) __alloc_traits::deallocate(__na_, __p, 1); } @@ -728,23 +898,47 @@ public: private: typedef allocator_traits __alloc_traits; + typedef typename + __make_hash_node_types::type + _NodeTypes; public: + + typedef typename _NodeTypes::__node_value_type __node_value_type; + typedef typename _NodeTypes::__container_value_type __container_value_type; + typedef typename _NodeTypes::key_type key_type; typedef value_type& reference; typedef const value_type& const_reference; typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::const_pointer const_pointer; +#ifndef _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE typedef typename __alloc_traits::size_type size_type; - typedef typename __alloc_traits::difference_type difference_type; +#else + typedef typename _NodeTypes::size_type size_type; +#endif + typedef typename _NodeTypes::difference_type difference_type; public: // Create __node - typedef __hash_node __node; + + typedef typename _NodeTypes::__node_type __node; typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator; typedef allocator_traits<__node_allocator> __node_traits; - typedef typename __node_traits::pointer __node_pointer; - typedef typename __node_traits::pointer __node_const_pointer; - typedef __hash_node_base<__node_pointer> __first_node; - typedef typename __rebind_pointer<__node_pointer, __first_node>::type - __node_base_pointer; + typedef typename _NodeTypes::__void_pointer __void_pointer; + typedef typename _NodeTypes::__node_pointer __node_pointer; + typedef typename _NodeTypes::__node_pointer __node_const_pointer; + typedef typename _NodeTypes::__node_base_type __first_node; + typedef typename _NodeTypes::__node_base_pointer __node_base_pointer; + +private: + // check for sane allocator pointer rebinding semantics. Rebinding the + // allocator for a new pointer type should be exactly the same as rebinding + // the pointer using 'pointer_traits'. + static_assert((is_same<__node_pointer, typename __node_traits::pointer>::value), + "Allocator does not rebind pointers in a sane manner."); + typedef typename __rebind_alloc_helper<__node_traits, __first_node>::type + __node_base_allocator; + typedef allocator_traits<__node_base_allocator> __node_base_traits; + static_assert((is_same<__node_base_pointer, typename __node_base_traits::pointer>::value), + "Allocator does not rebind pointers in a sane manner."); private: @@ -755,10 +949,10 @@ private: typedef typename __bucket_list_deleter::pointer __node_pointer_pointer; // --- Member data begin --- - __bucket_list __bucket_list_; - __compressed_pair<__first_node, __node_allocator> __p1_; - __compressed_pair __p2_; - __compressed_pair __p3_; + __bucket_list __bucket_list_; + __compressed_pair<__first_node, __node_allocator> __p1_; + __compressed_pair __p2_; + __compressed_pair __p3_; // --- Member data end --- _LIBCPP_INLINE_VISIBILITY @@ -809,7 +1003,7 @@ public: explicit __hash_table(const allocator_type& __a); __hash_table(const __hash_table& __u); __hash_table(const __hash_table& __u, const allocator_type& __a); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG __hash_table(__hash_table&& __u) _NOEXCEPT_( is_nothrow_move_constructible<__bucket_list>::value && @@ -818,11 +1012,11 @@ public: is_nothrow_move_constructible::value && is_nothrow_move_constructible::value); __hash_table(__hash_table&& __u, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG ~__hash_table(); __hash_table& operator=(const __hash_table& __u); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __hash_table& operator=(__hash_table&& __u) _NOEXCEPT_( @@ -848,41 +1042,103 @@ public: iterator __node_insert_multi(const_iterator __p, __node_pointer __nd); -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) - template - pair __emplace_unique(_Args&&... __args); - template - iterator __emplace_multi(_Args&&... __args); - template - iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args); -#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#ifndef _LIBCPP_CXX03_LANG + template + _LIBCPP_INLINE_VISIBILITY + pair __emplace_unique_key_args(_Key const& __k, _Args&&... __args); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template + template _LIBCPP_INLINE_VISIBILITY - pair __insert_unique_value(_ValueTp&& __x); -#else + pair __emplace_unique_impl(_Args&&... __args); + + template _LIBCPP_INLINE_VISIBILITY - pair __insert_unique_value(const value_type& __x); + pair __emplace_unique(_Pp&& __x) { + return __emplace_unique_extract_key(_VSTD::forward<_Pp>(__x), + __can_extract_key<_Pp, key_type>()); + } + + template + _LIBCPP_INLINE_VISIBILITY + typename enable_if< + __can_extract_map_key<_First, key_type, __container_value_type>::value, + pair + >::type __emplace_unique(_First&& __f, _Second&& __s) { + return __emplace_unique_key_args(__f, _VSTD::forward<_First>(__f), + _VSTD::forward<_Second>(__s)); + } + + template + _LIBCPP_INLINE_VISIBILITY + pair __emplace_unique(_Args&&... __args) { + return __emplace_unique_impl(_VSTD::forward<_Args>(__args)...); + } + + template + _LIBCPP_INLINE_VISIBILITY + pair + __emplace_unique_extract_key(_Pp&& __x, __extract_key_fail_tag) { + return __emplace_unique_impl(_VSTD::forward<_Pp>(__x)); + } + template + _LIBCPP_INLINE_VISIBILITY + pair + __emplace_unique_extract_key(_Pp&& __x, __extract_key_self_tag) { + return __emplace_unique_key_args(__x, _VSTD::forward<_Pp>(__x)); + } + template + _LIBCPP_INLINE_VISIBILITY + pair + __emplace_unique_extract_key(_Pp&& __x, __extract_key_first_tag) { + return __emplace_unique_key_args(__x.first, _VSTD::forward<_Pp>(__x)); + } + + template + _LIBCPP_INLINE_VISIBILITY + iterator __emplace_multi(_Args&&... __args); + template + _LIBCPP_INLINE_VISIBILITY + iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args); + + + _LIBCPP_INLINE_VISIBILITY + pair + __insert_unique(__container_value_type&& __x) { + return __emplace_unique_key_args(_NodeTypes::__get_key(__x), _VSTD::move(__x)); + } + + template ::value + >::type> + _LIBCPP_INLINE_VISIBILITY + pair __insert_unique(_Pp&& __x) { + return __emplace_unique(_VSTD::forward<_Pp>(__x)); + } + + template + _LIBCPP_INLINE_VISIBILITY + iterator __insert_multi(_Pp&& __x) { + return __emplace_multi(_VSTD::forward<_Pp>(__x)); + } + + template + _LIBCPP_INLINE_VISIBILITY + iterator __insert_multi(const_iterator __p, _Pp&& __x) { + return __emplace_hint_multi(__p, _VSTD::forward<_Pp>(__x)); + } + +#else // !defined(_LIBCPP_CXX03_LANG) + template + pair __emplace_unique_key_args(_Key const&, _Args& __args); + + iterator __insert_multi(const __container_value_type& __x); + iterator __insert_multi(const_iterator __p, const __container_value_type& __x); #endif - pair __insert_unique(const value_type& __x); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - pair __insert_unique(value_type&& __x); - template - pair __insert_unique(_Pp&& __x); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template - iterator __insert_multi(_Pp&& __x); - template - iterator __insert_multi(const_iterator __p, _Pp&& __x); -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES - iterator __insert_multi(const value_type& __x); - iterator __insert_multi(const_iterator __p, const value_type& __x); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY + pair __insert_unique(const __container_value_type& __x) { + return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x); + } void clear() _NOEXCEPT; void rehash(size_type __n); @@ -1042,16 +1298,17 @@ public: private: void __rehash(size_type __n); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template - __node_holder __construct_node(_Args&& ...__args); -#endif // _LIBCPP_HAS_NO_VARIADICS - __node_holder __construct_node(value_type&& __v, size_t __hash); -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES - __node_holder __construct_node(const value_type& __v); + __node_holder __construct_node(_Args&& ...__args); + + template + __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest); +#else // _LIBCPP_CXX03_LANG + __node_holder __construct_node(const __container_value_type& __v); + __node_holder __construct_node_hash(size_t __hash, const __container_value_type& __v); #endif - __node_holder __construct_node(const value_type& __v, size_t __hash); + _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __hash_table& __u) @@ -1061,6 +1318,7 @@ private: _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __hash_table&, false_type) {} +#ifndef _LIBCPP_CXX03_LANG void __move_assign(__hash_table& __u, false_type); void __move_assign(__hash_table& __u, true_type) _NOEXCEPT_( @@ -1087,6 +1345,7 @@ private: } _LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {} +#endif // _LIBCPP_CXX03_LANG void __deallocate(__node_pointer __np) _NOEXCEPT; __node_pointer __detach() _NOEXCEPT; @@ -1163,7 +1422,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u, { } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u) @@ -1212,11 +1471,15 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u, } } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table() { + static_assert((is_copy_constructible::value), + "Predicate must be copy-constructible."); + static_assert((is_copy_constructible::value), + "Hasher must be copy-constructible."); __deallocate(__p1_.first().__next_); #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__erase_c(this); @@ -1277,7 +1540,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__node_pointer __np) } __get_db()->unlock(); #endif - __node_traits::destroy(__na, _VSTD::addressof(__np->__value_)); + __node_traits::destroy(__na, _NodeTypes::__get_ptr(__np->__value_)); __node_traits::deallocate(__na, __np, 1); __np = __next; } @@ -1296,7 +1559,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach() _NOEXCEPT return __cache; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template void @@ -1369,8 +1632,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign( const_iterator __i = __u.begin(); while (__u.size() != 0) { - __node_holder __h = - __construct_node(_VSTD::move(__u.remove(__i++)->__value_)); + __node_holder __h = __construct_node(_NodeTypes::__move(__u.remove(__i++)->__value_)); __node_insert_multi(__h.get()); __h.release(); } @@ -1392,7 +1654,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template template @@ -1400,6 +1662,11 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first, _InputIterator __last) { + typedef iterator_traits<_InputIterator> _ITraits; + typedef typename _ITraits::value_type _ItValueType; + static_assert((is_same<_ItValueType, __container_value_type>::value), + "__assign_unique may only be called with the containers value type"); + if (bucket_count() != 0) { __node_pointer __cache = __detach(); @@ -1434,6 +1701,12 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first, _InputIterator __last) { + typedef iterator_traits<_InputIterator> _ITraits; + typedef typename _ITraits::value_type _ItValueType; + static_assert((is_same<_ItValueType, __container_value_type>::value || + is_same<_ItValueType, __node_value_type>::value), + "__assign_multi may only be called with the containers value type" + " or the nodes value type"); if (bucket_count() != 0) { __node_pointer __cache = __detach(); @@ -1459,7 +1732,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first, __deallocate(__cache); } for (; __first != __last; ++__first) - __insert_multi(*__first); + __insert_multi(_NodeTypes::__get_value(*__first)); } template @@ -1685,31 +1958,24 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi( return __node_insert_multi(__cp); } -template -pair::iterator, bool> -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(const value_type& __x) -{ - return __insert_unique_value(__x); -} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template -template +template _LIBCPP_INLINE_VISIBILITY pair::iterator, bool> -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(_ValueTp&& __x) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args) #else template +template _LIBCPP_INLINE_VISIBILITY pair::iterator, bool> -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(const value_type& __x) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args& __args) #endif { -#if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) - typedef const value_type& _ValueTp; -#endif - size_t __hash = hash_function()(__x); + + size_t __hash = hash_function()(__k); size_type __bc = bucket_count(); bool __inserted = false; __node_pointer __nd; @@ -1724,13 +1990,17 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(const value_type __constrain_hash(__nd->__hash_, __bc) == __chash; __nd = __nd->__next_) { - if (key_eq()(__nd->__value_, __x)) + if (key_eq()(__nd->__value_, __k)) goto __done; } } } { - __node_holder __h = __construct_node(_VSTD::forward<_ValueTp>(__x), __hash); +#ifndef _LIBCPP_CXX03_LANG + __node_holder __h = __construct_node_hash(__hash, _VSTD::forward<_Args>(__args)...); +#else + __node_holder __h = __construct_node_hash(__hash, __args); +#endif if (size()+1 > __bc * max_load_factor() || __bc == 0) { rehash(_VSTD::max(2 * __bc + !__is_hash_power2(__bc), @@ -1742,7 +2012,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(const value_type __node_pointer __pn = __bucket_list_[__chash]; if (__pn == nullptr) { - __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())); + __pn = static_cast<__node_pointer>(static_cast<__void_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()))); __h->__next_ = __pn->__next_; __pn->__next_ = __h.get(); // fix up __bucket_list_ @@ -1768,13 +2038,12 @@ __done: #endif } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template template pair::iterator, bool> -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique(_Args&&... __args) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_impl(_Args&&... __args) { __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...); pair __r = __node_insert_unique(__h.get()); @@ -1811,64 +2080,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi( return __r; } -#endif // _LIBCPP_HAS_NO_VARIADICS - -template -pair::iterator, bool> -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(value_type&& __x) -{ - return __insert_unique_value(_VSTD::move(__x)); -} - -template -template -pair::iterator, bool> -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_Pp&& __x) -{ - __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x)); - pair __r = __node_insert_unique(__h.get()); - if (__r.second) - __h.release(); - return __r; -} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - -template -template -typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(_Pp&& __x) -{ - __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x)); - iterator __r = __node_insert_multi(__h.get()); - __h.release(); - return __r; -} - -template -template -typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p, - _Pp&& __x) -{ -#if _LIBCPP_DEBUG_LEVEL >= 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "unordered container::insert(const_iterator, rvalue) called with an iterator not" - " referring to this unordered container"); -#endif - __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x)); - iterator __r = __node_insert_multi(__p, __h.get()); - __h.release(); - return __r; -} - -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#else // _LIBCPP_CXX03_LANG template typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const value_type& __x) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const __container_value_type& __x) { __node_holder __h = __construct_node(__x); iterator __r = __node_insert_multi(__h.get()); @@ -1879,7 +2095,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const value_type& __x) template typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p, - const value_type& __x) + const __container_value_type& __x) { #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, @@ -1892,7 +2108,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p, return __r; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template void @@ -1986,10 +2202,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) if (__nd != nullptr) { for (__nd = __nd->__next_; __nd != nullptr && - __constrain_hash(__nd->__hash_, __bc) == __chash; + (__nd->__hash_ == __hash + || __constrain_hash(__nd->__hash_, __bc) == __chash); __nd = __nd->__next_) { - if (key_eq()(__nd->__value_, __k)) + if ((__nd->__hash_ == __hash) && key_eq()(__nd->__value_, __k)) #if _LIBCPP_DEBUG_LEVEL >= 2 return iterator(__nd, this); #else @@ -2015,10 +2232,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const if (__nd != nullptr) { for (__nd = __nd->__next_; __nd != nullptr && - __constrain_hash(__nd->__hash_, __bc) == __chash; + (__hash == __nd->__hash_ || __constrain_hash(__nd->__hash_, __bc) == __chash); __nd = __nd->__next_) { - if (key_eq()(__nd->__value_, __k)) + if ((__nd->__hash_ == __hash) && key_eq()(__nd->__value_, __k)) #if _LIBCPP_DEBUG_LEVEL >= 2 return const_iterator(__nd, this); #else @@ -2031,70 +2248,74 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const return end(); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template template typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&& ...__args) { + static_assert(!__is_hash_value_type<_Args...>::value, + "Construct cannot be called with a hash value type"); __node_allocator& __na = __node_alloc(); __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); - __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...); + __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), _VSTD::forward<_Args>(__args)...); __h.get_deleter().__value_constructed = true; __h->__hash_ = hash_function()(__h->__value_); __h->__next_ = nullptr; return __h; } -#endif // _LIBCPP_HAS_NO_VARIADICS - template +template typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(value_type&& __v, - size_t __hash) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash( + size_t __hash, _First&& __f, _Rest&& ...__rest) { + static_assert(!__is_hash_value_type<_First, _Rest...>::value, + "Construct cannot be called with a hash value type"); __node_allocator& __na = __node_alloc(); __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); - __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::move(__v)); + __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), + _VSTD::forward<_First>(__f), + _VSTD::forward<_Rest>(__rest)...); __h.get_deleter().__value_constructed = true; __h->__hash_ = __hash; __h->__next_ = nullptr; return __h; } -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#else // _LIBCPP_CXX03_LANG template typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const __container_value_type& __v) { __node_allocator& __na = __node_alloc(); __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); - __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v); + __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v); __h.get_deleter().__value_constructed = true; __h->__hash_ = hash_function()(__h->__value_); __h->__next_ = nullptr; return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v, - size_t __hash) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(size_t __hash, + const __container_value_type& __v) { __node_allocator& __na = __node_alloc(); __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); - __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v); + __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v); __h.get_deleter().__value_constructed = true; __h->__hash_ = __hash; __h->__next_ = nullptr; return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 } +#endif // _LIBCPP_CXX03_LANG + template typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p) diff --git a/include/__mutex_base b/include/__mutex_base index b019b4760d18..38a76ac6f2ec 100644 --- a/include/__mutex_base +++ b/include/__mutex_base @@ -14,9 +14,7 @@ #include <__config> #include #include -#ifndef _LIBCPP_HAS_NO_THREADS -#include -#endif +#include <__threading_support> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -26,29 +24,41 @@ _LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_HAS_NO_THREADS -class _LIBCPP_TYPE_VIS mutex +#ifndef _LIBCPP_THREAD_SAFETY_ANNOTATION +# ifdef _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS +# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) __attribute__((x)) +# else +# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) +# endif +#endif // _LIBCPP_THREAD_SAFETY_ANNOTATION + +class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex { - pthread_mutex_t __m_; +#ifndef _LIBCPP_HAS_NO_CONSTEXPR + __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER; +#else + __libcpp_mutex_t __m_; +#endif public: _LIBCPP_INLINE_VISIBILITY #ifndef _LIBCPP_HAS_NO_CONSTEXPR - constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {} + constexpr mutex() _NOEXCEPT _LIBCPP_DEFAULT #else - mutex() _NOEXCEPT {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;} + mutex() _NOEXCEPT {__m_ = (__libcpp_mutex_t)_LIBCPP_MUTEX_INITIALIZER;} #endif - ~mutex(); + ~mutex(); private: mutex(const mutex&);// = delete; mutex& operator=(const mutex&);// = delete; public: - void lock(); - bool try_lock() _NOEXCEPT; - void unlock() _NOEXCEPT; + void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability()); + bool try_lock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true)); + void unlock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()); - typedef pthread_mutex_t* native_handle_type; + typedef __libcpp_mutex_t* native_handle_type; _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;} }; @@ -70,8 +80,21 @@ constexpr adopt_lock_t adopt_lock = adopt_lock_t(); #endif + +// Forward declare lock_guard as a variadic template even in C++03 to keep +// the mangling consistent between dialects. +#if defined(_LIBCPP_ABI_VARIADIC_LOCK_GUARD) +template +class _LIBCPP_TYPE_VIS_ONLY lock_guard; +#endif + template -class _LIBCPP_TYPE_VIS_ONLY lock_guard +class _LIBCPP_TYPE_VIS_ONLY _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable) +#if !defined(_LIBCPP_ABI_VARIADIC_LOCK_GUARD) +lock_guard +#else +lock_guard<_Mutex> +#endif { public: typedef _Mutex mutex_type; @@ -81,17 +104,17 @@ private: public: _LIBCPP_INLINE_VISIBILITY - explicit lock_guard(mutex_type& __m) + explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m)) : __m_(__m) {__m_.lock();} _LIBCPP_INLINE_VISIBILITY - lock_guard(mutex_type& __m, adopt_lock_t) + lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m)) : __m_(__m) {} _LIBCPP_INLINE_VISIBILITY - ~lock_guard() {__m_.unlock();} + ~lock_guard() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();} private: - lock_guard(lock_guard const&);// = delete; - lock_guard& operator=(lock_guard const&);// = delete; + lock_guard(lock_guard const&) _LIBCPP_EQUAL_DELETE; + lock_guard& operator=(lock_guard const&) _LIBCPP_EQUAL_DELETE; }; template @@ -109,24 +132,24 @@ public: unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {} _LIBCPP_INLINE_VISIBILITY explicit unique_lock(mutex_type& __m) - : __m_(&__m), __owns_(true) {__m_->lock();} + : __m_(_VSTD::addressof(__m)), __owns_(true) {__m_->lock();} _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT - : __m_(&__m), __owns_(false) {} + : __m_(_VSTD::addressof(__m)), __owns_(false) {} _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, try_to_lock_t) - : __m_(&__m), __owns_(__m.try_lock()) {} + : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock()) {} _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, adopt_lock_t) - : __m_(&__m), __owns_(true) {} + : __m_(_VSTD::addressof(__m)), __owns_(true) {} template _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t) - : __m_(&__m), __owns_(__m.try_lock_until(__t)) {} + : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_until(__t)) {} template _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d) - : __m_(&__m), __owns_(__m.try_lock_for(__d)) {} + : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_for(__d)) {} _LIBCPP_INLINE_VISIBILITY ~unique_lock() { @@ -268,13 +291,18 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status) class _LIBCPP_TYPE_VIS condition_variable { - pthread_cond_t __cv_; +#ifndef _LIBCPP_HAS_NO_CONSTEXPR + __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER; +#else + __libcpp_condvar_t __cv_; +#endif + public: _LIBCPP_INLINE_VISIBILITY #ifndef _LIBCPP_HAS_NO_CONSTEXPR - constexpr condition_variable() : __cv_(PTHREAD_COND_INITIALIZER) {} + constexpr condition_variable() _NOEXCEPT _LIBCPP_DEFAULT #else - condition_variable() {__cv_ = (pthread_cond_t)PTHREAD_COND_INITIALIZER;} + condition_variable() _NOEXCEPT {__cv_ = (__libcpp_condvar_t)_LIBCPP_CONDVAR_INITIALIZER;} #endif ~condition_variable(); @@ -313,7 +341,7 @@ public: const chrono::duration<_Rep, _Period>& __d, _Predicate __pred); - typedef pthread_cond_t* native_handle_type; + typedef __libcpp_condvar_t* native_handle_type; _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__cv_;} private: diff --git a/include/__threading_support b/include/__threading_support new file mode 100644 index 000000000000..c9a4ea9d0947 --- /dev/null +++ b/include/__threading_support @@ -0,0 +1,205 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_THREADING_SUPPORT +#define _LIBCPP_THREADING_SUPPORT + +#include <__config> + +#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +#pragma GCC system_header +#endif + +#ifndef _LIBCPP_HAS_NO_THREADS + +#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) +#include +#include +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) + +// Mutex +#define _LIBCPP_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER +typedef pthread_mutex_t __libcpp_mutex_t; + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_recursive_mutex_init(__libcpp_mutex_t* __m) +{ + pthread_mutexattr_t attr; + int __ec = pthread_mutexattr_init(&attr); + if (__ec) return __ec; + __ec = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + if (__ec) + { + pthread_mutexattr_destroy(&attr); + return __ec; + } + __ec = pthread_mutex_init(__m, &attr); + if (__ec) + { + pthread_mutexattr_destroy(&attr); + return __ec; + } + __ec = pthread_mutexattr_destroy(&attr); + if (__ec) + { + pthread_mutex_destroy(__m); + return __ec; + } + return 0; +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_mutex_lock(__libcpp_mutex_t* __m) +{ + return pthread_mutex_lock(__m); +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_mutex_trylock(__libcpp_mutex_t* __m) +{ + return pthread_mutex_trylock(__m); +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_mutex_unlock(__libcpp_mutex_t* __m) +{ + return pthread_mutex_unlock(__m); +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_mutex_destroy(__libcpp_mutex_t* __m) +{ + return pthread_mutex_destroy(__m); +} + +// Condition variable +#define _LIBCPP_CONDVAR_INITIALIZER PTHREAD_COND_INITIALIZER +typedef pthread_cond_t __libcpp_condvar_t; + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_condvar_signal(__libcpp_condvar_t* __cv) +{ + return pthread_cond_signal(__cv); +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_condvar_broadcast(__libcpp_condvar_t* __cv) +{ + return pthread_cond_broadcast(__cv); +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m) +{ + return pthread_cond_wait(__cv, __m); +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_condvar_timedwait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m, timespec* __ts) +{ + return pthread_cond_timedwait(__cv, __m, __ts); +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv) +{ + return pthread_cond_destroy(__cv); +} + +// Thread id +typedef pthread_t __libcpp_thread_id; + +// Returns non-zero if the thread ids are equal, otherwise 0 +inline _LIBCPP_ALWAYS_INLINE +bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2) +{ + return pthread_equal(t1, t2) != 0; +} + +// Returns non-zero if t1 < t2, otherwise 0 +inline _LIBCPP_ALWAYS_INLINE +bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2) +{ + return t1 < t2; +} + +// Thread +typedef pthread_t __libcpp_thread_t; + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_thread_create(__libcpp_thread_t* __t, void* (*__func)(void*), void* __arg) +{ + return pthread_create(__t, 0, __func, __arg); +} + +inline _LIBCPP_ALWAYS_INLINE +__libcpp_thread_id __libcpp_thread_get_current_id() +{ + return pthread_self(); +} + +inline _LIBCPP_ALWAYS_INLINE +__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t* __t) +{ + return *__t; +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_thread_join(__libcpp_thread_t* __t) +{ + return pthread_join(*__t, 0); +} + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_thread_detach(__libcpp_thread_t* __t) +{ + return pthread_detach(*__t); +} + +inline _LIBCPP_ALWAYS_INLINE +void __libcpp_thread_yield() +{ + sched_yield(); +} + +// Thread local storage +typedef pthread_key_t __libcpp_tl_key; + +inline _LIBCPP_ALWAYS_INLINE +int __libcpp_tl_create(__libcpp_tl_key* __key, void (*__at_exit)(void*)) +{ + return pthread_key_create(__key, __at_exit); +} + +inline _LIBCPP_ALWAYS_INLINE +void* __libcpp_tl_get(__libcpp_tl_key __key) +{ + return pthread_getspecific(__key); +} + +inline _LIBCPP_ALWAYS_INLINE +void __libcpp_tl_set(__libcpp_tl_key __key, void* __p) +{ + pthread_setspecific(__key, __p); +} + +#else // !_LIBCPP_HAS_THREAD_API_PTHREAD + #error "No thread API selected." +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP_HAS_NO_THREADS + +#endif // _LIBCPP_THREADING_SUPPORT diff --git a/include/__tree b/include/__tree index 94565bc3f74c..bfcec78d4c9b 100644 --- a/include/__tree +++ b/include/__tree @@ -29,6 +29,22 @@ template template class _LIBCPP_TYPE_VIS_ONLY __tree_const_iterator; +template class __tree_end_node; +template class __tree_node_base; +template class __tree_node; + +#ifndef _LIBCPP_CXX03_LANG +template +union __value_type; +#else +template +struct __value_type; +#endif + +template class __map_node_destructor; +template class _LIBCPP_TYPE_VIS_ONLY __map_iterator; +template class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator; + /* _NodePtr algorithms @@ -149,21 +165,36 @@ __tree_next(_NodePtr __x) _NOEXCEPT if (__x->__right_ != nullptr) return __tree_min(__x->__right_); while (!__tree_is_left_child(__x)) - __x = __x->__parent_; - return __x->__parent_; + __x = __x->__parent_unsafe(); + return __x->__parent_unsafe(); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +_EndNodePtr +__tree_next_iter(_NodePtr __x) _NOEXCEPT +{ + if (__x->__right_ != nullptr) + return static_cast<_EndNodePtr>(__tree_min(__x->__right_)); + while (!__tree_is_left_child(__x)) + __x = __x->__parent_unsafe(); + return static_cast<_EndNodePtr>(__x->__parent_); } // Returns: pointer to the previous in-order node before __x. // Precondition: __x != nullptr. -template +// Note: __x may be the end node. +template +inline _LIBCPP_INLINE_VISIBILITY _NodePtr -__tree_prev(_NodePtr __x) _NOEXCEPT +__tree_prev_iter(_EndNodePtr __x) _NOEXCEPT { if (__x->__left_ != nullptr) return __tree_max(__x->__left_); - while (__tree_is_left_child(__x)) - __x = __x->__parent_; - return __x->__parent_; + _NodePtr __xx = static_cast<_NodePtr>(__x); + while (__tree_is_left_child(__xx)) + __xx = __xx->__parent_unsafe(); + return __xx->__parent_unsafe(); } // Returns: pointer to a node which has no children @@ -199,14 +230,14 @@ __tree_left_rotate(_NodePtr __x) _NOEXCEPT _NodePtr __y = __x->__right_; __x->__right_ = __y->__left_; if (__x->__right_ != nullptr) - __x->__right_->__parent_ = __x; + __x->__right_->__set_parent(__x); __y->__parent_ = __x->__parent_; if (__tree_is_left_child(__x)) __x->__parent_->__left_ = __y; else - __x->__parent_->__right_ = __y; + __x->__parent_unsafe()->__right_ = __y; __y->__left_ = __x; - __x->__parent_ = __y; + __x->__set_parent(__y); } // Effects: Makes __x->__left_ the subtree root with __x as its right child @@ -219,14 +250,14 @@ __tree_right_rotate(_NodePtr __x) _NOEXCEPT _NodePtr __y = __x->__left_; __x->__left_ = __y->__right_; if (__x->__left_ != nullptr) - __x->__left_->__parent_ = __x; + __x->__left_->__set_parent(__x); __y->__parent_ = __x->__parent_; if (__tree_is_left_child(__x)) __x->__parent_->__left_ = __y; else - __x->__parent_->__right_ = __y; + __x->__parent_unsafe()->__right_ = __y; __y->__right_ = __x; - __x->__parent_ = __y; + __x->__set_parent(__y); } // Effects: Rebalances __root after attaching __x to a leaf. @@ -242,17 +273,17 @@ void __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT { __x->__is_black_ = __x == __root; - while (__x != __root && !__x->__parent_->__is_black_) + while (__x != __root && !__x->__parent_unsafe()->__is_black_) { // __x->__parent_ != __root because __x->__parent_->__is_black == false - if (__tree_is_left_child(__x->__parent_)) + if (__tree_is_left_child(__x->__parent_unsafe())) { - _NodePtr __y = __x->__parent_->__parent_->__right_; + _NodePtr __y = __x->__parent_unsafe()->__parent_unsafe()->__right_; if (__y != nullptr && !__y->__is_black_) { - __x = __x->__parent_; + __x = __x->__parent_unsafe(); __x->__is_black_ = true; - __x = __x->__parent_; + __x = __x->__parent_unsafe(); __x->__is_black_ = __x == __root; __y->__is_black_ = true; } @@ -260,12 +291,12 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT { if (!__tree_is_left_child(__x)) { - __x = __x->__parent_; + __x = __x->__parent_unsafe(); __tree_left_rotate(__x); } - __x = __x->__parent_; + __x = __x->__parent_unsafe(); __x->__is_black_ = true; - __x = __x->__parent_; + __x = __x->__parent_unsafe(); __x->__is_black_ = false; __tree_right_rotate(__x); break; @@ -273,12 +304,12 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT } else { - _NodePtr __y = __x->__parent_->__parent_->__left_; + _NodePtr __y = __x->__parent_unsafe()->__parent_->__left_; if (__y != nullptr && !__y->__is_black_) { - __x = __x->__parent_; + __x = __x->__parent_unsafe(); __x->__is_black_ = true; - __x = __x->__parent_; + __x = __x->__parent_unsafe(); __x->__is_black_ = __x == __root; __y->__is_black_ = true; } @@ -286,12 +317,12 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT { if (__tree_is_left_child(__x)) { - __x = __x->__parent_; + __x = __x->__parent_unsafe(); __tree_right_rotate(__x); } - __x = __x->__parent_; + __x = __x->__parent_unsafe(); __x->__is_black_ = true; - __x = __x->__parent_; + __x = __x->__parent_unsafe(); __x->__is_black_ = false; __tree_left_rotate(__x); break; @@ -328,13 +359,13 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT { __y->__parent_->__left_ = __x; if (__y != __root) - __w = __y->__parent_->__right_; + __w = __y->__parent_unsafe()->__right_; else __root = __x; // __w == nullptr } else { - __y->__parent_->__right_ = __x; + __y->__parent_unsafe()->__right_ = __x; // __y can't be root if it is a right child __w = __y->__parent_->__left_; } @@ -348,12 +379,12 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT if (__tree_is_left_child(__z)) __y->__parent_->__left_ = __y; else - __y->__parent_->__right_ = __y; + __y->__parent_unsafe()->__right_ = __y; __y->__left_ = __z->__left_; - __y->__left_->__parent_ = __y; + __y->__left_->__set_parent(__y); __y->__right_ = __z->__right_; if (__y->__right_ != nullptr) - __y->__right_->__parent_ = __y; + __y->__right_->__set_parent(__y); __y->__is_black_ = __z->__is_black_; if (__root == __z) __root = __y; @@ -390,8 +421,8 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT if (!__w->__is_black_) { __w->__is_black_ = true; - __w->__parent_->__is_black_ = false; - __tree_left_rotate(__w->__parent_); + __w->__parent_unsafe()->__is_black_ = false; + __tree_left_rotate(__w->__parent_unsafe()); // __x is still valid // reset __root only if necessary if (__root == __w->__left_) @@ -404,7 +435,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT (__w->__right_ == nullptr || __w->__right_->__is_black_)) { __w->__is_black_ = false; - __x = __w->__parent_; + __x = __w->__parent_unsafe(); // __x can no longer be null if (__x == __root || !__x->__is_black_) { @@ -413,7 +444,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT } // reset sibling, and it still can't be null __w = __tree_is_left_child(__x) ? - __x->__parent_->__right_ : + __x->__parent_unsafe()->__right_ : __x->__parent_->__left_; // continue; } @@ -427,13 +458,13 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT __tree_right_rotate(__w); // __w is known not to be root, so root hasn't changed // reset sibling, and it still can't be null - __w = __w->__parent_; + __w = __w->__parent_unsafe(); } // __w has a right red child, left child may be null - __w->__is_black_ = __w->__parent_->__is_black_; - __w->__parent_->__is_black_ = true; + __w->__is_black_ = __w->__parent_unsafe()->__is_black_; + __w->__parent_unsafe()->__is_black_ = true; __w->__right_->__is_black_ = true; - __tree_left_rotate(__w->__parent_); + __tree_left_rotate(__w->__parent_unsafe()); break; } } @@ -442,8 +473,8 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT if (!__w->__is_black_) { __w->__is_black_ = true; - __w->__parent_->__is_black_ = false; - __tree_right_rotate(__w->__parent_); + __w->__parent_unsafe()->__is_black_ = false; + __tree_right_rotate(__w->__parent_unsafe()); // __x is still valid // reset __root only if necessary if (__root == __w->__right_) @@ -456,7 +487,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT (__w->__right_ == nullptr || __w->__right_->__is_black_)) { __w->__is_black_ = false; - __x = __w->__parent_; + __x = __w->__parent_unsafe(); // __x can no longer be null if (!__x->__is_black_ || __x == __root) { @@ -465,7 +496,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT } // reset sibling, and it still can't be null __w = __tree_is_left_child(__x) ? - __x->__parent_->__right_ : + __x->__parent_unsafe()->__right_ : __x->__parent_->__left_; // continue; } @@ -479,13 +510,13 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT __tree_left_rotate(__w); // __w is known not to be root, so root hasn't changed // reset sibling, and it still can't be null - __w = __w->__parent_; + __w = __w->__parent_unsafe(); } // __w has a left red child, right child may be null - __w->__is_black_ = __w->__parent_->__is_black_; - __w->__parent_->__is_black_ = true; + __w->__is_black_ = __w->__parent_unsafe()->__is_black_; + __w->__parent_unsafe()->__is_black_ = true; __w->__left_->__is_black_ = true; - __tree_right_rotate(__w->__parent_); + __tree_right_rotate(__w->__parent_unsafe()); break; } } @@ -494,41 +525,182 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT } } -template class __map_node_destructor; +// node traits + + +#ifndef _LIBCPP_CXX03_LANG +template +struct __is_tree_value_type_imp : false_type {}; + +template +struct __is_tree_value_type_imp<__value_type<_Key, _Value>> : true_type {}; + +template +struct __is_tree_value_type : false_type {}; + +template +struct __is_tree_value_type<_One> : __is_tree_value_type_imp::type> {}; +#endif + +template +struct __tree_key_value_types { + typedef _Tp key_type; + typedef _Tp __node_value_type; + typedef _Tp __container_value_type; + static const bool __is_map = false; + + _LIBCPP_INLINE_VISIBILITY + static key_type const& __get_key(_Tp const& __v) { + return __v; + } + _LIBCPP_INLINE_VISIBILITY + static __container_value_type const& __get_value(__node_value_type const& __v) { + return __v; + } + _LIBCPP_INLINE_VISIBILITY + static __container_value_type* __get_ptr(__node_value_type& __n) { + return _VSTD::addressof(__n); + } + +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + static __container_value_type&& __move(__node_value_type& __v) { + return _VSTD::move(__v); + } +#endif +}; + +template +struct __tree_key_value_types<__value_type<_Key, _Tp> > { + typedef _Key key_type; + typedef _Tp mapped_type; + typedef __value_type<_Key, _Tp> __node_value_type; + typedef pair __container_value_type; + typedef pair<_Key, _Tp> __nc_value_type; + typedef __container_value_type __map_value_type; + static const bool __is_map = true; + + _LIBCPP_INLINE_VISIBILITY + static key_type const& + __get_key(__node_value_type const& __t) { + return __t.__cc.first; + } + + template + _LIBCPP_INLINE_VISIBILITY + static typename enable_if<__is_same_uncvref<_Up, __container_value_type>::value, + key_type const&>::type + __get_key(_Up& __t) { + return __t.first; + } + + _LIBCPP_INLINE_VISIBILITY + static __container_value_type const& + __get_value(__node_value_type const& __t) { + return __t.__cc; + } + + template + _LIBCPP_INLINE_VISIBILITY + static typename enable_if<__is_same_uncvref<_Up, __container_value_type>::value, + __container_value_type const&>::type + __get_value(_Up& __t) { + return __t; + } + + _LIBCPP_INLINE_VISIBILITY + static __container_value_type* __get_ptr(__node_value_type& __n) { + return _VSTD::addressof(__n.__cc); + } + +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + static __nc_value_type&& __move(__node_value_type& __v) { + return _VSTD::move(__v.__nc); + } +#endif +}; + +template +struct __tree_node_base_types { + typedef _VoidPtr __void_pointer; + + typedef __tree_node_base<__void_pointer> __node_base_type; + typedef typename __rebind_pointer<_VoidPtr, __node_base_type>::type + __node_base_pointer; + + typedef __tree_end_node<__node_base_pointer> __end_node_type; + typedef typename __rebind_pointer<_VoidPtr, __end_node_type>::type + __end_node_pointer; +#if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB) + typedef __end_node_pointer __parent_pointer; +#else + typedef typename conditional< + is_pointer<__end_node_pointer>::value, + __end_node_pointer, + __node_base_pointer>::type __parent_pointer; +#endif -template -class __tree_node_destructor -{ - typedef _Allocator allocator_type; - typedef allocator_traits __alloc_traits; - typedef typename __alloc_traits::value_type::value_type value_type; -public: - typedef typename __alloc_traits::pointer pointer; private: + static_assert((is_same::element_type, void>::value), + "_VoidPtr does not point to unqualified void type"); +}; - allocator_type& __na_; +template , + bool = _KVTypes::__is_map> +struct __tree_map_pointer_types {}; - __tree_node_destructor& operator=(const __tree_node_destructor&); +template +struct __tree_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> { + typedef typename _KVTypes::__map_value_type _Mv; + typedef typename __rebind_pointer<_AllocPtr, _Mv>::type + __map_value_type_pointer; + typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type + __const_map_value_type_pointer; +}; +template ::element_type> +struct __tree_node_types; + +template +struct __tree_node_types<_NodePtr, __tree_node<_Tp, _VoidPtr> > + : public __tree_node_base_types<_VoidPtr>, + __tree_key_value_types<_Tp>, + __tree_map_pointer_types<_Tp, _VoidPtr> +{ + typedef __tree_node_base_types<_VoidPtr> __base; + typedef __tree_key_value_types<_Tp> __key_base; + typedef __tree_map_pointer_types<_Tp, _VoidPtr> __map_pointer_base; public: - bool __value_constructed; - _LIBCPP_INLINE_VISIBILITY - explicit __tree_node_destructor(allocator_type& __na, bool __val = false) _NOEXCEPT - : __na_(__na), - __value_constructed(__val) - {} + typedef typename pointer_traits<_NodePtr>::element_type __node_type; + typedef _NodePtr __node_pointer; - _LIBCPP_INLINE_VISIBILITY - void operator()(pointer __p) _NOEXCEPT - { - if (__value_constructed) - __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_)); - if (__p) - __alloc_traits::deallocate(__na_, __p, 1); - } + typedef _Tp __node_value_type; + typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type + __node_value_type_pointer; + typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type + __const_node_value_type_pointer; +#if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB) + typedef typename __base::__end_node_pointer __iter_pointer; +#else + typedef typename conditional< + is_pointer<__node_pointer>::value, + typename __base::__end_node_pointer, + __node_pointer>::type __iter_pointer; +#endif +private: + static_assert(!is_const<__node_type>::value, + "_NodePtr should never be a pointer to const"); + static_assert((is_same::type, + _NodePtr>::value), "_VoidPtr does not rebind to _NodePtr."); +}; - template friend class __map_node_destructor; +template +struct __make_tree_node_types { + typedef typename __rebind_pointer<_VoidPtr, __tree_node<_ValueTp, _VoidPtr> >::type + _NodePtr; + typedef __tree_node_types<_NodePtr> type; }; // node @@ -546,26 +718,30 @@ public: template class __tree_node_base - : public __tree_end_node - < - typename __rebind_pointer<_VoidPtr, __tree_node_base<_VoidPtr> >::type - > + : public __tree_node_base_types<_VoidPtr>::__end_node_type { - __tree_node_base(const __tree_node_base&); - __tree_node_base& operator=(const __tree_node_base&); + typedef __tree_node_base_types<_VoidPtr> _NodeBaseTypes; + public: - typedef typename __rebind_pointer<_VoidPtr, __tree_node_base>::type pointer; - typedef typename __rebind_pointer<_VoidPtr, const __tree_node_base>::type const_pointer; + typedef typename _NodeBaseTypes::__node_base_pointer pointer; + typedef typename _NodeBaseTypes::__parent_pointer __parent_pointer; - typedef __tree_end_node base; - - pointer __right_; - pointer __parent_; + pointer __right_; + __parent_pointer __parent_; bool __is_black_; _LIBCPP_INLINE_VISIBILITY - __tree_node_base() _NOEXCEPT - : __right_(), __parent_(), __is_black_(false) {} + pointer __parent_unsafe() const { return static_cast(__parent_);} + + _LIBCPP_INLINE_VISIBILITY + void __set_parent(pointer __p) { + __parent_ = static_cast<__parent_pointer>(__p); + } + +private: + ~__tree_node_base() _LIBCPP_EQUAL_DELETE; + __tree_node_base(__tree_node_base const&) _LIBCPP_EQUAL_DELETE; + __tree_node_base& operator=(__tree_node_base const&) _LIBCPP_EQUAL_DELETE; }; template @@ -573,41 +749,71 @@ class __tree_node : public __tree_node_base<_VoidPtr> { public: - typedef __tree_node_base<_VoidPtr> base; - typedef _Tp value_type; + typedef _Tp __node_value_type; - value_type __value_; + __node_value_type __value_; -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) - template - _LIBCPP_INLINE_VISIBILITY - explicit __tree_node(_Args&& ...__args) - : __value_(_VSTD::forward<_Args>(__args)...) {} -#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) - _LIBCPP_INLINE_VISIBILITY - explicit __tree_node(const value_type& __v) - : __value_(__v) {} -#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +private: + ~__tree_node() _LIBCPP_EQUAL_DELETE; + __tree_node(__tree_node const&) _LIBCPP_EQUAL_DELETE; + __tree_node& operator=(__tree_node const&) _LIBCPP_EQUAL_DELETE; +}; + + +template +class __tree_node_destructor +{ + typedef _Allocator allocator_type; + typedef allocator_traits __alloc_traits; + +public: + typedef typename __alloc_traits::pointer pointer; +private: + typedef __tree_node_types _NodeTypes; + allocator_type& __na_; + + __tree_node_destructor& operator=(const __tree_node_destructor&); + +public: + bool __value_constructed; + + _LIBCPP_INLINE_VISIBILITY + explicit __tree_node_destructor(allocator_type& __na, bool __val = false) _NOEXCEPT + : __na_(__na), + __value_constructed(__val) + {} + + _LIBCPP_INLINE_VISIBILITY + void operator()(pointer __p) _NOEXCEPT + { + if (__value_constructed) + __alloc_traits::destroy(__na_, _NodeTypes::__get_ptr(__p->__value_)); + if (__p) + __alloc_traits::deallocate(__na_, __p, 1); + } + + template friend class __map_node_destructor; }; -template class _LIBCPP_TYPE_VIS_ONLY __map_iterator; -template class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator; template class _LIBCPP_TYPE_VIS_ONLY __tree_iterator { - typedef _NodePtr __node_pointer; - typedef typename pointer_traits<__node_pointer>::element_type __node; - - __node_pointer __ptr_; - + typedef __tree_node_types<_NodePtr> _NodeTypes; + typedef _NodePtr __node_pointer; + typedef typename _NodeTypes::__node_base_pointer __node_base_pointer; + typedef typename _NodeTypes::__end_node_pointer __end_node_pointer; + typedef typename _NodeTypes::__iter_pointer __iter_pointer; typedef pointer_traits<__node_pointer> __pointer_traits; + + __iter_pointer __ptr_; + public: - typedef bidirectional_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _DiffType difference_type; - typedef value_type& reference; - typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer; + typedef bidirectional_iterator_tag iterator_category; + typedef _Tp value_type; + typedef _DiffType difference_type; + typedef value_type& reference; + typedef typename _NodeTypes::__node_value_type_pointer pointer; _LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT #if _LIBCPP_STD_VER > 11 @@ -615,14 +821,15 @@ public: #endif {} - _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;} + _LIBCPP_INLINE_VISIBILITY reference operator*() const + {return __get_np()->__value_;} _LIBCPP_INLINE_VISIBILITY pointer operator->() const - {return pointer_traits::pointer_to(__ptr_->__value_);} + {return pointer_traits::pointer_to(__get_np()->__value_);} _LIBCPP_INLINE_VISIBILITY __tree_iterator& operator++() { - __ptr_ = static_cast<__node_pointer>( - __tree_next(static_cast(__ptr_))); + __ptr_ = static_cast<__iter_pointer>( + __tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_))); return *this; } _LIBCPP_INLINE_VISIBILITY @@ -631,8 +838,8 @@ public: _LIBCPP_INLINE_VISIBILITY __tree_iterator& operator--() { - __ptr_ = static_cast<__node_pointer>( - __tree_prev(static_cast(__ptr_))); + __ptr_ = static_cast<__iter_pointer>(__tree_prev_iter<__node_base_pointer>( + static_cast<__end_node_pointer>(__ptr_))); return *this; } _LIBCPP_INLINE_VISIBILITY @@ -649,6 +856,10 @@ public: private: _LIBCPP_INLINE_VISIBILITY explicit __tree_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {} + _LIBCPP_INLINE_VISIBILITY + explicit __tree_iterator(__end_node_pointer __p) _NOEXCEPT : __ptr_(__p) {} + _LIBCPP_INLINE_VISIBILITY + __node_pointer __get_np() const { return static_cast<__node_pointer>(__ptr_); } template friend class __tree; template friend class _LIBCPP_TYPE_VIS_ONLY __tree_const_iterator; template friend class _LIBCPP_TYPE_VIS_ONLY __map_iterator; @@ -658,21 +869,24 @@ private: template friend class _LIBCPP_TYPE_VIS_ONLY multiset; }; -template +template class _LIBCPP_TYPE_VIS_ONLY __tree_const_iterator { - typedef _ConstNodePtr __node_pointer; - typedef typename pointer_traits<__node_pointer>::element_type __node; - - __node_pointer __ptr_; - + typedef __tree_node_types<_NodePtr> _NodeTypes; + typedef typename _NodeTypes::__node_pointer __node_pointer; + typedef typename _NodeTypes::__node_base_pointer __node_base_pointer; + typedef typename _NodeTypes::__end_node_pointer __end_node_pointer; + typedef typename _NodeTypes::__iter_pointer __iter_pointer; typedef pointer_traits<__node_pointer> __pointer_traits; + + __iter_pointer __ptr_; + public: - typedef bidirectional_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _DiffType difference_type; - typedef const value_type& reference; - typedef typename __rebind_pointer<__node_pointer, const value_type>::type pointer; + typedef bidirectional_iterator_tag iterator_category; + typedef _Tp value_type; + typedef _DiffType difference_type; + typedef const value_type& reference; + typedef typename _NodeTypes::__const_node_value_type_pointer pointer; _LIBCPP_INLINE_VISIBILITY __tree_const_iterator() _NOEXCEPT #if _LIBCPP_STD_VER > 11 @@ -681,26 +895,22 @@ public: {} private: - typedef typename remove_const<__node>::type __non_const_node; - typedef typename __rebind_pointer<__node_pointer, __non_const_node>::type - __non_const_node_pointer; - typedef __tree_iterator - __non_const_iterator; + typedef __tree_iterator + __non_const_iterator; public: _LIBCPP_INLINE_VISIBILITY __tree_const_iterator(__non_const_iterator __p) _NOEXCEPT : __ptr_(__p.__ptr_) {} - _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;} + _LIBCPP_INLINE_VISIBILITY reference operator*() const + {return __get_np()->__value_;} _LIBCPP_INLINE_VISIBILITY pointer operator->() const - {return pointer_traits::pointer_to(__ptr_->__value_);} + {return pointer_traits::pointer_to(__get_np()->__value_);} _LIBCPP_INLINE_VISIBILITY __tree_const_iterator& operator++() { - typedef typename __rebind_pointer<__node_pointer, typename __node::base>::type - __node_base_pointer; - __ptr_ = static_cast<__node_pointer>( - __tree_next(static_cast<__node_base_pointer>(__ptr_))); + __ptr_ = static_cast<__iter_pointer>( + __tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_))); return *this; } @@ -710,10 +920,8 @@ public: _LIBCPP_INLINE_VISIBILITY __tree_const_iterator& operator--() { - typedef typename __rebind_pointer<__node_pointer, typename __node::base>::type - __node_base_pointer; - __ptr_ = static_cast<__node_pointer>( - __tree_prev(static_cast<__node_base_pointer>(__ptr_))); + __ptr_ = static_cast<__iter_pointer>(__tree_prev_iter<__node_base_pointer>( + static_cast<__end_node_pointer>(__ptr_))); return *this; } @@ -732,12 +940,19 @@ private: _LIBCPP_INLINE_VISIBILITY explicit __tree_const_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {} + _LIBCPP_INLINE_VISIBILITY + explicit __tree_const_iterator(__end_node_pointer __p) _NOEXCEPT + : __ptr_(__p) {} + _LIBCPP_INLINE_VISIBILITY + __node_pointer __get_np() const { return static_cast<__node_pointer>(__ptr_); } + template friend class __tree; template friend class _LIBCPP_TYPE_VIS_ONLY map; template friend class _LIBCPP_TYPE_VIS_ONLY multimap; template friend class _LIBCPP_TYPE_VIS_ONLY set; template friend class _LIBCPP_TYPE_VIS_ONLY multiset; template friend class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator; + }; template @@ -747,48 +962,73 @@ public: typedef _Tp value_type; typedef _Compare value_compare; typedef _Allocator allocator_type; + +private: typedef allocator_traits __alloc_traits; + typedef typename __make_tree_node_types::type + _NodeTypes; + typedef typename _NodeTypes::key_type key_type; +public: + typedef typename _NodeTypes::__node_value_type __node_value_type; + typedef typename _NodeTypes::__container_value_type __container_value_type; + typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::const_pointer const_pointer; typedef typename __alloc_traits::size_type size_type; typedef typename __alloc_traits::difference_type difference_type; - typedef typename __alloc_traits::void_pointer __void_pointer; +public: + typedef typename _NodeTypes::__void_pointer __void_pointer; + + typedef typename _NodeTypes::__node_type __node; + typedef typename _NodeTypes::__node_pointer __node_pointer; + + typedef typename _NodeTypes::__node_base_type __node_base; + typedef typename _NodeTypes::__node_base_pointer __node_base_pointer; + + typedef typename _NodeTypes::__end_node_type __end_node_t; + typedef typename _NodeTypes::__end_node_pointer __end_node_ptr; + + typedef typename _NodeTypes::__parent_pointer __parent_pointer; + typedef typename _NodeTypes::__iter_pointer __iter_pointer; - typedef __tree_node __node; - typedef __tree_node_base<__void_pointer> __node_base; typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator; - typedef allocator_traits<__node_allocator> __node_traits; - typedef typename __node_traits::pointer __node_pointer; - typedef typename __node_traits::pointer __node_const_pointer; - typedef typename __node_base::pointer __node_base_pointer; - typedef typename __node_base::pointer __node_base_const_pointer; -private: - typedef typename __node_base::base __end_node_t; - typedef typename __rebind_pointer<__node_pointer, __end_node_t>::type - __end_node_ptr; - typedef __end_node_ptr __end_node_const_ptr; + typedef allocator_traits<__node_allocator> __node_traits; - __node_pointer __begin_node_; +private: + // check for sane allocator pointer rebinding semantics. Rebinding the + // allocator for a new pointer type should be exactly the same as rebinding + // the pointer using 'pointer_traits'. + static_assert((is_same<__node_pointer, typename __node_traits::pointer>::value), + "Allocator does not rebind pointers in a sane manner."); + typedef typename __rebind_alloc_helper<__node_traits, __node_base>::type + __node_base_allocator; + typedef allocator_traits<__node_base_allocator> __node_base_traits; + static_assert((is_same<__node_base_pointer, typename __node_base_traits::pointer>::value), + "Allocator does not rebind pointers in a sane manner."); + +private: + __iter_pointer __begin_node_; __compressed_pair<__end_node_t, __node_allocator> __pair1_; __compressed_pair __pair3_; public: _LIBCPP_INLINE_VISIBILITY - __node_pointer __end_node() _NOEXCEPT + __iter_pointer __end_node() _NOEXCEPT { - return static_cast<__node_pointer> - ( - pointer_traits<__end_node_ptr>::pointer_to(__pair1_.first()) - ); + return static_cast<__iter_pointer>( + pointer_traits<__end_node_ptr>::pointer_to(__pair1_.first()) + ); } _LIBCPP_INLINE_VISIBILITY - __node_const_pointer __end_node() const _NOEXCEPT + __iter_pointer __end_node() const _NOEXCEPT { - return static_cast<__node_const_pointer> - ( - pointer_traits<__end_node_const_ptr>::pointer_to(const_cast<__end_node_t&>(__pair1_.first())) - ); + return static_cast<__iter_pointer>( + pointer_traits<__end_node_ptr>::pointer_to( + const_cast<__end_node_t&>(__pair1_.first()) + ) + ); } _LIBCPP_INLINE_VISIBILITY __node_allocator& __node_alloc() _NOEXCEPT {return __pair1_.second();} @@ -797,9 +1037,9 @@ private: const __node_allocator& __node_alloc() const _NOEXCEPT {return __pair1_.second();} _LIBCPP_INLINE_VISIBILITY - __node_pointer& __begin_node() _NOEXCEPT {return __begin_node_;} + __iter_pointer& __begin_node() _NOEXCEPT {return __begin_node_;} _LIBCPP_INLINE_VISIBILITY - const __node_pointer& __begin_node() const _NOEXCEPT {return __begin_node_;} + const __iter_pointer& __begin_node() const _NOEXCEPT {return __begin_node_;} public: _LIBCPP_INLINE_VISIBILITY allocator_type __alloc() const _NOEXCEPT @@ -816,12 +1056,14 @@ public: const value_compare& value_comp() const _NOEXCEPT {return __pair3_.second();} public: + _LIBCPP_INLINE_VISIBILITY - __node_pointer __root() _NOEXCEPT - {return static_cast<__node_pointer> (__end_node()->__left_);} - _LIBCPP_INLINE_VISIBILITY - __node_const_pointer __root() const _NOEXCEPT - {return static_cast<__node_const_pointer>(__end_node()->__left_);} + __node_pointer __root() const _NOEXCEPT + {return static_cast<__node_pointer>(__end_node()->__left_);} + + __node_base_pointer* __root_ptr() const _NOEXCEPT { + return _VSTD::addressof(__end_node()->__left_); + } typedef __tree_iterator iterator; typedef __tree_const_iterator const_iterator; @@ -877,45 +1119,195 @@ public: #endif ); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_VARIADICS + +#ifndef _LIBCPP_CXX03_LANG + template + pair + __emplace_unique_key_args(_Key const&, _Args&&... __args); + template + iterator + __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&&...); + template + pair __emplace_unique_impl(_Args&&... __args); + + template + iterator __emplace_hint_unique_impl(const_iterator __p, _Args&&... __args); + + template + iterator __emplace_multi(_Args&&... __args); + + template + iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args); + + template + _LIBCPP_INLINE_VISIBILITY + pair __emplace_unique(_Pp&& __x) { + return __emplace_unique_extract_key(_VSTD::forward<_Pp>(__x), + __can_extract_key<_Pp, key_type>()); + } + + template + _LIBCPP_INLINE_VISIBILITY + typename enable_if< + __can_extract_map_key<_First, key_type, __container_value_type>::value, pair - __emplace_unique(_Args&&... __args); - template - iterator - __emplace_multi(_Args&&... __args); + >::type __emplace_unique(_First&& __f, _Second&& __s) { + return __emplace_unique_key_args(__f, _VSTD::forward<_First>(__f), + _VSTD::forward<_Second>(__s)); + } template + _LIBCPP_INLINE_VISIBILITY + pair __emplace_unique(_Args&&... __args) { + return __emplace_unique_impl(_VSTD::forward<_Args>(__args)...); + } + + template + _LIBCPP_INLINE_VISIBILITY + pair + __emplace_unique_extract_key(_Pp&& __x, __extract_key_fail_tag) { + return __emplace_unique_impl(_VSTD::forward<_Pp>(__x)); + } + + template + _LIBCPP_INLINE_VISIBILITY + pair + __emplace_unique_extract_key(_Pp&& __x, __extract_key_self_tag) { + return __emplace_unique_key_args(__x, _VSTD::forward<_Pp>(__x)); + } + + template + _LIBCPP_INLINE_VISIBILITY + pair + __emplace_unique_extract_key(_Pp&& __x, __extract_key_first_tag) { + return __emplace_unique_key_args(__x.first, _VSTD::forward<_Pp>(__x)); + } + + template + _LIBCPP_INLINE_VISIBILITY + iterator __emplace_hint_unique(const_iterator __p, _Pp&& __x) { + return __emplace_hint_unique_extract_key(__p, _VSTD::forward<_Pp>(__x), + __can_extract_key<_Pp, key_type>()); + } + + template + _LIBCPP_INLINE_VISIBILITY + typename enable_if< + __can_extract_map_key<_First, key_type, __container_value_type>::value, iterator - __emplace_hint_unique(const_iterator __p, _Args&&... __args); + >::type __emplace_hint_unique(const_iterator __p, _First&& __f, _Second&& __s) { + return __emplace_hint_unique_key_args(__p, __f, + _VSTD::forward<_First>(__f), + _VSTD::forward<_Second>(__s)); + } + template - iterator - __emplace_hint_multi(const_iterator __p, _Args&&... __args); -#endif // _LIBCPP_HAS_NO_VARIADICS + _LIBCPP_INLINE_VISIBILITY + iterator __emplace_hint_unique(const_iterator __p, _Args&&... __args) { + return __emplace_hint_unique_impl(__p, _VSTD::forward<_Args>(__args)...); + } - template - pair __insert_unique(_Vp&& __v); - template - iterator __insert_unique(const_iterator __p, _Vp&& __v); - template - iterator __insert_multi(_Vp&& __v); - template - iterator __insert_multi(const_iterator __p, _Vp&& __v); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + template + _LIBCPP_INLINE_VISIBILITY + iterator + __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_fail_tag) { + return __emplace_hint_unique_impl(__p, _VSTD::forward<_Pp>(__x)); + } - pair __insert_unique(const value_type& __v); - iterator __insert_unique(const_iterator __p, const value_type& __v); - iterator __insert_multi(const value_type& __v); - iterator __insert_multi(const_iterator __p, const value_type& __v); + template + _LIBCPP_INLINE_VISIBILITY + iterator + __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_self_tag) { + return __emplace_hint_unique_key_args(__p, __x, _VSTD::forward<_Pp>(__x)); + } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - pair __insert_unique( value_type&& __v); - iterator __insert_unique(const_iterator __p, value_type&& __v); - iterator __insert_multi( value_type&& __v); - iterator __insert_multi(const_iterator __p, value_type&& __v); + template + _LIBCPP_INLINE_VISIBILITY + iterator + __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_first_tag) { + return __emplace_hint_unique_key_args(__p, __x.first, _VSTD::forward<_Pp>(__x)); + } + +#else + template + _LIBCPP_INLINE_VISIBILITY + pair __emplace_unique_key_args(_Key const&, _Args& __args); + template + _LIBCPP_INLINE_VISIBILITY + iterator __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&); #endif + _LIBCPP_INLINE_VISIBILITY + pair __insert_unique(const __container_value_type& __v) { + return __emplace_unique_key_args(_NodeTypes::__get_key(__v), __v); + } + + _LIBCPP_INLINE_VISIBILITY + iterator __insert_unique(const_iterator __p, const __container_value_type& __v) { + return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), __v); + } + +#ifdef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + iterator __insert_multi(const __container_value_type& __v); + _LIBCPP_INLINE_VISIBILITY + iterator __insert_multi(const_iterator __p, const __container_value_type& __v); +#else + _LIBCPP_INLINE_VISIBILITY + pair __insert_unique(__container_value_type&& __v) { + return __emplace_unique_key_args(_NodeTypes::__get_key(__v), _VSTD::move(__v)); + } + + _LIBCPP_INLINE_VISIBILITY + iterator __insert_unique(const_iterator __p, __container_value_type&& __v) { + return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), _VSTD::move(__v)); + } + + template ::type, + __container_value_type + >::value + >::type> + _LIBCPP_INLINE_VISIBILITY + pair __insert_unique(_Vp&& __v) { + return __emplace_unique(_VSTD::forward<_Vp>(__v)); + } + + template ::type, + __container_value_type + >::value + >::type> + _LIBCPP_INLINE_VISIBILITY + iterator __insert_unique(const_iterator __p, _Vp&& __v) { + return __emplace_hint_unique(__p, _VSTD::forward<_Vp>(__v)); + } + + _LIBCPP_INLINE_VISIBILITY + iterator __insert_multi(__container_value_type&& __v) { + return __emplace_multi(_VSTD::move(__v)); + } + + _LIBCPP_INLINE_VISIBILITY + iterator __insert_multi(const_iterator __p, __container_value_type&& __v) { + return __emplace_hint_multi(__p, _VSTD::move(__v)); + } + + template + _LIBCPP_INLINE_VISIBILITY + iterator __insert_multi(_Vp&& __v) { + return __emplace_multi(_VSTD::forward<_Vp>(__v)); + } + + template + _LIBCPP_INLINE_VISIBILITY + iterator __insert_multi(const_iterator __p, _Vp&& __v) { + return __emplace_hint_multi(__p, _VSTD::forward<_Vp>(__v)); + } + +#endif // !_LIBCPP_CXX03_LANG + pair __node_insert_unique(__node_pointer __nd); iterator __node_insert_unique(const_iterator __p, __node_pointer __nd); @@ -930,7 +1322,7 @@ public: template size_type __erase_multi(const _Key& __k); - void __insert_node_at(__node_base_pointer __parent, + void __insert_node_at(__parent_pointer __parent, __node_base_pointer& __child, __node_base_pointer __new_node); @@ -951,15 +1343,15 @@ public: template iterator __lower_bound(const _Key& __v, __node_pointer __root, - __node_pointer __result); + __iter_pointer __result); template _LIBCPP_INLINE_VISIBILITY const_iterator lower_bound(const _Key& __v) const {return __lower_bound(__v, __root(), __end_node());} template const_iterator __lower_bound(const _Key& __v, - __node_const_pointer __root, - __node_const_pointer __result) const; + __node_pointer __root, + __iter_pointer __result) const; template _LIBCPP_INLINE_VISIBILITY iterator upper_bound(const _Key& __v) @@ -967,15 +1359,15 @@ public: template iterator __upper_bound(const _Key& __v, __node_pointer __root, - __node_pointer __result); + __iter_pointer __result); template _LIBCPP_INLINE_VISIBILITY const_iterator upper_bound(const _Key& __v) const {return __upper_bound(__v, __root(), __end_node());} template const_iterator __upper_bound(const _Key& __v, - __node_const_pointer __root, - __node_const_pointer __result) const; + __node_pointer __root, + __iter_pointer __result) const; template pair __equal_range_unique(const _Key& __k); @@ -995,26 +1387,27 @@ public: __node_holder remove(const_iterator __p) _NOEXCEPT; private: - typename __node_base::pointer& - __find_leaf_low(typename __node_base::pointer& __parent, const value_type& __v); - typename __node_base::pointer& - __find_leaf_high(typename __node_base::pointer& __parent, const value_type& __v); - typename __node_base::pointer& + __node_base_pointer& + __find_leaf_low(__parent_pointer& __parent, const key_type& __v); + __node_base_pointer& + __find_leaf_high(__parent_pointer& __parent, const key_type& __v); + __node_base_pointer& __find_leaf(const_iterator __hint, - typename __node_base::pointer& __parent, const value_type& __v); + __parent_pointer& __parent, const key_type& __v); template - typename __node_base::pointer& - __find_equal(typename __node_base::pointer& __parent, const _Key& __v); + __node_base_pointer& + __find_equal(__parent_pointer& __parent, const _Key& __v); template - typename __node_base::pointer& - __find_equal(const_iterator __hint, typename __node_base::pointer& __parent, + __node_base_pointer& + __find_equal(const_iterator __hint, __parent_pointer& __parent, + __node_base_pointer& __dummy, const _Key& __v); -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#ifndef _LIBCPP_CXX03_LANG template - __node_holder __construct_node(_Args&& ...__args); -#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) - __node_holder __construct_node(const value_type& __v); + __node_holder __construct_node(_Args&& ...__args); +#else + __node_holder __construct_node(const __container_value_type& __v); #endif void destroy(__node_pointer __nd) _NOEXCEPT; @@ -1069,7 +1462,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp) template __tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a) - : __begin_node_(__node_pointer()), + : __begin_node_(__iter_pointer()), __pair1_(__node_allocator(__a)), __pair3_(0) { @@ -1079,7 +1472,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a) template __tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp, const allocator_type& __a) - : __begin_node_(__node_pointer()), + : __begin_node_(__iter_pointer()), __pair1_(__node_allocator(__a)), __pair3_(0, __comp) { @@ -1091,7 +1484,7 @@ template typename __tree<_Tp, _Compare, _Allocator>::__node_pointer __tree<_Tp, _Compare, _Allocator>::__detach() { - __node_pointer __cache = __begin_node(); + __node_pointer __cache = static_cast<__node_pointer>(__begin_node()); __begin_node() = __end_node(); __end_node()->__left_->__parent_ = nullptr; __end_node()->__left_ = nullptr; @@ -1123,7 +1516,7 @@ __tree<_Tp, _Compare, _Allocator>::__detach(__node_pointer __cache) return static_cast<__node_pointer>(__tree_leaf(__cache->__right_)); } // __cache is right child - __cache->__parent_->__right_ = nullptr; + __cache->__parent_unsafe()->__right_ = nullptr; __cache = static_cast<__node_pointer>(__cache->__parent_); if (__cache->__left_ == nullptr) return __cache; @@ -1148,6 +1541,11 @@ template void __tree<_Tp, _Compare, _Allocator>::__assign_unique(_InputIterator __first, _InputIterator __last) { + typedef iterator_traits<_InputIterator> _ITraits; + typedef typename _ITraits::value_type _ItValueType; + static_assert((is_same<_ItValueType, __container_value_type>::value), + "__assign_unique may only be called with the containers value type"); + if (size() != 0) { __node_pointer __cache = __detach(); @@ -1188,6 +1586,12 @@ template void __tree<_Tp, _Compare, _Allocator>::__assign_multi(_InputIterator __first, _InputIterator __last) { + typedef iterator_traits<_InputIterator> _ITraits; + typedef typename _ITraits::value_type _ItValueType; + static_assert((is_same<_ItValueType, __container_value_type>::value || + is_same<_ItValueType, __node_value_type>::value), + "__assign_multi may only be called with the containers value type" + " or the nodes value type"); if (size() != 0) { __node_pointer __cache = __detach(); @@ -1220,12 +1624,12 @@ __tree<_Tp, _Compare, _Allocator>::__assign_multi(_InputIterator __first, _Input } } for (; __first != __last; ++__first) - __insert_multi(*__first); + __insert_multi(_NodeTypes::__get_value(*__first)); } template __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t) - : __begin_node_(__node_pointer()), + : __begin_node_(__iter_pointer()), __pair1_(__node_traits::select_on_container_copy_construction(__t.__node_alloc())), __pair3_(0, __t.value_comp()) { @@ -1247,7 +1651,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) __begin_node() = __end_node(); else { - __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node()); + __end_node()->__left_->__parent_ = static_cast<__parent_pointer>(__end_node()); __t.__begin_node() = __t.__end_node(); __t.__end_node()->__left_ = nullptr; __t.size() = 0; @@ -1267,7 +1671,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __ { __begin_node() = __t.__begin_node(); __end_node()->__left_ = __t.__end_node()->__left_; - __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node()); + __end_node()->__left_->__parent_ = static_cast<__parent_pointer>(__end_node()); size() = __t.size(); __t.__begin_node() = __t.__end_node(); __t.__end_node()->__left_ = nullptr; @@ -1295,7 +1699,7 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type) __begin_node() = __end_node(); else { - __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node()); + __end_node()->__left_->__parent_ = static_cast<__parent_pointer>(__end_node()); __t.__begin_node() = __t.__end_node(); __t.__end_node()->__left_ = nullptr; __t.size() = 0; @@ -1344,7 +1748,7 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type) } } while (__t.size() != 0) - __insert_multi(__e, _VSTD::move(__t.remove(__t.begin())->__value_)); + __insert_multi(__e, _NodeTypes::__move(__t.remove(__t.begin())->__value_)); } } @@ -1367,6 +1771,8 @@ __tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t) template __tree<_Tp, _Compare, _Allocator>::~__tree() { + static_assert((is_copy_constructible::value), + "Comparator must be copy-constructible."); destroy(__root()); } @@ -1379,7 +1785,7 @@ __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT destroy(static_cast<__node_pointer>(__nd->__left_)); destroy(static_cast<__node_pointer>(__nd->__right_)); __node_allocator& __na = __node_alloc(); - __node_traits::destroy(__na, _VSTD::addressof(__nd->__value_)); + __node_traits::destroy(__na, _NodeTypes::__get_ptr(__nd->__value_)); __node_traits::deallocate(__na, __nd, 1); } } @@ -1403,11 +1809,11 @@ __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t) if (size() == 0) __begin_node() = __end_node(); else - __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node()); + __end_node()->__left_->__parent_ = static_cast<__parent_pointer>(__end_node()); if (__t.size() == 0) __t.__begin_node() = __t.__end_node(); else - __t.__end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__t.__end_node()); + __t.__end_node()->__left_->__parent_ = static_cast<__parent_pointer>(__t.__end_node()); } template @@ -1424,9 +1830,9 @@ __tree<_Tp, _Compare, _Allocator>::clear() _NOEXCEPT // Set __parent to parent of null leaf // Return reference to null leaf template -typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer& -__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer& __parent, - const value_type& __v) +typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& +__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(__parent_pointer& __parent, + const key_type& __v) { __node_pointer __nd = __root(); if (__nd != nullptr) @@ -1439,8 +1845,8 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer __nd = static_cast<__node_pointer>(__nd->__right_); else { - __parent = static_cast<__node_base_pointer>(__nd); - return __parent->__right_; + __parent = static_cast<__parent_pointer>(__nd); + return __nd->__right_; } } else @@ -1449,13 +1855,13 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer __nd = static_cast<__node_pointer>(__nd->__left_); else { - __parent = static_cast<__node_base_pointer>(__nd); + __parent = static_cast<__parent_pointer>(__nd); return __parent->__left_; } } } } - __parent = static_cast<__node_base_pointer>(__end_node()); + __parent = static_cast<__parent_pointer>(__end_node()); return __parent->__left_; } @@ -1463,9 +1869,9 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer // Set __parent to parent of null leaf // Return reference to null leaf template -typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer& -__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointer& __parent, - const value_type& __v) +typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& +__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(__parent_pointer& __parent, + const key_type& __v) { __node_pointer __nd = __root(); if (__nd != nullptr) @@ -1478,7 +1884,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointe __nd = static_cast<__node_pointer>(__nd->__left_); else { - __parent = static_cast<__node_base_pointer>(__nd); + __parent = static_cast<__parent_pointer>(__nd); return __parent->__left_; } } @@ -1488,13 +1894,13 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointe __nd = static_cast<__node_pointer>(__nd->__right_); else { - __parent = static_cast<__node_base_pointer>(__nd); - return __parent->__right_; + __parent = static_cast<__parent_pointer>(__nd); + return __nd->__right_; } } } } - __parent = static_cast<__node_base_pointer>(__end_node()); + __parent = static_cast<__parent_pointer>(__end_node()); return __parent->__left_; } @@ -1505,10 +1911,10 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointe // Set __parent to parent of null leaf // Return reference to null leaf template -typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer& +typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& __tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint, - typename __node_base::pointer& __parent, - const value_type& __v) + __parent_pointer& __parent, + const key_type& __v) { if (__hint == end() || !value_comp()(*__hint, __v)) // check before { @@ -1519,13 +1925,13 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint, // *prev(__hint) <= __v <= *__hint if (__hint.__ptr_->__left_ == nullptr) { - __parent = static_cast<__node_base_pointer>(__hint.__ptr_); + __parent = static_cast<__parent_pointer>(__hint.__ptr_); return __parent->__left_; } else { - __parent = static_cast<__node_base_pointer>(__prior.__ptr_); - return __parent->__right_; + __parent = static_cast<__parent_pointer>(__prior.__ptr_); + return static_cast<__node_base_pointer>(__prior.__ptr_)->__right_; } } // __v < *prev(__hint) @@ -1541,43 +1947,44 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint, // If __v exists, set parent to node of __v and return reference to node of __v template template -typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer& -__tree<_Tp, _Compare, _Allocator>::__find_equal(typename __node_base::pointer& __parent, +typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& +__tree<_Tp, _Compare, _Allocator>::__find_equal(__parent_pointer& __parent, const _Key& __v) { __node_pointer __nd = __root(); + __node_base_pointer* __nd_ptr = __root_ptr(); if (__nd != nullptr) { while (true) { if (value_comp()(__v, __nd->__value_)) { - if (__nd->__left_ != nullptr) + if (__nd->__left_ != nullptr) { + __nd_ptr = _VSTD::addressof(__nd->__left_); __nd = static_cast<__node_pointer>(__nd->__left_); - else - { - __parent = static_cast<__node_base_pointer>(__nd); + } else { + __parent = static_cast<__parent_pointer>(__nd); return __parent->__left_; } } else if (value_comp()(__nd->__value_, __v)) { - if (__nd->__right_ != nullptr) + if (__nd->__right_ != nullptr) { + __nd_ptr = _VSTD::addressof(__nd->__right_); __nd = static_cast<__node_pointer>(__nd->__right_); - else - { - __parent = static_cast<__node_base_pointer>(__nd); - return __parent->__right_; + } else { + __parent = static_cast<__parent_pointer>(__nd); + return __nd->__right_; } } else { - __parent = static_cast<__node_base_pointer>(__nd); - return __parent; + __parent = static_cast<__parent_pointer>(__nd); + return *__nd_ptr; } } } - __parent = static_cast<__node_base_pointer>(__end_node()); + __parent = static_cast<__parent_pointer>(__end_node()); return __parent->__left_; } @@ -1590,9 +1997,10 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(typename __node_base::pointer& _ // If __v exists, set parent to node of __v and return reference to node of __v template template -typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer& +typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer& __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, - typename __node_base::pointer& __parent, + __parent_pointer& __parent, + __node_base_pointer& __dummy, const _Key& __v) { if (__hint == end() || value_comp()(__v, *__hint)) // check before @@ -1604,13 +2012,13 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, // *prev(__hint) < __v < *__hint if (__hint.__ptr_->__left_ == nullptr) { - __parent = static_cast<__node_base_pointer>(__hint.__ptr_); + __parent = static_cast<__parent_pointer>(__hint.__ptr_); return __parent->__left_; } else { - __parent = static_cast<__node_base_pointer>(__prior.__ptr_); - return __parent->__right_; + __parent = static_cast<__parent_pointer>(__prior.__ptr_); + return static_cast<__node_base_pointer>(__prior.__ptr_)->__right_; } } // __v <= *prev(__hint) @@ -1623,14 +2031,14 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, if (__next == end() || value_comp()(__v, *__next)) { // *__hint < __v < *_VSTD::next(__hint) - if (__hint.__ptr_->__right_ == nullptr) + if (__hint.__get_np()->__right_ == nullptr) { - __parent = static_cast<__node_base_pointer>(__hint.__ptr_); - return __parent->__right_; + __parent = static_cast<__parent_pointer>(__hint.__ptr_); + return static_cast<__node_base_pointer>(__hint.__ptr_)->__right_; } else { - __parent = static_cast<__node_base_pointer>(__next.__ptr_); + __parent = static_cast<__parent_pointer>(__next.__ptr_); return __parent->__left_; } } @@ -1638,48 +2046,115 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint, return __find_equal(__parent, __v); } // else __v == *__hint - __parent = static_cast<__node_base_pointer>(__hint.__ptr_); - return __parent; + __parent = static_cast<__parent_pointer>(__hint.__ptr_); + __dummy = static_cast<__node_base_pointer>(__hint.__ptr_); + return __dummy; } template void -__tree<_Tp, _Compare, _Allocator>::__insert_node_at(__node_base_pointer __parent, +__tree<_Tp, _Compare, _Allocator>::__insert_node_at(__parent_pointer __parent, __node_base_pointer& __child, - __node_base_pointer __new_node) + __node_base_pointer __new_node) { __new_node->__left_ = nullptr; __new_node->__right_ = nullptr; __new_node->__parent_ = __parent; + // __new_node->__is_black_ is initialized in __tree_balance_after_insert __child = __new_node; if (__begin_node()->__left_ != nullptr) - __begin_node() = static_cast<__node_pointer>(__begin_node()->__left_); + __begin_node() = static_cast<__iter_pointer>(__begin_node()->__left_); __tree_balance_after_insert(__end_node()->__left_, __child); ++size(); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG +template +template +pair::iterator, bool> +__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args) +#else +template +template +pair::iterator, bool> +__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args& __args) +#endif +{ + __parent_pointer __parent; + __node_base_pointer& __child = __find_equal(__parent, __k); + __node_pointer __r = static_cast<__node_pointer>(__child); + bool __inserted = false; + if (__child == nullptr) + { +#ifndef _LIBCPP_CXX03_LANG + __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...); +#else + __node_holder __h = __construct_node(__args); +#endif + __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); + __r = __h.release(); + __inserted = true; + } + return pair(iterator(__r), __inserted); +} + + +#ifndef _LIBCPP_CXX03_LANG +template +template +typename __tree<_Tp, _Compare, _Allocator>::iterator +__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args( + const_iterator __p, _Key const& __k, _Args&&... __args) +#else +template +template +typename __tree<_Tp, _Compare, _Allocator>::iterator +__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args( + const_iterator __p, _Key const& __k, _Args& __args) +#endif +{ + __parent_pointer __parent; + __node_base_pointer __dummy; + __node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __k); + __node_pointer __r = static_cast<__node_pointer>(__child); + if (__child == nullptr) + { +#ifndef _LIBCPP_CXX03_LANG + __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...); +#else + __node_holder __h = __construct_node(__args); +#endif + __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); + __r = __h.release(); + } + return iterator(__r); +} + + +#ifndef _LIBCPP_CXX03_LANG template template typename __tree<_Tp, _Compare, _Allocator>::__node_holder __tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&& ...__args) { + static_assert(!__is_tree_value_type<_Args...>::value, + "Cannot construct from __value_type"); __node_allocator& __na = __node_alloc(); __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); - __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...); + __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), _VSTD::forward<_Args>(__args)...); __h.get_deleter().__value_constructed = true; return __h; } + template template pair::iterator, bool> -__tree<_Tp, _Compare, _Allocator>::__emplace_unique(_Args&&... __args) +__tree<_Tp, _Compare, _Allocator>::__emplace_unique_impl(_Args&&... __args) { __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...); - __node_base_pointer __parent; + __parent_pointer __parent; __node_base_pointer& __child = __find_equal(__parent, __h->__value_); __node_pointer __r = static_cast<__node_pointer>(__child); bool __inserted = false; @@ -1695,11 +2170,12 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_unique(_Args&&... __args) template template typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique(const_iterator __p, _Args&&... __args) +__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_impl(const_iterator __p, _Args&&... __args) { __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...); - __node_base_pointer __parent; - __node_base_pointer& __child = __find_equal(__p, __parent, __h->__value_); + __parent_pointer __parent; + __node_base_pointer __dummy; + __node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __h->__value_); __node_pointer __r = static_cast<__node_pointer>(__child); if (__child == nullptr) { @@ -1715,8 +2191,8 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__emplace_multi(_Args&&... __args) { __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...); - __node_base_pointer __parent; - __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_); + __parent_pointer __parent; + __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__h->__value_)); __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); return iterator(static_cast<__node_pointer>(__h.release())); } @@ -1728,161 +2204,35 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p, _Args&&... __args) { __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...); - __node_base_pointer __parent; - __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_); + __parent_pointer __parent; + __node_base_pointer& __child = __find_leaf(__p, __parent, _NodeTypes::__get_key(__h->__value_)); __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); return iterator(static_cast<__node_pointer>(__h.release())); } -#endif // _LIBCPP_HAS_NO_VARIADICS -template -pair::iterator, bool> -__tree<_Tp, _Compare, _Allocator>::__insert_unique(value_type&& __v) -{ - __node_holder __h = __construct_node(_VSTD::forward(__v)); - pair __r = __node_insert_unique(__h.get()); - if (__r.second) - __h.release(); - return __r; -} - -template -typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, value_type&& __v) -{ - __node_holder __h = __construct_node(_VSTD::forward(__v)); - iterator __r = __node_insert_unique(__p, __h.get()); - if (__r.__ptr_ == __h.get()) - __h.release(); - return __r; -} - -template -template -pair::iterator, bool> -__tree<_Tp, _Compare, _Allocator>::__insert_unique(_Vp&& __v) -{ - __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v)); - pair __r = __node_insert_unique(__h.get()); - if (__r.second) - __h.release(); - return __r; -} - -template -template -typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, _Vp&& __v) -{ - __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v)); - iterator __r = __node_insert_unique(__p, __h.get()); - if (__r.__ptr_ == __h.get()) - __h.release(); - return __r; -} - -template -typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_multi(value_type&& __v) -{ - __node_base_pointer __parent; - __node_base_pointer& __child = __find_leaf_high(__parent, __v); - __node_holder __h = __construct_node(_VSTD::forward(__v)); - __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); - return iterator(__h.release()); -} - -template -typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, value_type&& __v) -{ - __node_base_pointer __parent; - __node_base_pointer& __child = __find_leaf(__p, __parent, __v); - __node_holder __h = __construct_node(_VSTD::forward(__v)); - __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); - return iterator(__h.release()); -} - -template -template -typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_multi(_Vp&& __v) -{ - __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v)); - __node_base_pointer __parent; - __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_); - __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); - return iterator(__h.release()); -} - -template -template -typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, _Vp&& __v) -{ - __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v)); - __node_base_pointer __parent; - __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_); - __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); - return iterator(__h.release()); -} - -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#else // _LIBCPP_CXX03_LANG template typename __tree<_Tp, _Compare, _Allocator>::__node_holder -__tree<_Tp, _Compare, _Allocator>::__construct_node(const value_type& __v) +__tree<_Tp, _Compare, _Allocator>::__construct_node(const __container_value_type& __v) { __node_allocator& __na = __node_alloc(); __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); - __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v); + __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v); __h.get_deleter().__value_constructed = true; return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -template -pair::iterator, bool> -__tree<_Tp, _Compare, _Allocator>::__insert_unique(const value_type& __v) -{ - __node_base_pointer __parent; - __node_base_pointer& __child = __find_equal(__parent, __v); - __node_pointer __r = static_cast<__node_pointer>(__child); - bool __inserted = false; - if (__child == nullptr) - { - __node_holder __h = __construct_node(__v); - __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); - __r = __h.release(); - __inserted = true; - } - return pair(iterator(__r), __inserted); -} +#endif // _LIBCPP_CXX03_LANG +#ifdef _LIBCPP_CXX03_LANG template typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, const value_type& __v) +__tree<_Tp, _Compare, _Allocator>::__insert_multi(const __container_value_type& __v) { - __node_base_pointer __parent; - __node_base_pointer& __child = __find_equal(__p, __parent, __v); - __node_pointer __r = static_cast<__node_pointer>(__child); - if (__child == nullptr) - { - __node_holder __h = __construct_node(__v); - __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); - __r = __h.release(); - } - return iterator(__r); -} - -template -typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_multi(const value_type& __v) -{ - __node_base_pointer __parent; - __node_base_pointer& __child = __find_leaf_high(__parent, __v); + __parent_pointer __parent; + __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__v)); __node_holder __h = __construct_node(__v); __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); return iterator(__h.release()); @@ -1890,20 +2240,21 @@ __tree<_Tp, _Compare, _Allocator>::__insert_multi(const value_type& __v) template typename __tree<_Tp, _Compare, _Allocator>::iterator -__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, const value_type& __v) +__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, const __container_value_type& __v) { - __node_base_pointer __parent; - __node_base_pointer& __child = __find_leaf(__p, __parent, __v); + __parent_pointer __parent; + __node_base_pointer& __child = __find_leaf(__p, __parent, _NodeTypes::__get_key(__v)); __node_holder __h = __construct_node(__v); __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); return iterator(__h.release()); } +#endif template pair::iterator, bool> __tree<_Tp, _Compare, _Allocator>::__node_insert_unique(__node_pointer __nd) { - __node_base_pointer __parent; + __parent_pointer __parent; __node_base_pointer& __child = __find_equal(__parent, __nd->__value_); __node_pointer __r = static_cast<__node_pointer>(__child); bool __inserted = false; @@ -1921,7 +2272,8 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__node_insert_unique(const_iterator __p, __node_pointer __nd) { - __node_base_pointer __parent; + __parent_pointer __parent; + __node_base_pointer __dummy; __node_base_pointer& __child = __find_equal(__p, __parent, __nd->__value_); __node_pointer __r = static_cast<__node_pointer>(__child); if (__child == nullptr) @@ -1936,8 +2288,8 @@ template typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__node_insert_multi(__node_pointer __nd) { - __node_base_pointer __parent; - __node_base_pointer& __child = __find_leaf_high(__parent, __nd->__value_); + __parent_pointer __parent; + __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__nd->__value_)); __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd)); return iterator(__nd); } @@ -1947,8 +2299,8 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__node_insert_multi(const_iterator __p, __node_pointer __nd) { - __node_base_pointer __parent; - __node_base_pointer& __child = __find_leaf(__p, __parent, __nd->__value_); + __parent_pointer __parent; + __node_base_pointer& __child = __find_leaf(__p, __parent, _NodeTypes::__get_key(__nd->__value_)); __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd)); return iterator(__nd); } @@ -1957,16 +2309,17 @@ template typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::erase(const_iterator __p) { - __node_pointer __np = __p.__ptr_; - iterator __r(__np); + __node_pointer __np = __p.__get_np(); + iterator __r(__p.__ptr_); ++__r; - if (__begin_node() == __np) + if (__begin_node() == __p.__ptr_) __begin_node() = __r.__ptr_; --size(); __node_allocator& __na = __node_alloc(); __tree_remove(__end_node()->__left_, static_cast<__node_base_pointer>(__np)); - __node_traits::destroy(__na, const_cast(_VSTD::addressof(*__p))); + __node_traits::destroy(__na, _NodeTypes::__get_ptr( + const_cast<__node_value_type&>(*__p))); __node_traits::deallocate(__na, __np, 1); return __r; } @@ -2031,17 +2384,15 @@ template typename __tree<_Tp, _Compare, _Allocator>::size_type __tree<_Tp, _Compare, _Allocator>::__count_unique(const _Key& __k) const { - __node_const_pointer __result = __end_node(); - __node_const_pointer __rt = __root(); + __node_pointer __rt = __root(); while (__rt != nullptr) { if (value_comp()(__k, __rt->__value_)) { - __result = __rt; - __rt = static_cast<__node_const_pointer>(__rt->__left_); + __rt = static_cast<__node_pointer>(__rt->__left_); } else if (value_comp()(__rt->__value_, __k)) - __rt = static_cast<__node_const_pointer>(__rt->__right_); + __rt = static_cast<__node_pointer>(__rt->__right_); else return 1; } @@ -2053,21 +2404,21 @@ template typename __tree<_Tp, _Compare, _Allocator>::size_type __tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const { - __node_const_pointer __result = __end_node(); - __node_const_pointer __rt = __root(); + __iter_pointer __result = __end_node(); + __node_pointer __rt = __root(); while (__rt != nullptr) { if (value_comp()(__k, __rt->__value_)) { - __result = __rt; - __rt = static_cast<__node_const_pointer>(__rt->__left_); + __result = static_cast<__iter_pointer>(__rt); + __rt = static_cast<__node_pointer>(__rt->__left_); } else if (value_comp()(__rt->__value_, __k)) - __rt = static_cast<__node_const_pointer>(__rt->__right_); + __rt = static_cast<__node_pointer>(__rt->__right_); else return _VSTD::distance( - __lower_bound(__k, static_cast<__node_const_pointer>(__rt->__left_), __rt), - __upper_bound(__k, static_cast<__node_const_pointer>(__rt->__right_), __result) + __lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__iter_pointer>(__rt)), + __upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result) ); } return 0; @@ -2078,13 +2429,13 @@ template typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__lower_bound(const _Key& __v, __node_pointer __root, - __node_pointer __result) + __iter_pointer __result) { while (__root != nullptr) { if (!value_comp()(__root->__value_, __v)) { - __result = __root; + __result = static_cast<__iter_pointer>(__root); __root = static_cast<__node_pointer>(__root->__left_); } else @@ -2097,18 +2448,18 @@ template template typename __tree<_Tp, _Compare, _Allocator>::const_iterator __tree<_Tp, _Compare, _Allocator>::__lower_bound(const _Key& __v, - __node_const_pointer __root, - __node_const_pointer __result) const + __node_pointer __root, + __iter_pointer __result) const { while (__root != nullptr) { if (!value_comp()(__root->__value_, __v)) { - __result = __root; - __root = static_cast<__node_const_pointer>(__root->__left_); + __result = static_cast<__iter_pointer>(__root); + __root = static_cast<__node_pointer>(__root->__left_); } else - __root = static_cast<__node_const_pointer>(__root->__right_); + __root = static_cast<__node_pointer>(__root->__right_); } return const_iterator(__result); } @@ -2118,13 +2469,13 @@ template typename __tree<_Tp, _Compare, _Allocator>::iterator __tree<_Tp, _Compare, _Allocator>::__upper_bound(const _Key& __v, __node_pointer __root, - __node_pointer __result) + __iter_pointer __result) { while (__root != nullptr) { if (value_comp()(__v, __root->__value_)) { - __result = __root; + __result = static_cast<__iter_pointer>(__root); __root = static_cast<__node_pointer>(__root->__left_); } else @@ -2137,18 +2488,18 @@ template template typename __tree<_Tp, _Compare, _Allocator>::const_iterator __tree<_Tp, _Compare, _Allocator>::__upper_bound(const _Key& __v, - __node_const_pointer __root, - __node_const_pointer __result) const + __node_pointer __root, + __iter_pointer __result) const { while (__root != nullptr) { if (value_comp()(__v, __root->__value_)) { - __result = __root; - __root = static_cast<__node_const_pointer>(__root->__left_); + __result = static_cast<__iter_pointer>(__root); + __root = static_cast<__node_pointer>(__root->__left_); } else - __root = static_cast<__node_const_pointer>(__root->__right_); + __root = static_cast<__node_pointer>(__root->__right_); } return const_iterator(__result); } @@ -2160,13 +2511,13 @@ pair::iterator, __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) { typedef pair _Pp; - __node_pointer __result = __end_node(); + __iter_pointer __result = __end_node(); __node_pointer __rt = __root(); while (__rt != nullptr) { if (value_comp()(__k, __rt->__value_)) { - __result = __rt; + __result = static_cast<__iter_pointer>(__rt); __rt = static_cast<__node_pointer>(__rt->__left_); } else if (value_comp()(__rt->__value_, __k)) @@ -2175,7 +2526,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) return _Pp(iterator(__rt), iterator( __rt->__right_ != nullptr ? - static_cast<__node_pointer>(__tree_min(__rt->__right_)) + static_cast<__iter_pointer>(__tree_min(__rt->__right_)) : __result)); } return _Pp(iterator(__result), iterator(__result)); @@ -2188,22 +2539,22 @@ pair::const_iterator, __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const { typedef pair _Pp; - __node_const_pointer __result = __end_node(); - __node_const_pointer __rt = __root(); + __iter_pointer __result = __end_node(); + __node_pointer __rt = __root(); while (__rt != nullptr) { if (value_comp()(__k, __rt->__value_)) { - __result = __rt; - __rt = static_cast<__node_const_pointer>(__rt->__left_); + __result = static_cast<__iter_pointer>(__rt); + __rt = static_cast<__node_pointer>(__rt->__left_); } else if (value_comp()(__rt->__value_, __k)) - __rt = static_cast<__node_const_pointer>(__rt->__right_); + __rt = static_cast<__node_pointer>(__rt->__right_); else return _Pp(const_iterator(__rt), const_iterator( __rt->__right_ != nullptr ? - static_cast<__node_const_pointer>(__tree_min(__rt->__right_)) + static_cast<__iter_pointer>(__tree_min(__rt->__right_)) : __result)); } return _Pp(const_iterator(__result), const_iterator(__result)); @@ -2216,19 +2567,19 @@ pair::iterator, __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) { typedef pair _Pp; - __node_pointer __result = __end_node(); + __iter_pointer __result = __end_node(); __node_pointer __rt = __root(); while (__rt != nullptr) { if (value_comp()(__k, __rt->__value_)) { - __result = __rt; + __result = static_cast<__iter_pointer>(__rt); __rt = static_cast<__node_pointer>(__rt->__left_); } else if (value_comp()(__rt->__value_, __k)) __rt = static_cast<__node_pointer>(__rt->__right_); else - return _Pp(__lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), __rt), + return _Pp(__lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__iter_pointer>(__rt)), __upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result)); } return _Pp(iterator(__result), iterator(__result)); @@ -2241,20 +2592,20 @@ pair::const_iterator, __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const { typedef pair _Pp; - __node_const_pointer __result = __end_node(); - __node_const_pointer __rt = __root(); + __iter_pointer __result = __end_node(); + __node_pointer __rt = __root(); while (__rt != nullptr) { if (value_comp()(__k, __rt->__value_)) { - __result = __rt; - __rt = static_cast<__node_const_pointer>(__rt->__left_); + __result = static_cast<__iter_pointer>(__rt); + __rt = static_cast<__node_pointer>(__rt->__left_); } else if (value_comp()(__rt->__value_, __k)) - __rt = static_cast<__node_const_pointer>(__rt->__right_); + __rt = static_cast<__node_pointer>(__rt->__right_); else - return _Pp(__lower_bound(__k, static_cast<__node_const_pointer>(__rt->__left_), __rt), - __upper_bound(__k, static_cast<__node_const_pointer>(__rt->__right_), __result)); + return _Pp(__lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__iter_pointer>(__rt)), + __upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result)); } return _Pp(const_iterator(__result), const_iterator(__result)); } @@ -2263,13 +2614,13 @@ template typename __tree<_Tp, _Compare, _Allocator>::__node_holder __tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT { - __node_pointer __np = __p.__ptr_; - if (__begin_node() == __np) + __node_pointer __np = __p.__get_np(); + if (__begin_node() == __p.__ptr_) { if (__np->__right_ != nullptr) - __begin_node() = static_cast<__node_pointer>(__np->__right_); + __begin_node() = static_cast<__iter_pointer>(__np->__right_); else - __begin_node() = static_cast<__node_pointer>(__np->__parent_); + __begin_node() = static_cast<__iter_pointer>(__np->__parent_); } --size(); __tree_remove(__end_node()->__left_, diff --git a/include/__tuple b/include/__tuple index 8c31759774de..cc9fbbebc096 100644 --- a/include/__tuple +++ b/include/__tuple @@ -68,6 +68,80 @@ template struct __tuple_like : public __tuple_li // tuple specializations #if !defined(_LIBCPP_HAS_NO_VARIADICS) + +template struct __tuple_indices {}; + +template +struct __integer_sequence { + template