aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:07:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:07:56 +0000
commitf36202620b428c45a1c8d91743727c9313424fb2 (patch)
tree14928d8970ba4890a6370aca4c38fc832d45f21f
parent0294ba5648d889e48ffee8ddad25944e258940ae (diff)
downloadsrc-f36202620b428c45a1c8d91743727c9313424fb2.tar.gz
src-f36202620b428c45a1c8d91743727c9313424fb2.zip
Vendor import of libc++ trunk r338150:vendor/libc++/libc++-trunk-r338150
Notes
Notes: svn path=/vendor/libc++/dist/; revision=336819 svn path=/vendor/libc++/libc++-trunk-r338150/; revision=336820; tag=vendor/libc++/libc++-trunk-r338150
-rw-r--r--CMakeLists.txt82
-rw-r--r--CREDITS.TXT2
-rw-r--r--NOTES.TXT1
-rw-r--r--appveyor-reqs-install.cmd2
-rw-r--r--benchmarks/CMakeLists.txt3
-rw-r--r--benchmarks/ContainerBenchmarks.hpp2
-rw-r--r--benchmarks/GenerateInput.hpp6
-rw-r--r--benchmarks/algorithms.bench.cpp4
-rw-r--r--benchmarks/filesystem.bench.cpp59
-rw-r--r--benchmarks/string.bench.cpp25
-rw-r--r--benchmarks/stringstream.bench.cpp4
-rw-r--r--benchmarks/unordered_set_operations.bench.cpp4
-rw-r--r--benchmarks/util_smartptr.bench.cpp4
-rw-r--r--benchmarks/vector_operations.bench.cpp4
-rw-r--r--cmake/Modules/CheckLibcxxAtomic.cmake9
-rw-r--r--cmake/Modules/HandleCompilerRT.cmake3
-rw-r--r--cmake/Modules/HandleLibCXXABI.cmake43
-rw-r--r--cmake/Modules/HandleOutOfTreeLLVM.cmake7
-rw-r--r--docs/BuildingLibcxx.rst10
-rw-r--r--docs/DesignDocs/AvailabilityMarkup.rst2
-rw-r--r--docs/DesignDocs/CapturingConfigInfo.rst2
-rw-r--r--docs/DesignDocs/FileTimeType.rst494
-rw-r--r--docs/DesignDocs/ThreadingSupportAPI.rst4
-rw-r--r--docs/DesignDocs/VisibilityMacros.rst26
-rw-r--r--docs/Makefile.sphinx2
-rw-r--r--docs/UsingLibcxx.rst21
-rw-r--r--docs/conf.py4
-rw-r--r--docs/index.rst1
-rw-r--r--fuzzing/fuzz_test.cpp195
-rw-r--r--fuzzing/fuzzing.cpp70
-rw-r--r--include/CMakeLists.txt282
-rw-r--r--include/__bsd_locale_fallbacks.h22
-rw-r--r--include/__config940
-rw-r--r--include/__config_site.in1
-rw-r--r--include/__errc218
-rw-r--r--include/__functional_0356
-rw-r--r--include/__functional_base14
-rw-r--r--include/__hash_table16
-rw-r--r--include/__libcpp_version2
-rw-r--r--include/__locale174
-rw-r--r--include/__mutex_base6
-rw-r--r--include/__nullptr16
-rw-r--r--include/__sso_allocator4
-rw-r--r--include/__string10
-rw-r--r--include/__threading_support281
-rw-r--r--include/__tree19
-rw-r--r--include/algorithm508
-rw-r--r--include/any6
-rw-r--r--include/array181
-rw-r--r--include/atomic9
-rw-r--r--include/chrono497
-rw-r--r--include/cmath12
-rw-r--r--include/codecvt36
-rw-r--r--include/compare679
-rw-r--r--include/complex21
-rw-r--r--include/deque29
-rw-r--r--include/exception4
-rw-r--r--include/experimental/__config12
-rw-r--r--include/experimental/algorithm17
-rw-r--r--include/experimental/any583
-rw-r--r--include/experimental/chrono50
-rw-r--r--include/experimental/coroutine98
-rw-r--r--include/experimental/dynarray17
-rw-r--r--include/experimental/filesystem2051
-rw-r--r--include/experimental/functional8
-rw-r--r--include/experimental/memory_resource26
-rw-r--r--include/experimental/numeric110
-rw-r--r--include/experimental/optional913
-rw-r--r--include/experimental/propagate_const3
-rw-r--r--include/experimental/ratio68
-rw-r--r--include/experimental/simd1285
-rw-r--r--include/experimental/string_view809
-rw-r--r--include/experimental/system_error54
-rw-r--r--include/experimental/tuple73
-rw-r--r--include/experimental/type_traits375
-rw-r--r--include/filesystem2682
-rw-r--r--include/forward_list41
-rw-r--r--include/fstream348
-rw-r--r--include/functional156
-rw-r--r--include/future12
-rw-r--r--include/initializer_list10
-rw-r--r--include/ios39
-rw-r--r--include/istream324
-rw-r--r--include/iterator113
-rw-r--r--include/list69
-rw-r--r--include/locale191
-rw-r--r--include/map125
-rw-r--r--include/math.h66
-rw-r--r--include/memory86
-rw-r--r--include/module.modulemap53
-rw-r--r--include/mutex6
-rw-r--r--include/new53
-rw-r--r--include/numeric38
-rw-r--r--include/optional19
-rw-r--r--include/ostream8
-rw-r--r--include/queue68
-rw-r--r--include/random2
-rw-r--r--include/ratio30
-rw-r--r--include/regex18
-rw-r--r--include/set8
-rw-r--r--include/span608
-rw-r--r--include/stack24
-rw-r--r--include/stdexcept16
-rw-r--r--include/stdio.h7
-rw-r--r--include/streambuf17
-rw-r--r--include/string472
-rw-r--r--include/string_view4
-rw-r--r--include/support/android/locale_bionic.h37
-rw-r--r--include/support/win32/locale_win32.h8
-rw-r--r--include/support/xlocale/__posix_l_fallback.h78
-rw-r--r--include/support/xlocale/__strtonum_fallback.h24
-rw-r--r--include/system_error244
-rw-r--r--include/tgmath.h16
-rw-r--r--include/thread2
-rw-r--r--include/tuple39
-rw-r--r--include/type_traits709
-rw-r--r--include/typeinfo8
-rw-r--r--include/unordered_map112
-rw-r--r--include/utility25
-rw-r--r--include/valarray133
-rw-r--r--include/variant30
-rw-r--r--include/vector141
-rw-r--r--include/version (renamed from test/std/experimental/utilities/meta/meta.type.synop/includes.pass.cpp)22
-rw-r--r--lib/CMakeLists.txt75
-rw-r--r--lib/abi/5.0/x86_64-apple-darwin16.abilist (renamed from lib/abi/x86_64-apple-darwin16.abilist)0
-rw-r--r--lib/abi/5.0/x86_64-unknown-linux-gnu.abilist (renamed from lib/abi/x86_64-unknown-linux-gnu.abilist)0
-rw-r--r--lib/abi/6.0/x86_64-apple-darwin16.abilist2378
-rw-r--r--lib/abi/6.0/x86_64-unknown-linux-gnu.abilist1883
-rw-r--r--lib/abi/CHANGELOG.TXT18
-rw-r--r--lib/abi/CMakeLists.txt28
-rw-r--r--lib/abi/x86_64-apple-darwin.v1.abilist2378
-rw-r--r--lib/abi/x86_64-apple-darwin.v2.abilist2418
-rw-r--r--lib/abi/x86_64-unknown-linux-gnu.v1.abilist1883
-rw-r--r--src/any.cpp14
-rw-r--r--src/chrono.cpp41
-rw-r--r--src/experimental/filesystem/directory_iterator.cpp342
-rw-r--r--src/experimental/filesystem/filesystem_time_helper.h173
-rw-r--r--src/experimental/filesystem/operations.cpp808
-rw-r--r--src/experimental/filesystem/path.cpp448
-rw-r--r--src/experimental/memory_resource.cpp19
-rw-r--r--src/filesystem/directory_iterator.cpp396
-rw-r--r--src/filesystem/filesystem_common.h429
-rw-r--r--src/filesystem/int128_builtins.cpp55
-rw-r--r--src/filesystem/operations.cpp1686
-rw-r--r--src/include/apple_availability.h52
-rw-r--r--src/include/config_elast.h4
-rw-r--r--src/locale.cpp5
-rw-r--r--src/optional.cpp16
-rw-r--r--src/support/runtime/exception_libcxxabi.ipp2
-rw-r--r--src/support/runtime/exception_msvc.ipp28
-rw-r--r--src/support/runtime/exception_pointer_msvc.ipp34
-rw-r--r--src/support/win32/locale_win32.cpp4
-rw-r--r--src/support/win32/support.cpp2
-rw-r--r--src/support/win32/thread_win32.cpp276
-rw-r--r--src/typeinfo.cpp5
-rw-r--r--test/CMakeLists.txt13
-rw-r--r--test/libcxx/atomics/atomics.flag/init_bool.pass.cpp13
-rw-r--r--test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp49
-rw-r--r--test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp49
-rw-r--r--test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp53
-rw-r--r--test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp57
-rw-r--r--test/libcxx/depr/depr.c.headers/math_h.sh.cpp (renamed from test/libcxx/experimental/utilities/syserror/version.pass.cpp)17
-rw-r--r--test/libcxx/double_include.sh.cpp13
-rw-r--r--test/libcxx/experimental/any/size_and_alignment.pass.cpp23
-rw-r--r--test/libcxx/experimental/any/small_type.pass.cpp114
-rw-r--r--test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp70
-rw-r--r--test/libcxx/experimental/filesystem/convert_file_time.sh.cpp200
-rw-r--r--test/libcxx/experimental/filesystem/version.pass.cpp2
-rw-r--r--test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp12
-rw-r--r--test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp21
-rw-r--r--test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp21
-rw-r--r--test/libcxx/experimental/utilities/time/version.pass.cpp20
-rw-r--r--test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp20
-rw-r--r--test/libcxx/experimental/utilities/tuple/version.pass.cpp20
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp (renamed from test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool3.fail.cpp)19
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp46
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp52
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat1
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp42
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp48
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat1
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp60
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp60
-rw-r--r--test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp30
-rw-r--r--test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.sh.cpp93
-rw-r--r--test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp (renamed from test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp)25
-rw-r--r--test/libcxx/input.output/filesystems/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp (renamed from test/libcxx/experimental/filesystem/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp)6
-rw-r--r--test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp (renamed from test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp)6
-rw-r--r--test/libcxx/input.output/filesystems/convert_file_time.sh.cpp307
-rw-r--r--test/libcxx/input.output/filesystems/lit.local.cfg (renamed from test/libcxx/experimental/filesystem/lit.local.cfg)0
-rw-r--r--test/libcxx/input.output/filesystems/version.pass.cpp (renamed from test/libcxx/experimental/optional/version.pass.cpp)4
-rw-r--r--test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp (renamed from test/std/experimental/optional/optional.object/optional.object.observe/value_const.fail.cpp)24
-rw-r--r--test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp29
-rw-r--r--test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp26
-rw-r--r--test/libcxx/iterators/failed.pass.cpp (renamed from test/std/experimental/optional/optional.object/optional.object.observe/bool.pass.cpp)23
-rw-r--r--test/libcxx/language.support/cmp/version.pass.cpp (renamed from test/libcxx/experimental/any/version.pass.cpp)4
-rw-r--r--test/libcxx/language.support/support.limits/version.pass.cpp (renamed from test/libcxx/experimental/utilities/ratio/version.pass.cpp)8
-rw-r--r--test/libcxx/memory/is_allocator.pass.cpp42
-rw-r--r--test/libcxx/min_max_macros.sh.cpp16
-rw-r--r--test/libcxx/numerics/complex.number/__sqr.pass.cpp81
-rw-r--r--test/libcxx/strings/basic.string/string.modifiers/clear_and_shrink_db1.pass.cpp48
-rw-r--r--test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp16
-rw-r--r--test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp16
-rw-r--r--test/libcxx/type_traits/is_floating_point.pass.cpp (renamed from test/libcxx/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp)23
-rw-r--r--test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp40
-rw-r--r--test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp85
-rw-r--r--test/libcxx/utilities/utility/pairs/pairs.pair/assign_tuple_like.pass.cpp (renamed from test/std/utilities/utility/pairs/pairs.pair/assign_tuple.pass.cpp)52
-rw-r--r--test/lit.site.cfg.in4
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp21
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.fill/fill.pass.cpp18
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp20
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp22
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp29
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp26
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.partitions/partition_point.pass.cpp21
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp18
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp21
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp23
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp20
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.replace/replace.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp23
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp25
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp21
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp20
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp23
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp25
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp26
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp19
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp21
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp22
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp19
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp18
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp21
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.all_of/all_of.pass.cpp19
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp19
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp17
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp20
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp30
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp36
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp26
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp28
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp26
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp26
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp17
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp22
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp21
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp21
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp18
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp21
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp45
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.none_of/none_of.pass.cpp17
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp55
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp17
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp19
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp20
-rw-r--r--test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp44
-rw-r--r--test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp48
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp22
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp22
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp20
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp22
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp22
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp25
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp19
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp21
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp17
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_comp.pass.cpp17
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until.pass.cpp17
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp17
-rw-r--r--test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp18
-rw-r--r--test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare_comp.pass.cpp19
-rw-r--r--test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp24
-rw-r--r--test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp25
-rw-r--r--test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp19
-rw-r--r--test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp21
-rw-r--r--test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp25
-rw-r--r--test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp26
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp13
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp13
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp13
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until_comp.pass.cpp13
-rw-r--r--test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp2
-rw-r--r--test/std/containers/associative/map/map.cons/move.pass.cpp4
-rw-r--r--test/std/containers/associative/map/map.ops/count_transparent.pass.cpp50
-rw-r--r--test/std/containers/associative/map/map.ops/equal_range_transparent.pass.cpp60
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/move.pass.cpp4
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/count_transparent.pass.cpp50
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range_transparent.pass.cpp60
-rw-r--r--test/std/containers/associative/multiset/count_transparent.pass.cpp51
-rw-r--r--test/std/containers/associative/multiset/equal_range_transparent.pass.cpp60
-rw-r--r--test/std/containers/associative/multiset/insert_cv.pass.cpp78
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/move.pass.cpp4
-rw-r--r--test/std/containers/associative/set/count_transparent.pass.cpp51
-rw-r--r--test/std/containers/associative/set/equal_range_transparent.pass.cpp60
-rw-r--r--test/std/containers/associative/set/insert_cv.pass.cpp87
-rw-r--r--test/std/containers/associative/set/set.cons/move.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.fail.cpp58
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp123
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/deduct.fail.cpp46
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp91
-rw-r--r--test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp23
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/deduct.fail.cpp53
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp94
-rw-r--r--test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp23
-rw-r--r--test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp106
-rw-r--r--test/std/containers/sequences/array/array.cons/deduct.fail.cpp37
-rw-r--r--test/std/containers/sequences/array/array.cons/deduct.pass.cpp65
-rw-r--r--test/std/containers/sequences/array/array.cons/default.pass.cpp17
-rw-r--r--test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp93
-rw-r--r--test/std/containers/sequences/array/array.data/data.pass.cpp30
-rw-r--r--test/std/containers/sequences/array/array.data/data_const.pass.cpp19
-rw-r--r--test/std/containers/sequences/array/array.fill/fill.fail.cpp29
-rw-r--r--test/std/containers/sequences/array/array.swap/swap.fail.cpp30
-rw-r--r--test/std/containers/sequences/array/at.pass.cpp20
-rw-r--r--test/std/containers/sequences/array/begin.pass.cpp10
-rw-r--r--test/std/containers/sequences/array/compare.fail.cpp71
-rw-r--r--test/std/containers/sequences/array/compare.pass.cpp63
-rw-r--r--test/std/containers/sequences/array/empty.fail.cpp5
-rw-r--r--test/std/containers/sequences/array/front_back.pass.cpp33
-rw-r--r--test/std/containers/sequences/array/indexing.pass.cpp29
-rw-r--r--test/std/containers/sequences/array/size_and_alignment.pass.cpp71
-rw-r--r--test/std/containers/sequences/deque/deque.cons/deduct.fail.cpp42
-rw-r--r--test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp98
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.fail.cpp42
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp103
-rw-r--r--test/std/containers/sequences/list/list.cons/deduct.fail.cpp42
-rw-r--r--test/std/containers/sequences/list/list.cons/deduct.pass.cpp103
-rw-r--r--test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp41
-rw-r--r--test/std/containers/sequences/vector.bool/move.pass.cpp31
-rw-r--r--test/std/containers/sequences/vector/iterators.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector/vector.cons/deduct.fail.cpp40
-rw-r--r--test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp116
-rw-r--r--test/std/containers/sequences/vector/vector.cons/move.pass.cpp33
-rw-r--r--test/std/containers/test_compare.h4
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp15
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp79
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp77
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp80
-rw-r--r--test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp70
-rw-r--r--test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp69
-rw-r--r--test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp76
-rw-r--r--test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp67
-rw-r--r--test/std/containers/views/span.comparison/op.eq.pass.cpp168
-rw-r--r--test/std/containers/views/span.comparison/op.ge.pass.cpp153
-rw-r--r--test/std/containers/views/span.comparison/op.gt.pass.cpp154
-rw-r--r--test/std/containers/views/span.comparison/op.le.pass.cpp153
-rw-r--r--test/std/containers/views/span.comparison/op.lt.pass.cpp154
-rw-r--r--test/std/containers/views/span.comparison/op.ne.pass.cpp168
-rw-r--r--test/std/containers/views/span.cons/array.fail.cpp72
-rw-r--r--test/std/containers/views/span.cons/array.pass.cpp123
-rw-r--r--test/std/containers/views/span.cons/assign.pass.cpp293
-rw-r--r--test/std/containers/views/span.cons/container.fail.cpp117
-rw-r--r--test/std/containers/views/span.cons/container.pass.cpp118
-rw-r--r--test/std/containers/views/span.cons/copy.pass.cpp71
-rw-r--r--test/std/containers/views/span.cons/deduct.pass.cpp87
-rw-r--r--test/std/containers/views/span.cons/default.fail.cpp32
-rw-r--r--test/std/containers/views/span.cons/default.pass.cpp82
-rw-r--r--test/std/containers/views/span.cons/ptr_len.fail.cpp63
-rw-r--r--test/std/containers/views/span.cons/ptr_len.pass.cpp113
-rw-r--r--test/std/containers/views/span.cons/ptr_ptr.fail.cpp63
-rw-r--r--test/std/containers/views/span.cons/ptr_ptr.pass.cpp113
-rw-r--r--test/std/containers/views/span.cons/span.fail.cpp104
-rw-r--r--test/std/containers/views/span.cons/span.pass.cpp142
-rw-r--r--test/std/containers/views/span.cons/stdarray.pass.cpp114
-rw-r--r--test/std/containers/views/span.elem/data.pass.cpp121
-rw-r--r--test/std/containers/views/span.elem/op_idx.pass.cpp119
-rw-r--r--test/std/containers/views/span.iterators/begin.pass.cpp116
-rw-r--r--test/std/containers/views/span.iterators/end.pass.cpp118
-rw-r--r--test/std/containers/views/span.iterators/rbegin.pass.cpp117
-rw-r--r--test/std/containers/views/span.iterators/rend.pass.cpp118
-rw-r--r--test/std/containers/views/span.objectrep/as_bytes.pass.cpp78
-rw-r--r--test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp48
-rw-r--r--test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp78
-rw-r--r--test/std/containers/views/span.obs/empty.pass.cpp73
-rw-r--r--test/std/containers/views/span.obs/size.pass.cpp91
-rw-r--r--test/std/containers/views/span.obs/size_bytes.pass.cpp92
-rw-r--r--test/std/containers/views/span.sub/first.pass.cpp136
-rw-r--r--test/std/containers/views/span.sub/last.pass.cpp136
-rw-r--r--test/std/containers/views/span.sub/subspan.pass.cpp210
-rw-r--r--test/std/containers/views/types.pass.cpp107
-rw-r--r--test/std/depr/depr.c.headers/stddef_h.pass.cpp10
-rw-r--r--test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp5
-rw-r--r--test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp5
-rw-r--r--test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp5
-rw-r--r--test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp41
-rw-r--r--test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp150
-rw-r--r--test/std/experimental/algorithms/alg.random.sample/sample.stable.pass.cpp53
-rw-r--r--test/std/experimental/any/any.class/any.assign/copy.pass.cpp199
-rw-r--r--test/std/experimental/any/any.class/any.assign/move.pass.cpp104
-rw-r--r--test/std/experimental/any/any.class/any.assign/value.pass.cpp179
-rw-r--r--test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp38
-rw-r--r--test/std/experimental/any/any.class/any.cons/copy.pass.cpp102
-rw-r--r--test/std/experimental/any/any.class/any.cons/default.pass.cpp38
-rw-r--r--test/std/experimental/any/any.class/any.cons/move.pass.cpp104
-rw-r--r--test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp36
-rw-r--r--test/std/experimental/any/any.class/any.cons/value.pass.cpp118
-rw-r--r--test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp65
-rw-r--r--test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp103
-rw-r--r--test/std/experimental/any/any.class/any.observers/empty.pass.cpp64
-rw-r--r--test/std/experimental/any/any.class/any.observers/type.pass.cpp41
-rw-r--r--test/std/experimental/any/any.class/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp146
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp312
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp38
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp45
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp37
-rw-r--r--test/std/experimental/any/any.nonmembers/swap.pass.cpp41
-rw-r--r--test/std/experimental/filesystem/class.directory_entry/directory_entry.cons.pass.cpp97
-rw-r--r--test/std/experimental/filesystem/class.directory_entry/directory_entry.mods.pass.cpp113
-rw-r--r--test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/status.pass.cpp51
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.absolute/absolute.pass.cpp117
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp188
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp424
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.system_complete/system_complete.pass.cpp58
-rw-r--r--test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp9
-rw-r--r--test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp75
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp30
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp29
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp33
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp43
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp142
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp41
-rw-r--r--test/std/experimental/nothing_to_do.pass.cpp2
-rw-r--r--test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp15
-rw-r--r--test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp15
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp24
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp24
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp139
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp25
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp24
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp24
-rw-r--r--test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp139
-rw-r--r--test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp29
-rw-r--r--test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp31
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp53
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp55
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp55
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp55
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp55
-rw-r--r--test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp53
-rw-r--r--test/std/experimental/optional/optional.general/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/optional/optional.hash/hash.pass.cpp46
-rw-r--r--test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp36
-rw-r--r--test/std/experimental/optional/optional.nullops/equal.pass.cpp39
-rw-r--r--test/std/experimental/optional/optional.nullops/greater.pass.cpp39
-rw-r--r--test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp39
-rw-r--r--test/std/experimental/optional/optional.nullops/less_equal.pass.cpp43
-rw-r--r--test/std/experimental/optional/optional.nullops/less_than.pass.cpp39
-rw-r--r--test/std/experimental/optional/optional.nullops/not_equal.pass.cpp39
-rw-r--r--test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp38
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp80
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp101
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp153
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp126
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp114
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp62
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp116
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp139
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp62
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp144
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp118
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp149
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp63
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp110
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp54
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp44
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp52
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp43
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp65
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp59
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp64
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp66
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp77
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp313
-rw-r--r--test/std/experimental/optional/optional.object/optional_const_void.fail.cpp22
-rw-r--r--test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp28
-rw-r--r--test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp27
-rw-r--r--test/std/experimental/optional/optional.object/optional_void.fail.cpp22
-rw-r--r--test/std/experimental/optional/optional.object/types.pass.cpp38
-rw-r--r--test/std/experimental/optional/optional.relops/equal.pass.cpp74
-rw-r--r--test/std/experimental/optional/optional.relops/greater_equal.pass.cpp70
-rw-r--r--test/std/experimental/optional/optional.relops/greater_than.pass.cpp70
-rw-r--r--test/std/experimental/optional/optional.relops/less_equal.pass.cpp70
-rw-r--r--test/std/experimental/optional/optional.relops/less_than.pass.cpp70
-rw-r--r--test/std/experimental/optional/optional.relops/not_equal.pass.cpp74
-rw-r--r--test/std/experimental/optional/optional.specalg/make_optional.pass.cpp51
-rw-r--r--test/std/experimental/optional/optional.specalg/swap.pass.cpp303
-rw-r--r--test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp25
-rw-r--r--test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp23
-rw-r--r--test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp25
-rw-r--r--test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp25
-rw-r--r--test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp23
-rw-r--r--test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp23
-rw-r--r--test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp25
-rw-r--r--test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp23
-rw-r--r--test/std/experimental/simd/simd.casts/simd_cast.pass.cpp40
-rw-r--r--test/std/experimental/simd/simd.casts/static_simd_cast.pass.cpp38
-rw-r--r--test/std/experimental/simd/simd.cons/broadcast.pass.cpp58
-rw-r--r--test/std/experimental/simd/simd.cons/generator.pass.cpp46
-rw-r--r--test/std/experimental/simd/simd.traits/abi_for_size.pass.cpp30
-rw-r--r--test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp115
-rw-r--r--test/std/experimental/simd/simd.traits/is_simd.pass.cpp133
-rw-r--r--test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp55
-rw-r--r--test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp133
-rw-r--r--test/std/experimental/string.view/lit.local.cfg3
-rw-r--r--test/std/experimental/string.view/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/string.view/string.view.access/at.pass.cpp63
-rw-r--r--test/std/experimental/string.view/string.view.access/back.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.access/data.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.access/front.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.access/index.pass.cpp53
-rw-r--r--test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp89
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp69
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opeq.string_view.string.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp62
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp72
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opge.string_view.string.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp72
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opgt.string_view.string.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp72
-rw-r--r--test/std/experimental/string.view/string.view.comparison/ople.string_view.string.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp72
-rw-r--r--test/std/experimental/string.view/string.view.comparison/oplt.string_view.string.pass.cpp50
-rw-r--r--test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp70
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opne.string_view.string.pass.cpp49
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp62
-rw-r--r--test/std/experimental/string.view/string.view.cons/default.pass.cpp48
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp83
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_string.pass.cpp56
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_string1.fail.cpp32
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_string2.fail.cpp32
-rw-r--r--test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp85
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp85
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp166
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp148
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp83
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp166
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_string_view_size.pass.cpp148
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp83
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp166
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp148
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp83
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp166
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_string_view_size.pass.cpp148
-rw-r--r--test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp172
-rw-r--r--test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp394
-rw-r--r--test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp165
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp84
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp172
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp393
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp165
-rw-r--r--test/std/experimental/string.view/string.view.hash/string_view.pass.cpp55
-rw-r--r--test/std/experimental/string.view/string.view.io/stream_insert.pass.cpp58
-rw-r--r--test/std/experimental/string.view/string.view.iterators/begin.pass.cpp79
-rw-r--r--test/std/experimental/string.view/string.view.iterators/end.pass.cpp88
-rw-r--r--test/std/experimental/string.view/string.view.iterators/rbegin.pass.cpp61
-rw-r--r--test/std/experimental/string.view/string.view.iterators/rend.pass.cpp69
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp67
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp78
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp78
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp76
-rw-r--r--test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp214
-rw-r--r--test/std/experimental/string.view/string.view.ops/basic_string.pass.cpp65
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp127
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp453
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp403
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp1356
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp5849
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp122
-rw-r--r--test/std/experimental/string.view/string.view.ops/copy.pass.cpp101
-rw-r--r--test/std/experimental/string.view/string.view.ops/substr.pass.cpp119
-rw-r--r--test/std/experimental/string.view/string.view.ops/to_string.pass.cpp76
-rw-r--r--test/std/experimental/string.view/string.view.synop/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/string.view/string.view.template/nothing_to_do.pass.cpp12
-rw-r--r--test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp68
-rw-r--r--test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp68
-rw-r--r--test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp41
-rw-r--r--test/std/experimental/utilities/meta/meta.type.synop/meta.rel.pass.cpp62
-rw-r--r--test/std/experimental/utilities/meta/meta.type.synop/meta.unary.cat.pass.cpp178
-rw-r--r--test/std/experimental/utilities/meta/meta.type.synop/meta.unary.comp.pass.cpp99
-rw-r--r--test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp492
-rw-r--r--test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.query.pass.cpp62
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp22
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_equal_v.pass.cpp47
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_equal_v.pass.cpp61
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_v.pass.cpp57
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_equal_v.pass.cpp57
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_v.pass.cpp57
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/ratio_not_equal_v.pass.cpp47
-rw-r--r--test/std/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp21
-rw-r--r--test/std/experimental/utilities/syserror/header.system_error.synop/is_error_code_enum_v.pass.cpp37
-rw-r--r--test/std/experimental/utilities/syserror/header.system_error.synop/is_error_condition_enum.pass.cpp38
-rw-r--r--test/std/experimental/utilities/time/header.chrono.synop/includes.pass.cpp19
-rw-r--r--test/std/experimental/utilities/time/header.chrono.synop/treat_as_floating_point_v.pass.cpp49
-rw-r--r--test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp20
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp187
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp118
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp427
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/large_arity.pass.cpp146
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp53
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp70
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp431
-rw-r--r--test/std/experimental/utilities/tuple/tuple_size_v.fail.cpp25
-rw-r--r--test/std/experimental/utilities/tuple/tuple_size_v.pass.cpp45
-rw-r--r--test/std/experimental/utilities/tuple/tuple_size_v_3.fail.cpp25
-rw-r--r--test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp56
-rw-r--r--test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp20
-rw-r--r--test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp8
-rw-r--r--test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp49
-rw-r--r--test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp52
-rw-r--r--test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp53
-rw-r--r--test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp48
-rw-r--r--test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp69
-rw-r--r--test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp62
l---------test/std/input.output/filesystems/Inputs/static_test_env/bad_symlink (renamed from test/std/experimental/filesystem/Inputs/static_test_env/bad_symlink)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/afile3 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/afile3)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/dir3/file5 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/dir3/file5)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/file4 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/file4)0
l---------test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/symlink_to_dir3 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/symlink_to_dir3)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/dir1/file1 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/file1)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/dir1/file2 (renamed from test/std/experimental/filesystem/Inputs/static_test_env/dir1/file2)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/empty_file (renamed from test/std/experimental/filesystem/Inputs/static_test_env/empty_file)0
-rw-r--r--test/std/input.output/filesystems/Inputs/static_test_env/non_empty_file (renamed from test/std/experimental/filesystem/Inputs/static_test_env/non_empty_file)0
l---------test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_dir (renamed from test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_dir)0
l---------test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_empty_file (renamed from test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_empty_file)0
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp74
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp82
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default.pass.cpp31
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default_const.pass.cpp32
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp72
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp78
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp182
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp132
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp341
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp169
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/comparisons.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp242
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp258
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp242
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp215
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/path.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/path.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp58
-rw-r--r--test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp)36
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp)10
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/increment.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp (renamed from test/std/experimental/filesystem/class.directory_iterator/types.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.file_status/file_status.cons.pass.cpp (renamed from test/std/experimental/filesystem/class.file_status/file_status.cons.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.file_status/file_status.mods.pass.cpp (renamed from test/std/experimental/filesystem/class.file_status/file_status.mods.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.file_status/file_status.obs.pass.cpp (renamed from test/std/experimental/filesystem/class.file_status/file_status.obs.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp (renamed from test/std/experimental/filesystem/class.filesystem_error/filesystem_error.members.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.itr/iterator.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.itr/iterator.pass.cpp)9
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp)77
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.assign/braced_init.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.assign/copy.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.assign/move.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp)22
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.construct/copy.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.construct/default.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.construct/default.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.construct/move.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp)29
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp)113
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp142
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp89
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.generic.obs/named_overloads.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/clear.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/make_preferred.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/make_preferred.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp)51
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_extension.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_extension.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_filename.pass.cpp)20
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.modifiers/swap.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.modifiers/swap.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.native.obs/named_overloads.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.native.obs/string_alloc.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp)2
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/append_op.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/append_op.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp)0
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp)0
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/path.factory.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp)37
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/path.io.unicode_bug.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/path.io.unicode_bug.pass.cpp)4
-rw-r--r--test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp (renamed from test/std/experimental/filesystem/class.path/path.nonmember/swap.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.path/synop.pass.cpp (renamed from test/std/experimental/filesystem/class.path/synop.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp)10
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp)40
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp (renamed from test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp (renamed from test/std/experimental/filesystem/fs.enum/check_bitmask_types.hpp)0
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp (renamed from test/std/experimental/filesystem/fs.enum/enum.copy_options.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp (renamed from test/std/experimental/filesystem/fs.enum/enum.directory_options.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp (renamed from test/std/experimental/filesystem/fs.enum/enum.file_type.pass.cpp)5
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp38
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp48
-rw-r--r--test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp (renamed from test/std/experimental/filesystem/fs.enum/enum.perms.pass.cpp)10
-rw-r--r--test/std/input.output/filesystems/fs.error.report/tested_elsewhere.pass.cpp (renamed from test/std/experimental/filesystem/fs.error.report/tested_elsewhere.pass.cpp)0
-rw-r--r--test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp (renamed from test/std/experimental/filesystem/fs.filesystem.synopsis/file_time_type.pass.cpp)31
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp58
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.canonical/canonical.pass.cpp)52
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp189
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp99
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp)41
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp)11
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp)46
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.current_path/current_path.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.file_size/file_size.pass.cpp)32
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_other/is_other.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp594
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp)90
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp133
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp78
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp)23
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp)23
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp)7
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.status/status.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.status_known/status_known.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.status_known/status_known.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp (renamed from test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp)6
-rw-r--r--test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp76
-rw-r--r--test/std/input.output/filesystems/fs.req.macros/feature_macro.pass.cpp29
-rw-r--r--test/std/input.output/filesystems/fs.req.namespace/namespace.fail.cpp29
-rw-r--r--test/std/input.output/filesystems/fs.req.namespace/namespace.pass.cpp (renamed from test/std/experimental/utilities/tuple/tuple_size_v_2.fail.cpp)21
-rw-r--r--test/std/input.output/filesystems/lit.local.cfg (renamed from test/std/experimental/filesystem/lit.local.cfg)0
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp62
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp62
-rw-r--r--test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp4
-rw-r--r--test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp4
-rw-r--r--test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp13
-rw-r--r--test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp13
-rw-r--r--test/std/iterators/iterator.container/data.pass.cpp10
-rw-r--r--test/std/iterators/iterator.container/empty.pass.cpp10
-rw-r--r--test/std/iterators/iterator.container/size.pass.cpp12
-rw-r--r--test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp6
-rw-r--r--test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp17
-rw-r--r--test/std/language.support/cmp/cmp.common/common_comparison_category.pass.cpp93
-rw-r--r--test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp164
-rw-r--r--test/std/language.support/cmp/cmp.strongeq/cmp.strongeq.pass.cpp96
-rw-r--r--test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp212
-rw-r--r--test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp70
-rw-r--r--test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp169
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp11
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp5
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp5
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp8
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp8
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp2
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp2
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp2
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp11
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp5
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp8
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp6
-rw-r--r--test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp12
-rw-r--r--test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp48
-rw-r--r--test/std/language.support/support.limits/version.pass.cpp (renamed from test/std/experimental/optional/optional.defs/tested_elsewhere.pass.cpp)5
-rw-r--r--test/std/language.support/support.types/byte.pass.cpp6
-rw-r--r--test/std/language.support/support.types/max_align_t.pass.cpp14
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp56
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp58
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp6
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp19
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_min_max.pass.cpp23
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp164
-rw-r--r--test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp11
-rw-r--r--test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp6
-rw-r--r--test/std/numerics/c.math/cmath.pass.cpp14
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp9
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp9
-rw-r--r--test/std/numerics/complex.number/complex.value.ops/polar.pass.cpp2
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp27
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp26
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp12
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp16
-rw-r--r--test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp21
-rw-r--r--test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp11
-rw-r--r--test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp17
-rw-r--r--test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp17
-rw-r--r--test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp33
-rw-r--r--test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp84
-rw-r--r--test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp66
-rw-r--r--test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp86
-rw-r--r--test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp83
-rw-r--r--test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp12
-rw-r--r--test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp14
-rw-r--r--test/std/numerics/rand/rand.device/eval.pass.cpp1
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp2
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp1
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp8
-rw-r--r--test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp37
-rw-r--r--test/std/re/re.regex/re.regex.construct/deduct.fail.cpp45
-rw-r--r--test/std/re/re.regex/re.regex.construct/deduct.pass.cpp137
-rw-r--r--test/std/strings/basic.string/char.bad.fail.cpp53
-rw-r--r--test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp51
-rw-r--r--test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp1
-rw-r--r--test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp56
-rw-r--r--test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp93
-rw-r--r--test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp3
-rw-r--r--test/std/strings/basic.string/string.cons/move_noexcept.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp41
-rw-r--r--test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp95
-rw-r--r--test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp47
-rw-r--r--test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp99
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp5
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp9
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp3
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp10
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp8
-rw-r--r--test/std/strings/string.view/char.bad.fail.cpp53
-rw-r--r--test/std/strings/string.view/string.view.access/data.pass.cpp4
-rw-r--r--test/std/strings/string.view/string.view.capacity/capacity.pass.cpp5
-rw-r--r--test/std/strings/string.view/string.view.cons/assign.pass.cpp6
-rw-r--r--test/std/strings/string.view/types.pass.cpp28
-rw-r--r--test/std/thread/futures/futures.async/async.fail.cpp6
-rw-r--r--test/std/utilities/any/any.class/any.assign/copy.pass.cpp6
-rw-r--r--test/std/utilities/function.objects/comparisons/constexpr_init.pass.cpp48
-rw-r--r--test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp12
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp129
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp125
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp143
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp134
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp129
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp124
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp137
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp131
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.default/default.pass.cpp96
-rw-r--r--test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp103
-rw-r--r--test/std/utilities/function.objects/func.search/nothing_to_do.pass.cpp (renamed from test/std/experimental/utilities/ratio/nothing_to_do.pass.cpp)0
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp8
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp46
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp46
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.ctor.pass.cpp50
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp102
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp4
-rw-r--r--test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp35
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp7
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp138
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp21
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp5
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/remove_cvref.pass.cpp2
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp24
-rw-r--r--test/std/utilities/meta/meta.type.synop/endian.pass.cpp48
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp106
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp2
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp12
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp2
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp46
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp54
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp (renamed from test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.pass.cpp)78
-rw-r--r--test/std/utilities/utility/exchange/exchange.pass.cpp30
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp22
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp2
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp16
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp4
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp2
-rw-r--r--test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp6
-rw-r--r--test/support/Counter.h4
-rw-r--r--test/support/MoveOnly.h3
-rw-r--r--test/support/count_new.hpp169
-rw-r--r--test/support/filesystem_include.hpp13
-rw-r--r--test/support/filesystem_test_helper.hpp149
-rw-r--r--test/support/format_string.hpp71
-rw-r--r--test/support/msvc_stdlib_force_include.hpp6
-rw-r--r--test/support/platform_support.h12
-rw-r--r--test/support/rapid-cxx-test.hpp23
-rw-r--r--test/support/test_allocator.h57
-rw-r--r--test/support/test_comparisons.h175
-rw-r--r--test/support/test_macros.h34
-rw-r--r--test/support/test_memory_resource.hpp2
-rw-r--r--test/support/verbose_assert.h222
-rw-r--r--utils/google-benchmark/AUTHORS17
-rw-r--r--utils/google-benchmark/CMakeLists.txt101
-rw-r--r--utils/google-benchmark/CONTRIBUTORS20
-rw-r--r--utils/google-benchmark/README.md381
-rw-r--r--utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake12
-rw-r--r--utils/google-benchmark/cmake/CXXFeatureCheck.cmake34
-rw-r--r--utils/google-benchmark/cmake/GetGitVersion.cmake3
-rw-r--r--utils/google-benchmark/cmake/HandleGTest.cmake113
-rw-r--r--utils/google-benchmark/cmake/benchmark.pc.in11
-rw-r--r--utils/google-benchmark/cmake/llvm-toolchain.cmake8
-rw-r--r--utils/google-benchmark/cmake/split_list.cmake3
-rw-r--r--utils/google-benchmark/docs/AssemblyTests.md147
-rw-r--r--utils/google-benchmark/docs/tools.md243
-rw-r--r--utils/google-benchmark/include/benchmark/benchmark.h1452
-rw-r--r--utils/google-benchmark/include/benchmark/benchmark_api.h915
-rw-r--r--utils/google-benchmark/include/benchmark/macros.h66
-rw-r--r--utils/google-benchmark/include/benchmark/reporter.h230
-rw-r--r--utils/google-benchmark/mingw.py320
-rw-r--r--utils/google-benchmark/releasing.md16
-rw-r--r--utils/google-benchmark/src/CMakeLists.txt79
-rw-r--r--utils/google-benchmark/src/benchmark.cc264
-rw-r--r--utils/google-benchmark/src/benchmark_api_internal.h12
-rw-r--r--utils/google-benchmark/src/benchmark_main.cc17
-rw-r--r--utils/google-benchmark/src/benchmark_register.cc113
-rw-r--r--utils/google-benchmark/src/benchmark_register.h33
-rw-r--r--utils/google-benchmark/src/check.h11
-rw-r--r--utils/google-benchmark/src/colorprint.cc4
-rw-r--r--utils/google-benchmark/src/commandlineflags.cc8
-rw-r--r--utils/google-benchmark/src/complexity.cc131
-rw-r--r--utils/google-benchmark/src/complexity.h10
-rw-r--r--utils/google-benchmark/src/console_reporter.cc55
-rw-r--r--utils/google-benchmark/src/counter.cc29
-rw-r--r--utils/google-benchmark/src/counter.h10
-rw-r--r--utils/google-benchmark/src/csv_reporter.cc29
-rw-r--r--utils/google-benchmark/src/cycleclock.h9
-rw-r--r--utils/google-benchmark/src/internal_macros.h79
-rw-r--r--utils/google-benchmark/src/json_reporter.cc83
-rw-r--r--utils/google-benchmark/src/log.h7
-rw-r--r--utils/google-benchmark/src/re.h44
-rw-r--r--utils/google-benchmark/src/reporter.cc37
-rw-r--r--utils/google-benchmark/src/stat.h306
-rw-r--r--utils/google-benchmark/src/statistics.cc177
-rw-r--r--utils/google-benchmark/src/statistics.h37
-rw-r--r--utils/google-benchmark/src/string_util.cc107
-rw-r--r--utils/google-benchmark/src/string_util.h30
-rw-r--r--utils/google-benchmark/src/sysinfo.cc724
-rw-r--r--utils/google-benchmark/src/sysinfo.h10
-rw-r--r--utils/google-benchmark/src/thread_manager.h66
-rw-r--r--utils/google-benchmark/src/thread_timer.h69
-rw-r--r--utils/google-benchmark/src/timers.cc15
-rw-r--r--utils/google-benchmark/test/CMakeLists.txt104
-rw-r--r--utils/google-benchmark/test/basic_test.cc57
-rw-r--r--utils/google-benchmark/test/benchmark_gtest.cc33
-rw-r--r--utils/google-benchmark/test/benchmark_test.cc82
-rw-r--r--utils/google-benchmark/test/clobber_memory_assembly_test.cc64
-rw-r--r--utils/google-benchmark/test/complexity_test.cc27
-rw-r--r--utils/google-benchmark/test/cxx03_test.cc17
-rw-r--r--utils/google-benchmark/test/diagnostics_test.cc20
-rw-r--r--utils/google-benchmark/test/donotoptimize_assembly_test.cc163
-rw-r--r--utils/google-benchmark/test/donotoptimize_test.cc27
-rw-r--r--utils/google-benchmark/test/filter_test.cc10
-rw-r--r--utils/google-benchmark/test/fixture_test.cc6
-rw-r--r--utils/google-benchmark/test/link_main_test.cc8
-rw-r--r--utils/google-benchmark/test/map_test.cc21
-rw-r--r--utils/google-benchmark/test/multiple_ranges_test.cc41
-rw-r--r--utils/google-benchmark/test/options_test.cc18
-rw-r--r--utils/google-benchmark/test/output_test.h135
-rw-r--r--utils/google-benchmark/test/output_test_helper.cc201
-rw-r--r--utils/google-benchmark/test/register_benchmark_test.cc58
-rw-r--r--utils/google-benchmark/test/reporter_output_test.cc191
-rw-r--r--utils/google-benchmark/test/skip_with_error_test.cc45
-rw-r--r--utils/google-benchmark/test/state_assembly_test.cc68
-rw-r--r--utils/google-benchmark/test/statistics_gtest.cc28
-rw-r--r--utils/google-benchmark/test/string_util_gtest.cc146
-rw-r--r--utils/google-benchmark/test/templated_fixture_test.cc28
-rw-r--r--utils/google-benchmark/test/user_counters_tabular_test.cc252
-rw-r--r--utils/google-benchmark/test/user_counters_test.cc380
-rwxr-xr-xutils/google-benchmark/tools/compare.py373
-rw-r--r--utils/google-benchmark/tools/compare_bench.py11
-rw-r--r--utils/google-benchmark/tools/gbench/Inputs/test1_run1.json44
-rw-r--r--utils/google-benchmark/tools/gbench/Inputs/test1_run2.json48
-rw-r--r--utils/google-benchmark/tools/gbench/Inputs/test2_run.json81
-rw-r--r--utils/google-benchmark/tools/gbench/Inputs/test3_run0.json39
-rw-r--r--utils/google-benchmark/tools/gbench/Inputs/test3_run1.json39
-rw-r--r--utils/google-benchmark/tools/gbench/report.py256
-rwxr-xr-xutils/google-benchmark/tools/strip_asm.py151
-rw-r--r--utils/libcxx/test/config.py30
-rw-r--r--utils/libcxx/test/format.py13
-rw-r--r--utils/libcxx/test/target_info.py4
-rw-r--r--www/TS_deprecation.html138
-rw-r--r--www/cxx1z_status.html39
-rw-r--r--www/cxx2a_status.html114
-rw-r--r--www/index.html15
-rw-r--r--www/upcoming_meeting.html109
1043 files changed, 54279 insertions, 42621 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 29eef8f35dbc..39ff0a29dcdf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,10 @@ endif()
if(POLICY CMP0022)
cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang
endif()
+if(POLICY CMP0068)
+ cmake_policy(SET CMP0068 NEW)
+ set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
+endif()
# Add path for custom modules
set(CMAKE_MODULE_PATH
@@ -23,7 +27,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
project(libcxx CXX C)
set(PACKAGE_NAME libcxx)
- set(PACKAGE_VERSION 6.0.0svn)
+ set(PACKAGE_VERSION 7.0.0svn)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org")
@@ -68,7 +72,7 @@ set(ENABLE_FILESYSTEM_DEFAULT ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY})
if (WIN32)
set(ENABLE_FILESYSTEM_DEFAULT OFF)
endif()
-option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of libc++experimental.a"
+option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of libc++fs.a"
${ENABLE_FILESYSTEM_DEFAULT})
option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
@@ -93,11 +97,26 @@ set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
"Define suffix of library directory name (32/64)")
option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON)
option(LIBCXX_INSTALL_LIBRARY "Install the libc++ library." ON)
+cmake_dependent_option(LIBCXX_INSTALL_STATIC_LIBRARY
+ "Install the static libc++ library." ON
+ "LIBCXX_ENABLE_STATIC;LIBCXX_INSTALL_LIBRARY" OFF)
+cmake_dependent_option(LIBCXX_INSTALL_SHARED_LIBRARY
+ "Install the shared libc++ library." ON
+ "LIBCXX_ENABLE_SHARED;LIBCXX_INSTALL_LIBRARY" OFF)
option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON)
cmake_dependent_option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY
"Install libc++experimental.a" ON
"LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY;LIBCXX_INSTALL_LIBRARY" OFF)
-set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.")
+cmake_dependent_option(LIBCXX_INSTALL_FILESYSTEM_LIBRARY
+ "Install libc++fs.a" ON
+ "LIBCXX_ENABLE_FILESYSTEM;LIBCXX_INSTALL_LIBRARY" OFF)
+
+if (FUCHSIA)
+ set(DEFAULT_ABI_VERSION 2)
+else()
+ set(DEFAULT_ABI_VERSION 1)
+endif()
+set(LIBCXX_ABI_VERSION ${DEFAULT_ABI_VERSION} CACHE STRING "ABI version of libc++.")
option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
option(LIBCXX_ABI_FORCE_ITANIUM "Ignore auto-detection and force use of the Itanium ABI.")
option(LIBCXX_ABI_FORCE_MICROSOFT "Ignore auto-detection and force use of the Microsoft ABI.")
@@ -123,6 +142,7 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
${LLVM_MAIN_SRC_DIR}/../libcxxabi/include
NO_DEFAULT_PATH
+ NO_CMAKE_FIND_ROOT_PATH
)
if (LIBCXX_TARGETING_MSVC)
# FIXME: Figure out how to configure the ABI library on Windows.
@@ -135,6 +155,9 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
elseif (APPLE)
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_SYSTEM 1)
+ elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+ set(LIBCXX_CXX_ABI_LIBNAME "libcxxrt")
+ set(LIBCXX_CXX_ABI_INCLUDE_PATHS "/usr/include/c++/v1")
else()
set(LIBCXX_CXX_ABI_LIBNAME "default")
endif()
@@ -146,13 +169,21 @@ endif()
# cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT.
option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)
+cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY
+ "Statically link the ABI library to static library" ON
+ "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF)
+
+cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY
+ "Statically link the ABI library to shared library" ON
+ "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF)
+
# Generate and install a linker script inplace of libc++.so. The linker script
# will link libc++ to the correct ABI library. This option is on by default
# on UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY'
# is on. This option is also disabled when the ABI library is not specified
# or is specified to be "none".
set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
-if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY
+if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY
AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"
AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "default"
AND PYTHONINTERP_FOUND
@@ -202,6 +233,7 @@ option(LIBCXX_ENABLE_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)
+option(LIBCXX_HAS_WIN32_THREAD_API "Ignore auto-detection and force use of win32 thread API" OFF)
option(LIBCXX_HAS_EXTERNAL_THREAD_API
"Build libc++ with an externalized threading API.
This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON." OFF)
@@ -273,6 +305,10 @@ if(NOT LIBCXX_ENABLE_THREADS)
message(FATAL_ERROR "LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY can only be set "
"to ON when LIBCXX_ENABLE_THREADS is also set to ON.")
endif()
+ if (LIBCXX_HAS_WIN32_THREAD_API)
+ message(FATAL_ERROR "LIBCXX_HAS_WIN32_THREAD_API can only be set to ON"
+ " when LIBCXX_ENABLE_THREADS is also set to ON.")
+ endif()
endif()
@@ -287,6 +323,19 @@ if (LIBCXX_HAS_EXTERNAL_THREAD_API)
"and LIBCXX_HAS_PTHREAD_API cannot be both"
"set to ON at the same time.")
endif()
+ if (LIBCXX_HAS_WIN32_THREAD_API)
+ message(FATAL_ERROR "The options LIBCXX_HAS_EXTERNAL_THREAD_API"
+ "and LIBCXX_HAS_WIN32_THREAD_API cannot be both"
+ "set to ON at the same time.")
+ endif()
+endif()
+
+if (LIBCXX_HAS_PTHREAD_API)
+ if (LIBCXX_HAS_WIN32_THREAD_API)
+ message(FATAL_ERROR "The options LIBCXX_HAS_PTHREAD_API"
+ "and LIBCXX_HAS_WIN32_THREAD_API cannot be both"
+ "set to ON at the same time.")
+ endif()
endif()
# Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE
@@ -329,7 +378,7 @@ if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
endif()
endif()
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
message(FATAL_ERROR "Conflicting options given.
LIBCXX_ENABLE_STATIC_ABI_LIBRARY cannot be specified with
LIBCXX_ENABLE_ABI_LINKER_SCRIPT")
@@ -352,19 +401,29 @@ set(LIBCXX_COMPILER ${CMAKE_CXX_COMPILER})
set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LIBCXX_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
-if (LLVM_LIBRARY_OUTPUT_INTDIR)
+
+string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
+ ${PACKAGE_VERSION})
+
+if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
+ set(DEFAULT_INSTALL_PREFIX lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/${LLVM_DEFAULT_TARGET_TRIPLE}/)
+ set(DEFAULT_INSTALL_HEADER_PREFIX lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/)
+ set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/${LLVM_DEFAULT_TARGET_TRIPLE}/lib${LIBCXX_LIBDIR_SUFFIX})
+ set(LIBCXX_HEADER_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION})
+elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+ set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR})
else()
set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
endif()
+
file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")
-set(LIBCXX_INSTALL_PREFIX "" CACHE STRING
+set(LIBCXX_INSTALL_PREFIX ${DEFAULT_INSTALL_PREFIX} CACHE STRING
"Define libc++ destination prefix.")
-if (NOT LIBCXX_INSTALL_PREFIX MATCHES "^$|.*/")
- message(FATAL_ERROR "LIBCXX_INSTALL_PREFIX has to end with \"/\".")
-endif()
+set(LIBCXX_INSTALL_HEADER_PREFIX ${DEFAULT_INSTALL_HEADER_PREFIX} CACHE STRING
+ "Define libc++ header destination prefix.")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
@@ -597,7 +656,7 @@ if (LIBCXX_STANDALONE_BUILD)
endif()
# Configuration file flags =====================================================
-if (NOT LIBCXX_ABI_VERSION EQUAL "1")
+if (NOT LIBCXX_ABI_VERSION EQUAL DEFAULT_ABI_VERSION)
config_define(${LIBCXX_ABI_VERSION} _LIBCPP_ABI_VERSION)
endif()
config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE)
@@ -613,6 +672,7 @@ config_define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS _LIBCPP_HAS_NO_THRE
config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCPP_HAS_THREAD_API_PTHREAD)
config_define_if(LIBCXX_HAS_EXTERNAL_THREAD_API _LIBCPP_HAS_THREAD_API_EXTERNAL)
+config_define_if(LIBCXX_HAS_WIN32_THREAD_API _LIBCPP_HAS_THREAD_API_WIN32)
config_define_if(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL)
config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC)
config_define_if(LIBCXX_NO_VCRUNTIME _LIBCPP_NO_VCRUNTIME)
diff --git a/CREDITS.TXT b/CREDITS.TXT
index 88d923a48e91..46a06c6eab08 100644
--- a/CREDITS.TXT
+++ b/CREDITS.TXT
@@ -101,7 +101,7 @@ E: nico.rieck@gmail.com
D: Windows fixes
N: Jon Roelofs
-E: jonathan@codesourcery.com
+E: jroelofS@jroelofs.com
D: Remote testing, Newlib port, baremetal/single-threaded support.
N: Jonathan Sauer
diff --git a/NOTES.TXT b/NOTES.TXT
index f0597de64ae8..24d245d437cc 100644
--- a/NOTES.TXT
+++ b/NOTES.TXT
@@ -26,3 +26,4 @@ to libc++.
1. Add a test under `test/libcxx` that the header defines `_LIBCPP_VERSION`.
2. Update `test/libcxx/double_include.sh.cpp` to include the new header.
3. Create a submodule in `include/module.modulemap` for the new header.
+4. Update the include/CMakeLists.txt file to include the new header.
diff --git a/appveyor-reqs-install.cmd b/appveyor-reqs-install.cmd
index 43655d5612a8..a4160110aa5f 100644
--- a/appveyor-reqs-install.cmd
+++ b/appveyor-reqs-install.cmd
@@ -9,7 +9,7 @@ cd C:\projects\deps
:: Setup Compiler
::###########################################################################
if NOT EXIST llvm-installer.exe (
- appveyor DownloadFile http://prereleases.llvm.org/win-snapshots/LLVM-6.0.0-r316086-win32.exe -FileName llvm-installer.exe
+ appveyor DownloadFile http://prereleases.llvm.org/win-snapshots/LLVM-7.0.0-r325576-win32.exe -FileName llvm-installer.exe
)
if "%CLANG_VERSION%"=="ToT" (
START /WAIT llvm-installer.exe /S /D=C:\"Program Files\LLVM"
diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt
index 8211ebd009a7..f557d4aea39a 100644
--- a/benchmarks/CMakeLists.txt
+++ b/benchmarks/CMakeLists.txt
@@ -59,6 +59,7 @@ if (LIBCXX_BENCHMARK_NATIVE_STDLIB)
-DBENCHMARK_ENABLE_TESTING:BOOL=OFF)
endif()
+
#==============================================================================
# Benchmark tests configuration
#==============================================================================
@@ -67,7 +68,7 @@ set(BENCHMARK_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(BENCHMARK_LIBCXX_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx)
set(BENCHMARK_NATIVE_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native)
set(BENCHMARK_TEST_COMPILE_FLAGS
- -std=c++14 -O2
+ -std=c++17 -O2
-I${BENCHMARK_LIBCXX_INSTALL}/include
-I${LIBCXX_SOURCE_DIR}/test/support
)
diff --git a/benchmarks/ContainerBenchmarks.hpp b/benchmarks/ContainerBenchmarks.hpp
index dc268e7ebca3..509e3d23ed9a 100644
--- a/benchmarks/ContainerBenchmarks.hpp
+++ b/benchmarks/ContainerBenchmarks.hpp
@@ -3,7 +3,7 @@
#include <cassert>
-#include "benchmark/benchmark_api.h"
+#include "benchmark/benchmark.h"
namespace ContainerBenchmarks {
diff --git a/benchmarks/GenerateInput.hpp b/benchmarks/GenerateInput.hpp
index 9d5adac4af4f..8c97f5881f1e 100644
--- a/benchmarks/GenerateInput.hpp
+++ b/benchmarks/GenerateInput.hpp
@@ -29,14 +29,16 @@ inline std::default_random_engine& getRandomEngine() {
return RandEngine;
}
+
inline char getRandomChar() {
std::uniform_int_distribution<> LettersDist(0, LettersSize-1);
return Letters[LettersDist(getRandomEngine())];
}
template <class IntT>
-inline IntT getRandomInteger() {
- std::uniform_int_distribution<IntT> dist;
+inline IntT getRandomInteger(IntT Min = 0,
+ IntT Max = std::numeric_limits<IntT>::max()) {
+ std::uniform_int_distribution<IntT> dist(Min, Max);
return dist(getRandomEngine());
}
diff --git a/benchmarks/algorithms.bench.cpp b/benchmarks/algorithms.bench.cpp
index 745cc1727184..86315390e0d2 100644
--- a/benchmarks/algorithms.bench.cpp
+++ b/benchmarks/algorithms.bench.cpp
@@ -2,7 +2,7 @@
#include <vector>
#include <cstdint>
-#include "benchmark/benchmark_api.h"
+#include "benchmark/benchmark.h"
#include "GenerateInput.hpp"
constexpr std::size_t TestNumInputs = 1024;
@@ -59,4 +59,4 @@ BENCHMARK_CAPTURE(BM_Sort, single_element_strings,
getDuplicateStringInputs)->Arg(TestNumInputs);
-BENCHMARK_MAIN()
+BENCHMARK_MAIN();
diff --git a/benchmarks/filesystem.bench.cpp b/benchmarks/filesystem.bench.cpp
index f7949a163a7f..3e4956059151 100644
--- a/benchmarks/filesystem.bench.cpp
+++ b/benchmarks/filesystem.bench.cpp
@@ -1,17 +1,14 @@
-#include <experimental/filesystem>
-
-#include "benchmark/benchmark_api.h"
+#include "benchmark/benchmark.h"
#include "GenerateInput.hpp"
#include "test_iterators.h"
-
-namespace fs = std::experimental::filesystem;
+#include "filesystem_include.hpp"
static const size_t TestNumInputs = 1024;
template <class GenInputs>
void BM_PathConstructString(benchmark::State &st, GenInputs gen) {
- using namespace fs;
+ using fs::path;
const auto in = gen(st.range(0));
path PP;
for (auto& Part : in)
@@ -21,14 +18,15 @@ void BM_PathConstructString(benchmark::State &st, GenInputs gen) {
const path P(PP.native());
benchmark::DoNotOptimize(P.native().data());
}
+ st.SetComplexityN(st.range(0));
}
BENCHMARK_CAPTURE(BM_PathConstructString, large_string,
- getRandomStringInputs)->Arg(TestNumInputs);
+ getRandomStringInputs)->Range(8, TestNumInputs)->Complexity();
template <class GenInputs>
void BM_PathConstructCStr(benchmark::State &st, GenInputs gen) {
- using namespace fs;
+ using fs::path;
const auto in = gen(st.range(0));
path PP;
for (auto& Part : in)
@@ -45,7 +43,7 @@ BENCHMARK_CAPTURE(BM_PathConstructCStr, large_string,
template <template <class...> class ItType, class GenInputs>
void BM_PathConstructIter(benchmark::State &st, GenInputs gen) {
- using namespace fs;
+ using fs::path;
using Iter = ItType<std::string::const_iterator>;
const auto in = gen(st.range(0));
path PP;
@@ -60,6 +58,7 @@ void BM_PathConstructIter(benchmark::State &st, GenInputs gen) {
const path P(Start, End);
benchmark::DoNotOptimize(P.native().data());
}
+ st.SetComplexityN(st.range(0));
}
template <class GenInputs>
void BM_PathConstructInputIter(benchmark::State &st, GenInputs gen) {
@@ -70,14 +69,14 @@ void BM_PathConstructForwardIter(benchmark::State &st, GenInputs gen) {
BM_PathConstructIter<forward_iterator>(st, gen);
}
BENCHMARK_CAPTURE(BM_PathConstructInputIter, large_string,
- getRandomStringInputs)->Arg(TestNumInputs);
+ getRandomStringInputs)->Range(8, TestNumInputs)->Complexity();
BENCHMARK_CAPTURE(BM_PathConstructForwardIter, large_string,
- getRandomStringInputs)->Arg(TestNumInputs);
+ getRandomStringInputs)->Range(8, TestNumInputs)->Complexity();
template <class GenInputs>
void BM_PathIterateMultipleTimes(benchmark::State &st, GenInputs gen) {
- using namespace fs;
+ using fs::path;
const auto in = gen(st.range(0));
path PP;
for (auto& Part : in)
@@ -89,14 +88,15 @@ void BM_PathIterateMultipleTimes(benchmark::State &st, GenInputs gen) {
}
benchmark::ClobberMemory();
}
+ st.SetComplexityN(st.range(0));
}
BENCHMARK_CAPTURE(BM_PathIterateMultipleTimes, iterate_elements,
- getRandomStringInputs)->Arg(TestNumInputs);
+ getRandomStringInputs)->Range(8, TestNumInputs)->Complexity();
template <class GenInputs>
void BM_PathIterateOnce(benchmark::State &st, GenInputs gen) {
- using namespace fs;
+ using fs::path;
const auto in = gen(st.range(0));
path PP;
for (auto& Part : in)
@@ -109,13 +109,14 @@ void BM_PathIterateOnce(benchmark::State &st, GenInputs gen) {
}
benchmark::ClobberMemory();
}
+ st.SetComplexityN(st.range(0));
}
BENCHMARK_CAPTURE(BM_PathIterateOnce, iterate_elements,
- getRandomStringInputs)->Arg(TestNumInputs);
+ getRandomStringInputs)->Range(8, TestNumInputs)->Complexity();
template <class GenInputs>
void BM_PathIterateOnceBackwards(benchmark::State &st, GenInputs gen) {
- using namespace fs;
+ using fs::path;
const auto in = gen(st.range(0));
path PP;
for (auto& Part : in)
@@ -135,4 +136,28 @@ void BM_PathIterateOnceBackwards(benchmark::State &st, GenInputs gen) {
BENCHMARK_CAPTURE(BM_PathIterateOnceBackwards, iterate_elements,
getRandomStringInputs)->Arg(TestNumInputs);
-BENCHMARK_MAIN()
+static fs::path getRandomPaths(int NumParts, int PathLen) {
+ fs::path Result;
+ while (NumParts--) {
+ std::string Part = getRandomString(PathLen);
+ Result /= Part;
+ }
+ return Result;
+}
+
+template <class GenInput>
+void BM_LexicallyNormal(benchmark::State &st, GenInput gen, size_t PathLen) {
+ using fs::path;
+ auto In = gen(st.range(0), PathLen);
+ benchmark::DoNotOptimize(&In);
+ while (st.KeepRunning()) {
+ benchmark::DoNotOptimize(In.lexically_normal());
+ }
+ st.SetComplexityN(st.range(0));
+}
+BENCHMARK_CAPTURE(BM_LexicallyNormal, small_path,
+ getRandomPaths, /*PathLen*/5)->RangeMultiplier(2)->Range(2, 256)->Complexity();
+BENCHMARK_CAPTURE(BM_LexicallyNormal, large_path,
+ getRandomPaths, /*PathLen*/32)->RangeMultiplier(2)->Range(2, 256)->Complexity();
+
+BENCHMARK_MAIN();
diff --git a/benchmarks/string.bench.cpp b/benchmarks/string.bench.cpp
index ef8923916883..8a09e738d9b6 100644
--- a/benchmarks/string.bench.cpp
+++ b/benchmarks/string.bench.cpp
@@ -2,7 +2,7 @@
#include <vector>
#include <cstdint>
-#include "benchmark/benchmark_api.h"
+#include "benchmark/benchmark.h"
#include "GenerateInput.hpp"
constexpr std::size_t MAX_STRING_LEN = 8 << 14;
@@ -46,4 +46,25 @@ static void BM_StringFindMatch2(benchmark::State &state) {
}
BENCHMARK(BM_StringFindMatch2)->Range(1, MAX_STRING_LEN / 4);
-BENCHMARK_MAIN()
+static void BM_StringCtorDefault(benchmark::State &state) {
+ while (state.KeepRunning()) {
+ for (unsigned I=0; I < 1000; ++I) {
+ std::string Default;
+ benchmark::DoNotOptimize(Default.c_str());
+ }
+ }
+}
+BENCHMARK(BM_StringCtorDefault);
+
+static void BM_StringCtorCStr(benchmark::State &state) {
+ std::string Input = getRandomString(state.range(0));
+ const char *Str = Input.c_str();
+ benchmark::DoNotOptimize(Str);
+ while (state.KeepRunning()) {
+ std::string Tmp(Str);
+ benchmark::DoNotOptimize(Tmp.c_str());
+ }
+}
+BENCHMARK(BM_StringCtorCStr)->Arg(1)->Arg(8)->Range(16, MAX_STRING_LEN / 4);
+
+BENCHMARK_MAIN();
diff --git a/benchmarks/stringstream.bench.cpp b/benchmarks/stringstream.bench.cpp
index 6023cf775bc8..75a7a284e072 100644
--- a/benchmarks/stringstream.bench.cpp
+++ b/benchmarks/stringstream.bench.cpp
@@ -1,4 +1,4 @@
-#include "benchmark/benchmark_api.h"
+#include "benchmark/benchmark.h"
#include <sstream>
double __attribute__((noinline)) istream_numbers();
@@ -35,4 +35,4 @@ static void BM_Istream_numbers(benchmark::State &state) {
}
BENCHMARK(BM_Istream_numbers)->RangeMultiplier(2)->Range(1024, 4096);
-BENCHMARK_MAIN()
+BENCHMARK_MAIN();
diff --git a/benchmarks/unordered_set_operations.bench.cpp b/benchmarks/unordered_set_operations.bench.cpp
index e2afdde56dc4..ee0ea29b8d21 100644
--- a/benchmarks/unordered_set_operations.bench.cpp
+++ b/benchmarks/unordered_set_operations.bench.cpp
@@ -5,7 +5,7 @@
#include <cstdlib>
#include <cstring>
-#include "benchmark/benchmark_api.h"
+#include "benchmark/benchmark.h"
#include "ContainerBenchmarks.hpp"
#include "GenerateInput.hpp"
@@ -303,4 +303,4 @@ BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
std::unordered_set<std::string>{},
getRandomCStringInputs)->Arg(TestNumInputs);
-BENCHMARK_MAIN()
+BENCHMARK_MAIN();
diff --git a/benchmarks/util_smartptr.bench.cpp b/benchmarks/util_smartptr.bench.cpp
index ad3f03a0448a..c984b2ca6665 100644
--- a/benchmarks/util_smartptr.bench.cpp
+++ b/benchmarks/util_smartptr.bench.cpp
@@ -9,7 +9,7 @@
#include <memory>
-#include "benchmark/benchmark_api.h"
+#include "benchmark/benchmark.h"
static void BM_SharedPtrCreateDestroy(benchmark::State& st) {
while (st.KeepRunning()) {
@@ -39,4 +39,4 @@ static void BM_WeakPtrIncDecRef(benchmark::State& st) {
}
BENCHMARK(BM_WeakPtrIncDecRef);
-BENCHMARK_MAIN()
+BENCHMARK_MAIN();
diff --git a/benchmarks/vector_operations.bench.cpp b/benchmarks/vector_operations.bench.cpp
index 004e801f0be5..a2c4e5dbbc03 100644
--- a/benchmarks/vector_operations.bench.cpp
+++ b/benchmarks/vector_operations.bench.cpp
@@ -4,7 +4,7 @@
#include <cstdlib>
#include <cstring>
-#include "benchmark/benchmark_api.h"
+#include "benchmark/benchmark.h"
#include "ContainerBenchmarks.hpp"
#include "GenerateInput.hpp"
@@ -29,4 +29,4 @@ BENCHMARK_CAPTURE(BM_ConstructIterIter,
getRandomStringInputs)->Arg(TestNumInputs);
-BENCHMARK_MAIN()
+BENCHMARK_MAIN();
diff --git a/cmake/Modules/CheckLibcxxAtomic.cmake b/cmake/Modules/CheckLibcxxAtomic.cmake
index a7ae667a1558..98862d42397b 100644
--- a/cmake/Modules/CheckLibcxxAtomic.cmake
+++ b/cmake/Modules/CheckLibcxxAtomic.cmake
@@ -9,7 +9,7 @@ INCLUDE(CheckCXXSourceCompiles)
function(check_cxx_atomics varname)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
- set(CMAKE_REQUIRED_FLAGS "-nodefaultlibs -std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include")
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs -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()
@@ -31,7 +31,14 @@ int main() {
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
endfunction(check_cxx_atomics)
+# Perform the check for 64bit atomics without libatomic. It may have been
+# added to the required libraries during in the configuration of LLVM, which
+# would cause the check for CXX atomics without libatomic to incorrectly pass.
+set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "atomic")
check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)
+set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
+
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)
diff --git a/cmake/Modules/HandleCompilerRT.cmake b/cmake/Modules/HandleCompilerRT.cmake
index e9da3c43a211..2e0e69e5e085 100644
--- a/cmake/Modules/HandleCompilerRT.cmake
+++ b/cmake/Modules/HandleCompilerRT.cmake
@@ -14,6 +14,7 @@ function(find_compiler_rt_library name dest)
OUTPUT_VARIABLE LIBRARY_FILE
)
string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE)
+ file(TO_CMAKE_PATH "${LIBRARY_FILE}" LIBRARY_FILE)
string(REPLACE "builtins" "${name}" LIBRARY_FILE "${LIBRARY_FILE}")
if (NOT HAD_ERROR AND EXISTS "${LIBRARY_FILE}")
message(STATUS "Found compiler-rt library: ${LIBRARY_FILE}")
@@ -37,6 +38,7 @@ function(find_compiler_rt_dir dest)
OUTPUT_VARIABLE LIBRARY_DIR
)
string(STRIP "${LIBRARY_DIR}" LIBRARY_DIR)
+ file(TO_CMAKE_PATH "${LIBRARY_DIR}" LIBRARY_DIR)
set(LIBRARY_DIR "${LIBRARY_DIR}/darwin")
else()
set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXX_COMPILE_FLAGS}
@@ -47,6 +49,7 @@ function(find_compiler_rt_dir dest)
OUTPUT_VARIABLE LIBRARY_FILE
)
string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE)
+ file(TO_CMAKE_PATH "${LIBRARY_FILE}" LIBRARY_FILE)
get_filename_component(LIBRARY_DIR "${LIBRARY_FILE}" DIRECTORY)
endif()
if (NOT HAD_ERROR AND EXISTS "${LIBRARY_DIR}")
diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake
index 558e11ba2cc1..ef3b4f5dde22 100644
--- a/cmake/Modules/HandleLibCXXABI.cmake
+++ b/cmake/Modules/HandleLibCXXABI.cmake
@@ -32,14 +32,6 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
set(LIBCXX_CXX_ABI_LIBRARY ${abilib})
set(LIBCXX_ABILIB_FILES ${abifiles})
- # The place in the build tree where we store out-of-source headers.
- file(MAKE_DIRECTORY "${LIBCXX_BUILD_HEADERS_ROOT}")
- file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1")
- foreach(_d ${abidirs})
- file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}/${_d}")
- file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1/${_d}")
- endforeach()
-
foreach(fpath ${LIBCXX_ABILIB_FILES})
set(found FALSE)
foreach(incpath ${LIBCXX_CXX_ABI_INCLUDE_PATHS})
@@ -47,20 +39,31 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
set(found TRUE)
get_filename_component(dstdir ${fpath} PATH)
get_filename_component(ifile ${fpath} NAME)
- file(COPY "${incpath}/${fpath}"
- DESTINATION "${LIBCXX_BINARY_INCLUDE_DIR}/${dstdir}"
- )
- file(COPY "${incpath}/${fpath}"
- DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1/${dstdir}"
- )
+ set(src ${incpath}/${fpath})
+
+ set(dst ${LIBCXX_BINARY_INCLUDE_DIR}/${dstdir}/${fpath})
+ add_custom_command(OUTPUT ${dst}
+ DEPENDS ${src}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+ COMMENT "Copying C++ ABI header ${fpath}...")
+ list(APPEND abilib_headers "${dst}")
+
+ if (NOT LIBCXX_USING_INSTALLED_LLVM AND LIBCXX_HEADER_DIR)
+ set(dst "${LIBCXX_HEADER_DIR}/include/c++/v1/${dstdir}/${fpath}")
+ add_custom_command(OUTPUT ${dst}
+ DEPENDS ${src}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+ COMMENT "Copying C++ ABI header ${fpath}...")
+ list(APPEND abilib_headers "${dst}")
+ endif()
+
if (LIBCXX_INSTALL_HEADERS)
install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1/${dstdir}
+ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir}
COMPONENT cxx-headers
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
endif()
- list(APPEND abilib_headers "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}")
endif()
endforeach()
if (NOT found)
@@ -69,6 +72,8 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
endforeach()
include_directories("${LIBCXX_BINARY_INCLUDE_DIR}")
+ add_custom_target(cxx_abi_headers ALL DEPENDS ${abilib_headers})
+ set(LIBCXX_CXX_ABI_HEADER_TARGET "cxx_abi_headers")
endmacro()
@@ -93,10 +98,10 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
if (LIBCXX_CXX_ABI_INTREE)
# Link against just-built "cxxabi" target.
- if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
- set(CXXABI_LIBNAME cxxabi_static)
+ if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
+ set(CXXABI_LIBNAME cxxabi_static)
else()
- set(CXXABI_LIBNAME cxxabi_shared)
+ set(CXXABI_LIBNAME cxxabi_shared)
endif()
set(LIBCXX_LIBCPPABI_VERSION "2" PARENT_SCOPE)
else()
diff --git a/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake
index 83948b14fd1f..70eed1d70ba1 100644
--- a/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -46,10 +46,11 @@ macro(find_llvm_parts)
OUTPUT_VARIABLE CONFIG_OUTPUT
ERROR_QUIET)
if(NOT HAD_ERROR)
- string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH)
+ string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH_FROM_LLVM_CONFIG)
+ file(TO_CMAKE_PATH "${LLVM_CMAKE_PATH_FROM_LLVM_CONFIG}" LLVM_CMAKE_PATH)
else()
- set(LLVM_CMAKE_PATH
- "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+ file(TO_CMAKE_PATH "${LLVM_BINARY_DIR}" LLVM_BINARY_DIR_CMAKE_STYLE)
+ set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
endif()
else()
set(LLVM_FOUND OFF)
diff --git a/docs/BuildingLibcxx.rst b/docs/BuildingLibcxx.rst
index 3dae2f41c274..d0b03c675c8b 100644
--- a/docs/BuildingLibcxx.rst
+++ b/docs/BuildingLibcxx.rst
@@ -242,11 +242,15 @@ libc++experimental Specific Options
.. option:: LIBCXX_ENABLE_FILESYSTEM:BOOL
- **Default**: ``LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY``
+ **Default**: ``ON``
+
+ Build filesystem as a standalone library libc++fs.a.
+
+.. option:: LIBCXX_INSTALL_FILESYSTEM_LIBRARY:BOOL
- Build filesystem as part of libc++experimental.a. This allows filesystem
- to be disabled without turning off the entire experimental library.
+ **Default**: ``LIBCXX_ENABLE_FILESYSTEM AND LIBCXX_INSTALL_LIBRARY``
+ Install libc++fs.a alongside libc++.
.. _ABI Library Specific Options:
diff --git a/docs/DesignDocs/AvailabilityMarkup.rst b/docs/DesignDocs/AvailabilityMarkup.rst
index 4a85c698f232..b8b44509790d 100644
--- a/docs/DesignDocs/AvailabilityMarkup.rst
+++ b/docs/DesignDocs/AvailabilityMarkup.rst
@@ -58,7 +58,7 @@ Testing
Some parameters can be passed to lit to run the test-suite and exercising the
availability.
-* The `platform` parameter controls the deployement target. For example lit can
+* The `platform` parameter controls the deployment target. For example lit can
be invoked with `--param=platform=macosx10.8`. Default is the current host.
* The `use_system_cxx_lib` parameter indicates to use another library than the
just built one. Invoking lit with `--param=use_system_cxx_lib=true` will run
diff --git a/docs/DesignDocs/CapturingConfigInfo.rst b/docs/DesignDocs/CapturingConfigInfo.rst
index 73378a21c0a9..88102251d932 100644
--- a/docs/DesignDocs/CapturingConfigInfo.rst
+++ b/docs/DesignDocs/CapturingConfigInfo.rst
@@ -46,7 +46,7 @@ we do NOTHING.
Otherwise we create a custom installation rule that modifies the installed __config
header. The rule first generates a dummy "__config_site" header containing the required
-#defines. The contents of the dummy header are then prependend to the installed
+#defines. The contents of the dummy header are then prepended to the installed
__config header. By manually prepending the files we avoid the cost of an
extra #include and we allow the __config header to be ignorant of the extra
configuration all together. An example "__config" header generated when
diff --git a/docs/DesignDocs/FileTimeType.rst b/docs/DesignDocs/FileTimeType.rst
new file mode 100644
index 000000000000..488ff174b341
--- /dev/null
+++ b/docs/DesignDocs/FileTimeType.rst
@@ -0,0 +1,494 @@
+==============
+File Time Type
+==============
+
+.. contents::
+ :local:
+
+.. _file-time-type-motivation:
+
+Motivation
+==========
+
+The filesystem library provides interfaces for getting and setting the last
+write time of a file or directory. The interfaces use the ``file_time_type``
+type, which is a specialization of ``chrono::time_point`` for the
+"filesystem clock". According to [fs.filesystem.syn]
+
+ trivial-clock is an implementation-defined type that satisfies the
+ Cpp17TrivialClock requirements ([time.clock.req]) and that is capable of
+ representing and measuring file time values. Implementations should ensure
+ that the resolution and range of file_­time_­type reflect the operating
+ system dependent resolution and range of file time values.
+
+
+On POSIX systems, file times are represented using the ``timespec`` struct,
+which is defined as follows:
+
+.. code-block:: cpp
+
+ struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+ };
+
+To represent the range and resolution of ``timespec``, we need to (A) have
+nanosecond resolution, and (B) use more than 64 bits (assuming a 64 bit ``time_t``).
+
+As the standard requires us to use the ``chrono`` interface, we have to define
+our own filesystem clock which specifies the period and representation of
+the time points and duration it provides. It will look like this:
+
+.. code-block:: cpp
+
+ struct _FilesystemClock {
+ using period = nano;
+ using rep = TBD; // What is this?
+
+ using duration = chrono::duration<rep, period>;
+ using time_point = chrono::time_point<_FilesystemClock>;
+
+ // ... //
+ };
+
+ using file_time_type = _FilesystemClock::time_point;
+
+
+To get nanosecond resolution, we simply define ``period`` to be ``std::nano``.
+But what type can we use as the arithmetic representation that is capable
+of representing the range of the ``timespec`` struct?
+
+Problems To Consider
+====================
+
+Before considering solutions, let's consider the problems they should solve,
+and how important solving those problems are:
+
+
+Having a Smaller Range than ``timespec``
+----------------------------------------
+
+One solution to the range problem is to simply reduce the resolution of
+``file_time_type`` to be less than that of nanoseconds. This is what libc++'s
+initial implementation of ``file_time_type`` did; it's also what
+``std::system_clock`` does. As a result, it can represent time points about
+292 thousand years on either side of the epoch, as opposed to only 292 years
+at nanosecond resolution.
+
+``timespec`` can represent time points +/- 292 billion years from the epoch
+(just in case you needed a time point 200 billion years before the big bang,
+and with nanosecond resolution).
+
+To get the same range, we would need to drop our resolution to that of seconds
+to come close to having the same range.
+
+This begs the question, is the range problem "really a problem"? Sane usages
+of file time stamps shouldn't exceed +/- 300 years, so should we care to support it?
+
+I believe the answer is yes. We're not designing the filesystem time API, we're
+providing glorified C++ wrappers for it. If the underlying API supports
+a value, then we should too. Our wrappers should not place artificial restrictions
+on users that are not present in the underlying filesystem.
+
+Having a smaller range that the underlying filesystem forces the
+implementation to report ``value_too_large`` errors when it encounters a time
+point that it can't represent. This can cause the call to ``last_write_time``
+to throw in cases where the user was confident the call should succeed. (See below)
+
+
+.. code-block:: cpp
+
+ #include <filesystem>
+ using namespace std::filesystem;
+
+ // Set the times using the system interface.
+ void set_file_times(const char* path, struct timespec ts) {
+ timespec both_times[2];
+ both_times[0] = ts;
+ both_times[1] = ts;
+ int result = ::utimensat(AT_FDCWD, path, both_times, 0);
+ assert(result != -1);
+ }
+
+ // Called elsewhere to set the file time to something insane, and way
+ // out of the 300 year range we might expect.
+ void some_bad_persons_code() {
+ struct timespec new_times;
+ new_times.tv_sec = numeric_limits<time_t>::max();
+ new_times.tv_nsec = 0;
+ set_file_times("/tmp/foo", new_times); // OK, supported by most FSes
+ }
+
+ int main() {
+ path p = "/tmp/foo";
+ file_status st = status(p);
+ if (!exists(st) || !is_regular_file(st))
+ return 1;
+ if ((st.permissions() & perms::others_read) == perms::none)
+ return 1;
+ // It seems reasonable to assume this call should succeed.
+ file_time_type tp = last_write_time(p); // BAD! Throws value_too_large.
+ }
+
+
+Having a Smaller Resolution than ``timespec``
+---------------------------------------------
+
+As mentioned in the previous section, one way to solve the range problem
+is by reducing the resolution. But matching the range of ``timespec`` using a
+64 bit representation requires limiting the resolution to seconds.
+
+So we might ask: Do users "need" nanosecond precision? Is seconds not good enough?
+I limit my consideration of the point to this: Why was it not good enough for
+the underlying system interfaces? If it wasn't good enough for them, then it
+isn't good enough for us. Our job is to match the filesystems range and
+representation, not design it.
+
+
+Having a Larger Range than ``timespec``
+----------------------------------------
+
+We should also consider the opposite problem of having a ``file_time_type``
+that is able to represent a larger range than ``timespec``. At least in
+this case ``last_write_time`` can be used to get and set all possible values
+supported by the underlying filesystem; meaning ``last_write_time(p)`` will
+never throw a overflow error when retrieving a value.
+
+However, this introduces a new problem, where users are allowed to attempt to
+create a time point beyond what the filesystem can represent. Two particular
+values which cause this are ``file_time_type::min()`` and
+``file_time_type::max()``. As a result, the following code would throw:
+
+.. code-block:: cpp
+
+ void test() {
+ last_write_time("/tmp/foo", file_time_type::max()); // Throws
+ last_write_time("/tmp/foo", file_time_type::min()); // Throws.
+ }
+
+Apart from cases explicitly using ``min`` and ``max``, I don't see users taking
+a valid time point, adding a couple hundred billions of years in error,
+and then trying to update a file's write time to that value very often.
+
+Compared to having a smaller range, this problem seems preferable. At least
+now we can represent any time point the filesystem can, so users won't be forced
+to revert back to system interfaces to avoid limitations in the C++ STL.
+
+I posit that we should only consider this concern *after* we have something
+with at least the same range and resolution of the underlying filesystem. The
+latter two problems are much more important to solve.
+
+Potential Solutions And Their Complications
+===========================================
+
+Source Code Portability Across Implementations
+-----------------------------------------------
+
+As we've discussed, ``file_time_type`` needs a representation that uses more
+than 64 bits. The possible solutions include using ``__int128_t``, emulating a
+128 bit integer using a class, or potentially defining a ``timespec`` like
+arithmetic type. All three will allow us to, at minimum, match the range
+and resolution, and the last one might even allow us to match them exactly.
+
+But when considering these potential solutions we need to consider more than
+just the values they can represent. We need to consider the effects they will
+have on users and their code. For example, each of them breaks the following
+code in some way:
+
+.. code-block:: cpp
+
+ // Bug caused by an unexpected 'rep' type returned by count.
+ void print_time(path p) {
+ // __int128_t doesn't have streaming operators, and neither would our
+ // custom arithmetic types.
+ cout << last_write_time(p).time_since_epoch().count() << endl;
+ }
+
+ // Overflow during creation bug.
+ file_time_type timespec_to_file_time_type(struct timespec ts) {
+ // woops! chrono::seconds and chrono::nanoseconds use a 64 bit representation
+ // this may overflow before it's converted to a file_time_type.
+ auto dur = seconds(ts.tv_sec) + nanoseconds(ts.tv_nsec);
+ return file_time_type(dur);
+ }
+
+ file_time_type correct_timespec_to_file_time_type(struct timespec ts) {
+ // This is the correct version of the above example, where we
+ // avoid using the chrono typedefs as they're not sufficient.
+ // Can we expect users to avoid this bug?
+ using fs_seconds = chrono::duration<file_time_type::rep>;
+ using fs_nanoseconds = chrono::duration<file_time_type::rep, nano>;
+ auto dur = fs_seconds(ts.tv_sec) + fs_nanoseconds(tv.tv_nsec);
+ return file_time_type(dur);
+ }
+
+ // Implicit truncation during conversion bug.
+ intmax_t get_time_in_seconds(path p) {
+ using fs_seconds = duration<file_time_type::rep, ratio<1, 1> >;
+ auto tp = last_write_time(p);
+
+ // This works with truncation for __int128_t, but what does it do for
+ // our custom arithmetic types.
+ return duration_cast<fs_seconds>().count();
+ }
+
+
+Each of the above examples would require a user to adjust their filesystem code
+to the particular eccentricities of the representation, hopefully only in such
+a way that the code is still portable across implementations.
+
+At least some of the above issues are unavoidable, no matter what
+representation we choose. But some representations may be quirkier than others,
+and, as I'll argue later, using an actual arithmetic type (``__int128_t``)
+provides the least aberrant behavior.
+
+
+Chrono and ``timespec`` Emulation.
+----------------------------------
+
+One of the options we've considered is using something akin to ``timespec``
+to represent the ``file_time_type``. It only seems natural seeing as that's
+what the underlying system uses, and because it might allow us to match
+the range and resolution exactly. But would it work with chrono? And could
+it still act at all like a ``timespec`` struct?
+
+For ease of consideration, let's consider what the implementation might
+look like.
+
+.. code-block:: cpp
+
+ struct fs_timespec_rep {
+ fs_timespec_rep(long long v)
+ : tv_sec(v / nano::den), tv_nsec(v % nano::den)
+ { }
+ private:
+ time_t tv_sec;
+ long tv_nsec;
+ };
+ bool operator==(fs_timespec_rep, fs_timespec_rep);
+ fs_int128_rep operator+(fs_timespec_rep, fs_timespec_rep);
+ // ... arithmetic operators ... //
+
+The first thing to notice is that we can't construct ``fs_timespec_rep`` like
+a ``timespec`` by passing ``{secs, nsecs}``. Instead we're limited to
+constructing it from a single 64 bit integer.
+
+We also can't allow the user to inspect the ``tv_sec`` or ``tv_nsec`` values
+directly. A ``chrono::duration`` represents its value as a tick period and a
+number of ticks stored using ``rep``. The representation is unaware of the
+tick period it is being used to represent, but ``timespec`` is setup to assume
+a nanosecond tick period; which is the only case where the names ``tv_sec``
+and ``tv_nsec`` match the values they store.
+
+When we convert a nanosecond duration to seconds, ``fs_timespec_rep`` will
+use ``tv_sec`` to represent the number of giga seconds, and ``tv_nsec`` the
+remaining seconds. Let's consider how this might cause a bug were users allowed
+to manipulate the fields directly.
+
+.. code-block:: cpp
+
+ template <class Period>
+ timespec convert_to_timespec(duration<fs_time_rep, Period> dur) {
+ fs_timespec_rep rep = dur.count();
+ return {rep.tv_sec, rep.tv_nsec}; // Oops! Period may not be nanoseconds.
+ }
+
+ template <class Duration>
+ Duration convert_to_duration(timespec ts) {
+ Duration dur({ts.tv_sec, ts.tv_nsec}); // Oops! Period may not be nanoseconds.
+ return file_time_type(dur);
+ file_time_type tp = last_write_time(p);
+ auto dur =
+ }
+
+ time_t extract_seconds(file_time_type tp) {
+ // Converting to seconds is a silly bug, but I could see it happening.
+ using SecsT = chrono::duration<file_time_type::rep, ratio<1, 1>>;
+ auto secs = duration_cast<Secs>(tp.time_since_epoch());
+ // tv_sec is now representing gigaseconds.
+ return secs.count().tv_sec; // Oops!
+ }
+
+Despite ``fs_timespec_rep`` not being usable in any manner resembling
+``timespec``, it still might buy us our goal of matching its range exactly,
+right?
+
+Sort of. Chrono provides a specialization point which specifies the minimum
+and maximum values for a custom representation. It looks like this:
+
+.. code-block:: cpp
+
+ template <>
+ struct duration_values<fs_timespec_rep> {
+ static fs_timespec_rep zero();
+ static fs_timespec_rep min();
+ static fs_timespec_rep max() { // assume friendship.
+ fs_timespec_rep val;
+ val.tv_sec = numeric_limits<time_t>::max();
+ val.tv_nsec = nano::den - 1;
+ return val;
+ }
+ };
+
+Notice that ``duration_values`` doesn't tell the representation what tick
+period it's actually representing. This would indeed correctly limit the range
+of ``duration<fs_timespec_rep, nano>`` to exactly that of ``timespec``. But
+nanoseconds isn't the only tick period it will be used to represent. For
+example:
+
+.. code-block:: cpp
+
+ void test() {
+ using rep = file_time_type::rep;
+ using fs_nsec = duration<rep, nano>;
+ using fs_sec = duration<rep>;
+ fs_nsec nsecs(fs_seconds::max()); // Truncates
+ }
+
+Though the above example may appear silly, I think it follows from the incorrect
+notion that using a ``timespec`` rep in chrono actually makes it act as if it
+were an actual ``timespec``.
+
+Interactions with 32 bit ``time_t``
+-----------------------------------
+
+Up until now we've only be considering cases where ``time_t`` is 64 bits, but what
+about 32 bit systems/builds where ``time_t`` is 32 bits? (this is the common case
+for 32 bit builds).
+
+When ``time_t`` is 32 bits, we can implement ``file_time_type`` simply using 64-bit
+``long long``. There is no need to get either ``__int128_t`` or ``timespec`` emulation
+involved. And nor should we, as it would suffer from the numerous complications
+described by this paper.
+
+Obviously our implementation for 32-bit builds should act as similarly to the
+64-bit build as possible. Code which compiles in one, should compile in the other.
+This consideration is important when choosing between ``__int128_t`` and
+emulating ``timespec``. The solution which provides the most uniformity with
+the least eccentricity is the preferable one.
+
+Summary
+=======
+
+The ``file_time_type`` time point is used to represent the write times for files.
+Its job is to act as part of a C++ wrapper for less ideal system interfaces. The
+underlying filesystem uses the ``timespec`` struct for the same purpose.
+
+However, the initial implementation of ``file_time_type`` could not represent
+either the range or resolution of ``timespec``, making it unsuitable. Fixing
+this requires an implementation which uses more than 64 bits to store the
+time point.
+
+We primarily considered two solutions: Using ``__int128_t`` and using a
+arithmetic emulation of ``timespec``. Each has its pros and cons, and both
+come with more than one complication.
+
+The Potential Solutions
+-----------------------
+
+``long long`` - The Status Quo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Pros:
+
+* As a type ``long long`` plays the nicest with others:
+
+ * It works with streaming operators and other library entities which support
+ builtin integer types, but don't support ``__int128_t``.
+ * Its the representation used by chrono's ``nanosecond`` and ``second`` typedefs.
+
+Cons:
+
+* It cannot provide the same resolution as ``timespec`` unless we limit it
+ to a range of +/- 300 years from the epoch.
+* It cannot provide the same range as ``timespec`` unless we limit its resolution
+ to seconds.
+* ``last_write_time`` has to report an error when the time reported by the filesystem
+ is unrepresentable.
+
+__int128_t
+~~~~~~~~~~~
+
+Pros:
+
+* It is an integer type.
+* It makes the implementation simple and efficient.
+* Acts exactly like other arithmetic types.
+* Can be implicitly converted to a builtin integer type by the user.
+
+ * This is important for doing things like:
+
+ .. code-block:: cpp
+
+ void c_interface_using_time_t(const char* p, time_t);
+
+ void foo(path p) {
+ file_time_type tp = last_write_time(p);
+ time_t secs = duration_cast<seconds>(tp.time_since_epoch()).count();
+ c_interface_using_time_t(p.c_str(), secs);
+ }
+
+Cons:
+
+* It isn't always available (but on 64 bit machines, it normally is).
+* It causes ``file_time_type`` to have a larger range than ``timespec``.
+* It doesn't always act the same as other builtin integer types. For example
+ with ``cout`` or ``to_string``.
+* Allows implicit truncation to 64 bit integers.
+* It can be implicitly converted to a builtin integer type by the user,
+ truncating its value.
+
+Arithmetic ``timespec`` Emulation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Pros:
+
+* It has the exact same range and resolution of ``timespec`` when representing
+ a nanosecond tick period.
+* It's always available, unlike ``__int128_t``.
+
+Cons:
+
+* It has a larger range when representing any period longer than a nanosecond.
+* Doesn't actually allow users to use it like a ``timespec``.
+* The required representation of using ``tv_sec`` to store the giga tick count
+ and ``tv_nsec`` to store the remainder adds nothing over a 128 bit integer,
+ but complicates a lot.
+* It isn't a builtin integer type, and can't be used anything like one.
+* Chrono can be made to work with it, but not nicely.
+* Emulating arithmetic classes come with their own host of problems regarding
+ overload resolution (Each operator needs three SFINAE constrained versions of
+ it in order to act like builtin integer types).
+* It offers little over simply using ``__int128_t``.
+* It acts the most differently than implementations using an actual integer type,
+ which has a high chance of breaking source compatibility.
+
+
+Selected Solution - Using ``__int128_t``
+=========================================
+
+The solution I selected for libc++ is using ``__int128_t`` when available,
+and otherwise falling back to using ``long long`` with nanosecond precision.
+
+When ``__int128_t`` is available, or when ``time_t`` is 32-bits, the implementation
+provides same resolution and a greater range than ``timespec``. Otherwise
+it still provides the same resolution, but is limited to a range of +/- 300
+years. This final case should be rather rare, as ``__int128_t``
+is normally available in 64-bit builds, and ``time_t`` is normally 32-bits
+during 32-bit builds.
+
+Although falling back to ``long long`` and nanosecond precision is less than
+ideal, it also happens to be the implementation provided by both libstdc++
+and MSVC. (So that makes it better, right?)
+
+Although the ``timespec`` emulation solution is feasible and would largely
+do what we want, it comes with too many complications, potential problems
+and discrepancies when compared to "normal" chrono time points and durations.
+
+An emulation of a builtin arithmetic type using a class is never going to act
+exactly the same, and the difference will be felt by users. It's not reasonable
+to expect them to tolerate and work around these differences. And once
+we commit to an ABI it will be too late to change. Committing to this seems
+risky.
+
+Therefore, ``__int128_t`` seems like the better solution.
diff --git a/docs/DesignDocs/ThreadingSupportAPI.rst b/docs/DesignDocs/ThreadingSupportAPI.rst
index 556c45b7e1f7..330ce74cf77a 100644
--- a/docs/DesignDocs/ThreadingSupportAPI.rst
+++ b/docs/DesignDocs/ThreadingSupportAPI.rst
@@ -66,6 +66,10 @@ Threading Configuration Macros
This macro is defined when libc++ should use POSIX threads to implement the
internal threading API.
+**_LIBCPP_HAS_THREAD_API_WIN32**
+ This macro is defined when libc++ should use Win32 threads to implement the
+ internal threading API.
+
**_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL**
This macro is defined when libc++ expects the definitions of the internal
threading API to be provided by an external library. When defined
diff --git a/docs/DesignDocs/VisibilityMacros.rst b/docs/DesignDocs/VisibilityMacros.rst
index 993ce2cca5fd..878566ea0bc1 100644
--- a/docs/DesignDocs/VisibilityMacros.rst
+++ b/docs/DesignDocs/VisibilityMacros.rst
@@ -40,11 +40,11 @@ Visibility Macros
this macro therefore expands to `__declspec(dllexport)` when building the
library and has an empty definition otherwise.
-**_LIBCPP_INLINE_VISIBILITY**
- Mark a function as hidden and force inlining whenever possible.
-
-**_LIBCPP_ALWAYS_INLINE**
- A synonym for `_LIBCPP_INLINE_VISIBILITY`
+**_LIBCPP_HIDE_FROM_ABI**
+ Mark a function as not being part of the ABI of any final linked image that
+ uses it, and also as being internal to each TU that uses that function. In
+ other words, the address of a function marked with this attribute is not
+ guaranteed to be the same across translation units.
**_LIBCPP_TYPE_VIS**
Mark a type's typeinfo, vtable and members as having default visibility.
@@ -155,6 +155,22 @@ Visibility Macros
versioning namespace. This allows throwing and catching some exception types
between libc++ and libstdc++.
+**_LIBCPP_INTERNAL_LINKAGE**
+ Mark the affected entity as having internal linkage (i.e. the `static`
+ keyword in C). This is only a best effort: when the `internal_linkage`
+ attribute is not available, we fall back to forcing the function to be
+ inlined, which approximates internal linkage since an externally visible
+ symbol is never generated for that function. This is an internal macro
+ used as an implementation detail by other visibility macros. Never mark
+ a function or a class with this macro directly.
+
+**_LIBCPP_ALWAYS_INLINE**
+ Forces inlining of the function it is applied to. For visibility purposes,
+ this macro is used to make sure that an externally visible symbol is never
+ generated in an object file when the `internal_linkage` attribute is not
+ available. This is an internal macro used by other visibility macros, and
+ it should not be used directly.
+
Links
=====
diff --git a/docs/Makefile.sphinx b/docs/Makefile.sphinx
index ae37a34b54ee..a34f0cc0bad3 100644
--- a/docs/Makefile.sphinx
+++ b/docs/Makefile.sphinx
@@ -5,7 +5,7 @@
# out-of-tree builds.
# You can set these variables from the command line.
-SPHINXOPTS = -n -W
+SPHINXOPTS = -n -W -v
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
diff --git a/docs/UsingLibcxx.rst b/docs/UsingLibcxx.rst
index f54234d6aa3f..e10a27c598a1 100644
--- a/docs/UsingLibcxx.rst
+++ b/docs/UsingLibcxx.rst
@@ -49,6 +49,24 @@ An example of using ``LD_LIBRARY_PATH``:
$ export LD_LIBRARY_PATH=<libcxx-install-prefix>/lib
$ ./a.out # Searches for libc++ along LD_LIBRARY_PATH
+
+Using ``<filesystem>`` and libc++fs
+====================================
+
+Libc++ provides the implementation of the filesystem library in a separate
+library. Users of ``<filesystem>`` and ``<experimental/filesystem>`` are
+required to link ``-lc++fs``.
+
+.. note::
+ Prior to libc++ 7.0, users of ``<experimental/filesystem>`` were required
+ to link libc++experimental.
+
+.. warning::
+ The Filesystem library is still experimental in nature. As such normal
+ guarantees about ABI stability and backwards compatibility do not yet apply
+ to it. In the future, this restriction will be removed.
+
+
Using libc++experimental and ``<experimental/...>``
=====================================================
@@ -65,6 +83,9 @@ installed. For information on building libc++experimental from source see
:ref:`Building Libc++ <build instructions>` and
:ref:`libc++experimental CMake Options <libc++experimental options>`.
+Note that as of libc++ 7.0 using the ``<experimental/filesystem>`` requires linking
+libc++fs instead of libc++experimental.
+
Also see the `Experimental Library Implementation Status <http://libcxx.llvm.org/ts1z_status.html>`__
page.
diff --git a/docs/conf.py b/docs/conf.py
index bb231ac3e353..4c1ea3653cdb 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -47,9 +47,9 @@ copyright = u'2011-2017, LLVM Project'
# built documents.
#
# The short X.Y version.
-version = '6.0'
+version = '7.0'
# The full version, including alpha/beta/rc tags.
-release = '6.0'
+release = '7.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/docs/index.rst b/docs/index.rst
index 3526b47210f0..e4b3a879da94 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -134,6 +134,7 @@ Design Documents
DesignDocs/ABIVersioning
DesignDocs/VisibilityMacros
DesignDocs/ThreadingSupportAPI
+ DesignDocs/FileTimeType
* `<atomic> design <http://libcxx.llvm.org/atomic_design.html>`_
* `<type_traits> design <http://libcxx.llvm.org/type_traits_design.html>`_
diff --git a/fuzzing/fuzz_test.cpp b/fuzzing/fuzz_test.cpp
new file mode 100644
index 000000000000..98ebe99bf2f6
--- /dev/null
+++ b/fuzzing/fuzz_test.cpp
@@ -0,0 +1,195 @@
+// -*- C++ -*-
+//===------------------------- fuzz_test.cpp ------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// A simple program for running regressions on the fuzzing routines.
+// This code is not part of any shipping product.
+//
+// To build:
+// clang++ -std=c++11 fuzz_test.cpp fuzzing.cpp
+//
+// To use:
+// fuzz_test -r partial_sort [-v] files...
+//
+// Each file should contain a test case.
+
+// TODO: should add some memory tracking, too.
+
+
+#include <iostream>
+#include <fstream>
+#include <iterator>
+#include <vector>
+#include <map>
+#include <chrono>
+
+#include "fuzzing.h"
+
+// ==== Count memory allocations ====
+
+struct MemoryCounters {
+ size_t totalAllocationCount;
+ size_t netAllocationCount;
+ size_t totalBytesAllocated;
+ };
+
+MemoryCounters gMemoryCounters;
+
+void ZeroMemoryCounters() {
+ gMemoryCounters.totalAllocationCount = 0;
+ gMemoryCounters.netAllocationCount = 0;
+ gMemoryCounters.totalBytesAllocated = 0;
+}
+
+void* operator new(std::size_t size)
+{
+ if (size == 0) size = 1;
+ void *p = ::malloc(size);
+ if (p == NULL)
+ throw std::bad_alloc();
+ gMemoryCounters.totalAllocationCount += 1;
+ gMemoryCounters.netAllocationCount += 1;
+ gMemoryCounters.totalBytesAllocated += size;
+ return p;
+}
+
+void* operator new(std::size_t size, const std::nothrow_t&) noexcept
+{
+ try { return operator new(size); }
+ catch (const std::bad_alloc &) {}
+ return nullptr;
+}
+
+void* operator new[](std::size_t size)
+{
+ return ::operator new(size);
+}
+
+void* operator new[](std::size_t size, const std::nothrow_t&) noexcept
+{
+ try { return operator new(size); }
+ catch (const std::bad_alloc &) {}
+ return nullptr;
+}
+
+void operator delete(void* ptr) noexcept
+{
+ if (ptr)
+ ::free(ptr);
+ gMemoryCounters.netAllocationCount -= 1;
+}
+
+void operator delete(void* ptr, const std::nothrow_t&) noexcept
+{
+ ::operator delete(ptr);
+}
+
+void operator delete[](void* ptr) noexcept
+{
+ ::operator delete(ptr);
+}
+
+void operator delete[](void* ptr, const std::nothrow_t&) noexcept
+{
+ ::operator delete(ptr);
+}
+
+// ==== End count memory allocations ====
+
+
+typedef int (*FuzzProc) (const uint8_t *data, size_t size);
+
+const std::map<std::string, FuzzProc> procs = {
+ {"sort", fuzzing::sort},
+ {"stable_sort", fuzzing::stable_sort},
+ {"partition", fuzzing::partition},
+ {"partition_copy", fuzzing::partition_copy},
+ {"stable_partition", fuzzing::stable_partition},
+ {"unique", fuzzing::unique},
+ {"unique_copy", fuzzing::unique_copy},
+ {"nth_element", fuzzing::nth_element},
+ {"partial_sort", fuzzing::partial_sort},
+ {"partial_sort_copy", fuzzing::partial_sort_copy},
+ {"make_heap", fuzzing::make_heap},
+ {"push_heap", fuzzing::push_heap},
+ {"pop_heap", fuzzing::pop_heap},
+ {"regex_ECMAScript", fuzzing::regex_ECMAScript},
+ {"regex_POSIX", fuzzing::regex_POSIX},
+ {"regex_extended", fuzzing::regex_extended},
+ {"regex_awk", fuzzing::regex_awk},
+ {"regex_grep", fuzzing::regex_grep},
+ {"regex_egrep", fuzzing::regex_egrep},
+ {"search", fuzzing::search}
+};
+
+
+
+bool verbose = false;
+
+void test_one(const char *filename, FuzzProc fp)
+{
+ std::vector<uint8_t> v;
+ std::ifstream f (filename, std::ios::binary);
+ if (!f.is_open())
+ std::cerr << "## Can't open '" << filename << "'" << std::endl;
+ else
+ {
+ typedef std::istream_iterator<uint8_t> Iter;
+ std::copy(Iter(f), Iter(), std::back_inserter(v));
+ if (verbose)
+ std::cout << "File '" << filename << "' contains " << v.size() << " entries" << std::endl;
+ ZeroMemoryCounters();
+ const auto start_time = std::chrono::high_resolution_clock::now();
+ int ret = fp (v.data(), v.size());
+ const auto finish_time = std::chrono::high_resolution_clock::now();
+ MemoryCounters mc = gMemoryCounters;
+ if (ret != 0)
+ std::cerr << "## Failure code: " << ret << std::endl;
+ if (verbose)
+ {
+ std::cout << "Execution time: "
+ << std::chrono::duration_cast<std::chrono::milliseconds>(finish_time - start_time).count()
+ << " milliseconds" << std::endl;
+ std::cout << "Memory: "
+ << mc.totalBytesAllocated << " bytes allocated ("
+ << mc.totalAllocationCount << " allocations); "
+ << mc.netAllocationCount << " allocations remain" << std::endl;
+ }
+ }
+}
+
+void usage (const char *name)
+{
+ std::cout << "Usage: " << name << " -r proc [-v] files..." << std::endl;
+ std::cout << "Supported routines:" << std::endl;
+ for (const auto &p : procs)
+ std::cout << " " << p.first << std::endl;
+ std::cout << std::endl;
+}
+
+// Poor man's command-line options
+const std::string dashR("-r");
+const std::string dashV("-v");
+
+int main(int argc, char *argv[])
+{
+ if (argc < 4 || dashR != argv[1] || procs.find(argv[2]) == procs.end())
+ usage(argv[0]);
+ else {
+ FuzzProc fp = procs.find(argv[2])->second;
+ int firstFile = 3;
+ if (dashV == argv[firstFile])
+ {
+ verbose = true;
+ ++firstFile;
+ }
+ for (int i = firstFile; i < argc; ++i)
+ test_one(argv[i], fp);
+ }
+}
diff --git a/fuzzing/fuzzing.cpp b/fuzzing/fuzzing.cpp
index 9471a1d0af90..8888cbeac72e 100644
--- a/fuzzing/fuzzing.cpp
+++ b/fuzzing/fuzzing.cpp
@@ -105,6 +105,60 @@ struct is_even<stable_test>
typedef std::vector<uint8_t> Vec;
typedef std::vector<stable_test> StableVec;
+typedef StableVec::const_iterator SVIter;
+
+// Cheap version of is_permutation
+// Builds a set of buckets for each of the key values.
+// Sums all the payloads.
+// Not 100% perfect, but _way_ faster
+bool is_permutation(SVIter first1, SVIter last1, SVIter first2)
+{
+ size_t xBuckets[256] = {0};
+ size_t xPayloads[256] = {0};
+ size_t yBuckets[256] = {0};
+ size_t yPayloads[256] = {0};
+
+ for (; first1 != last1; ++first1, ++first2)
+ {
+ xBuckets [first1->key]++;
+ xPayloads[first1->key] += first1->payload;
+
+ yBuckets [first2->key]++;
+ yPayloads[first2->key] += first2->payload;
+ }
+
+ for (size_t i = 0; i < 256; ++i)
+ {
+ if (xBuckets[i] != yBuckets[i])
+ return false;
+ if (xPayloads[i] != yPayloads[i])
+ return false;
+ }
+
+ return true;
+}
+
+template <typename Iter1, typename Iter2>
+bool is_permutation(Iter1 first1, Iter1 last1, Iter2 first2)
+{
+ static_assert((std::is_same<typename std::iterator_traits<Iter1>::value_type, uint8_t>::value), "");
+ static_assert((std::is_same<typename std::iterator_traits<Iter2>::value_type, uint8_t>::value), "");
+
+ size_t xBuckets[256] = {0};
+ size_t yBuckets[256] = {0};
+
+ for (; first1 != last1; ++first1, ++first2)
+ {
+ xBuckets [*first1]++;
+ yBuckets [*first2]++;
+ }
+
+ for (size_t i = 0; i < 256; ++i)
+ if (xBuckets[i] != yBuckets[i])
+ return false;
+
+ return true;
+}
// == sort ==
int sort(const uint8_t *data, size_t size)
@@ -113,7 +167,7 @@ int sort(const uint8_t *data, size_t size)
std::sort(working.begin(), working.end());
if (!std::is_sorted(working.begin(), working.end())) return 1;
- if (!std::is_permutation(data, data + size, working.begin())) return 99;
+ if (!fuzzing::is_permutation(data, data + size, working.cbegin())) return 99;
return 0;
}
@@ -135,7 +189,7 @@ int stable_sort(const uint8_t *data, size_t size)
if (!std::is_sorted(range.first, range.second, total_less())) return 2;
iter = range.second;
}
- if (!std::is_permutation(input.begin(), input.end(), working.begin())) return 99;
+ if (!fuzzing::is_permutation(input.cbegin(), input.cend(), working.cbegin())) return 99;
return 0;
}
@@ -147,7 +201,7 @@ int partition(const uint8_t *data, size_t size)
if (!std::all_of (working.begin(), iter, is_even<uint8_t>())) return 1;
if (!std::none_of(iter, working.end(), is_even<uint8_t>())) return 2;
- if (!std::is_permutation(data, data + size, working.begin())) return 99;
+ if (!fuzzing::is_permutation(data, data + size, working.cbegin())) return 99;
return 0;
}
@@ -190,7 +244,7 @@ int stable_partition (const uint8_t *data, size_t size)
if (!std::none_of(iter, working.end(), is_even<stable_test>())) return 2;
if (!std::is_sorted(working.begin(), iter, payload_less())) return 3;
if (!std::is_sorted(iter, working.end(), payload_less())) return 4;
- if (!std::is_permutation(input.begin(), input.end(), working.begin())) return 99;
+ if (!fuzzing::is_permutation(input.cbegin(), input.cend(), working.cbegin())) return 99;
return 0;
}
@@ -216,7 +270,7 @@ int nth_element (const uint8_t *data, size_t size)
return 1;
if (!std::all_of(partition_iter, working.end(), [=](uint8_t v) { return v >= nth; }))
return 2;
- if (!std::is_permutation(data + 1, data + size, working.begin())) return 99;
+ if (!fuzzing::is_permutation(data + 1, data + size, working.cbegin())) return 99;
}
return 0;
@@ -241,7 +295,7 @@ int partial_sort (const uint8_t *data, size_t size)
return 2;
}
if (!std::is_sorted(working.begin(), sort_iter)) return 3;
- if (!std::is_permutation(data + 1, data + size, working.begin())) return 99;
+ if (!fuzzing::is_permutation(data + 1, data + size, working.cbegin())) return 99;
return 0;
}
@@ -440,7 +494,7 @@ int make_heap (const uint8_t *data, size_t size)
std::make_heap(working.begin(), working.end());
if (!std::is_heap(working.begin(), working.end())) return 1;
- if (!std::is_permutation(data, data + size, working.begin())) return 99;
+ if (!fuzzing::is_permutation(data, data + size, working.cbegin())) return 99;
return 0;
}
@@ -461,7 +515,7 @@ int push_heap (const uint8_t *data, size_t size)
if (!std::is_heap(working.begin(), iter)) return 2;
}
- if (!std::is_permutation(data, data + size, working.begin())) return 99;
+ if (!fuzzing::is_permutation(data, data + size, working.cbegin())) return 99;
return 0;
}
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index b98e09260ca1..c5e92e4c4bda 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,58 +1,262 @@
-if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
- set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE)
-endif()
-
-set(LIBCXX_HEADER_PATTERN
- PATTERN "*"
- PATTERN "CMakeLists.txt" EXCLUDE
- PATTERN ".svn" EXCLUDE
- PATTERN "__config_site.in" EXCLUDE
- ${LIBCXX_SUPPORT_HEADER_PATTERN}
+set(files
+ __bit_reference
+ __bsd_locale_defaults.h
+ __bsd_locale_fallbacks.h
+ __errc
+ __debug
+ __functional_03
+ __functional_base
+ __functional_base_03
+ __hash_table
+ __libcpp_version
+ __locale
+ __mutex_base
+ __nullptr
+ __split_buffer
+ __sso_allocator
+ __std_stream
+ __string
+ __threading_support
+ __tree
+ __tuple
+ __undef_macros
+ algorithm
+ any
+ array
+ atomic
+ bitset
+ cassert
+ ccomplex
+ cctype
+ cerrno
+ cfenv
+ cfloat
+ chrono
+ cinttypes
+ ciso646
+ climits
+ clocale
+ cmath
+ codecvt
+ compare
+ complex
+ complex.h
+ condition_variable
+ csetjmp
+ csignal
+ cstdarg
+ cstdbool
+ cstddef
+ cstdint
+ cstdio
+ cstdlib
+ cstring
+ ctgmath
+ ctime
+ ctype.h
+ cwchar
+ cwctype
+ deque
+ errno.h
+ exception
+ experimental/__config
+ experimental/__memory
+ experimental/algorithm
+ experimental/any
+ experimental/chrono
+ experimental/coroutine
+ experimental/deque
+ experimental/dynarray
+ experimental/filesystem
+ experimental/forward_list
+ experimental/functional
+ experimental/iterator
+ experimental/list
+ experimental/map
+ experimental/memory_resource
+ experimental/numeric
+ experimental/optional
+ experimental/propagate_const
+ experimental/ratio
+ experimental/regex
+ experimental/set
+ experimental/simd
+ experimental/string
+ experimental/string_view
+ experimental/system_error
+ experimental/tuple
+ experimental/type_traits
+ experimental/unordered_map
+ experimental/unordered_set
+ experimental/utility
+ experimental/vector
+ ext/__hash
+ ext/hash_map
+ ext/hash_set
+ filesystem
+ float.h
+ forward_list
+ fstream
+ functional
+ future
+ initializer_list
+ inttypes.h
+ iomanip
+ ios
+ iosfwd
+ iostream
+ istream
+ iterator
+ limits
+ limits.h
+ list
+ locale
+ locale.h
+ map
+ math.h
+ memory
+ module.modulemap
+ mutex
+ new
+ numeric
+ optional
+ ostream
+ queue
+ random
+ ratio
+ regex
+ scoped_allocator
+ set
+ setjmp.h
+ shared_mutex
+ span
+ sstream
+ stack
+ stdbool.h
+ stddef.h
+ stdexcept
+ stdint.h
+ stdio.h
+ stdlib.h
+ streambuf
+ string
+ string.h
+ string_view
+ strstream
+ system_error
+ tgmath.h
+ thread
+ tuple
+ type_traits
+ typeindex
+ typeinfo
+ unordered_map
+ unordered_set
+ utility
+ valarray
+ variant
+ vector
+ version
+ wchar.h
+ wctype.h
)
-if(NOT LIBCXX_USING_INSTALLED_LLVM AND LLVM_BINARY_DIR)
- file(COPY .
- DESTINATION "${LLVM_BINARY_DIR}/include/c++/v1"
- FILES_MATCHING
- ${LIBCXX_HEADER_PATTERN}
+if(LIBCXX_INSTALL_SUPPORT_HEADERS)
+ set(files
+ ${files}
+ support/android/locale_bionic.h
+ support/fuchsia/xlocale.h
+ support/ibm/limits.h
+ support/ibm/locale_mgmt_aix.h
+ support/ibm/support.h
+ support/ibm/xlocale.h
+ support/musl/xlocale.h
+ support/newlib/xlocale.h
+ support/solaris/floatingpoint.h
+ support/solaris/wchar.h
+ support/solaris/xlocale.h
+ support/win32/limits_msvc_win32.h
+ support/win32/locale_win32.h
+ support/xlocale/__nop_locale_mgmt.h
+ support/xlocale/__posix_l_fallback.h
+ support/xlocale/__strtonum_fallback.h
+ support/xlocale/xlocale.h
)
endif()
-if (LIBCXX_INSTALL_HEADERS)
- install(DIRECTORY .
- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1
- COMPONENT cxx-headers
- FILES_MATCHING
- ${LIBCXX_HEADER_PATTERN}
- PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+if (LIBCXX_NEEDS_SITE_CONFIG)
+ # Generate a custom __config header. The new header is created
+ # by prepending __config_site to the current __config header.
+ add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
+ COMMAND ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py
+ ${LIBCXX_BINARY_DIR}/__config_site
+ ${LIBCXX_SOURCE_DIR}/include/__config
+ -o ${LIBCXX_BINARY_DIR}/__generated_config
+ DEPENDS ${LIBCXX_SOURCE_DIR}/include/__config
+ ${LIBCXX_BINARY_DIR}/__config_site
)
+ # Add a target that executes the generation commands.
+ add_custom_target(cxx-generated-config ALL
+ DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config)
+ set(generated_config_deps cxx-generated-config)
+else()
+ set(files
+ ${files}
+ __config
+ )
+endif()
+
+if(NOT LIBCXX_USING_INSTALLED_LLVM AND LIBCXX_HEADER_DIR)
+ set(output_dir ${LIBCXX_HEADER_DIR}/include/c++/v1)
+
+ set(out_files)
+ foreach(f ${files})
+ set(src ${CMAKE_CURRENT_SOURCE_DIR}/${f})
+ set(dst ${output_dir}/${f})
+ add_custom_command(OUTPUT ${dst}
+ DEPENDS ${src}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+ COMMENT "Copying CXX header ${f}")
+ list(APPEND out_files ${dst})
+ endforeach()
if (LIBCXX_NEEDS_SITE_CONFIG)
- # Generate and install a custom __config header. The new header is created
- # by prepending __config_site to the current __config header.
- add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
- COMMAND ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py
- ${LIBCXX_BINARY_DIR}/__config_site
- ${LIBCXX_SOURCE_DIR}/include/__config
- -o ${LIBCXX_BINARY_DIR}/__generated_config
- DEPENDS ${LIBCXX_SOURCE_DIR}/include/__config
- ${LIBCXX_BINARY_DIR}/__config_site
+ # Copy the generated header as __config into build directory.
+ set(src ${LIBCXX_BINARY_DIR}/__generated_config)
+ set(dst ${output_dir}/__config)
+ add_custom_command(OUTPUT ${dst}
+ DEPENDS ${src} ${generated_config_deps}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+ COMMENT "Copying CXX __config")
+ list(APPEND out_files ${dst})
+ endif()
+
+ add_custom_target(cxx-headers ALL DEPENDS ${out_files} ${LIBCXX_CXX_ABI_HEADER_TARGET})
+else()
+ add_custom_target(cxx-headers)
+endif()
+set_target_properties(cxx-headers PROPERTIES FOLDER "Misc")
+
+if (LIBCXX_INSTALL_HEADERS)
+ foreach(file ${files})
+ get_filename_component(dir ${file} DIRECTORY)
+ install(FILES ${file}
+ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir}
+ COMPONENT cxx-headers
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
- # 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)
+ endforeach()
+
+ if (LIBCXX_NEEDS_SITE_CONFIG)
# Install the generated header as __config.
install(FILES ${LIBCXX_BINARY_DIR}/__generated_config
- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1
+ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
RENAME __config
COMPONENT cxx-headers)
endif()
if (NOT CMAKE_CONFIGURATION_TYPES)
- # this target is just needed as a placeholder for the distribution target
- add_custom_target(cxx-headers)
add_custom_target(install-cxx-headers
DEPENDS cxx-headers ${generated_config_deps}
COMMAND "${CMAKE_COMMAND}"
@@ -61,9 +265,7 @@ if (LIBCXX_INSTALL_HEADERS)
# Stripping is a no-op for headers
add_custom_target(install-cxx-headers-stripped DEPENDS install-cxx-headers)
- add_custom_target(libcxx-headers)
add_custom_target(install-libcxx-headers DEPENDS install-cxx-headers)
add_custom_target(install-libcxx-headers-stripped DEPENDS install-cxx-headers-stripped)
endif()
-
endif()
diff --git a/include/__bsd_locale_fallbacks.h b/include/__bsd_locale_fallbacks.h
index 5e9e09483072..3097b01410d3 100644
--- a/include/__bsd_locale_fallbacks.h
+++ b/include/__bsd_locale_fallbacks.h
@@ -24,28 +24,28 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
{
__libcpp_locale_guard __current(__l);
return MB_CUR_MAX;
}
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
wint_t __libcpp_btowc_l(int __c, locale_t __l)
{
__libcpp_locale_guard __current(__l);
return btowc(__c);
}
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
int __libcpp_wctob_l(wint_t __c, locale_t __l)
{
__libcpp_locale_guard __current(__l);
return wctob(__c);
}
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
size_t __len, mbstate_t *__ps, locale_t __l)
{
@@ -53,14 +53,14 @@ size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
}
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
{
__libcpp_locale_guard __current(__l);
return wcrtomb(__s, __wc, __ps);
}
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
size_t __len, mbstate_t *__ps, locale_t __l)
{
@@ -68,7 +68,7 @@ size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
}
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
mbstate_t *__ps, locale_t __l)
{
@@ -76,28 +76,28 @@ size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
return mbrtowc(__pwc, __s, __n, __ps);
}
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
{
__libcpp_locale_guard __current(__l);
return mbtowc(__pwc, __pmb, __max);
}
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
{
__libcpp_locale_guard __current(__l);
return mbrlen(__s, __n, __ps);
}
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
lconv *__libcpp_localeconv_l(locale_t __l)
{
__libcpp_locale_guard __current(__l);
return localeconv();
}
-inline _LIBCPP_ALWAYS_INLINE
+inline _LIBCPP_INLINE_VISIBILITY
size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
mbstate_t *__ps, locale_t __l)
{
diff --git a/include/__config b/include/__config
index d0f95ef28342..c01ac12be4b8 100644
--- a/include/__config
+++ b/include/__config
@@ -12,9 +12,9 @@
#define _LIBCPP_CONFIG
#if defined(_MSC_VER) && !defined(__clang__)
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
-#endif
+# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+# endif
#endif
#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
@@ -24,79 +24,95 @@
#ifdef __cplusplus
#ifdef __GNUC__
-#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
+# define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
// The _GNUC_VER_NEW macro better represents the new GCC versioning scheme
// introduced in GCC 5.0.
-#define _GNUC_VER_NEW (_GNUC_VER * 10 + __GNUC_PATCHLEVEL__)
+# define _GNUC_VER_NEW (_GNUC_VER * 10 + __GNUC_PATCHLEVEL__)
#else
-#define _GNUC_VER 0
-#define _GNUC_VER_NEW 0
+# define _GNUC_VER 0
+# define _GNUC_VER_NEW 0
#endif
-#define _LIBCPP_VERSION 6000
+#define _LIBCPP_VERSION 7000
#ifndef _LIBCPP_ABI_VERSION
-#define _LIBCPP_ABI_VERSION 1
+# ifdef __Fuchsia__
+# define _LIBCPP_ABI_VERSION 2
+# else
+# define _LIBCPP_ABI_VERSION 1
+# endif
#endif
+#ifndef _LIBCPP_STD_VER
+# if __cplusplus <= 201103L
+# define _LIBCPP_STD_VER 11
+# elif __cplusplus <= 201402L
+# define _LIBCPP_STD_VER 14
+# elif __cplusplus <= 201703L
+# define _LIBCPP_STD_VER 17
+# else
+# define _LIBCPP_STD_VER 18 // current year, or date of c++2a ratification
+# endif
+#endif // _LIBCPP_STD_VER
+
#if defined(__ELF__)
-#define _LIBCPP_OBJECT_FORMAT_ELF 1
+# define _LIBCPP_OBJECT_FORMAT_ELF 1
#elif defined(__MACH__)
-#define _LIBCPP_OBJECT_FORMAT_MACHO 1
+# define _LIBCPP_OBJECT_FORMAT_MACHO 1
#elif defined(_WIN32)
-#define _LIBCPP_OBJECT_FORMAT_COFF 1
+# define _LIBCPP_OBJECT_FORMAT_COFF 1
#elif defined(__wasm__)
-#define _LIBCPP_OBJECT_FORMAT_WASM 1
+# define _LIBCPP_OBJECT_FORMAT_WASM 1
#else
-#error Unknown object file format
+# error Unknown object file format
#endif
#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
// Change short string representation so that string data starts at offset 0,
// improving its alignment in some cases.
-#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
// Fix deque iterator type in order to support incomplete types.
-#define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
+# define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
// Fix undefined behavior in how std::list stores its linked nodes.
-#define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
+# 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_TREE_REMOVE_NODE_POINTER_UB
// Fix undefined behavior in how __hash_table stores its pointer types.
-#define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
-#define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
-#define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
+# define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
+# define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
+# define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
// Don't use a nullptr_t simulation type in C++03 instead using C++11 nullptr
// provided under the alternate keyword __nullptr, which changes the mangling
// of nullptr_t. This option is ABI incompatible with GCC in C++03 mode.
-#define _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR
+# define _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR
// Define the `pointer_safety` enum as a C++11 strongly typed enumeration
// instead of as a class simulating an enum. If this option is enabled
// `pointer_safety` and `get_pointer_safety()` will no longer be available
// in C++03.
-#define _LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE
+# define _LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE
// Define a key function for `bad_function_call` in the library, to centralize
// its vtable and typeinfo to libc++ rather than having all other libraries
// using that class define their own copies.
-#define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
// Enable optimized version of __do_get_(un)signed which avoids redundant copies.
-#define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
+# define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
// Use the smallest possible integer type to represent the index of the variant.
// Previously libc++ used "unsigned int" exclusivly.
-#define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
+# define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
#elif _LIBCPP_ABI_VERSION == 1
-#if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
+# if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
// Enable compiling copies of now inline methods into the dylib to support
// applications compiled against older libraries. This is unnecessary with
// COFF dllexport semantics, since dllexport forces a non-inline definition
// of inline functions to be emitted anyway. Our own non-inline copy would
// conflict with the dllexport-emitted copy, so we disable it.
-#define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
-#endif
+# define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
+# endif
// 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
+# if defined(__FreeBSD__)
+# define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
+# endif
#endif
#ifdef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
@@ -116,46 +132,50 @@
#ifndef __has_attribute
#define __has_attribute(__x) 0
#endif
+
#ifndef __has_builtin
#define __has_builtin(__x) 0
#endif
+
#ifndef __has_extension
#define __has_extension(__x) 0
#endif
+
#ifndef __has_feature
#define __has_feature(__x) 0
#endif
+
#ifndef __has_cpp_attribute
#define __has_cpp_attribute(__x) 0
#endif
+
// '__is_identifier' returns '0' if '__x' is a reserved identifier provided by
// the compiler and '1' otherwise.
#ifndef __is_identifier
#define __is_identifier(__x) 1
#endif
+
#ifndef __has_declspec_attribute
#define __has_declspec_attribute(__x) 0
#endif
#define __has_keyword(__x) !(__is_identifier(__x))
-#ifdef __has_include
-#define __libcpp_has_include(__x) __has_include(__x)
-#else
-#define __libcpp_has_include(__x) 0
+#ifndef __has_include
+#define __has_include(...) 0
#endif
#if defined(__clang__)
-#define _LIBCPP_COMPILER_CLANG
-# ifndef __apple_build_version__
-# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
-# endif
+# define _LIBCPP_COMPILER_CLANG
+# ifndef __apple_build_version__
+# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
+# endif
#elif defined(__GNUC__)
-#define _LIBCPP_COMPILER_GCC
+# define _LIBCPP_COMPILER_GCC
#elif defined(_MSC_VER)
-#define _LIBCPP_COMPILER_MSVC
+# define _LIBCPP_COMPILER_MSVC
#elif defined(__IBMCPP__)
-#define _LIBCPP_COMPILER_IBM
+# define _LIBCPP_COMPILER_IBM
#endif
#ifndef _LIBCPP_CLANG_VER
@@ -168,67 +188,69 @@
// and allow the user to explicitly specify the ABI to handle cases where this
// heuristic falls short.
#if defined(_LIBCPP_ABI_FORCE_ITANIUM) && defined(_LIBCPP_ABI_FORCE_MICROSOFT)
-# error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be defined"
+# error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be defined"
#elif defined(_LIBCPP_ABI_FORCE_ITANIUM)
-# define _LIBCPP_ABI_ITANIUM
+# define _LIBCPP_ABI_ITANIUM
#elif defined(_LIBCPP_ABI_FORCE_MICROSOFT)
-# define _LIBCPP_ABI_MICROSOFT
-#else
-# if defined(_WIN32) && defined(_MSC_VER)
# define _LIBCPP_ABI_MICROSOFT
-# else
-# define _LIBCPP_ABI_ITANIUM
-# endif
+#else
+# if defined(_WIN32) && defined(_MSC_VER)
+# define _LIBCPP_ABI_MICROSOFT
+# else
+# define _LIBCPP_ABI_ITANIUM
+# endif
#endif
// Need to detect which libc we're using if we're on Linux.
#if defined(__linux__)
-#include <features.h>
-#if !defined(__GLIBC_PREREQ)
-#define __GLIBC_PREREQ(a, b) 0
-#endif // !defined(__GLIBC_PREREQ)
+# include <features.h>
+# if defined(__GLIBC_PREREQ)
+# define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
+# else
+# define _LIBCPP_GLIBC_PREREQ(a, b) 0
+# endif // defined(__GLIBC_PREREQ)
#endif // defined(__linux__)
#ifdef __LITTLE_ENDIAN__
-#if __LITTLE_ENDIAN__
-#define _LIBCPP_LITTLE_ENDIAN
-#endif // __LITTLE_ENDIAN__
+# if __LITTLE_ENDIAN__
+# define _LIBCPP_LITTLE_ENDIAN
+# endif // __LITTLE_ENDIAN__
#endif // __LITTLE_ENDIAN__
#ifdef __BIG_ENDIAN__
-#if __BIG_ENDIAN__
-#define _LIBCPP_BIG_ENDIAN
-#endif // __BIG_ENDIAN__
+# if __BIG_ENDIAN__
+# define _LIBCPP_BIG_ENDIAN
+# endif // __BIG_ENDIAN__
#endif // __BIG_ENDIAN__
#ifdef __BYTE_ORDER__
-#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-#define _LIBCPP_LITTLE_ENDIAN
-#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-#define _LIBCPP_BIG_ENDIAN
-#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+# define _LIBCPP_LITTLE_ENDIAN
+# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+# define _LIBCPP_BIG_ENDIAN
+# endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#endif // __BYTE_ORDER__
#ifdef __FreeBSD__
-# include <sys/endian.h>
+# include <sys/endian.h>
# if _BYTE_ORDER == _LITTLE_ENDIAN
-# define _LIBCPP_LITTLE_ENDIAN
-# else // _BYTE_ORDER == _LITTLE_ENDIAN
-# define _LIBCPP_BIG_ENDIAN
-# endif // _BYTE_ORDER == _LITTLE_ENDIAN
-# ifndef __LONG_LONG_SUPPORTED
-# define _LIBCPP_HAS_NO_LONG_LONG
-# endif // __LONG_LONG_SUPPORTED
+# define _LIBCPP_LITTLE_ENDIAN
+# else // _BYTE_ORDER == _LITTLE_ENDIAN
+# define _LIBCPP_BIG_ENDIAN
+# endif // _BYTE_ORDER == _LITTLE_ENDIAN
+# ifndef __LONG_LONG_SUPPORTED
+# define _LIBCPP_HAS_NO_LONG_LONG
+# endif // __LONG_LONG_SUPPORTED
#endif // __FreeBSD__
#ifdef __NetBSD__
-# include <sys/endian.h>
+# include <sys/endian.h>
# if _BYTE_ORDER == _LITTLE_ENDIAN
-# define _LIBCPP_LITTLE_ENDIAN
-# else // _BYTE_ORDER == _LITTLE_ENDIAN
-# define _LIBCPP_BIG_ENDIAN
-# endif // _BYTE_ORDER == _LITTLE_ENDIAN
-# define _LIBCPP_HAS_QUICK_EXIT
+# define _LIBCPP_LITTLE_ENDIAN
+# else // _BYTE_ORDER == _LITTLE_ENDIAN
+# define _LIBCPP_BIG_ENDIAN
+# endif // _BYTE_ORDER == _LITTLE_ENDIAN
+# define _LIBCPP_HAS_QUICK_EXIT
#endif // __NetBSD__
#if defined(_WIN32)
@@ -245,64 +267,65 @@
# if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__))
# define _LIBCPP_HAS_BITSCAN64
# endif
-# if defined(_LIBCPP_MSVCRT)
-# define _LIBCPP_HAS_QUICK_EXIT
-# endif
+# define _LIBCPP_HAS_OPEN_WITH_WCHAR
+# if defined(_LIBCPP_MSVCRT)
+# define _LIBCPP_HAS_QUICK_EXIT
+# endif
// Some CRT APIs are unavailable to store apps
-#if defined(WINAPI_FAMILY)
-#include <winapifamily.h>
-#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && \
- (!defined(WINAPI_PARTITION_SYSTEM) || \
- !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_SYSTEM))
-#define _LIBCPP_WINDOWS_STORE_APP
-#endif
-#endif
+# if defined(WINAPI_FAMILY)
+# include <winapifamily.h>
+# if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && \
+ (!defined(WINAPI_PARTITION_SYSTEM) || \
+ !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_SYSTEM))
+# define _LIBCPP_WINDOWS_STORE_APP
+# endif
+# endif
#endif // defined(_WIN32)
#ifdef __sun__
-# include <sys/isa_defs.h>
-# ifdef _LITTLE_ENDIAN
-# define _LIBCPP_LITTLE_ENDIAN
-# else
-# define _LIBCPP_BIG_ENDIAN
-# endif
+# include <sys/isa_defs.h>
+# ifdef _LITTLE_ENDIAN
+# define _LIBCPP_LITTLE_ENDIAN
+# else
+# define _LIBCPP_BIG_ENDIAN
+# endif
#endif // __sun__
#if defined(__CloudABI__)
- // Certain architectures provide arc4random(). Prefer using
- // arc4random() over /dev/{u,}random to make it possible to obtain
- // random data even when using sandboxing mechanisms such as chroots,
- // Capsicum, etc.
-# define _LIBCPP_USING_ARC4_RANDOM
+ // Certain architectures provide arc4random(). Prefer using
+ // arc4random() over /dev/{u,}random to make it possible to obtain
+ // random data even when using sandboxing mechanisms such as chroots,
+ // Capsicum, etc.
+# define _LIBCPP_USING_ARC4_RANDOM
#elif defined(__Fuchsia__)
-# define _LIBCPP_USING_GETENTROPY
+# define _LIBCPP_USING_GETENTROPY
#elif defined(__native_client__)
- // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
- // including accesses to the special files under /dev. C++11's
- // std::random_device is instead exposed through a NaCl syscall.
-# define _LIBCPP_USING_NACL_RANDOM
+ // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
+ // including accesses to the special files under /dev. C++11's
+ // std::random_device is instead exposed through a NaCl syscall.
+# define _LIBCPP_USING_NACL_RANDOM
#elif defined(_LIBCPP_WIN32API)
-# define _LIBCPP_USING_WIN32_RANDOM
+# define _LIBCPP_USING_WIN32_RANDOM
#else
-# define _LIBCPP_USING_DEV_RANDOM
+# define _LIBCPP_USING_DEV_RANDOM
#endif
#if !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN)
-# include <endian.h>
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define _LIBCPP_LITTLE_ENDIAN
-# elif __BYTE_ORDER == __BIG_ENDIAN
-# define _LIBCPP_BIG_ENDIAN
-# else // __BYTE_ORDER == __BIG_ENDIAN
-# error unable to determine endian
-# endif
+# include <endian.h>
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define _LIBCPP_LITTLE_ENDIAN
+# elif __BYTE_ORDER == __BIG_ENDIAN
+# define _LIBCPP_BIG_ENDIAN
+# else // __BYTE_ORDER == __BIG_ENDIAN
+# error unable to determine endian
+# endif
#endif // !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN)
#if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC)
-#define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi")))
+# define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi")))
#else
-#define _LIBCPP_NO_CFI
+# define _LIBCPP_NO_CFI
#endif
#if defined(_LIBCPP_COMPILER_CLANG)
@@ -355,11 +378,11 @@ typedef __char32_t char32_t;
#endif
#if !(__has_feature(cxx_nullptr))
-# if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR)
-# define nullptr __nullptr
-# else
-# define _LIBCPP_HAS_NO_NULLPTR
-# endif
+# if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR)
+# define nullptr __nullptr
+# else
+# define _LIBCPP_HAS_NO_NULLPTR
+# endif
#endif
#if !(__has_feature(cxx_rvalue_references))
@@ -379,11 +402,11 @@ typedef __char32_t char32_t;
#endif
#if __has_feature(is_base_of)
-# define _LIBCPP_HAS_IS_BASE_OF
+#define _LIBCPP_HAS_IS_BASE_OF
#endif
#if __has_feature(is_final)
-# define _LIBCPP_HAS_IS_FINAL
+#define _LIBCPP_HAS_IS_FINAL
#endif
// Objective-C++ features (opt-in)
@@ -408,25 +431,25 @@ typedef __char32_t char32_t;
#endif
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
-#if defined(__FreeBSD__)
-#define _LIBCPP_HAS_QUICK_EXIT
-#define _LIBCPP_HAS_C11_FEATURES
-#elif defined(__Fuchsia__)
-#define _LIBCPP_HAS_QUICK_EXIT
-#define _LIBCPP_HAS_C11_FEATURES
-#elif defined(__linux__)
-#if !defined(_LIBCPP_HAS_MUSL_LIBC)
-#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
-#define _LIBCPP_HAS_QUICK_EXIT
-#endif
-#if __GLIBC_PREREQ(2, 17)
-#define _LIBCPP_HAS_C11_FEATURES
-#endif
-#else // defined(_LIBCPP_HAS_MUSL_LIBC)
-#define _LIBCPP_HAS_QUICK_EXIT
-#define _LIBCPP_HAS_C11_FEATURES
-#endif
-#endif // __linux__
+# if defined(__FreeBSD__)
+# define _LIBCPP_HAS_QUICK_EXIT
+# define _LIBCPP_HAS_C11_FEATURES
+# elif defined(__Fuchsia__)
+# define _LIBCPP_HAS_QUICK_EXIT
+# define _LIBCPP_HAS_C11_FEATURES
+# elif defined(__linux__)
+# if !defined(_LIBCPP_HAS_MUSL_LIBC)
+# if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
+# define _LIBCPP_HAS_QUICK_EXIT
+# endif
+# if _LIBCPP_GLIBC_PREREQ(2, 17)
+# define _LIBCPP_HAS_C11_FEATURES
+# endif
+# else // defined(_LIBCPP_HAS_MUSL_LIBC)
+# define _LIBCPP_HAS_QUICK_EXIT
+# define _LIBCPP_HAS_C11_FEATURES
+# endif
+# endif // __linux__
#endif
#if !(__has_feature(cxx_noexcept))
@@ -434,11 +457,11 @@ typedef __char32_t char32_t;
#endif
#if __has_feature(underlying_type)
-# define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
+#define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
#endif
#if __has_feature(is_literal)
-# define _LIBCPP_IS_LITERAL(T) __is_literal(T)
+#define _LIBCPP_IS_LITERAL(T) __is_literal(T)
#endif
// Inline namespaces are available in Clang regardless of C++ dialect.
@@ -458,12 +481,18 @@ namespace std {
// Allow for build-time disabling of unsigned integer sanitization
#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
+#endif
#if __has_builtin(__builtin_launder)
-#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
+#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
#endif
+#if !__is_identifier(__has_unique_object_representations)
+#define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
+#endif
+
+#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
+
#elif defined(_LIBCPP_COMPILER_GCC)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
@@ -478,7 +507,7 @@ namespace std {
#endif
#if defined(__GNUC__) && _GNUC_VER >= 403
-# define _LIBCPP_HAS_IS_BASE_OF
+#define _LIBCPP_HAS_IS_BASE_OF
#endif
#if !__EXCEPTIONS
@@ -487,10 +516,10 @@ namespace std {
// constexpr was added to GCC in 4.6.
#if _GNUC_VER < 406
-#define _LIBCPP_HAS_NO_CONSTEXPR
+# define _LIBCPP_HAS_NO_CONSTEXPR
// Can only use constexpr in c++11 mode.
#elif !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
-#define _LIBCPP_HAS_NO_CONSTEXPR
+# define _LIBCPP_HAS_NO_CONSTEXPR
#endif
// Determine if GCC supports relaxed constexpr
@@ -504,6 +533,7 @@ namespace std {
#endif
#ifndef __GXX_EXPERIMENTAL_CXX0X__
+
#define _LIBCPP_HAS_NO_DECLTYPE
#define _LIBCPP_HAS_NO_NULLPTR
#define _LIBCPP_HAS_NO_UNICODE_CHARS
@@ -547,9 +577,15 @@ namespace std {
#endif
#if _GNUC_VER >= 700
-#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
+#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
+#endif
+
+#if _GNUC_VER >= 700
+#define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
#endif
+#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
+
#elif defined(_LIBCPP_COMPILER_MSVC)
#define _LIBCPP_TOSTRING2(x) #x
@@ -564,25 +600,26 @@ namespace std {
#define _LIBCPP_HAS_NO_CONSTEXPR
#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
-#if _MSC_VER <= 1800
-#define _LIBCPP_HAS_NO_UNICODE_CHARS
-#endif
#define _LIBCPP_HAS_NO_NOEXCEPT
#define __alignof__ __alignof
#define _LIBCPP_NORETURN __declspec(noreturn)
#define _ALIGNAS(x) __declspec(align(x))
+#define _ALIGNAS_TYPE(x) alignas(x)
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
#define _LIBCPP_END_NAMESPACE_STD }
#define _VSTD std
-# define _LIBCPP_WEAK
namespace std {
}
+#define _LIBCPP_WEAK
+
#define _LIBCPP_HAS_NO_ASAN
+#define _LIBCPP_ALWAYS_INLINE __forceinline
+
#elif defined(_LIBCPP_COMPILER_IBM)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
@@ -613,24 +650,47 @@ namespace std {
#define _LIBCPP_HAS_NO_ASAN
+#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
+
#endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM]
+#if _LIBCPP_STD_VER >= 17
+#define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM \
+ _LIBCPP_BEGIN_NAMESPACE_STD inline namespace __fs { namespace filesystem {
+#else
+#define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM \
+ _LIBCPP_BEGIN_NAMESPACE_STD namespace __fs { namespace filesystem {
+#endif
+
+#define _LIBCPP_END_NAMESPACE_FILESYSTEM \
+ _LIBCPP_END_NAMESPACE_STD } }
+
+#define _VSTD_FS _VSTD::__fs::filesystem
+
+
#if defined(_LIBCPP_OBJECT_FORMAT_COFF)
+
+#ifdef _DLL
+# define _LIBCPP_CRT_FUNC __declspec(dllimport)
+#else
+# define _LIBCPP_CRT_FUNC
+#endif
+
#if defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-# define _LIBCPP_DLL_VIS
-# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
-# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
-# define _LIBCPP_OVERRIDABLE_FUNC_VIS
+# define _LIBCPP_DLL_VIS
+# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
+# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
+# define _LIBCPP_OVERRIDABLE_FUNC_VIS
#elif defined(_LIBCPP_BUILDING_LIBRARY)
-# define _LIBCPP_DLL_VIS __declspec(dllexport)
-# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
-# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS
-# define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_DLL_VIS
+# define _LIBCPP_DLL_VIS __declspec(dllexport)
+# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
+# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS
+# define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_DLL_VIS
#else
-# define _LIBCPP_DLL_VIS __declspec(dllimport)
-# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS
-# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
-# define _LIBCPP_OVERRIDABLE_FUNC_VIS
+# define _LIBCPP_DLL_VIS __declspec(dllimport)
+# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS
+# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
+# define _LIBCPP_OVERRIDABLE_FUNC_VIS
#endif
#define _LIBCPP_TYPE_VIS _LIBCPP_DLL_VIS
@@ -643,39 +703,36 @@ namespace std {
#define _LIBCPP_ENUM_VIS
#if defined(_LIBCPP_COMPILER_MSVC)
-# define _LIBCPP_INLINE_VISIBILITY __forceinline
-# define _LIBCPP_ALWAYS_INLINE __forceinline
-# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline
+# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline
#else
-# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
-# define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
-# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__ ((__always_inline__))
+# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__ ((__always_inline__))
#endif
+
#endif // defined(_LIBCPP_OBJECT_FORMAT_COFF)
#ifndef _LIBCPP_HIDDEN
-#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
-#else
-#define _LIBCPP_HIDDEN
-#endif
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+# define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
+# else
+# define _LIBCPP_HIDDEN
+# endif
#endif
#ifndef _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
-#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
// The inline should be removed once PR32114 is resolved
-#define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS inline _LIBCPP_HIDDEN
-#else
-#define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
-#endif
+# define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS inline _LIBCPP_HIDDEN
+# else
+# define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+# endif
#endif
#ifndef _LIBCPP_FUNC_VIS
-#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
-#else
-#define _LIBCPP_FUNC_VIS
-#endif
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+# define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
+# else
+# define _LIBCPP_FUNC_VIS
+# endif
#endif
#ifndef _LIBCPP_TYPE_VIS
@@ -699,19 +756,19 @@ namespace std {
#endif
#ifndef _LIBCPP_EXTERN_VIS
-# define _LIBCPP_EXTERN_VIS
+#define _LIBCPP_EXTERN_VIS
#endif
#ifndef _LIBCPP_OVERRIDABLE_FUNC_VIS
-# define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_FUNC_VIS
+#define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_FUNC_VIS
#endif
#ifndef _LIBCPP_EXCEPTION_ABI
-#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
-#else
-#define _LIBCPP_EXCEPTION_ABI
-#endif
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+# define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
+# else
+# define _LIBCPP_EXCEPTION_ABI
+# endif
#endif
#ifndef _LIBCPP_ENUM_VIS
@@ -731,31 +788,28 @@ namespace std {
#endif
#ifndef _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
-# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
+#define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
#endif
-#ifndef _LIBCPP_INLINE_VISIBILITY
-#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
+#if __has_attribute(internal_linkage)
+# define _LIBCPP_INTERNAL_LINKAGE __attribute__ ((internal_linkage))
#else
-#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
-#endif
+# define _LIBCPP_INTERNAL_LINKAGE _LIBCPP_ALWAYS_INLINE
#endif
-#ifndef _LIBCPP_ALWAYS_INLINE
-#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
-#else
-#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
-#endif
+#ifndef _LIBCPP_HIDE_FROM_ABI
+# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE
#endif
+// Just so we can migrate to _LIBCPP_HIDE_FROM_ABI gradually.
+#define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
+
#ifndef _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
-# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__visibility__("default"), __always_inline__))
-# else
-# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__always_inline__))
-# endif
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__visibility__("default"), __always_inline__))
+# else
+# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__always_inline__))
+# endif
#endif
#ifndef _LIBCPP_PREFERRED_OVERLOAD
@@ -773,14 +827,19 @@ namespace std {
#endif
#if defined(_LIBCPP_DEBUG_USE_EXCEPTIONS)
-# if !defined(_LIBCPP_DEBUG)
-# error cannot use _LIBCPP_DEBUG_USE_EXCEPTIONS unless _LIBCPP_DEBUG is defined
-# endif
-# define _NOEXCEPT_DEBUG noexcept(false)
-# define _NOEXCEPT_DEBUG_(x) noexcept(false)
+# if !defined(_LIBCPP_DEBUG)
+# error cannot use _LIBCPP_DEBUG_USE_EXCEPTIONS unless _LIBCPP_DEBUG is defined
+# endif
+# ifdef _LIBCPP_HAS_NO_NOEXCEPT
+# define _NOEXCEPT_DEBUG
+# define _NOEXCEPT_DEBUG_(x)
+# else
+# define _NOEXCEPT_DEBUG noexcept(false)
+# define _NOEXCEPT_DEBUG_(x) noexcept(false)
+# endif
#else
-# define _NOEXCEPT_DEBUG _NOEXCEPT
-# define _NOEXCEPT_DEBUG_(x) _NOEXCEPT_(x)
+# define _NOEXCEPT_DEBUG _NOEXCEPT
+# define _NOEXCEPT_DEBUG_(x) _NOEXCEPT_(x)
#endif
#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
@@ -793,88 +852,88 @@ typedef unsigned int char32_t;
#endif
#ifdef _LIBCPP_CXX03_LANG
-# if __has_extension(c_static_assert)
-# define static_assert(__b, __m) _Static_assert(__b, __m)
-# else
+# if __has_extension(c_static_assert)
+# define static_assert(__b, __m) _Static_assert(__b, __m)
+# else
extern "C++" {
template <bool> struct __static_assert_test;
template <> struct __static_assert_test<true> {};
template <unsigned> struct __static_assert_check {};
}
-#define static_assert(__b, __m) \
- typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \
- _LIBCPP_CONCAT(__t, __LINE__)
-# endif // __has_extension(c_static_assert)
+# define static_assert(__b, __m) \
+ typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \
+ _LIBCPP_CONCAT(__t, __LINE__)
+# endif // __has_extension(c_static_assert)
#endif // _LIBCPP_CXX03_LANG
#ifdef _LIBCPP_HAS_NO_DECLTYPE
// GCC 4.6 provides __decltype in all standard modes.
-#if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || _GNUC_VER >= 406
-# define decltype(__x) __decltype(__x)
-#else
-# define decltype(__x) __typeof__(__x)
-#endif
+# if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || _GNUC_VER >= 406
+# define decltype(__x) __decltype(__x)
+# else
+# define decltype(__x) __typeof__(__x)
+# endif
#endif
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
-#define _LIBCPP_CONSTEXPR
+# define _LIBCPP_CONSTEXPR
#else
-#define _LIBCPP_CONSTEXPR constexpr
+# define _LIBCPP_CONSTEXPR constexpr
#endif
#ifdef _LIBCPP_CXX03_LANG
-#define _LIBCPP_DEFAULT {}
+# define _LIBCPP_DEFAULT {}
#else
-#define _LIBCPP_DEFAULT = default;
+# define _LIBCPP_DEFAULT = default;
#endif
#ifdef _LIBCPP_CXX03_LANG
-#define _LIBCPP_EQUAL_DELETE
+# define _LIBCPP_EQUAL_DELETE
#else
-#define _LIBCPP_EQUAL_DELETE = delete
+# define _LIBCPP_EQUAL_DELETE = delete
#endif
#ifdef __GNUC__
-#define _NOALIAS __attribute__((__malloc__))
+# define _NOALIAS __attribute__((__malloc__))
#else
-#define _NOALIAS
+# define _NOALIAS
#endif
#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || \
(!defined(_LIBCPP_CXX03_LANG) && defined(__GNUC__)) // All supported GCC versions
-# define _LIBCPP_EXPLICIT explicit
+# define _LIBCPP_EXPLICIT explicit
#else
-# define _LIBCPP_EXPLICIT
+# define _LIBCPP_EXPLICIT
#endif
#if !__has_builtin(__builtin_operator_new) || !__has_builtin(__builtin_operator_delete)
-# define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
+#define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
#endif
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
-#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
- __lx __v_; \
- _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
- _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
- _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
- };
+# define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
+# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
+ __lx __v_; \
+ _LIBCPP_INLINE_VISIBILITY x(__lx __v) : __v_(__v) {} \
+ _LIBCPP_INLINE_VISIBILITY explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
+ _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;} \
+ };
#else // _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_ENUM_VIS x
-#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
+# define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_ENUM_VIS x
+# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
#endif // _LIBCPP_HAS_NO_STRONG_ENUMS
#ifdef _LIBCPP_DEBUG
-# if _LIBCPP_DEBUG == 0
-# define _LIBCPP_DEBUG_LEVEL 1
-# elif _LIBCPP_DEBUG == 1
-# define _LIBCPP_DEBUG_LEVEL 2
-# else
-# error Supported values for _LIBCPP_DEBUG are 0 and 1
-# endif
-# if !defined(_LIBCPP_BUILDING_LIBRARY)
-# define _LIBCPP_EXTERN_TEMPLATE(...)
-# endif
+# if _LIBCPP_DEBUG == 0
+# define _LIBCPP_DEBUG_LEVEL 1
+# elif _LIBCPP_DEBUG == 1
+# define _LIBCPP_DEBUG_LEVEL 2
+# else
+# error Supported values for _LIBCPP_DEBUG are 0 and 1
+# endif
+# if !defined(_LIBCPP_BUILDING_LIBRARY)
+# define _LIBCPP_EXTERN_TEMPLATE(...)
+# endif
#endif
#ifdef _LIBCPP_DISABLE_EXTERN_TEMPLATE
@@ -901,27 +960,34 @@ template <unsigned> struct __static_assert_check {};
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
// Most unix variants have catopen. These are the specific ones that don't.
-#if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION)
-#define _LIBCPP_HAS_CATOPEN 1
-#endif
+# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION)
+# define _LIBCPP_HAS_CATOPEN 1
+# endif
#endif
#ifdef __FreeBSD__
#define _DECLARE_C99_LDBL_MATH 1
#endif
+// If we are getting operator new from the MSVC CRT, then allocation overloads
+// for align_val_t were added in 19.12, aka VS 2017 version 15.3.
+#if defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912
+#define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+#endif
+
#if defined(__APPLE__)
-# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \
- defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
-# define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
-# endif
-# if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
-# if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060
-# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
-# endif
-# endif
+# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \
+ defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+# define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+# endif
+# if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+# if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+# endif
+# endif
#endif // defined(__APPLE__)
+
#if defined(__APPLE__) || defined(__FreeBSD__)
#define _LIBCPP_HAS_DEFAULTRUNELOCALE
#endif
@@ -930,59 +996,48 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_WCTYPE_IS_MASK
#endif
-#ifndef _LIBCPP_STD_VER
-# if __cplusplus <= 201103L
-# define _LIBCPP_STD_VER 11
-# elif __cplusplus <= 201402L
-# define _LIBCPP_STD_VER 14
-# elif __cplusplus <= 201703L
-# define _LIBCPP_STD_VER 17
-# else
-# define _LIBCPP_STD_VER 18 // current year, or date of c++2a ratification
-# endif
-#endif // _LIBCPP_STD_VER
-
#if _LIBCPP_STD_VER > 11
-#define _LIBCPP_DEPRECATED [[deprecated]]
+# define _LIBCPP_DEPRECATED [[deprecated]]
#else
-#define _LIBCPP_DEPRECATED
+# define _LIBCPP_DEPRECATED
#endif
#if _LIBCPP_STD_VER <= 11
-#define _LIBCPP_EXPLICIT_AFTER_CXX11
-#define _LIBCPP_DEPRECATED_AFTER_CXX11
+# define _LIBCPP_EXPLICIT_AFTER_CXX11
+# define _LIBCPP_DEPRECATED_AFTER_CXX11
#else
-#define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
-#define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]]
+# define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
+# define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]]
#endif
#if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
-#define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
+# define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
#else
-#define _LIBCPP_CONSTEXPR_AFTER_CXX11
+# define _LIBCPP_CONSTEXPR_AFTER_CXX11
#endif
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
-#define _LIBCPP_CONSTEXPR_AFTER_CXX14 constexpr
+# define _LIBCPP_CONSTEXPR_AFTER_CXX14 constexpr
#else
-#define _LIBCPP_CONSTEXPR_AFTER_CXX14
+# define _LIBCPP_CONSTEXPR_AFTER_CXX14
#endif
#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
-#define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr
+# define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr
#else
-#define _LIBCPP_CONSTEXPR_AFTER_CXX17
+# define _LIBCPP_CONSTEXPR_AFTER_CXX17
#endif
#if __has_cpp_attribute(nodiscard) && _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17)
-#define _LIBCPP_NODISCARD_AFTER_CXX17 [[nodiscard]]
+# define _LIBCPP_NODISCARD_AFTER_CXX17 [[nodiscard]]
#else
-#define _LIBCPP_NODISCARD_AFTER_CXX17
+# define _LIBCPP_NODISCARD_AFTER_CXX17
#endif
-// FIXME: Remove all usages of this macro once compilers catch up.
-#if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606L)
-# define _LIBCPP_HAS_NO_INLINE_VARIABLES
+#if _LIBCPP_STD_VER > 14 && defined(__cpp_inline_variables) && (__cpp_inline_variables >= 201606L)
+# define _LIBCPP_INLINE_VAR inline
+#else
+# define _LIBCPP_INLINE_VAR
#endif
#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -991,6 +1046,14 @@ template <unsigned> struct __static_assert_check {};
# define _LIBCPP_EXPLICIT_MOVE(x) (x)
#endif
+#ifndef _LIBCPP_CONSTEXPR_IF_NODEBUG
+#if defined(_LIBCPP_DEBUG) || defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
+#define _LIBCPP_CONSTEXPR_IF_NODEBUG
+#else
+#define _LIBCPP_CONSTEXPR_IF_NODEBUG constexpr
+#endif
+#endif
+
#ifndef _LIBCPP_HAS_NO_ASAN
_LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
const void *, const void *, const void *, const void *);
@@ -1000,8 +1063,10 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
// g++ and cl.exe have RTTI on by default and define a macro when it is.
// g++ only defines the macro in 4.3.2 and onwards.
#if !defined(_LIBCPP_NO_RTTI)
-# if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \
- (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI)
+# if defined(__GNUC__) && \
+ ((__GNUC__ >= 5) || \
+ (__GNUC__ == 4 && (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && \
+ !defined(__GXX_RTTI)
# define _LIBCPP_NO_RTTI
# elif defined(_LIBCPP_COMPILER_MSVC) && !defined(_CPPRTTI)
# define _LIBCPP_NO_RTTI
@@ -1009,7 +1074,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
#endif
#ifndef _LIBCPP_WEAK
-# define _LIBCPP_WEAK __attribute__((__weak__))
+#define _LIBCPP_WEAK __attribute__((__weak__))
#endif
// Thread API
@@ -1017,35 +1082,35 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
!defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && \
!defined(_LIBCPP_HAS_THREAD_API_WIN32) && \
!defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
-# if defined(__FreeBSD__) || \
- defined(__Fuchsia__) || \
- defined(__NetBSD__) || \
- defined(__linux__) || \
- defined(__APPLE__) || \
- defined(__CloudABI__) || \
- defined(__sun__) || \
- (defined(__MINGW32__) && __libcpp_has_include(<pthread.h>))
-# define _LIBCPP_HAS_THREAD_API_PTHREAD
-# elif defined(_LIBCPP_WIN32API)
-# define _LIBCPP_HAS_THREAD_API_WIN32
-# else
-# error "No thread API"
-# endif // _LIBCPP_HAS_THREAD_API
+# if defined(__FreeBSD__) || \
+ defined(__Fuchsia__) || \
+ defined(__NetBSD__) || \
+ defined(__linux__) || \
+ defined(__APPLE__) || \
+ defined(__CloudABI__) || \
+ defined(__sun__) || \
+ (defined(__MINGW32__) && __has_include(<pthread.h>))
+# define _LIBCPP_HAS_THREAD_API_PTHREAD
+# elif defined(_LIBCPP_WIN32API)
+# define _LIBCPP_HAS_THREAD_API_WIN32
+# 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.
+#error _LIBCPP_HAS_THREAD_API_PTHREAD may only be defined when \
+ _LIBCPP_HAS_NO_THREADS is not defined.
#endif
#if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
-# error _LIBCPP_HAS_THREAD_API_EXTERNAL may not be defined when \
- _LIBCPP_HAS_NO_THREADS is defined.
+#error _LIBCPP_HAS_THREAD_API_EXTERNAL may not be defined when \
+ _LIBCPP_HAS_NO_THREADS is 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.
+#error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \
+ _LIBCPP_HAS_NO_THREADS is defined.
#endif
// Systems that use capability-based security (FreeBSD with Capsicum,
@@ -1075,9 +1140,9 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
#endif
#if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic)
-#define _LIBCPP_HAS_C_ATOMIC_IMP
+# define _LIBCPP_HAS_C_ATOMIC_IMP
#elif _GNUC_VER > 407
-#define _LIBCPP_HAS_GCC_ATOMIC_IMP
+# define _LIBCPP_HAS_GCC_ATOMIC_IMP
#endif
#if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \
@@ -1090,139 +1155,144 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
#endif
#if defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS)
-#if defined(__clang__) && __has_attribute(acquire_capability)
+# if defined(__clang__) && __has_attribute(acquire_capability)
// Work around the attribute handling in clang. When both __declspec and
// __attribute__ are present, the processing goes awry preventing the definition
// of the types.
-#if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
-#define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
-#endif
-#endif
+# if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
+# define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
+# endif
+# endif
#endif
#if __has_attribute(require_constant_initialization)
-#define _LIBCPP_SAFE_STATIC __attribute__((__require_constant_initialization__))
+# define _LIBCPP_SAFE_STATIC __attribute__((__require_constant_initialization__))
#else
-#define _LIBCPP_SAFE_STATIC
+# define _LIBCPP_SAFE_STATIC
#endif
#if !__has_builtin(__builtin_addressof) && _GNUC_VER < 700
-# define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+#define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
#endif
#if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
-#if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION)
-#define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
-#endif
+# if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION)
+# define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
+# endif
#endif
#if __has_attribute(diagnose_if) && !defined(_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS)
-# define _LIBCPP_DIAGNOSE_WARNING(...) \
- __attribute__((diagnose_if(__VA_ARGS__, "warning")))
-# define _LIBCPP_DIAGNOSE_ERROR(...) \
- __attribute__((diagnose_if(__VA_ARGS__, "error")))
+# define _LIBCPP_DIAGNOSE_WARNING(...) \
+ __attribute__((diagnose_if(__VA_ARGS__, "warning")))
+# define _LIBCPP_DIAGNOSE_ERROR(...) \
+ __attribute__((diagnose_if(__VA_ARGS__, "error")))
#else
-# define _LIBCPP_DIAGNOSE_WARNING(...)
-# define _LIBCPP_DIAGNOSE_ERROR(...)
+# define _LIBCPP_DIAGNOSE_WARNING(...)
+# define _LIBCPP_DIAGNOSE_ERROR(...)
#endif
#if __has_attribute(fallthough) || _GNUC_VER >= 700
// Use a function like macro to imply that it must be followed by a semicolon
-#define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__))
+# define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__))
#else
-#define _LIBCPP_FALLTHROUGH() ((void)0)
+# define _LIBCPP_FALLTHROUGH() ((void)0)
#endif
#if defined(_LIBCPP_ABI_MICROSOFT) && \
- (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
-# define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
+ (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
+# define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
#else
-# define _LIBCPP_DECLSPEC_EMPTY_BASES
+# define _LIBCPP_DECLSPEC_EMPTY_BASES
#endif
#if defined(_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES)
-# define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
-# define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
-# define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
-# define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS
+#define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
+#define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
+#define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
+#define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS
#endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
#if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611
-# define _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#define _LIBCPP_HAS_NO_DEDUCTION_GUIDES
#endif
#if !__has_keyword(__is_aggregate) && (_GNUC_VER_NEW < 7001)
-# define _LIBCPP_HAS_NO_IS_AGGREGATE
+#define _LIBCPP_HAS_NO_IS_AGGREGATE
#endif
#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
-# define _LIBCPP_HAS_NO_COROUTINES
+#define _LIBCPP_HAS_NO_COROUTINES
#endif
+// FIXME: Correct this macro when either (A) a feature test macro for the
+// spaceship operator is provided, or (B) a compiler provides a complete
+// implementation.
+#define _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
+
// Decide whether to use availability macros.
#if !defined(_LIBCPP_BUILDING_LIBRARY) && \
!defined(_LIBCPP_DISABLE_AVAILABILITY) && \
__has_feature(attribute_availability_with_strict) && \
__has_feature(attribute_availability_in_templates)
-#ifdef __APPLE__
-#define _LIBCPP_USE_AVAILABILITY_APPLE
-#endif
+# ifdef __APPLE__
+# define _LIBCPP_USE_AVAILABILITY_APPLE
+# endif
#endif
// Define availability macros.
#if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
-#define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
- __attribute__((availability(macosx,strict,introduced=10.12))) \
- __attribute__((availability(ios,strict,introduced=10.0))) \
- __attribute__((availability(tvos,strict,introduced=10.0))) \
- __attribute__((availability(watchos,strict,introduced=3.0)))
-#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
-#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable))
-#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST __attribute__((unavailable))
-#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
- __attribute__((availability(macosx,strict,introduced=10.12))) \
- __attribute__((availability(ios,strict,introduced=10.0))) \
- __attribute__((availability(tvos,strict,introduced=10.0))) \
- __attribute__((availability(watchos,strict,introduced=3.0)))
-#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \
- __attribute__((availability(macosx,strict,introduced=10.12))) \
- __attribute__((availability(ios,strict,introduced=10.0))) \
- __attribute__((availability(tvos,strict,introduced=10.0))) \
- __attribute__((availability(watchos,strict,introduced=3.0)))
-#define _LIBCPP_AVAILABILITY_FUTURE_ERROR \
- __attribute__((availability(ios,strict,introduced=6.0)))
-#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \
- __attribute__((availability(macosx,strict,introduced=10.9))) \
- __attribute__((availability(ios,strict,introduced=7.0)))
-#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \
- __attribute__((availability(macosx,strict,introduced=10.9))) \
- __attribute__((availability(ios,strict,introduced=7.0)))
-#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
- __attribute__((availability(macosx,strict,introduced=10.9))) \
- __attribute__((availability(ios,strict,introduced=7.0)))
+# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
+ __attribute__((availability(macosx,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
+# define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable))
+# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST __attribute__((unavailable))
+# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
+ __attribute__((availability(macosx,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \
+ __attribute__((availability(macosx,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+# define _LIBCPP_AVAILABILITY_FUTURE_ERROR \
+ __attribute__((availability(ios,strict,introduced=6.0)))
+# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \
+ __attribute__((availability(macosx,strict,introduced=10.9))) \
+ __attribute__((availability(ios,strict,introduced=7.0)))
+# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \
+ __attribute__((availability(macosx,strict,introduced=10.9))) \
+ __attribute__((availability(ios,strict,introduced=7.0)))
+# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
+ __attribute__((availability(macosx,strict,introduced=10.9))) \
+ __attribute__((availability(ios,strict,introduced=7.0)))
#else
-#define _LIBCPP_AVAILABILITY_SHARED_MUTEX
-#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
-#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
-#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
-#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
-#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
-#define _LIBCPP_AVAILABILITY_FUTURE_ERROR
-#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
-#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
-#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+# define _LIBCPP_AVAILABILITY_SHARED_MUTEX
+# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+# define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
+# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
+# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
+# define _LIBCPP_AVAILABILITY_FUTURE_ERROR
+# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
+# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
+# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
#endif
// Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
#ifdef _LIBCPP_NO_EXCEPTIONS
-#define _LIBCPP_AVAILABILITY_DYNARRAY
-#define _LIBCPP_AVAILABILITY_FUTURE
-#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
+# define _LIBCPP_AVAILABILITY_DYNARRAY
+# define _LIBCPP_AVAILABILITY_FUTURE
+# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
#else
-#define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
-#define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
-#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST \
- _LIBCPP_AVAILABILITY_BAD_ANY_CAST
+# define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+# define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
+# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST \
+ _LIBCPP_AVAILABILITY_BAD_ANY_CAST
#endif
// Availability of stream API in the dylib got dropped and re-added. The
@@ -1242,38 +1312,40 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
#endif
#if defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO)
-# define _LIBCPP_PUSH_MACROS
-# define _LIBCPP_POP_MACROS
+# define _LIBCPP_PUSH_MACROS
+# define _LIBCPP_POP_MACROS
#else
// Don't warn about macro conflicts when we can restore them at the
// end of the header.
-# ifndef _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS
-# define _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS
-# endif
-# if defined(_LIBCPP_COMPILER_MSVC)
-# define _LIBCPP_PUSH_MACROS \
- __pragma(push_macro("min")) \
- __pragma(push_macro("max"))
-# define _LIBCPP_POP_MACROS \
- __pragma(pop_macro("min")) \
- __pragma(pop_macro("max"))
-# else
-# define _LIBCPP_PUSH_MACROS \
- _Pragma("push_macro(\"min\")") \
- _Pragma("push_macro(\"max\")")
-# define _LIBCPP_POP_MACROS \
- _Pragma("pop_macro(\"min\")") \
- _Pragma("pop_macro(\"max\")")
-# endif
+# ifndef _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS
+# define _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS
+# endif
+# if defined(_LIBCPP_COMPILER_MSVC)
+# define _LIBCPP_PUSH_MACROS \
+ __pragma(push_macro("min")) \
+ __pragma(push_macro("max"))
+# define _LIBCPP_POP_MACROS \
+ __pragma(pop_macro("min")) \
+ __pragma(pop_macro("max"))
+# else
+# define _LIBCPP_PUSH_MACROS \
+ _Pragma("push_macro(\"min\")") \
+ _Pragma("push_macro(\"max\")")
+# define _LIBCPP_POP_MACROS \
+ _Pragma("pop_macro(\"min\")") \
+ _Pragma("pop_macro(\"max\")")
+# endif
#endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO)
-#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
-# if defined(_DLL)
-# pragma(lib, "c++.lib")
-# else
-# pragma(lib, "libc++.lib")
-# endif
-#endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
+#ifndef _LIBCPP_NO_AUTO_LINK
+# if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
+# if defined(_DLL)
+# pragma comment(lib, "c++.lib")
+# else
+# pragma comment(lib, "libc++.lib")
+# endif
+# endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
+#endif // _LIBCPP_NO_AUTO_LINK
#endif // __cplusplus
diff --git a/include/__config_site.in b/include/__config_site.in
index 86418a3e17b1..8d980ff57cc8 100644
--- a/include/__config_site.in
+++ b/include/__config_site.in
@@ -23,6 +23,7 @@
#cmakedefine _LIBCPP_HAS_MUSL_LIBC
#cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD
#cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL
+#cmakedefine _LIBCPP_HAS_THREAD_API_WIN32
#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL
#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
#cmakedefine _LIBCPP_NO_VCRUNTIME
diff --git a/include/__errc b/include/__errc
new file mode 100644
index 000000000000..d0f00b7f0be0
--- /dev/null
+++ b/include/__errc
@@ -0,0 +1,218 @@
+// -*- C++ -*-
+//===---------------------------- __errc ----------------------------------===//
+//
+// 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___ERRC
+#define _LIBCPP___ERRC
+
+/*
+ system_error synopsis
+
+namespace std
+{
+
+enum class errc
+{
+ address_family_not_supported, // EAFNOSUPPORT
+ address_in_use, // EADDRINUSE
+ address_not_available, // EADDRNOTAVAIL
+ already_connected, // EISCONN
+ argument_list_too_long, // E2BIG
+ argument_out_of_domain, // EDOM
+ bad_address, // EFAULT
+ bad_file_descriptor, // EBADF
+ bad_message, // EBADMSG
+ broken_pipe, // EPIPE
+ connection_aborted, // ECONNABORTED
+ connection_already_in_progress, // EALREADY
+ connection_refused, // ECONNREFUSED
+ connection_reset, // ECONNRESET
+ cross_device_link, // EXDEV
+ destination_address_required, // EDESTADDRREQ
+ device_or_resource_busy, // EBUSY
+ directory_not_empty, // ENOTEMPTY
+ executable_format_error, // ENOEXEC
+ file_exists, // EEXIST
+ file_too_large, // EFBIG
+ filename_too_long, // ENAMETOOLONG
+ function_not_supported, // ENOSYS
+ host_unreachable, // EHOSTUNREACH
+ identifier_removed, // EIDRM
+ illegal_byte_sequence, // EILSEQ
+ inappropriate_io_control_operation, // ENOTTY
+ interrupted, // EINTR
+ invalid_argument, // EINVAL
+ invalid_seek, // ESPIPE
+ io_error, // EIO
+ is_a_directory, // EISDIR
+ message_size, // EMSGSIZE
+ network_down, // ENETDOWN
+ network_reset, // ENETRESET
+ network_unreachable, // ENETUNREACH
+ no_buffer_space, // ENOBUFS
+ no_child_process, // ECHILD
+ no_link, // ENOLINK
+ no_lock_available, // ENOLCK
+ no_message_available, // ENODATA
+ no_message, // ENOMSG
+ no_protocol_option, // ENOPROTOOPT
+ no_space_on_device, // ENOSPC
+ no_stream_resources, // ENOSR
+ no_such_device_or_address, // ENXIO
+ no_such_device, // ENODEV
+ no_such_file_or_directory, // ENOENT
+ no_such_process, // ESRCH
+ not_a_directory, // ENOTDIR
+ not_a_socket, // ENOTSOCK
+ not_a_stream, // ENOSTR
+ not_connected, // ENOTCONN
+ not_enough_memory, // ENOMEM
+ not_supported, // ENOTSUP
+ operation_canceled, // ECANCELED
+ operation_in_progress, // EINPROGRESS
+ operation_not_permitted, // EPERM
+ operation_not_supported, // EOPNOTSUPP
+ operation_would_block, // EWOULDBLOCK
+ owner_dead, // EOWNERDEAD
+ permission_denied, // EACCES
+ protocol_error, // EPROTO
+ protocol_not_supported, // EPROTONOSUPPORT
+ read_only_file_system, // EROFS
+ resource_deadlock_would_occur, // EDEADLK
+ resource_unavailable_try_again, // EAGAIN
+ result_out_of_range, // ERANGE
+ state_not_recoverable, // ENOTRECOVERABLE
+ stream_timeout, // ETIME
+ text_file_busy, // ETXTBSY
+ timed_out, // ETIMEDOUT
+ too_many_files_open_in_system, // ENFILE
+ too_many_files_open, // EMFILE
+ too_many_links, // EMLINK
+ too_many_symbolic_link_levels, // ELOOP
+ value_too_large, // EOVERFLOW
+ wrong_protocol_type // EPROTOTYPE
+};
+
+*/
+
+#include <__config>
+#include <cerrno>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// Some error codes are not present on all platforms, so we provide equivalents
+// for them:
+
+//enum class errc
+_LIBCPP_DECLARE_STRONG_ENUM(errc)
+{
+ address_family_not_supported = EAFNOSUPPORT,
+ address_in_use = EADDRINUSE,
+ address_not_available = EADDRNOTAVAIL,
+ already_connected = EISCONN,
+ argument_list_too_long = E2BIG,
+ argument_out_of_domain = EDOM,
+ bad_address = EFAULT,
+ bad_file_descriptor = EBADF,
+ bad_message = EBADMSG,
+ broken_pipe = EPIPE,
+ connection_aborted = ECONNABORTED,
+ connection_already_in_progress = EALREADY,
+ connection_refused = ECONNREFUSED,
+ connection_reset = ECONNRESET,
+ cross_device_link = EXDEV,
+ destination_address_required = EDESTADDRREQ,
+ device_or_resource_busy = EBUSY,
+ directory_not_empty = ENOTEMPTY,
+ executable_format_error = ENOEXEC,
+ file_exists = EEXIST,
+ file_too_large = EFBIG,
+ filename_too_long = ENAMETOOLONG,
+ function_not_supported = ENOSYS,
+ host_unreachable = EHOSTUNREACH,
+ identifier_removed = EIDRM,
+ illegal_byte_sequence = EILSEQ,
+ inappropriate_io_control_operation = ENOTTY,
+ interrupted = EINTR,
+ invalid_argument = EINVAL,
+ invalid_seek = ESPIPE,
+ io_error = EIO,
+ is_a_directory = EISDIR,
+ message_size = EMSGSIZE,
+ network_down = ENETDOWN,
+ network_reset = ENETRESET,
+ network_unreachable = ENETUNREACH,
+ no_buffer_space = ENOBUFS,
+ no_child_process = ECHILD,
+ no_link = ENOLINK,
+ no_lock_available = ENOLCK,
+#ifdef ENODATA
+ no_message_available = ENODATA,
+#else
+ no_message_available = ENOMSG,
+#endif
+ no_message = ENOMSG,
+ no_protocol_option = ENOPROTOOPT,
+ no_space_on_device = ENOSPC,
+#ifdef ENOSR
+ no_stream_resources = ENOSR,
+#else
+ no_stream_resources = ENOMEM,
+#endif
+ no_such_device_or_address = ENXIO,
+ no_such_device = ENODEV,
+ no_such_file_or_directory = ENOENT,
+ no_such_process = ESRCH,
+ not_a_directory = ENOTDIR,
+ not_a_socket = ENOTSOCK,
+#ifdef ENOSTR
+ not_a_stream = ENOSTR,
+#else
+ not_a_stream = EINVAL,
+#endif
+ not_connected = ENOTCONN,
+ not_enough_memory = ENOMEM,
+ not_supported = ENOTSUP,
+ operation_canceled = ECANCELED,
+ operation_in_progress = EINPROGRESS,
+ operation_not_permitted = EPERM,
+ operation_not_supported = EOPNOTSUPP,
+ operation_would_block = EWOULDBLOCK,
+ owner_dead = EOWNERDEAD,
+ permission_denied = EACCES,
+ protocol_error = EPROTO,
+ protocol_not_supported = EPROTONOSUPPORT,
+ read_only_file_system = EROFS,
+ resource_deadlock_would_occur = EDEADLK,
+ resource_unavailable_try_again = EAGAIN,
+ result_out_of_range = ERANGE,
+ state_not_recoverable = ENOTRECOVERABLE,
+#ifdef ETIME
+ stream_timeout = ETIME,
+#else
+ stream_timeout = ETIMEDOUT,
+#endif
+ text_file_busy = ETXTBSY,
+ timed_out = ETIMEDOUT,
+ too_many_files_open_in_system = ENFILE,
+ too_many_files_open = EMFILE,
+ too_many_links = EMLINK,
+ too_many_symbolic_link_levels = ELOOP,
+ value_too_large = EOVERFLOW,
+ wrong_protocol_type = EPROTOTYPE
+};
+_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___ERRC
diff --git a/include/__functional_03 b/include/__functional_03
index 13d8a3d96009..0a3bfbaa3d2c 100644
--- a/include/__functional_03
+++ b/include/__functional_03
@@ -600,7 +600,10 @@ template<class _Rp>
function<_Rp()>&
function<_Rp()>::operator=(const function& __f)
{
- function(__f).swap(*this);
+ if (__f)
+ function(__f).swap(*this);
+ else
+ *this = nullptr;
return *this;
}
@@ -608,11 +611,12 @@ template<class _Rp>
function<_Rp()>&
function<_Rp()>::operator=(nullptr_t)
{
- if (__f_ == (__base*)&__buf_)
- __f_->destroy();
- else if (__f_)
- __f_->destroy_deallocate();
+ __base* __t = __f_;
__f_ = 0;
+ if (__t == (__base*)&__buf_)
+ __t->destroy();
+ else if (__t)
+ __t->destroy_deallocate();
return *this;
}
@@ -876,7 +880,10 @@ template<class _Rp, class _A0>
function<_Rp(_A0)>&
function<_Rp(_A0)>::operator=(const function& __f)
{
- function(__f).swap(*this);
+ if (__f)
+ function(__f).swap(*this);
+ else
+ *this = nullptr;
return *this;
}
@@ -884,11 +891,12 @@ template<class _Rp, class _A0>
function<_Rp(_A0)>&
function<_Rp(_A0)>::operator=(nullptr_t)
{
- if (__f_ == (__base*)&__buf_)
- __f_->destroy();
- else if (__f_)
- __f_->destroy_deallocate();
+ __base* __t = __f_;
__f_ = 0;
+ if (__t == (__base*)&__buf_)
+ __t->destroy();
+ else if (__t)
+ __t->destroy_deallocate();
return *this;
}
@@ -1152,7 +1160,10 @@ template<class _Rp, class _A0, class _A1>
function<_Rp(_A0, _A1)>&
function<_Rp(_A0, _A1)>::operator=(const function& __f)
{
- function(__f).swap(*this);
+ if (__f)
+ function(__f).swap(*this);
+ else
+ *this = nullptr;
return *this;
}
@@ -1160,11 +1171,12 @@ template<class _Rp, class _A0, class _A1>
function<_Rp(_A0, _A1)>&
function<_Rp(_A0, _A1)>::operator=(nullptr_t)
{
- if (__f_ == (__base*)&__buf_)
- __f_->destroy();
- else if (__f_)
- __f_->destroy_deallocate();
+ __base* __t = __f_;
__f_ = 0;
+ if (__t == (__base*)&__buf_)
+ __t->destroy();
+ else if (__t)
+ __t->destroy_deallocate();
return *this;
}
@@ -1428,7 +1440,10 @@ template<class _Rp, class _A0, class _A1, class _A2>
function<_Rp(_A0, _A1, _A2)>&
function<_Rp(_A0, _A1, _A2)>::operator=(const function& __f)
{
- function(__f).swap(*this);
+ if (__f)
+ function(__f).swap(*this);
+ else
+ *this = nullptr;
return *this;
}
@@ -1436,11 +1451,12 @@ template<class _Rp, class _A0, class _A1, class _A2>
function<_Rp(_A0, _A1, _A2)>&
function<_Rp(_A0, _A1, _A2)>::operator=(nullptr_t)
{
- if (__f_ == (__base*)&__buf_)
- __f_->destroy();
- else if (__f_)
- __f_->destroy_deallocate();
+ __base* __t = __f_;
__f_ = 0;
+ if (__t == (__base*)&__buf_)
+ __t->destroy();
+ else if (__t)
+ __t->destroy_deallocate();
return *this;
}
diff --git a/include/__functional_base b/include/__functional_base
index 79017fe759b4..1a90bd6280f6 100644
--- a/include/__functional_base
+++ b/include/__functional_base
@@ -564,7 +564,7 @@ struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { };
#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MEMORY)
extern const allocator_arg_t allocator_arg;
#else
-constexpr allocator_arg_t allocator_arg = allocator_arg_t();
+/* _LIBCPP_INLINE_VAR */ constexpr allocator_arg_t allocator_arg = allocator_arg_t();
#endif
// uses_allocator
@@ -601,7 +601,7 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator
#if _LIBCPP_STD_VER > 14
template <class _Tp, class _Alloc>
-constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
+_LIBCPP_INLINE_VAR constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
#endif
#ifndef _LIBCPP_CXX03_LANG
@@ -646,16 +646,6 @@ void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, con
new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a);
}
-// FIXME: Theis should have a version which takes a non-const alloc.
-template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
-void __user_alloc_construct (_Tp *__storage, const _Allocator &__a, _Args &&... __args)
-{
- __user_alloc_construct_impl(
- __uses_alloc_ctor<_Tp, _Allocator>(),
- __storage, __a, _VSTD::forward<_Args>(__args)...
- );
-}
#endif // _LIBCPP_CXX03_LANG
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/__hash_table b/include/__hash_table
index 3f430af1283e..44ba268a0ec8 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -32,13 +32,8 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Key, class _Tp>
-union __hash_value_type;
-#else
template <class _Key, class _Tp>
struct __hash_value_type;
-#endif
template <class _Key, class _Cp, class _Hash,
bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value>
@@ -172,7 +167,7 @@ struct __hash_key_value_types {
}
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- static __container_value_type&& __move(__node_value_type& __v) {
+ static __container_value_type&& __move(__node_value_type& __v) {
return _VSTD::move(__v);
}
#endif
@@ -184,7 +179,6 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {
typedef _Tp mapped_type;
typedef __hash_value_type<_Key, _Tp> __node_value_type;
typedef pair<const _Key, _Tp> __container_value_type;
- typedef pair<_Key, _Tp> __nc_value_type;
typedef __container_value_type __map_value_type;
static const bool __is_map = true;
@@ -198,7 +192,7 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {
static typename enable_if<__is_same_uncvref<_Up, __node_value_type>::value,
__container_value_type const&>::type
__get_value(_Up& __t) {
- return __t.__cc;
+ return __t.__get_value();
}
template <class _Up>
@@ -211,12 +205,12 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {
_LIBCPP_INLINE_VISIBILITY
static __container_value_type* __get_ptr(__node_value_type& __n) {
- return _VSTD::addressof(__n.__cc);
+ return _VSTD::addressof(__n.__get_value());
}
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- static __nc_value_type&& __move(__node_value_type& __v) {
- return _VSTD::move(__v.__nc);
+ static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {
+ return __v.__move();
}
#endif
diff --git a/include/__libcpp_version b/include/__libcpp_version
index a77fd92cf17b..2bdc6533bec7 100644
--- a/include/__libcpp_version
+++ b/include/__libcpp_version
@@ -1 +1 @@
-6000
+7000
diff --git a/include/__locale b/include/__locale
index 601f0d1ec325..f43e7b4303d3 100644
--- a/include/__locale
+++ b/include/__locale
@@ -24,11 +24,7 @@
#elif defined(_AIX)
# include <support/ibm/xlocale.h>
#elif defined(__ANDROID__)
-// Android gained the locale aware functions in L (API level 21)
-# include <android/api-level.h>
-# if __ANDROID_API__ <= 20
-# include <support/android/locale_bionic.h>
-# endif
+# include <support/android/locale_bionic.h>
#elif defined(__sun__)
# include <xlocale.h>
# include <support/solaris/xlocale.h>
@@ -473,7 +469,7 @@ public:
static const mask alnum = alpha | digit;
static const mask graph = alnum | punct;
- _LIBCPP_ALWAYS_INLINE ctype_base() {}
+ _LIBCPP_INLINE_VISIBILITY ctype_base() {}
};
template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype;
@@ -486,77 +482,77 @@ class _LIBCPP_TYPE_VIS ctype<wchar_t>
public:
typedef wchar_t char_type;
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
explicit ctype(size_t __refs = 0)
: locale::facet(__refs) {}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
bool is(mask __m, char_type __c) const
{
return do_is(__m, __c);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const
{
return do_is(__low, __high, __vec);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* scan_is(mask __m, const char_type* __low, const char_type* __high) const
{
return do_scan_is(__m, __low, __high);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const
{
return do_scan_not(__m, __low, __high);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
char_type toupper(char_type __c) const
{
return do_toupper(__c);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* toupper(char_type* __low, const char_type* __high) const
{
return do_toupper(__low, __high);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
char_type tolower(char_type __c) const
{
return do_tolower(__c);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* tolower(char_type* __low, const char_type* __high) const
{
return do_tolower(__low, __high);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
char_type widen(char __c) const
{
return do_widen(__c);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char* widen(const char* __low, const char* __high, char_type* __to) const
{
return do_widen(__low, __high, __to);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
char narrow(char_type __c, char __dfault) const
{
return do_narrow(__c, __dfault);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const
{
return do_narrow(__low, __high, __dfault, __to);
@@ -591,13 +587,13 @@ public:
explicit ctype(const mask* __tab = 0, bool __del = false, size_t __refs = 0);
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
bool is(mask __m, char_type __c) const
{
return isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) !=0 : false;
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const
{
for (; __low != __high; ++__low, ++__vec)
@@ -605,7 +601,7 @@ public:
return __low;
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* scan_is (mask __m, const char_type* __low, const char_type* __high) const
{
for (; __low != __high; ++__low)
@@ -614,7 +610,7 @@ public:
return __low;
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const
{
for (; __low != __high; ++__low)
@@ -623,49 +619,49 @@ public:
return __low;
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
char_type toupper(char_type __c) const
{
return do_toupper(__c);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* toupper(char_type* __low, const char_type* __high) const
{
return do_toupper(__low, __high);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
char_type tolower(char_type __c) const
{
return do_tolower(__c);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char_type* tolower(char_type* __low, const char_type* __high) const
{
return do_tolower(__low, __high);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
char_type widen(char __c) const
{
return do_widen(__c);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char* widen(const char* __low, const char* __high, char_type* __to) const
{
return do_widen(__low, __high, __to);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
char narrow(char_type __c, char __dfault) const
{
return do_narrow(__c, __dfault);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
const char* narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const
{
return do_narrow(__low, __high, __dfault, __to);
@@ -678,7 +674,7 @@ public:
#else
static const size_t table_size = 256; // FIXME: Don't hardcode this.
#endif
- _LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;}
+ _LIBCPP_INLINE_VISIBILITY const mask* table() const _NOEXCEPT {return __tab_;}
static const mask* classic_table() _NOEXCEPT;
#if defined(__GLIBC__) || defined(__EMSCRIPTEN__)
static const int* __classic_upper_table() _NOEXCEPT;
@@ -858,7 +854,7 @@ tolower(_CharT __c, const locale& __loc)
class _LIBCPP_TYPE_VIS codecvt_base
{
public:
- _LIBCPP_ALWAYS_INLINE codecvt_base() {}
+ _LIBCPP_INLINE_VISIBILITY codecvt_base() {}
enum result {ok, partial, error, noconv};
};
@@ -878,11 +874,11 @@ public:
typedef char extern_type;
typedef mbstate_t state_type;
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
explicit codecvt(size_t __refs = 0)
: locale::facet(__refs) {}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
@@ -890,14 +886,14 @@ public:
return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result unshift(state_type& __st,
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
{
return do_unshift(__st, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result in(state_type& __st,
const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
@@ -905,25 +901,25 @@ public:
return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int encoding() const _NOEXCEPT
{
return do_encoding();
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
bool always_noconv() const _NOEXCEPT
{
return do_always_noconv();
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
{
return do_length(__st, __frm, __end, __mx);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int max_length() const _NOEXCEPT
{
return do_max_length();
@@ -932,7 +928,7 @@ public:
static locale::id id;
protected:
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
@@ -967,7 +963,7 @@ public:
explicit codecvt(size_t __refs = 0);
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
@@ -975,14 +971,14 @@ public:
return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result unshift(state_type& __st,
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
{
return do_unshift(__st, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result in(state_type& __st,
const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
@@ -990,25 +986,25 @@ public:
return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int encoding() const _NOEXCEPT
{
return do_encoding();
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
bool always_noconv() const _NOEXCEPT
{
return do_always_noconv();
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
{
return do_length(__st, __frm, __end, __mx);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int max_length() const _NOEXCEPT
{
return do_max_length();
@@ -1047,11 +1043,11 @@ public:
typedef char extern_type;
typedef mbstate_t state_type;
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
explicit codecvt(size_t __refs = 0)
: locale::facet(__refs) {}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
@@ -1059,14 +1055,14 @@ public:
return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result unshift(state_type& __st,
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
{
return do_unshift(__st, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result in(state_type& __st,
const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
@@ -1074,25 +1070,25 @@ public:
return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int encoding() const _NOEXCEPT
{
return do_encoding();
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
bool always_noconv() const _NOEXCEPT
{
return do_always_noconv();
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
{
return do_length(__st, __frm, __end, __mx);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int max_length() const _NOEXCEPT
{
return do_max_length();
@@ -1101,7 +1097,7 @@ public:
static locale::id id;
protected:
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
@@ -1133,11 +1129,11 @@ public:
typedef char extern_type;
typedef mbstate_t state_type;
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
explicit codecvt(size_t __refs = 0)
: locale::facet(__refs) {}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
@@ -1145,14 +1141,14 @@ public:
return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result unshift(state_type& __st,
extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
{
return do_unshift(__st, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
result in(state_type& __st,
const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
@@ -1160,25 +1156,25 @@ public:
return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int encoding() const _NOEXCEPT
{
return do_encoding();
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
bool always_noconv() const _NOEXCEPT
{
return do_always_noconv();
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
{
return do_length(__st, __frm, __end, __mx);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
int max_length() const _NOEXCEPT
{
return do_max_length();
@@ -1187,7 +1183,7 @@ public:
static locale::id id;
protected:
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
@@ -1214,10 +1210,10 @@ class _LIBCPP_TEMPLATE_VIS codecvt_byname
: public codecvt<_InternT, _ExternT, _StateT>
{
public:
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
explicit codecvt_byname(const char* __nm, size_t __refs = 0)
: codecvt<_InternT, _ExternT, _StateT>(__nm, __refs) {}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
explicit codecvt_byname(const string& __nm, size_t __refs = 0)
: codecvt<_InternT, _ExternT, _StateT>(__nm.c_str(), __refs) {}
protected:
@@ -1248,7 +1244,7 @@ template <>
struct __narrow_to_utf8<8>
{
template <class _OutputIterator, class _CharT>
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
_OutputIterator
operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const
{
@@ -1262,13 +1258,13 @@ template <>
struct __narrow_to_utf8<16>
: public codecvt<char16_t, char, mbstate_t>
{
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
__narrow_to_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
~__narrow_to_utf8();
template <class _OutputIterator, class _CharT>
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
_OutputIterator
operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const
{
@@ -1296,13 +1292,13 @@ template <>
struct __narrow_to_utf8<32>
: public codecvt<char32_t, char, mbstate_t>
{
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
__narrow_to_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
~__narrow_to_utf8();
template <class _OutputIterator, class _CharT>
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
_OutputIterator
operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const
{
@@ -1338,7 +1334,7 @@ template <>
struct __widen_from_utf8<8>
{
template <class _OutputIterator>
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
_OutputIterator
operator()(_OutputIterator __s, const char* __nb, const char* __ne) const
{
@@ -1352,13 +1348,13 @@ template <>
struct __widen_from_utf8<16>
: public codecvt<char16_t, char, mbstate_t>
{
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
__widen_from_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
~__widen_from_utf8();
template <class _OutputIterator>
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
_OutputIterator
operator()(_OutputIterator __s, const char* __nb, const char* __ne) const
{
@@ -1386,13 +1382,13 @@ template <>
struct __widen_from_utf8<32>
: public codecvt<char32_t, char, mbstate_t>
{
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
__widen_from_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
~__widen_from_utf8();
template <class _OutputIterator>
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
_OutputIterator
operator()(_OutputIterator __s, const char* __nb, const char* __ne) const
{
@@ -1430,11 +1426,11 @@ public:
explicit numpunct(size_t __refs = 0);
- _LIBCPP_ALWAYS_INLINE char_type decimal_point() const {return do_decimal_point();}
- _LIBCPP_ALWAYS_INLINE char_type thousands_sep() const {return do_thousands_sep();}
- _LIBCPP_ALWAYS_INLINE string grouping() const {return do_grouping();}
- _LIBCPP_ALWAYS_INLINE string_type truename() const {return do_truename();}
- _LIBCPP_ALWAYS_INLINE string_type falsename() const {return do_falsename();}
+ _LIBCPP_INLINE_VISIBILITY char_type decimal_point() const {return do_decimal_point();}
+ _LIBCPP_INLINE_VISIBILITY char_type thousands_sep() const {return do_thousands_sep();}
+ _LIBCPP_INLINE_VISIBILITY string grouping() const {return do_grouping();}
+ _LIBCPP_INLINE_VISIBILITY string_type truename() const {return do_truename();}
+ _LIBCPP_INLINE_VISIBILITY string_type falsename() const {return do_falsename();}
static locale::id id;
@@ -1461,11 +1457,11 @@ public:
explicit numpunct(size_t __refs = 0);
- _LIBCPP_ALWAYS_INLINE char_type decimal_point() const {return do_decimal_point();}
- _LIBCPP_ALWAYS_INLINE char_type thousands_sep() const {return do_thousands_sep();}
- _LIBCPP_ALWAYS_INLINE string grouping() const {return do_grouping();}
- _LIBCPP_ALWAYS_INLINE string_type truename() const {return do_truename();}
- _LIBCPP_ALWAYS_INLINE string_type falsename() const {return do_falsename();}
+ _LIBCPP_INLINE_VISIBILITY char_type decimal_point() const {return do_decimal_point();}
+ _LIBCPP_INLINE_VISIBILITY char_type thousands_sep() const {return do_thousands_sep();}
+ _LIBCPP_INLINE_VISIBILITY string grouping() const {return do_grouping();}
+ _LIBCPP_INLINE_VISIBILITY string_type truename() const {return do_truename();}
+ _LIBCPP_INLINE_VISIBILITY string_type falsename() const {return do_falsename();}
static locale::id id;
diff --git a/include/__mutex_base b/include/__mutex_base
index 3b2453f1ba1a..402a52d945e1 100644
--- a/include/__mutex_base
+++ b/include/__mutex_base
@@ -82,9 +82,9 @@ extern const adopt_lock_t adopt_lock;
#else
-constexpr defer_lock_t defer_lock = defer_lock_t();
-constexpr try_to_lock_t try_to_lock = try_to_lock_t();
-constexpr adopt_lock_t adopt_lock = adopt_lock_t();
+/* _LIBCPP_INLINE_VAR */ constexpr defer_lock_t defer_lock = defer_lock_t();
+/* _LIBCPP_INLINE_VAR */ constexpr try_to_lock_t try_to_lock = try_to_lock_t();
+/* _LIBCPP_INLINE_VAR */ constexpr adopt_lock_t adopt_lock = adopt_lock_t();
#endif
diff --git a/include/__nullptr b/include/__nullptr
index a341234f5d19..aa3b4d2145a5 100644
--- a/include/__nullptr
+++ b/include/__nullptr
@@ -27,24 +27,24 @@ struct _LIBCPP_TEMPLATE_VIS nullptr_t
struct __nat {int __for_bool_;};
- _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {}
- _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {}
- _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;}
template <class _Tp>
- _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
operator _Tp* () const {return 0;}
template <class _Tp, class _Up>
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
operator _Tp _Up::* () const {return 0;}
- friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;}
- friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;}
+ friend _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;}
+ friend _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;}
};
-inline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);}
#define nullptr _VSTD::__get_nullptr_t()
diff --git a/include/__sso_allocator b/include/__sso_allocator
index 8147e75ec2c8..40027363a185 100644
--- a/include/__sso_allocator
+++ b/include/__sso_allocator
@@ -55,14 +55,14 @@ public:
__allocated_ = true;
return (pointer)&buf_;
}
- return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp)));
+ return static_cast<pointer>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), __alignof(_Tp)));
}
_LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type)
{
if (__p == (pointer)&buf_)
__allocated_ = false;
else
- _VSTD::__libcpp_deallocate(__p);
+ _VSTD::__libcpp_deallocate(__p, __alignof(_Tp));
}
_LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}
diff --git a/include/__string b/include/__string
index d30c7fddc8d6..44c55987f9f7 100644
--- a/include/__string
+++ b/include/__string
@@ -266,7 +266,7 @@ const char*
char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
{
if (__n == 0)
- return NULL;
+ return nullptr;
#if __has_feature(cxx_constexpr_string_builtins)
return __builtin_char_memchr(__s, to_int_type(__a), __n);
#elif _LIBCPP_STD_VER <= 14
@@ -278,7 +278,7 @@ char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a)
return __s;
++__s;
}
- return NULL;
+ return nullptr;
#endif
}
@@ -372,9 +372,9 @@ const wchar_t*
char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
{
if (__n == 0)
- return NULL;
+ return nullptr;
#if __has_feature(cxx_constexpr_string_builtins)
- return __builtin_wmemchr(__s, __a, __n);
+ return __builtin_wmemchr(__s, __a, __n);
#elif _LIBCPP_STD_VER <= 14
return wmemchr(__s, __a, __n);
#else
@@ -384,7 +384,7 @@ char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __
return __s;
++__s;
}
- return NULL;
+ return nullptr;
#endif
}
diff --git a/include/__threading_support b/include/__threading_support
index 5d4c907966ee..3c1eff22f530 100644
--- a/include/__threading_support
+++ b/include/__threading_support
@@ -26,18 +26,14 @@
#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
# include <pthread.h>
# include <sched.h>
-#elif defined(_LIBCPP_HAS_THREAD_API_WIN32)
-#include <windows.h>
-#include <process.h>
-#include <fibersapi.h>
#endif
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-
#if defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
- defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL)
+ defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) || \
+ defined(_LIBCPP_HAS_THREAD_API_WIN32)
#define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS
#else
#define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
@@ -80,31 +76,37 @@ typedef pthread_key_t __libcpp_tls_key;
#define _LIBCPP_TLS_DESTRUCTOR_CC
#else
// Mutex
-typedef SRWLOCK __libcpp_mutex_t;
-#define _LIBCPP_MUTEX_INITIALIZER SRWLOCK_INIT
+typedef void* __libcpp_mutex_t;
+#define _LIBCPP_MUTEX_INITIALIZER 0
-typedef CRITICAL_SECTION __libcpp_recursive_mutex_t;
+#if defined(_M_IX86) || defined(__i386__) || defined(_M_ARM) || defined(__arm__)
+typedef void* __libcpp_recursive_mutex_t[6];
+#elif defined(_M_AMD64) || defined(__x86_64__) || defined(_M_ARM64) || defined(__aarch64__)
+typedef void* __libcpp_recursive_mutex_t[5];
+#else
+# error Unsupported architecture
+#endif
// Condition Variable
-typedef CONDITION_VARIABLE __libcpp_condvar_t;
-#define _LIBCPP_CONDVAR_INITIALIZER CONDITION_VARIABLE_INIT
+typedef void* __libcpp_condvar_t;
+#define _LIBCPP_CONDVAR_INITIALIZER 0
// Execute Once
-typedef INIT_ONCE __libcpp_exec_once_flag;
-#define _LIBCPP_EXEC_ONCE_INITIALIZER INIT_ONCE_STATIC_INIT
+typedef void* __libcpp_exec_once_flag;
+#define _LIBCPP_EXEC_ONCE_INITIALIZER 0
// Thread ID
-typedef DWORD __libcpp_thread_id;
+typedef long __libcpp_thread_id;
// Thread
#define _LIBCPP_NULL_THREAD 0U
-typedef HANDLE __libcpp_thread_t;
+typedef void* __libcpp_thread_t;
// Thread Local Storage
-typedef DWORD __libcpp_tls_key;
+typedef long __libcpp_tls_key;
-#define _LIBCPP_TLS_DESTRUCTOR_CC WINAPI
+#define _LIBCPP_TLS_DESTRUCTOR_CC __stdcall
#endif
// Mutex
@@ -201,10 +203,9 @@ void *__libcpp_tls_get(__libcpp_tls_key __key);
_LIBCPP_THREAD_ABI_VISIBILITY
int __libcpp_tls_set(__libcpp_tls_key __key, void *__p);
-#if !defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
- defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL)
-
-#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+#if (!defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
+ defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL)) && \
+ defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
{
@@ -390,244 +391,6 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p)
return pthread_setspecific(__key, __p);
}
-#elif defined(_LIBCPP_HAS_THREAD_API_WIN32)
-
-// Mutex
-int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
-{
- InitializeCriticalSection(__m);
- return 0;
-}
-
-int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m)
-{
- EnterCriticalSection(__m);
- return 0;
-}
-
-bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m)
-{
- return TryEnterCriticalSection(__m) != 0;
-}
-
-int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m)
-{
- LeaveCriticalSection(__m);
- return 0;
-}
-
-int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m)
-{
- DeleteCriticalSection(__m);
- return 0;
-}
-
-int __libcpp_mutex_lock(__libcpp_mutex_t *__m)
-{
- AcquireSRWLockExclusive(__m);
- return 0;
-}
-
-bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m)
-{
- return TryAcquireSRWLockExclusive(__m) != 0;
-}
-
-int __libcpp_mutex_unlock(__libcpp_mutex_t *__m)
-{
- ReleaseSRWLockExclusive(__m);
- return 0;
-}
-
-int __libcpp_mutex_destroy(__libcpp_mutex_t *__m)
-{
- static_cast<void>(__m);
- return 0;
-}
-
-// Condition Variable
-int __libcpp_condvar_signal(__libcpp_condvar_t *__cv)
-{
- WakeConditionVariable(__cv);
- return 0;
-}
-
-int __libcpp_condvar_broadcast(__libcpp_condvar_t *__cv)
-{
- WakeAllConditionVariable(__cv);
- return 0;
-}
-
-int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m)
-{
- SleepConditionVariableSRW(__cv, __m, INFINITE, 0);
- return 0;
-}
-
-int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,
- timespec *__ts)
-{
- using namespace _VSTD::chrono;
-
- auto duration = seconds(__ts->tv_sec) + nanoseconds(__ts->tv_nsec);
- auto abstime =
- system_clock::time_point(duration_cast<system_clock::duration>(duration));
- auto timeout_ms = duration_cast<milliseconds>(abstime - system_clock::now());
-
- if (!SleepConditionVariableSRW(__cv, __m,
- timeout_ms.count() > 0 ? timeout_ms.count()
- : 0,
- 0))
- {
- auto __ec = GetLastError();
- return __ec == ERROR_TIMEOUT ? ETIMEDOUT : __ec;
- }
- return 0;
-}
-
-int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv)
-{
- static_cast<void>(__cv);
- return 0;
-}
-
-// Execute Once
-static inline _LIBCPP_ALWAYS_INLINE BOOL CALLBACK
-__libcpp_init_once_execute_once_thunk(PINIT_ONCE __init_once, PVOID __parameter,
- PVOID *__context)
-{
- static_cast<void>(__init_once);
- static_cast<void>(__context);
-
- void (*init_routine)(void) = reinterpret_cast<void (*)(void)>(__parameter);
- init_routine();
- return TRUE;
-}
-
-int __libcpp_execute_once(__libcpp_exec_once_flag *__flag,
- void (*__init_routine)(void))
-{
- if (!InitOnceExecuteOnce(__flag, __libcpp_init_once_execute_once_thunk,
- reinterpret_cast<void *>(__init_routine), NULL))
- return GetLastError();
- return 0;
-}
-
-// Thread ID
-bool __libcpp_thread_id_equal(__libcpp_thread_id __lhs,
- __libcpp_thread_id __rhs)
-{
- return __lhs == __rhs;
-}
-
-bool __libcpp_thread_id_less(__libcpp_thread_id __lhs, __libcpp_thread_id __rhs)
-{
- return __lhs < __rhs;
-}
-
-// Thread
-struct __libcpp_beginthreadex_thunk_data
-{
- void *(*__func)(void *);
- void *__arg;
-};
-
-static inline _LIBCPP_ALWAYS_INLINE unsigned WINAPI
-__libcpp_beginthreadex_thunk(void *__raw_data)
-{
- auto *__data =
- static_cast<__libcpp_beginthreadex_thunk_data *>(__raw_data);
- auto *__func = __data->__func;
- void *__arg = __data->__arg;
- delete __data;
- return static_cast<unsigned>(reinterpret_cast<uintptr_t>(__func(__arg)));
-}
-
-bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
- return *__t == 0;
-}
-
-int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
- void *__arg)
-{
- auto *__data = new __libcpp_beginthreadex_thunk_data;
- __data->__func = __func;
- __data->__arg = __arg;
-
- *__t = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, 0,
- __libcpp_beginthreadex_thunk,
- __data, 0, nullptr));
-
- if (*__t)
- return 0;
- return GetLastError();
-}
-
-__libcpp_thread_id __libcpp_thread_get_current_id()
-{
- return GetCurrentThreadId();
-}
-
-__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
-{
- return GetThreadId(*__t);
-}
-
-int __libcpp_thread_join(__libcpp_thread_t *__t)
-{
- if (WaitForSingleObjectEx(*__t, INFINITE, FALSE) == WAIT_FAILED)
- return GetLastError();
- if (!CloseHandle(*__t))
- return GetLastError();
- return 0;
-}
-
-int __libcpp_thread_detach(__libcpp_thread_t *__t)
-{
- if (!CloseHandle(*__t))
- return GetLastError();
- return 0;
-}
-
-void __libcpp_thread_yield()
-{
- SwitchToThread();
-}
-
-void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns)
-{
- using namespace chrono;
- // round-up to the nearest milisecond
- milliseconds __ms =
- duration_cast<milliseconds>(__ns + chrono::nanoseconds(999999));
- // FIXME(compnerd) this should be an alertable sleep (WFSO or SleepEx)
- Sleep(__ms.count());
-}
-
-// Thread Local Storage
-int __libcpp_tls_create(__libcpp_tls_key* __key,
- void(_LIBCPP_TLS_DESTRUCTOR_CC* __at_exit)(void*))
-{
- *__key = FlsAlloc(__at_exit);
- if (*__key == FLS_OUT_OF_INDEXES)
- return GetLastError();
- return 0;
-}
-
-void *__libcpp_tls_get(__libcpp_tls_key __key)
-{
- return FlsGetValue(__key);
-}
-
-int __libcpp_tls_set(__libcpp_tls_key __key, void *__p)
-{
- if (!FlsSetValue(__key, __p))
- return GetLastError();
- return 0;
-}
-
-#endif // _LIBCPP_HAS_THREAD_API_PTHREAD
-
#endif // !_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL || _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/__tree b/include/__tree
index 3ccfcb700310..30c32f163935 100644
--- a/include/__tree
+++ b/include/__tree
@@ -37,13 +37,8 @@ template <class _Pointer> class __tree_end_node;
template <class _VoidPtr> class __tree_node_base;
template <class _Tp, class _VoidPtr> class __tree_node;
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Key, class _Value>
-union __value_type;
-#else
template <class _Key, class _Value>
struct __value_type;
-#endif
template <class _Key, class _CP, class _Compare,
bool = is_empty<_Compare>::value && !__libcpp_is_final<_Compare>::value>
@@ -569,10 +564,9 @@ struct __tree_key_value_types {
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) {
+ static __container_value_type&& __move(__node_value_type& __v) {
return _VSTD::move(__v);
}
#endif
@@ -584,14 +578,13 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > {
typedef _Tp mapped_type;
typedef __value_type<_Key, _Tp> __node_value_type;
typedef pair<const _Key, _Tp> __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;
+ return __t.__get_value().first;
}
template <class _Up>
@@ -605,7 +598,7 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > {
_LIBCPP_INLINE_VISIBILITY
static __container_value_type const&
__get_value(__node_value_type const& __t) {
- return __t.__cc;
+ return __t.__get_value();
}
template <class _Up>
@@ -618,13 +611,13 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > {
_LIBCPP_INLINE_VISIBILITY
static __container_value_type* __get_ptr(__node_value_type& __n) {
- return _VSTD::addressof(__n.__cc);
+ return _VSTD::addressof(__n.__get_value());
}
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- static __nc_value_type&& __move(__node_value_type& __v) {
- return _VSTD::move(__v.__nc);
+ static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {
+ return __v.__move();
}
#endif
};
diff --git a/include/algorithm b/include/algorithm
index 35c6129ea508..90f1d246c63d 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -20,149 +20,150 @@ namespace std
{
template <class InputIterator, class Predicate>
- bool
+ constexpr bool // constexpr in C++20
all_of(InputIterator first, InputIterator last, Predicate pred);
template <class InputIterator, class Predicate>
- bool
+ constexpr bool // constexpr in C++20
any_of(InputIterator first, InputIterator last, Predicate pred);
template <class InputIterator, class Predicate>
- bool
+ constexpr bool // constexpr in C++20
none_of(InputIterator first, InputIterator last, Predicate pred);
template <class InputIterator, class Function>
- Function
+ constexpr Function // constexpr in C++20
for_each(InputIterator first, InputIterator last, Function f);
template<class InputIterator, class Size, class Function>
- InputIterator for_each_n(InputIterator first, Size n, Function f); // C++17
+ constexpr InputIterator // constexpr in C++20
+ for_each_n(InputIterator first, Size n, Function f); // C++17
template <class InputIterator, class T>
- InputIterator
+ constexpr InputIterator // constexpr in C++20
find(InputIterator first, InputIterator last, const T& value);
template <class InputIterator, class Predicate>
- InputIterator
+ constexpr InputIterator // constexpr in C++20
find_if(InputIterator first, InputIterator last, Predicate pred);
template<class InputIterator, class Predicate>
- InputIterator
+ InputIterator // constexpr in C++20
find_if_not(InputIterator first, InputIterator last, Predicate pred);
template <class ForwardIterator1, class ForwardIterator2>
- ForwardIterator1
+ ForwardIterator1 // constexpr in C++20
find_end(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2);
template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
- ForwardIterator1
+ ForwardIterator1 // constexpr in C++20
find_end(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);
template <class ForwardIterator1, class ForwardIterator2>
- ForwardIterator1
+ constexpr ForwardIterator1 // constexpr in C++20
find_first_of(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2);
template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
- ForwardIterator1
+ constexpr ForwardIterator1 // constexpr in C++20
find_first_of(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);
template <class ForwardIterator>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
adjacent_find(ForwardIterator first, ForwardIterator last);
template <class ForwardIterator, class BinaryPredicate>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred);
template <class InputIterator, class T>
- typename iterator_traits<InputIterator>::difference_type
+ constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20
count(InputIterator first, InputIterator last, const T& value);
template <class InputIterator, class Predicate>
- typename iterator_traits<InputIterator>::difference_type
+ constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20
count_if(InputIterator first, InputIterator last, Predicate pred);
template <class InputIterator1, class InputIterator2>
- pair<InputIterator1, InputIterator2>
+ constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20
mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2);
template <class InputIterator1, class InputIterator2>
- pair<InputIterator1, InputIterator2>
+ constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20
mismatch(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2); // **C++14**
template <class InputIterator1, class InputIterator2, class BinaryPredicate>
- pair<InputIterator1, InputIterator2>
+ constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20
mismatch(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, BinaryPredicate pred);
template <class InputIterator1, class InputIterator2, class BinaryPredicate>
- pair<InputIterator1, InputIterator2>
+ constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20
mismatch(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
BinaryPredicate pred); // **C++14**
template <class InputIterator1, class InputIterator2>
- bool
+ constexpr bool // constexpr in C++20
equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2);
template <class InputIterator1, class InputIterator2>
- bool
+ constexpr bool // constexpr in C++20
equal(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2); // **C++14**
template <class InputIterator1, class InputIterator2, class BinaryPredicate>
- bool
+ constexpr bool // constexpr in C++20
equal(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, BinaryPredicate pred);
template <class InputIterator1, class InputIterator2, class BinaryPredicate>
- bool
+ constexpr bool // constexpr in C++20
equal(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
BinaryPredicate pred); // **C++14**
template<class ForwardIterator1, class ForwardIterator2>
- bool
+ constexpr bool // constexpr in C++20
is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2);
template<class ForwardIterator1, class ForwardIterator2>
- bool
+ constexpr bool // constexpr in C++20
is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2); // **C++14**
template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
- bool
+ constexpr bool // constexpr in C++20
is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, BinaryPredicate pred);
template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
- bool
+ constexpr bool // constexpr in C++20
is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2,
BinaryPredicate pred); // **C++14**
template <class ForwardIterator1, class ForwardIterator2>
- ForwardIterator1
+ constexpr ForwardIterator1 // constexpr in C++20
search(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2);
template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
- ForwardIterator1
+ constexpr ForwardIterator1 // constexpr in C++20
search(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);
template <class ForwardIterator, class Size, class T>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value);
template <class ForwardIterator, class Size, class T, class BinaryPredicate>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
search_n(ForwardIterator first, ForwardIterator last,
Size count, const T& value, BinaryPredicate pred);
@@ -193,61 +194,61 @@ template <class ForwardIterator1, class ForwardIterator2>
iter_swap(ForwardIterator1 a, ForwardIterator2 b);
template <class InputIterator, class OutputIterator, class UnaryOperation>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op);
template <class InputIterator1, class InputIterator2, class OutputIterator, class BinaryOperation>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,
OutputIterator result, BinaryOperation binary_op);
template <class ForwardIterator, class T>
- void
+ constexpr void // constexpr in C++20
replace(ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value);
template <class ForwardIterator, class Predicate, class T>
- void
+ constexpr void // constexpr in C++20
replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value);
template <class InputIterator, class OutputIterator, class T>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
replace_copy(InputIterator first, InputIterator last, OutputIterator result,
const T& old_value, const T& new_value);
template <class InputIterator, class OutputIterator, class Predicate, class T>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, const T& new_value);
template <class ForwardIterator, class T>
- void
+ constexpr void // constexpr in C++20
fill(ForwardIterator first, ForwardIterator last, const T& value);
template <class OutputIterator, class Size, class T>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
fill_n(OutputIterator first, Size n, const T& value);
template <class ForwardIterator, class Generator>
- void
+ constexpr void // constexpr in C++20
generate(ForwardIterator first, ForwardIterator last, Generator gen);
template <class OutputIterator, class Size, class Generator>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
generate_n(OutputIterator first, Size n, Generator gen);
template <class ForwardIterator, class T>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
remove(ForwardIterator first, ForwardIterator last, const T& value);
template <class ForwardIterator, class Predicate>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
remove_if(ForwardIterator first, ForwardIterator last, Predicate pred);
template <class InputIterator, class OutputIterator, class T>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value);
template <class InputIterator, class OutputIterator, class Predicate>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred);
template <class ForwardIterator>
@@ -271,7 +272,7 @@ template <class BidirectionalIterator>
reverse(BidirectionalIterator first, BidirectionalIterator last);
template <class BidirectionalIterator, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result);
template <class ForwardIterator>
@@ -302,7 +303,7 @@ template<class RandomAccessIterator, class UniformRandomNumberGenerator>
UniformRandomNumberGenerator&& g);
template <class InputIterator, class Predicate>
- bool
+ constexpr bool // constexpr in C++20
is_partitioned(InputIterator first, InputIterator last, Predicate pred);
template <class ForwardIterator, class Predicate>
@@ -311,7 +312,7 @@ template <class ForwardIterator, class Predicate>
template <class InputIterator, class OutputIterator1,
class OutputIterator2, class Predicate>
- pair<OutputIterator1, OutputIterator2>
+ constexpr pair<OutputIterator1, OutputIterator2> // constexpr in C++20
partition_copy(InputIterator first, InputIterator last,
OutputIterator1 out_true, OutputIterator2 out_false,
Predicate pred);
@@ -321,11 +322,11 @@ template <class ForwardIterator, class Predicate>
stable_partition(ForwardIterator first, ForwardIterator last, Predicate pred);
template<class ForwardIterator, class Predicate>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
partition_point(ForwardIterator first, ForwardIterator last, Predicate pred);
template <class ForwardIterator>
- bool
+ constexpr bool // constexpr in C++20
is_sorted(ForwardIterator first, ForwardIterator last);
template <class ForwardIterator, class Compare>
@@ -333,11 +334,11 @@ template <class ForwardIterator, class Compare>
is_sorted(ForwardIterator first, ForwardIterator last, Compare comp);
template<class ForwardIterator>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
is_sorted_until(ForwardIterator first, ForwardIterator last);
template <class ForwardIterator, class Compare>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp);
template <class RandomAccessIterator>
@@ -383,35 +384,35 @@ template <class RandomAccessIterator, class Compare>
nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp);
template <class ForwardIterator, class T>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
lower_bound(ForwardIterator first, ForwardIterator last, const T& value);
template <class ForwardIterator, class T, class Compare>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);
template <class ForwardIterator, class T>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
upper_bound(ForwardIterator first, ForwardIterator last, const T& value);
template <class ForwardIterator, class T, class Compare>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);
template <class ForwardIterator, class T>
- pair<ForwardIterator, ForwardIterator>
+ constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20
equal_range(ForwardIterator first, ForwardIterator last, const T& value);
template <class ForwardIterator, class T, class Compare>
- pair<ForwardIterator, ForwardIterator>
+ constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20
equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);
template <class ForwardIterator, class T>
- bool
+ constexpr bool // constexpr in C++20
binary_search(ForwardIterator first, ForwardIterator last, const T& value);
template <class ForwardIterator, class T, class Compare>
- bool
+ constexpr bool // constexpr in C++20
binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);
template <class InputIterator1, class InputIterator2, class OutputIterator>
@@ -433,11 +434,11 @@ template <class BidirectionalIterator, class Compare>
inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp);
template <class InputIterator1, class InputIterator2>
- bool
+ constexpr bool // constexpr in C++20
includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2);
template <class InputIterator1, class InputIterator2, class Compare>
- bool
+ constexpr bool // constexpr in C++20
includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp);
template <class InputIterator1, class InputIterator2, class OutputIterator>
@@ -451,12 +452,12 @@ template <class InputIterator1, class InputIterator2, class OutputIterator, clas
InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
template <class InputIterator1, class InputIterator2, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
set_intersection(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, OutputIterator result);
template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
set_intersection(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
@@ -513,19 +514,19 @@ template <class RandomAccessIterator, class Compare>
sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp);
template <class RandomAccessIterator>
- bool
+ constexpr bool // constexpr in C++20
is_heap(RandomAccessIterator first, RandomAccessiterator last);
template <class RandomAccessIterator, class Compare>
- bool
+ constexpr bool // constexpr in C++20
is_heap(RandomAccessIterator first, RandomAccessiterator last, Compare comp);
template <class RandomAccessIterator>
- RandomAccessIterator
+ constexpr RandomAccessIterator // constexpr in C++20
is_heap_until(RandomAccessIterator first, RandomAccessiterator last);
template <class RandomAccessIterator, class Compare>
- RandomAccessIterator
+ constexpr RandomAccessIterator // constexpr in C++20
is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp);
template <class ForwardIterator>
@@ -607,11 +608,11 @@ template<class T, class Compare>
minmax(initializer_list<T> t, Compare comp); // constexpr in C++14
template <class InputIterator1, class InputIterator2>
- bool
+ constexpr bool // constexpr in C++20
lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2);
template <class InputIterator1, class InputIterator2, class Compare>
- bool
+ constexpr bool // constexpr in C++20
lexicographical_compare(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2, Compare comp);
@@ -641,6 +642,7 @@ template <class BidirectionalIterator, class Compare>
#include <cstring>
#include <utility> // needed to provide swap_ranges.
#include <memory>
+#include <functional>
#include <iterator>
#include <cstddef>
@@ -669,10 +671,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _T1, class _T2 = _T1>
struct __equal_to
{
- _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
- _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}
- _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}
- _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}
};
template <class _T1>
@@ -918,7 +920,7 @@ inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long long __x) {
// all_of
template <class _InputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
@@ -931,7 +933,7 @@ all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
// any_of
template <class _InputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
@@ -944,7 +946,7 @@ any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
// none_of
template <class _InputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
@@ -957,7 +959,7 @@ none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
// for_each
template <class _InputIterator, class _Function>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_Function
for_each(_InputIterator __first, _InputIterator __last, _Function __f)
{
@@ -970,7 +972,7 @@ for_each(_InputIterator __first, _InputIterator __last, _Function __f)
// for_each_n
template <class _InputIterator, class _Size, class _Function>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_InputIterator
for_each_n(_InputIterator __first, _Size __orig_n, _Function __f)
{
@@ -989,7 +991,7 @@ for_each_n(_InputIterator __first, _Size __orig_n, _Function __f)
// find
template <class _InputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_InputIterator
find(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
{
@@ -1002,7 +1004,7 @@ find(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
// find_if
template <class _InputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_InputIterator
find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
@@ -1015,7 +1017,7 @@ find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
// find_if_not
template<class _InputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_InputIterator
find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
@@ -1028,7 +1030,7 @@ find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred)
// find_end
template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
-_ForwardIterator1
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1
__find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,
forward_iterator_tag, forward_iterator_tag)
@@ -1070,7 +1072,7 @@ __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
}
template <class _BinaryPredicate, class _BidirectionalIterator1, class _BidirectionalIterator2>
-_BidirectionalIterator1
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator1
__find_end(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1,
_BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, _BinaryPredicate __pred,
bidirectional_iterator_tag, bidirectional_iterator_tag)
@@ -1150,7 +1152,7 @@ __find_end(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
}
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator1
find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
@@ -1162,7 +1164,7 @@ find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
}
template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator1
find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2)
@@ -1188,7 +1190,7 @@ __find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator1
find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
@@ -1197,7 +1199,7 @@ find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
}
template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator1
find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2)
@@ -1210,7 +1212,7 @@ find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
// adjacent_find
template <class _ForwardIterator, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
{
@@ -1228,7 +1230,7 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicat
}
template <class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
{
@@ -1239,7 +1241,7 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
// count
template <class _InputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
typename iterator_traits<_InputIterator>::difference_type
count(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
{
@@ -1253,7 +1255,7 @@ count(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
// count_if
template <class _InputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
typename iterator_traits<_InputIterator>::difference_type
count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
@@ -1267,7 +1269,7 @@ count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
// mismatch
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
pair<_InputIterator1, _InputIterator2>
mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _BinaryPredicate __pred)
@@ -1279,7 +1281,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
}
template <class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
pair<_InputIterator1, _InputIterator2>
mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2)
{
@@ -1290,7 +1292,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi
#if _LIBCPP_STD_VER > 11
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
pair<_InputIterator1, _InputIterator2>
mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2,
@@ -1303,7 +1305,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
}
template <class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
pair<_InputIterator1, _InputIterator2>
mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2)
@@ -1317,7 +1319,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
// equal
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred)
{
@@ -1328,7 +1330,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first
}
template <class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2)
{
@@ -1339,7 +1341,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first
#if _LIBCPP_STD_VER > 11
template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
__equal(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred,
@@ -1352,7 +1354,7 @@ __equal(_InputIterator1 __first1, _InputIterator1 __last1,
}
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
_RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
@@ -1366,7 +1368,7 @@ __equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
}
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
equal(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred )
@@ -1378,7 +1380,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1,
}
template <class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
equal(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2)
@@ -1394,17 +1396,18 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1,
// is_permutation
template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-bool
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _BinaryPredicate __pred)
{
- // shorten sequences as much as possible by lopping of any equal parts
+// shorten sequences as much as possible by lopping of any equal prefix
for (; __first1 != __last1; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2))
- goto __not_done;
- return true;
-__not_done:
- // __first1 != __last1 && *__first1 != *__first2
+ break;
+ if (__first1 == __last1)
+ return true;
+
+// __first1 != __last1 && *__first1 != *__first2
typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1;
_D1 __l1 = _VSTD::distance(__first1, __last1);
if (__l1 == _D1(1))
@@ -1414,11 +1417,12 @@ __not_done:
// equal elements in [f2, l2)
for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i)
{
- // Have we already counted the number of *__i in [f1, l1)?
- for (_ForwardIterator1 __j = __first1; __j != __i; ++__j)
- if (__pred(*__j, *__i))
- goto __next_iter;
- {
+ // Have we already counted the number of *__i in [f1, l1)?
+ _ForwardIterator1 __match = __first1;
+ for (; __match != __i; ++__match)
+ if (__pred(*__match, *__i))
+ break;
+ if (__match == __i) {
// Count number of *__i in [f2, l2)
_D1 __c2 = 0;
for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
@@ -1434,13 +1438,12 @@ __not_done:
if (__c1 != __c2)
return false;
}
-__next_iter:;
}
return true;
}
template<class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2)
@@ -1452,19 +1455,21 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
#if _LIBCPP_STD_VER > 11
template<class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
-bool
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
__is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2,
_BinaryPredicate __pred,
forward_iterator_tag, forward_iterator_tag )
{
- // shorten sequences as much as possible by lopping of any equal parts
+// shorten sequences as much as possible by lopping of any equal prefix
for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2))
- goto __not_done;
- return __first1 == __last1 && __first2 == __last2;
-__not_done:
- // __first1 != __last1 && __first2 != __last2 && *__first1 != *__first2
+ break;
+ if (__first1 == __last1)
+ return __first2 == __last2;
+ else if (__first2 == __last2)
+ return false;
+
typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1;
_D1 __l1 = _VSTD::distance(__first1, __last1);
@@ -1477,11 +1482,12 @@ __not_done:
// equal elements in [f2, l2)
for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i)
{
- // Have we already counted the number of *__i in [f1, l1)?
- for (_ForwardIterator1 __j = __first1; __j != __i; ++__j)
- if (__pred(*__j, *__i))
- goto __next_iter;
- {
+ // Have we already counted the number of *__i in [f1, l1)?
+ _ForwardIterator1 __match = __first1;
+ for (; __match != __i; ++__match)
+ if (__pred(*__match, *__i))
+ break;
+ if (__match == __i) {
// Count number of *__i in [f2, l2)
_D1 __c2 = 0;
for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
@@ -1497,13 +1503,12 @@ __not_done:
if (__c1 != __c2)
return false;
}
-__next_iter:;
}
return true;
}
template<class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-bool
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
__is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1,
_RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2,
_BinaryPredicate __pred,
@@ -1517,7 +1522,7 @@ __is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1
}
template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2,
@@ -1530,7 +1535,7 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
}
template<class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2)
@@ -1545,91 +1550,10 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
#endif
// search
-
-template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
-pair<_ForwardIterator1, _ForwardIterator1>
-__search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,
- forward_iterator_tag, forward_iterator_tag)
-{
- if (__first2 == __last2)
- return make_pair(__first1, __first1); // Everything matches an empty sequence
- while (true)
- {
- // Find first element in sequence 1 that matchs *__first2, with a mininum of loop checks
- while (true)
- {
- if (__first1 == __last1) // return __last1 if no element matches *__first2
- return make_pair(__last1, __last1);
- if (__pred(*__first1, *__first2))
- break;
- ++__first1;
- }
- // *__first1 matches *__first2, now match elements after here
- _ForwardIterator1 __m1 = __first1;
- _ForwardIterator2 __m2 = __first2;
- while (true)
- {
- if (++__m2 == __last2) // If pattern exhausted, __first1 is the answer (works for 1 element pattern)
- return make_pair(__first1, __m1);
- if (++__m1 == __last1) // Otherwise if source exhaused, pattern not found
- return make_pair(__last1, __last1);
- if (!__pred(*__m1, *__m2)) // if there is a mismatch, restart with a new __first1
- {
- ++__first1;
- break;
- } // else there is a match, check next elements
- }
- }
-}
-
-template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX11
-pair<_RandomAccessIterator1, _RandomAccessIterator1>
-__search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
- random_access_iterator_tag, random_access_iterator_tag)
-{
- typedef typename iterator_traits<_RandomAccessIterator1>::difference_type _D1;
- typedef typename iterator_traits<_RandomAccessIterator2>::difference_type _D2;
- // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern
- const _D2 __len2 = __last2 - __first2;
- if (__len2 == 0)
- return make_pair(__first1, __first1);
- const _D1 __len1 = __last1 - __first1;
- if (__len1 < __len2)
- return make_pair(__last1, __last1);
- const _RandomAccessIterator1 __s = __last1 - (__len2 - 1); // Start of pattern match can't go beyond here
-
- while (true)
- {
- while (true)
- {
- if (__first1 == __s)
- return make_pair(__last1, __last1);
- if (__pred(*__first1, *__first2))
- break;
- ++__first1;
- }
-
- _RandomAccessIterator1 __m1 = __first1;
- _RandomAccessIterator2 __m2 = __first2;
- while (true)
- {
- if (++__m2 == __last2)
- return make_pair(__first1, __first1 + __len2);
- ++__m1; // no need to check range on __m1 because __s guarantees we have enough source
- if (!__pred(*__m1, *__m2))
- {
- ++__first1;
- break;
- }
- }
- }
-}
+// __search is in <functional>
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator1
search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
@@ -1642,7 +1566,7 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
}
template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator1
search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2)
@@ -1652,10 +1576,18 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
return _VSTD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
}
+
+#if _LIBCPP_STD_VER > 14
+template <class _ForwardIterator, class _Searcher>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s)
+{ return __s(__f, __l).first; }
+#endif
+
// search_n
template <class _BinaryPredicate, class _ForwardIterator, class _Size, class _Tp>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
__search_n(_ForwardIterator __first, _ForwardIterator __last,
_Size __count, const _Tp& __value_, _BinaryPredicate __pred, forward_iterator_tag)
{
@@ -1692,7 +1624,7 @@ __search_n(_ForwardIterator __first, _ForwardIterator __last,
}
template <class _BinaryPredicate, class _RandomAccessIterator, class _Size, class _Tp>
-_RandomAccessIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
__search_n(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Size __count, const _Tp& __value_, _BinaryPredicate __pred, random_access_iterator_tag)
{
@@ -1732,7 +1664,7 @@ __search_n(_RandomAccessIterator __first, _RandomAccessIterator __last,
}
template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
search_n(_ForwardIterator __first, _ForwardIterator __last,
_Size __count, const _Tp& __value_, _BinaryPredicate __pred)
@@ -1743,7 +1675,7 @@ search_n(_ForwardIterator __first, _ForwardIterator __last,
}
template <class _ForwardIterator, class _Size, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_)
{
@@ -1776,7 +1708,7 @@ __unwrap_iter(move_iterator<_Tp*> __i)
#if _LIBCPP_DEBUG_LEVEL < 2
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
typename enable_if
<
is_trivially_copy_assignable<_Tp>::value,
@@ -1790,7 +1722,7 @@ __unwrap_iter(__wrap_iter<_Tp*> __i)
#else
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
typename enable_if
<
is_trivially_copy_assignable<_Tp>::value,
@@ -2023,7 +1955,7 @@ move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
// transform
template <class _InputIterator, class _OutputIterator, class _UnaryOperation>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op)
{
@@ -2033,7 +1965,7 @@ transform(_InputIterator __first, _InputIterator __last, _OutputIterator __resul
}
template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _BinaryOperation>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
_OutputIterator __result, _BinaryOperation __binary_op)
@@ -2046,7 +1978,7 @@ transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __f
// replace
template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
void
replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value)
{
@@ -2058,7 +1990,7 @@ replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_valu
// replace_if
template <class _ForwardIterator, class _Predicate, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
void
replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value)
{
@@ -2070,7 +2002,7 @@ replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
// replace_copy
template <class _InputIterator, class _OutputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
const _Tp& __old_value, const _Tp& __new_value)
@@ -2086,7 +2018,7 @@ replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __re
// replace_copy_if
template <class _InputIterator, class _OutputIterator, class _Predicate, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
_Predicate __pred, const _Tp& __new_value)
@@ -2102,7 +2034,7 @@ replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator _
// fill_n
template <class _OutputIterator, class _Size, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
{
@@ -2111,24 +2043,8 @@ __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
return __first;
}
-template <class _Tp, class _Size, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value && sizeof(_Tp) == 1 &&
- !is_same<_Tp, bool>::value &&
- is_integral<_Up>::value && sizeof(_Up) == 1,
- _Tp*
->::type
-__fill_n(_Tp* __first, _Size __n,_Up __value_)
-{
- if (__n > 0)
- _VSTD::memset(__first, (unsigned char)__value_, (size_t)(__n));
- return __first + __n;
-}
-
template <class _OutputIterator, class _Size, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
{
@@ -2138,7 +2054,7 @@ fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
// fill
template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
void
__fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag)
{
@@ -2147,7 +2063,7 @@ __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, f
}
template <class _RandomAccessIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
void
__fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value_, random_access_iterator_tag)
{
@@ -2155,7 +2071,7 @@ __fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& _
}
template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
void
fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
{
@@ -2165,7 +2081,7 @@ fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
// generate
template <class _ForwardIterator, class _Generator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
void
generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen)
{
@@ -2176,7 +2092,7 @@ generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen)
// generate_n
template <class _OutputIterator, class _Size, class _Generator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen)
{
@@ -2190,7 +2106,7 @@ generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen)
// remove
template <class _ForwardIterator, class _Tp>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
{
__first = _VSTD::find(__first, __last, __value_);
@@ -2212,7 +2128,7 @@ remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
// remove_if
template <class _ForwardIterator, class _Predicate>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
{
__first = _VSTD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type>
@@ -2235,7 +2151,7 @@ remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
// remove_copy
template <class _InputIterator, class _OutputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value_)
{
@@ -2253,7 +2169,7 @@ remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res
// remove_copy_if
template <class _InputIterator, class _OutputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred)
{
@@ -2271,7 +2187,7 @@ remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __
// unique
template <class _ForwardIterator, class _BinaryPredicate>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
{
__first = _VSTD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type>
@@ -2290,7 +2206,7 @@ unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pre
}
template <class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
unique(_ForwardIterator __first, _ForwardIterator __last)
{
@@ -2301,7 +2217,7 @@ unique(_ForwardIterator __first, _ForwardIterator __last)
// unique_copy
template <class _BinaryPredicate, class _InputIterator, class _OutputIterator>
-_OutputIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
__unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred,
input_iterator_tag, output_iterator_tag)
{
@@ -2324,7 +2240,7 @@ __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __r
}
template <class _BinaryPredicate, class _ForwardIterator, class _OutputIterator>
-_OutputIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
__unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryPredicate __pred,
forward_iterator_tag, output_iterator_tag)
{
@@ -2347,7 +2263,7 @@ __unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator
}
template <class _BinaryPredicate, class _InputIterator, class _ForwardIterator>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
__unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __pred,
input_iterator_tag, forward_iterator_tag)
{
@@ -2363,7 +2279,7 @@ __unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __
}
template <class _InputIterator, class _OutputIterator, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred)
{
@@ -2374,7 +2290,7 @@ unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res
}
template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
@@ -2419,7 +2335,7 @@ reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
// reverse_copy
template <class _BidirectionalIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
{
@@ -3303,7 +3219,7 @@ template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>
}
template <class _InputIterator, class _Predicate>
-bool
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
for (; __first != __last; ++__first)
@@ -3381,7 +3297,7 @@ partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
template <class _InputIterator, class _OutputIterator1,
class _OutputIterator2, class _Predicate>
-pair<_OutputIterator1, _OutputIterator2>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2>
partition_copy(_InputIterator __first, _InputIterator __last,
_OutputIterator1 __out_true, _OutputIterator2 __out_false,
_Predicate __pred)
@@ -3405,7 +3321,7 @@ partition_copy(_InputIterator __first, _InputIterator __last,
// partition_point
template<class _ForwardIterator, class _Predicate>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
{
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
@@ -3711,7 +3627,7 @@ stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate _
// is_sorted_until
template <class _ForwardIterator, class _Compare>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
if (__first != __last)
@@ -3728,7 +3644,7 @@ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __co
}
template<class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
{
@@ -3738,7 +3654,7 @@ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
// is_sorted
template <class _ForwardIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
@@ -3746,7 +3662,7 @@ is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
}
template<class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
is_sorted(_ForwardIterator __first, _ForwardIterator __last)
{
@@ -4272,7 +4188,7 @@ _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS unsigned __sort5<__less<long double>&,
// lower_bound
template <class _Compare, class _ForwardIterator, class _Tp>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
__lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
{
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
@@ -4294,7 +4210,7 @@ __lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
}
template <class _ForwardIterator, class _Tp, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
{
@@ -4309,7 +4225,7 @@ lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
}
template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
{
@@ -4320,7 +4236,7 @@ lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
// upper_bound
template <class _Compare, class _ForwardIterator, class _Tp>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
__upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
{
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
@@ -4342,7 +4258,7 @@ __upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
}
template <class _ForwardIterator, class _Tp, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
{
@@ -4357,7 +4273,7 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
}
template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
{
@@ -4368,7 +4284,7 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
// equal_range
template <class _Compare, class _ForwardIterator, class _Tp>
-pair<_ForwardIterator, _ForwardIterator>
+_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator>
__equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
{
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
@@ -4402,7 +4318,7 @@ __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
}
template <class _ForwardIterator, class _Tp, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
pair<_ForwardIterator, _ForwardIterator>
equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
{
@@ -4417,7 +4333,7 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
}
template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
pair<_ForwardIterator, _ForwardIterator>
equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
{
@@ -4428,7 +4344,7 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
// binary_search
template <class _Compare, class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
__binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
{
@@ -4437,7 +4353,7 @@ __binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __
}
template <class _ForwardIterator, class _Tp, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
{
@@ -4452,7 +4368,7 @@ binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
}
template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
{
@@ -4787,9 +4703,9 @@ __stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1
::new(__first2) value_type(_VSTD::move(*__first1));
return;
case 2:
- __destruct_n __d(0);
+ __destruct_n __d(0);
unique_ptr<value_type, __destruct_n&> __h2(__first2, __d);
- if (__comp(*--__last1, *__first1))
+ if (__comp(*--__last1, *__first1))
{
::new(__first2) value_type(_VSTD::move(*__last1));
__d.__incr((value_type*)0);
@@ -4906,7 +4822,7 @@ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
// is_heap_until
template <class _RandomAccessIterator, class _Compare>
-_RandomAccessIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -4933,7 +4849,7 @@ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp
}
template<class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_RandomAccessIterator
is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
@@ -4943,7 +4859,7 @@ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
// is_heap
template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
@@ -4951,7 +4867,7 @@ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __
}
template<class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
@@ -5489,7 +5405,7 @@ nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomA
// includes
template <class _Compare, class _InputIterator1, class _InputIterator2>
-bool
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
__includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
_Compare __comp)
{
@@ -5504,7 +5420,7 @@ __includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __
}
template <class _InputIterator1, class _InputIterator2, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
_Compare __comp)
@@ -5520,7 +5436,7 @@ includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi
}
template <class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)
{
@@ -5586,7 +5502,7 @@ set_union(_InputIterator1 __first1, _InputIterator1 __last1,
// set_intersection
template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
-_OutputIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
__set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
{
@@ -5609,7 +5525,7 @@ __set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
}
template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
@@ -5625,7 +5541,7 @@ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
}
template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
@@ -5751,7 +5667,7 @@ set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
// lexicographical_compare
template <class _Compare, class _InputIterator1, class _InputIterator2>
-bool
+_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
__lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
{
@@ -5766,7 +5682,7 @@ __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
}
template <class _InputIterator1, class _InputIterator2, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
@@ -5782,7 +5698,7 @@ lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
}
template <class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2)
diff --git a/include/any b/include/any
index d7161b0d6f4c..9bd2f53c5601 100644
--- a/include/any
+++ b/include/any
@@ -104,7 +104,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER > 14
-_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_any_cast()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
@@ -304,7 +304,7 @@ private:
__any_imp::_Buffer __buf;
};
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
void * __call(_Action __a, any * __other = nullptr,
type_info const * __info = nullptr,
const void* __fallback_info = nullptr) const
@@ -312,7 +312,7 @@ private:
return __h(__a, this, __other, __info, __fallback_info);
}
- _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_INLINE_VISIBILITY
void * __call(_Action __a, any * __other = nullptr,
type_info const * __info = nullptr,
const void* __fallback_info = nullptr)
diff --git a/include/array b/include/array
index 4eb2fe6fc624..1e6a650198b5 100644
--- a/include/array
+++ b/include/array
@@ -72,6 +72,9 @@ struct array
const T* data() const noexcept;
};
+ template <class T, class... U>
+ array(T, U...) -> array<T, 1 + sizeof...(U)>;
+
template <class T, size_t N>
bool operator==(const array<T,N>& x, const array<T,N>& y);
template <class T, size_t N>
@@ -86,7 +89,7 @@ template <class T, size_t N>
bool operator>=(const array<T,N>& x, const array<T,N>& y);
template <class T, size_t N >
- void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y)));
+ void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); // C++17
template <class T> class tuple_size;
template <size_t I, class T> class tuple_element;
@@ -108,6 +111,8 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
#include <iterator>
#include <algorithm>
#include <stdexcept>
+#include <cstdlib> // for _LIBCPP_UNREACHABLE
+#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -117,6 +122,7 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
_LIBCPP_BEGIN_NAMESPACE_STD
+
template <class _Tp, size_t _Size>
struct _LIBCPP_TEMPLATE_VIS array
{
@@ -134,31 +140,27 @@ struct _LIBCPP_TEMPLATE_VIS array
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- value_type __elems_[_Size > 0 ? _Size : 1];
+ _Tp __elems_[_Size];
// No explicit construct/copy/destroy for aggregate type
- _LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u)
- {_VSTD::fill_n(__elems_, _Size, __u);}
- _LIBCPP_INLINE_VISIBILITY
- void swap(array& __a) _NOEXCEPT_(_Size == 0 || __is_nothrow_swappable<_Tp>::value)
- { __swap_dispatch((std::integral_constant<bool, _Size == 0>()), __a); }
-
- _LIBCPP_INLINE_VISIBILITY
- void __swap_dispatch(std::true_type, array&) {}
+ _LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u) {
+ _VSTD::fill_n(__elems_, _Size, __u);
+ }
_LIBCPP_INLINE_VISIBILITY
- void __swap_dispatch(std::false_type, array& __a)
- { _VSTD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
+ void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
+ std::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);
+ }
// iterators:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- iterator begin() _NOEXCEPT {return iterator(__elems_);}
+ iterator begin() _NOEXCEPT {return iterator(data());}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- const_iterator begin() const _NOEXCEPT {return const_iterator(__elems_);}
+ const_iterator begin() const _NOEXCEPT {return const_iterator(data());}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- iterator end() _NOEXCEPT {return iterator(__elems_ + _Size);}
+ iterator end() _NOEXCEPT {return iterator(data() + _Size);}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
- const_iterator end() const _NOEXCEPT {return const_iterator(__elems_ + _Size);}
+ const_iterator end() const _NOEXCEPT {return const_iterator(data() + _Size);}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
@@ -184,7 +186,7 @@ struct _LIBCPP_TEMPLATE_VIS array
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return _Size;}
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;}
+ _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return false; }
// element access:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
@@ -197,8 +199,8 @@ struct _LIBCPP_TEMPLATE_VIS array
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() {return __elems_[0];}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const {return __elems_[0];}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() {return __elems_[_Size > 0 ? _Size-1 : 0];}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const {return __elems_[_Size > 0 ? _Size-1 : 0];}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() {return __elems_[_Size - 1];}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const {return __elems_[_Size - 1];}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
value_type* data() _NOEXCEPT {return __elems_;}
@@ -206,6 +208,7 @@ struct _LIBCPP_TEMPLATE_VIS array
const value_type* data() const _NOEXCEPT {return __elems_;}
};
+
template <class _Tp, size_t _Size>
_LIBCPP_CONSTEXPR_AFTER_CXX14
typename array<_Tp, _Size>::reference
@@ -227,12 +230,147 @@ array<_Tp, _Size>::at(size_type __n) const
return __elems_[__n];
}
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
+{
+ // types:
+ typedef array __self;
+ typedef _Tp value_type;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef value_type* iterator;
+ typedef const value_type* const_iterator;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ typedef typename conditional<is_const<_Tp>::value, const char,
+ char>::type _CharType;
+
+ struct _ArrayInStructT { _Tp __data_[1]; };
+ _ALIGNAS_TYPE(_ArrayInStructT) _CharType __elems_[sizeof(_ArrayInStructT)];
+
+ // No explicit construct/copy/destroy for aggregate type
+ _LIBCPP_INLINE_VISIBILITY void fill(const value_type&) {
+ static_assert(!is_const<_Tp>::value,
+ "cannot fill zero-sized array of type 'const T'");
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(array&) _NOEXCEPT {
+ static_assert(!is_const<_Tp>::value,
+ "cannot swap zero-sized array of type 'const T'");
+ }
+
+ // iterators:
+ _LIBCPP_INLINE_VISIBILITY
+ iterator begin() _NOEXCEPT {return iterator(data());}
+ _LIBCPP_INLINE_VISIBILITY
+ const_iterator begin() const _NOEXCEPT {return const_iterator(data());}
+ _LIBCPP_INLINE_VISIBILITY
+ iterator end() _NOEXCEPT {return iterator(data());}
+ _LIBCPP_INLINE_VISIBILITY
+ const_iterator end() const _NOEXCEPT {return const_iterator(data());}
+
+ _LIBCPP_INLINE_VISIBILITY
+ reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator rbegin() const _NOEXCEPT {return const_reverse_iterator(end());}
+ _LIBCPP_INLINE_VISIBILITY
+ reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());}
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator rend() const _NOEXCEPT {return const_reverse_iterator(begin());}
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_iterator cbegin() const _NOEXCEPT {return begin();}
+ _LIBCPP_INLINE_VISIBILITY
+ const_iterator cend() const _NOEXCEPT {return end();}
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator crend() const _NOEXCEPT {return rend();}
+
+ // capacity:
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT {return 0; }
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return 0;}
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return true;}
+
+ // element access:
+ _LIBCPP_INLINE_VISIBILITY
+ reference operator[](size_type) {
+ _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
+ _LIBCPP_UNREACHABLE();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ const_reference operator[](size_type) const {
+ _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
+ _LIBCPP_UNREACHABLE();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ reference at(size_type) {
+ __throw_out_of_range("array<T, 0>::at");
+ _LIBCPP_UNREACHABLE();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reference at(size_type) const {
+ __throw_out_of_range("array<T, 0>::at");
+ _LIBCPP_UNREACHABLE();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ reference front() {
+ _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array");
+ _LIBCPP_UNREACHABLE();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reference front() const {
+ _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array");
+ _LIBCPP_UNREACHABLE();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ reference back() {
+ _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array");
+ _LIBCPP_UNREACHABLE();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reference back() const {
+ _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array");
+ _LIBCPP_UNREACHABLE();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ value_type* data() _NOEXCEPT {return reinterpret_cast<value_type*>(__elems_);}
+ _LIBCPP_INLINE_VISIBILITY
+ const value_type* data() const _NOEXCEPT {return reinterpret_cast<const value_type*>(__elems_);}
+};
+
+
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+template<class _Tp, class... _Args,
+ class = typename enable_if<(is_same_v<_Tp, _Args> && ...), void>::type
+ >
+array(_Tp, _Args...)
+ -> array<_Tp, 1 + sizeof...(_Args)>;
+#endif
+
template <class _Tp, size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator==(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
{
- return _VSTD::equal(__x.__elems_, __x.__elems_ + _Size, __y.__elems_);
+ return _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}
template <class _Tp, size_t _Size>
@@ -248,7 +386,8 @@ inline _LIBCPP_INLINE_VISIBILITY
bool
operator<(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
{
- return _VSTD::lexicographical_compare(__x.__elems_, __x.__elems_ + _Size, __y.__elems_, __y.__elems_ + _Size);
+ return _VSTD::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end());
}
template <class _Tp, size_t _Size>
diff --git a/include/atomic b/include/atomic
index f55e28ff5e92..809f78a06d36 100644
--- a/include/atomic
+++ b/include/atomic
@@ -555,6 +555,9 @@ void atomic_signal_fence(memory_order m) noexcept;
#if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
#error <atomic> is not implemented
#endif
+#ifdef kill_dependency
+#error C++ standard library is incompatible with <stdatomic.h>
+#endif
#if _LIBCPP_STD_VER > 14
# define __cpp_lib_atomic_is_always_lock_free 201603L
@@ -695,7 +698,7 @@ static inline void __c11_atomic_store(_Atomic(_Tp)* __a, _Tp __val,
}
template <typename _Tp>
-static inline _Tp __c11_atomic_load(volatile _Atomic(_Tp)* __a,
+static inline _Tp __c11_atomic_load(const volatile _Atomic(_Tp)* __a,
memory_order __order) {
_Tp __ret;
__atomic_load(&__a->__a_value, &__ret,
@@ -704,7 +707,7 @@ static inline _Tp __c11_atomic_load(volatile _Atomic(_Tp)* __a,
}
template <typename _Tp>
-static inline _Tp __c11_atomic_load(_Atomic(_Tp)* __a, memory_order __order) {
+static inline _Tp __c11_atomic_load(const _Atomic(_Tp)* __a, memory_order __order) {
_Tp __ret;
__atomic_load(&__a->__a_value, &__ret,
__gcc_atomic::__to_gcc_order(__order));
@@ -1741,7 +1744,7 @@ typedef struct atomic_flag
atomic_flag() _NOEXCEPT : __a_() {}
#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
#ifndef _LIBCPP_CXX03_LANG
diff --git a/include/chrono b/include/chrono
index c69e88ae4ded..f6a6f4b24343 100644
--- a/include/chrono
+++ b/include/chrono
@@ -26,7 +26,7 @@ duration_cast(const duration<Rep, Period>& fd);
template <class Rep> struct treat_as_floating_point : is_floating_point<Rep> {};
-template <class Rep> constexpr bool treat_as_floating_point_v
+template <class Rep> inline constexpr bool treat_as_floating_point_v
= treat_as_floating_point<Rep>::value; // C++17
template <class Rep>
@@ -147,6 +147,11 @@ template <class Clock, class Duration1, class Duration2>
namespace chrono {
+
+template<class T> struct is_clock; // C++20
+template<class T> inline constexpr bool is_clock_v = is_clock<T>::value; // C++20
+
+
// duration arithmetic
template <class Rep1, class Period1, class Rep2, class Period2>
constexpr
@@ -204,6 +209,8 @@ template <class ToDuration, class Rep, class Period>
template <class ToDuration, class Rep, class Period>
constexpr ToDuration round(const duration<Rep, Period>& d); // C++17
+// duration I/O is elsewhere
+
// time_point arithmetic (all constexpr in C++14)
template <class Clock, class Duration1, class Rep2, class Period2>
time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
@@ -251,6 +258,7 @@ template <class ToDuration, class Clock, class Duration>
template <class Rep, class Period>
constexpr duration<Rep, Period> abs(duration<Rep, Period> d); // C++17
+
// Clocks
class system_clock
@@ -267,6 +275,28 @@ public:
static time_point from_time_t(time_t __t) noexcept;
};
+template <class Duration>
+ using sys_time = time_point<system_clock, Duration>; // C++20
+using sys_seconds = sys_time<seconds>; // C++20
+using sys_days = sys_time<days>; // C++20
+
+class utc_clock; // C++20
+
+template <class Duration>
+ using utc_time = time_point<utc_clock, Duration>; // C++20
+using utc_seconds = utc_time<seconds>; // C++20
+
+class tai_clock; // C++20
+
+template <class Duration>
+ using tai_time = time_point<tai_clock, Duration>; // C++20
+using tai_seconds = tai_time<seconds>; // C++20
+
+class file_clock; // C++20
+
+template<class Duration>
+ using file_time = time_point<file_clock, Duration>; // C++20
+
class steady_clock
{
public:
@@ -281,8 +311,466 @@ public:
typedef steady_clock high_resolution_clock;
+// 25.7.8, local time // C++20
+struct local_t {};
+template<class Duration>
+ using local_time = time_point<local_t, Duration>;
+using local_seconds = local_time<seconds>;
+using local_days = local_time<days>;
+
+// 25.7.9, time_point conversions template<class DestClock, class SourceClock> // C++20
+struct clock_time_conversion;
+
+template<class DestClock, class SourceClock, class Duration>
+ auto clock_cast(const time_point<SourceClock, Duration>& t);
+
+// 25.8.2, class last_spec // C++20
+struct last_spec;
+
+// 25.8.3, class day // C++20
+
+class day;
+constexpr bool operator==(const day& x, const day& y) noexcept;
+constexpr bool operator!=(const day& x, const day& y) noexcept;
+constexpr bool operator< (const day& x, const day& y) noexcept;
+constexpr bool operator> (const day& x, const day& y) noexcept;
+constexpr bool operator<=(const day& x, const day& y) noexcept;
+constexpr bool operator>=(const day& x, const day& y) noexcept;
+constexpr day operator+(const day& x, const days& y) noexcept;
+constexpr day operator+(const days& x, const day& y) noexcept;
+constexpr day operator-(const day& x, const days& y) noexcept;
+constexpr days operator-(const day& x, const day& y) noexcept;
+
+// 25.8.4, class month // C++20
+class month;
+constexpr bool operator==(const month& x, const month& y) noexcept;
+constexpr bool operator!=(const month& x, const month& y) noexcept;
+constexpr bool operator< (const month& x, const month& y) noexcept;
+constexpr bool operator> (const month& x, const month& y) noexcept;
+constexpr bool operator<=(const month& x, const month& y) noexcept;
+constexpr bool operator>=(const month& x, const month& y) noexcept;
+constexpr month operator+(const month& x, const months& y) noexcept;
+constexpr month operator+(const months& x, const month& y) noexcept;
+constexpr month operator-(const month& x, const months& y) noexcept;
+constexpr months operator-(const month& x, const month& y) noexcept;
+
+// 25.8.5, class year // C++20
+class year;
+constexpr bool operator==(const year& x, const year& y) noexcept;
+constexpr bool operator!=(const year& x, const year& y) noexcept;
+constexpr bool operator< (const year& x, const year& y) noexcept;
+constexpr bool operator> (const year& x, const year& y) noexcept;
+constexpr bool operator<=(const year& x, const year& y) noexcept;
+constexpr bool operator>=(const year& x, const year& y) noexcept;
+constexpr year operator+(const year& x, const years& y) noexcept;
+constexpr year operator+(const years& x, const year& y) noexcept;
+constexpr year operator-(const year& x, const years& y) noexcept;
+constexpr years operator-(const year& x, const year& y) noexcept;
+
+// 25.8.6, class weekday // C++20
+class weekday;
+
+constexpr bool operator==(const weekday& x, const weekday& y) noexcept;
+constexpr bool operator!=(const weekday& x, const weekday& y) noexcept;
+constexpr weekday operator+(const weekday& x, const days& y) noexcept;
+constexpr weekday operator+(const days& x, const weekday& y) noexcept;
+constexpr weekday operator-(const weekday& x, const days& y) noexcept;
+constexpr days operator-(const weekday& x, const weekday& y) noexcept;
+
+// 25.8.7, class weekday_indexed // C++20
+
+class weekday_indexed;
+constexpr bool operator==(const weekday_indexed& x, const weekday_indexed& y) noexcept;
+constexpr bool operator!=(const weekday_indexed& x, const weekday_indexed& y) noexcept;
+
+// 25.8.8, class weekday_last // C++20
+class weekday_last;
+
+constexpr bool operator==(const weekday_last& x, const weekday_last& y) noexcept;
+constexpr bool operator!=(const weekday_last& x, const weekday_last& y) noexcept;
+
+// 25.8.9, class month_day // C++20
+class month_day;
+
+constexpr bool operator==(const month_day& x, const month_day& y) noexcept;
+constexpr bool operator!=(const month_day& x, const month_day& y) noexcept;
+constexpr bool operator< (const month_day& x, const month_day& y) noexcept;
+constexpr bool operator> (const month_day& x, const month_day& y) noexcept;
+constexpr bool operator<=(const month_day& x, const month_day& y) noexcept;
+constexpr bool operator>=(const month_day& x, const month_day& y) noexcept;
+
+
+// 25.8.10, class month_day_last // C++20
+class month_day_last;
+
+constexpr bool operator==(const month_day_last& x, const month_day_last& y) noexcept;
+constexpr bool operator!=(const month_day_last& x, const month_day_last& y) noexcept;
+constexpr bool operator< (const month_day_last& x, const month_day_last& y) noexcept;
+constexpr bool operator> (const month_day_last& x, const month_day_last& y) noexcept;
+constexpr bool operator<=(const month_day_last& x, const month_day_last& y) noexcept;
+constexpr bool operator>=(const month_day_last& x, const month_day_last& y) noexcept;
+
+// 25.8.11, class month_weekday // C++20
+class month_weekday;
+
+constexpr bool operator==(const month_weekday& x, const month_weekday& y) noexcept;
+constexpr bool operator!=(const month_weekday& x, const month_weekday& y) noexcept;
+
+// 25.8.12, class month_weekday_last // C++20
+class month_weekday_last;
+
+constexpr bool operator==(const month_weekday_last& x, const month_weekday_last& y) noexcept;
+constexpr bool operator!=(const month_weekday_last& x, const month_weekday_last& y) noexcept;
+
+
+// 25.8.13, class year_month // C++20
+class year_month;
+
+constexpr bool operator==(const year_month& x, const year_month& y) noexcept;
+constexpr bool operator!=(const year_month& x, const year_month& y) noexcept;
+constexpr bool operator< (const year_month& x, const year_month& y) noexcept;
+constexpr bool operator> (const year_month& x, const year_month& y) noexcept;
+constexpr bool operator<=(const year_month& x, const year_month& y) noexcept;
+constexpr bool operator>=(const year_month& x, const year_month& y) noexcept;
+
+constexpr year_month operator+(const year_month& ym, const months& dm) noexcept;
+constexpr year_month operator+(const months& dm, const year_month& ym) noexcept;
+constexpr year_month operator-(const year_month& ym, const months& dm) noexcept;
+constexpr months operator-(const year_month& x, const year_month& y) noexcept;
+constexpr year_month operator+(const year_month& ym, const years& dy) noexcept;
+constexpr year_month operator+(const years& dy, const year_month& ym) noexcept;
+constexpr year_month operator-(const year_month& ym, const years& dy) noexcept;
+
+// 25.8.14, class year_month_day class // C++20
+year_month_day;
+
+constexpr bool operator==(const year_month_day& x, const year_month_day& y) noexcept;
+constexpr bool operator!=(const year_month_day& x, const year_month_day& y) noexcept;
+constexpr bool operator< (const year_month_day& x, const year_month_day& y) noexcept;
+constexpr bool operator> (const year_month_day& x, const year_month_day& y) noexcept;
+constexpr bool operator<=(const year_month_day& x, const year_month_day& y) noexcept;
+constexpr bool operator>=(const year_month_day& x, const year_month_day& y) noexcept;
+
+constexpr year_month_day operator+(const year_month_day& ymd, const months& dm) noexcept;
+constexpr year_month_day operator+(const months& dm, const year_month_day& ymd) noexcept;
+constexpr year_month_day operator+(const year_month_day& ymd, const years& dy) noexcept;
+constexpr year_month_day operator+(const years& dy, const year_month_day& ymd) noexcept;
+constexpr year_month_day operator-(const year_month_day& ymd, const months& dm) noexcept;
+constexpr year_month_day operator-(const year_month_day& ymd, const years& dy) noexcept;
+
+
+// 25.8.15, class year_month_day_last // C++20
+class year_month_day_last;
+
+constexpr bool operator==(const year_month_day_last& x,
+ const year_month_day_last& y) noexcept;
+constexpr bool operator!=(const year_month_day_last& x,
+ const year_month_day_last& y) noexcept;
+constexpr bool operator< (const year_month_day_last& x,
+ const year_month_day_last& y) noexcept;
+constexpr bool operator> (const year_month_day_last& x,
+ const year_month_day_last& y) noexcept;
+constexpr bool operator<=(const year_month_day_last& x,
+ const year_month_day_last& y) noexcept;
+constexpr bool operator>=(const year_month_day_last& x,
+ const year_month_day_last& y) noexcept;
+
+constexpr year_month_day_last
+ operator+(const year_month_day_last& ymdl, const months& dm) noexcept;
+constexpr year_month_day_last
+ operator+(const months& dm, const year_month_day_last& ymdl) noexcept;
+constexpr year_month_day_last
+ operator+(const year_month_day_last& ymdl, const years& dy) noexcept;
+constexpr year_month_day_last
+ operator+(const years& dy, const year_month_day_last& ymdl) noexcept;
+constexpr year_month_day_last
+ operator-(const year_month_day_last& ymdl, const months& dm) noexcept;
+constexpr year_month_day_last
+ operator-(const year_month_day_last& ymdl, const years& dy) noexcept;
+
+// 25.8.16, class year_month_weekday // C++20
+class year_month_weekday;
+
+constexpr bool operator==(const year_month_weekday& x,
+ const year_month_weekday& y) noexcept;
+constexpr bool operator!=(const year_month_weekday& x,
+ const year_month_weekday& y) noexcept;
+
+constexpr year_month_weekday
+ operator+(const year_month_weekday& ymwd, const months& dm) noexcept;
+constexpr year_month_weekday
+ operator+(const months& dm, const year_month_weekday& ymwd) noexcept;
+constexpr year_month_weekday
+ operator+(const year_month_weekday& ymwd, const years& dy) noexcept;
+constexpr year_month_weekday
+ operator+(const years& dy, const year_month_weekday& ymwd) noexcept;
+constexpr year_month_weekday
+ operator-(const year_month_weekday& ymwd, const months& dm) noexcept;
+constexpr year_month_weekday
+ operator-(const year_month_weekday& ymwd, const years& dy) noexcept;
+
+// 25.8.17, class year_month_weekday_last // C++20
+class year_month_weekday_last;
+
+constexpr bool operator==(const year_month_weekday_last& x,
+ const year_month_weekday_last& y) noexcept;
+constexpr bool operator!=(const year_month_weekday_last& x,
+ const year_month_weekday_last& y) noexcept;
+constexpr year_month_weekday_last
+ operator+(const year_month_weekday_last& ymwdl, const months& dm) noexcept;
+constexpr year_month_weekday_last
+ operator+(const months& dm, const year_month_weekday_last& ymwdl) noexcept;
+constexpr year_month_weekday_last
+ operator+(const year_month_weekday_last& ymwdl, const years& dy) noexcept;
+constexpr year_month_weekday_last
+ operator+(const years& dy, const year_month_weekday_last& ymwdl) noexcept;
+constexpr year_month_weekday_last
+ operator-(const year_month_weekday_last& ymwdl, const months& dm) noexcept;
+constexpr year_month_weekday_last
+ operator-(const year_month_weekday_last& ymwdl, const years& dy) noexcept;
+
+// 25.8.18, civil calendar conventional syntax operators // C++20
+constexpr year_month
+ operator/(const year& y, const month& m) noexcept;
+constexpr year_month
+ operator/(const year& y, int m) noexcept;
+constexpr month_day
+ operator/(const month& m, const day& d) noexcept;
+constexpr month_day
+ operator/(const month& m, int d) noexcept;
+constexpr month_day
+ operator/(int m, const day& d) noexcept;
+constexpr month_day
+ operator/(const day& d, const month& m) noexcept;
+constexpr month_day
+ operator/(const day& d, int m) noexcept;
+constexpr month_day_last
+ operator/(const month& m, last_spec) noexcept;
+constexpr month_day_last
+ operator/(int m, last_spec) noexcept;
+constexpr month_day_last
+ operator/(last_spec, const month& m) noexcept;
+constexpr month_day_last
+ operator/(last_spec, int m) noexcept;
+constexpr month_weekday
+ operator/(const month& m, const weekday_indexed& wdi) noexcept;
+constexpr month_weekday
+ operator/(int m, const weekday_indexed& wdi) noexcept;
+constexpr month_weekday
+ operator/(const weekday_indexed& wdi, const month& m) noexcept;
+constexpr month_weekday
+ operator/(const weekday_indexed& wdi, int m) noexcept;
+constexpr month_weekday_last
+ operator/(const month& m, const weekday_last& wdl) noexcept;
+constexpr month_weekday_last
+ operator/(int m, const weekday_last& wdl) noexcept;
+constexpr month_weekday_last
+ operator/(const weekday_last& wdl, const month& m) noexcept;
+constexpr month_weekday_last
+ operator/(const weekday_last& wdl, int m) noexcept;
+constexpr year_month_day
+ operator/(const year_month& ym, const day& d) noexcept;
+constexpr year_month_day
+ operator/(const year_month& ym, int d) noexcept;
+constexpr year_month_day
+ operator/(const year& y, const month_day& md) noexcept;
+constexpr year_month_day
+ operator/(int y, const month_day& md) noexcept;
+constexpr year_month_day
+ operator/(const month_day& md, const year& y) noexcept;
+constexpr year_month_day
+ operator/(const month_day& md, int y) noexcept;
+constexpr year_month_day_last
+ operator/(const year_month& ym, last_spec) noexcept;
+constexpr year_month_day_last
+ operator/(const year& y, const month_day_last& mdl) noexcept;
+constexpr year_month_day_last
+ operator/(int y, const month_day_last& mdl) noexcept;
+constexpr year_month_day_last
+ operator/(const month_day_last& mdl, const year& y) noexcept;
+constexpr year_month_day_last
+ operator/(const month_day_last& mdl, int y) noexcept;
+constexpr year_month_weekday
+ operator/(const year_month& ym, const weekday_indexed& wdi) noexcept;
+constexpr year_month_weekday
+ operator/(const year& y, const month_weekday& mwd) noexcept;
+constexpr year_month_weekday
+ operator/(int y, const month_weekday& mwd) noexcept;
+constexpr year_month_weekday
+ operator/(const month_weekday& mwd, const year& y) noexcept;
+constexpr year_month_weekday
+ operator/(const month_weekday& mwd, int y) noexcept;
+constexpr year_month_weekday_last
+ operator/(const year_month& ym, const weekday_last& wdl) noexcept;
+constexpr year_month_weekday_last
+ operator/(const year& y, const month_weekday_last& mwdl) noexcept;
+constexpr year_month_weekday_last
+ operator/(int y, const month_weekday_last& mwdl) noexcept;
+constexpr year_month_weekday_last
+ operator/(const month_weekday_last& mwdl, const year& y) noexcept;
+constexpr year_month_weekday_last
+ operator/(const month_weekday_last& mwdl, int y) noexcept;
+
+// 25.9, class template time_of_day // C++20
+template<class Duration> class time_of_day;
+
+template<> class time_of_day<hours>;
+template<> class time_of_day<minutes>;
+template<> class time_of_day<seconds>;
+template<class Rep, class Period> class time_of_day<duration<Rep, Period>>;
+
+// 25.10.2, time zone database // C++20
+struct tzdb;
+class tzdb_list;
+
+// 25.10.2.3, time zone database access // C++20
+const tzdb& get_tzdb();
+tzdb_list& get_tzdb_list();
+const time_zone* locate_zone(string_view tz_name);
+const time_zone* current_zone();
+
+// 25.10.2.4, remote time zone database support // C++20
+const tzdb& reload_tzdb();
+string remote_version();
+
+// 25.10.3, exception classes // C++20
+class nonexistent_local_time;
+class ambiguous_local_time;
+
+// 25.10.4, information classes // C++20
+struct sys_info;
+struct local_info;
+
+// 25.10.5, class time_zone // C++20
+enum class choose {earliest, latest};
+class time_zone;
+bool operator==(const time_zone& x, const time_zone& y) noexcept;
+bool operator!=(const time_zone& x, const time_zone& y) noexcept;
+bool operator<(const time_zone& x, const time_zone& y) noexcept;
+bool operator>(const time_zone& x, const time_zone& y) noexcept;
+bool operator<=(const time_zone& x, const time_zone& y) noexcept;
+bool operator>=(const time_zone& x, const time_zone& y) noexcept;
+
+// 25.10.6, class template zoned_traits // C++20
+template<class T> struct zoned_traits;
+
+// 25.10.7, class template zoned_time // C++20
+template<class Duration, class TimeZonePtr = const time_zone*> class zoned_time;
+using zoned_seconds = zoned_time<seconds>;
+
+template<class Duration1, class Duration2, class TimeZonePtr>
+ bool operator==(const zoned_time<Duration1, TimeZonePtr>& x,
+ const zoned_time<Duration2, TimeZonePtr>& y);
+template<class Duration1, class Duration2, class TimeZonePtr>
+ bool operator!=(const zoned_time<Duration1, TimeZonePtr>& x,
+ const zoned_time<Duration2, TimeZonePtr>& y);
+
+// 25.10.8, leap second support // C++20
+class leap;
+
+bool operator==(const leap& x, const leap& y);
+bool operator!=(const leap& x, const leap& y);
+bool operator< (const leap& x, const leap& y);
+bool operator> (const leap& x, const leap& y);
+bool operator<=(const leap& x, const leap& y);
+bool operator>=(const leap& x, const leap& y);
+template<class Duration>
+ bool operator==(const leap& x, const sys_time<Duration>& y);
+template<class Duration>
+ bool operator==(const sys_time<Duration>& x, const leap& y);
+template<class Duration>
+ bool operator!=(const leap& x, const sys_time<Duration>& y);
+template<class Duration>
+ bool operator!=(const sys_time<Duration>& x, const leap& y);
+template<class Duration>
+ bool operator< (const leap& x, const sys_time<Duration>& y);
+template<class Duration>
+ bool operator< (const sys_time<Duration>& x, const leap& y);
+template<class Duration>
+ bool operator> (const leap& x, const sys_time<Duration>& y);
+template<class Duration>
+ bool operator> (const sys_time<Duration>& x, const leap& y);
+template<class Duration>
+ bool operator<=(const leap& x, const sys_time<Duration>& y);
+template<class Duration>
+ bool operator<=(const sys_time<Duration>& x, const leap& y);
+template<class Duration>
+ bool operator>=(const leap& x, const sys_time<Duration>& y);
+template<class Duration>
+ bool operator>=(const sys_time<Duration>& x, const leap& y);
+
+// 25.10.9, class link // C++20
+class link;
+bool operator==(const link& x, const link& y);
+bool operator!=(const link& x, const link& y);
+bool operator< (const link& x, const link& y);
+bool operator> (const link& x, const link& y);
+bool operator<=(const link& x, const link& y);
+bool operator>=(const link& x, const link& y);
+
+// 25.11, formatting // C++20
+template<class charT, class Streamable>
+ basic_string<charT>
+ format(const charT* fmt, const Streamable& s);
+
+template<class charT, class Streamable>
+ basic_string<charT>
+ format(const locale& loc, const charT* fmt, const Streamable& s);
+
+template<class charT, class traits, class Alloc, class Streamable>
+ basic_string<charT, traits, Alloc>
+ format(const basic_string<charT, traits, Alloc>& fmt, const Streamable& s);
+
+template<class charT, class traits, class Alloc, class Streamable>
+ basic_string<charT, traits, Alloc>
+ format(const locale& loc, const basic_string<charT, traits, Alloc>& fmt,
+ const Streamable& s);
+
+// 25.12, parsing // C++20
+template<class charT, class traits, class Alloc, class Parsable>
+unspecified
+ parse(const basic_string<charT, traits, Alloc>& format, Parsable& tp);
+
+template<class charT, class traits, class Alloc, class Parsable>
+unspecified
+ parse(const basic_string<charT, traits, Alloc>& format, Parsable& tp,
+ basic_string<charT, traits, Alloc>& abbrev);
+
+template<class charT, class traits, class Alloc, class Parsable>
+unspecified
+ parse(const basic_string<charT, traits, Alloc>& format, Parsable& tp,
+ minutes& offset);
+
+template<class charT, class traits, class Alloc, class Parsable>
+unspecified
+ parse(const basic_string<charT, traits, Alloc>& format, Parsable& tp,
+ basic_string<charT, traits, Alloc>& abbrev, minutes& offset);
+
+inline constexpr last_spec last{}; // C++20
+inline constexpr chrono::weekday Sunday{0}; // C++20
+inline constexpr chrono::weekday Monday{1}; // C++20
+inline constexpr chrono::weekday Tuesday{2}; // C++20
+inline constexpr chrono::weekday Wednesday{3}; // C++20
+inline constexpr chrono::weekday Thursday{4}; // C++20
+inline constexpr chrono::weekday Friday{5}; // C++20
+inline constexpr chrono::weekday Saturday{6}; // C++20
+
+inline constexpr chrono::month January{1}; // C++20
+inline constexpr chrono::month February{2}; // C++20
+inline constexpr chrono::month March{3}; // C++20
+inline constexpr chrono::month April{4}; // C++20
+inline constexpr chrono::month May{5}; // C++20
+inline constexpr chrono::month June{6}; // C++20
+inline constexpr chrono::month July{7}; // C++20
+inline constexpr chrono::month August{8}; // C++20
+inline constexpr chrono::month September{9}; // C++20
+inline constexpr chrono::month October{10}; // C++20
+inline constexpr chrono::month November{11}; // C++20
+inline constexpr chrono::month December{12}; // C++20
} // chrono
+inline namespace literals {
+ inline namespace chrono_literals {
constexpr chrono::hours operator ""h(unsigned long long); // C++14
constexpr chrono::duration<unspecified , ratio<3600,1>> operator ""h(long double); // C++14
constexpr chrono::minutes operator ""min(unsigned long long); // C++14
@@ -295,6 +783,10 @@ constexpr chrono::microseconds operator ""us(unsigned l
constexpr chrono::duration<unspecified , micro> operator ""us(long double); // C++14
constexpr chrono::nanoseconds operator ""ns(unsigned long long); // C++14
constexpr chrono::duration<unspecified , nano> operator ""ns(long double); // C++14
+constexpr chrono::day operator ""d(unsigned long long d) noexcept; // C++20
+constexpr chrono::year operator ""y(unsigned long long y) noexcept; // C++20
+} // chrono_literals
+} // literals
} // std
*/
@@ -419,7 +911,8 @@ template <class _Rep>
struct _LIBCPP_TEMPLATE_VIS treat_as_floating_point : is_floating_point<_Rep> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
-template <class _Rep> _LIBCPP_CONSTEXPR bool treat_as_floating_point_v
+template <class _Rep>
+_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool treat_as_floating_point_v
= treat_as_floating_point<_Rep>::value;
#endif
diff --git a/include/cmath b/include/cmath
index 917928a1f42f..ffb1c46c7b68 100644
--- a/include/cmath
+++ b/include/cmath
@@ -547,7 +547,7 @@ hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
#endif
template <class _A1>
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
__libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT
{
@@ -559,7 +559,7 @@ __libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT
}
template <class _A1>
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
__libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT
{
@@ -567,7 +567,7 @@ __libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT