aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-format11
-rw-r--r--.gitignore7
-rw-r--r--CMakeLists.txt184
-rw-r--r--NOTES.TXT28
-rw-r--r--TODO.TXT30
-rw-r--r--benchmarks/CMakeLists.txt154
-rw-r--r--benchmarks/ContainerBenchmarks.hpp113
-rw-r--r--benchmarks/GenerateInput.hpp142
-rw-r--r--benchmarks/algorithms.bench.cpp62
-rw-r--r--benchmarks/filesystem.bench.cpp138
-rw-r--r--benchmarks/string.bench.cpp49
-rw-r--r--benchmarks/unordered_set_operations.bench.cpp316
-rw-r--r--benchmarks/util_smartptr.bench.cpp42
-rw-r--r--benchmarks/vector_operations.bench.cpp32
-rw-r--r--cmake/Modules/CheckLibcxxAtomic.cmake8
-rw-r--r--cmake/Modules/HandleLibCXXABI.cmake16
-rw-r--r--cmake/Modules/HandleLibcxxFlags.cmake8
-rw-r--r--cmake/Modules/HandleOutOfTreeLLVM.cmake87
-rw-r--r--cmake/config-ix.cmake63
-rw-r--r--docs/BuildingLibcxx.rst50
-rw-r--r--docs/DesignDocs/DebugMode.rst100
-rw-r--r--docs/DesignDocs/VisibilityMacros.rst127
-rw-r--r--docs/Makefile.sphinx2
-rw-r--r--docs/TestingLibcxx.rst100
-rw-r--r--docs/UsingLibcxx.rst50
-rw-r--r--docs/conf.py4
-rw-r--r--docs/index.rst3
-rw-r--r--include/CMakeLists.txt29
-rw-r--r--include/__bit_reference28
-rw-r--r--include/__config371
-rw-r--r--include/__config_site.in2
-rw-r--r--include/__debug102
-rw-r--r--include/__functional_0324
-rw-r--r--include/__functional_base11
-rw-r--r--include/__hash_table489
-rw-r--r--include/__libcpp_version1
-rw-r--r--include/__locale19
-rw-r--r--include/__mutex_base4
-rw-r--r--include/__nullptr4
-rw-r--r--include/__refstring188
-rw-r--r--include/__std_stream2
-rw-r--r--include/__string766
-rw-r--r--include/__threading_support123
-rw-r--r--include/__tree21
-rw-r--r--include/__tuple107
-rw-r--r--include/algorithm223
-rw-r--r--include/any663
-rw-r--r--include/array16
-rw-r--r--include/atomic13
-rw-r--r--include/bitset68
-rw-r--r--include/chrono5
-rw-r--r--include/cmath102
-rw-r--r--include/complex367
-rw-r--r--include/cstdio8
-rw-r--r--include/cstdlib8
-rw-r--r--include/cwchar6
-rw-r--r--include/deque37
-rw-r--r--include/exception31
-rw-r--r--include/experimental/algorithm60
-rw-r--r--include/experimental/any7
-rw-r--r--include/experimental/dynarray31
-rw-r--r--include/experimental/filesystem155
-rw-r--r--include/experimental/memory_resource8
-rw-r--r--include/experimental/numeric103
-rw-r--r--include/experimental/optional63
-rw-r--r--include/experimental/propagate_const12
-rw-r--r--include/experimental/string_view8
-rw-r--r--include/experimental/type_traits103
-rw-r--r--include/forward_list25
-rw-r--r--include/fstream26
-rw-r--r--include/functional171
-rw-r--r--include/future17
-rw-r--r--include/inttypes.h7
-rw-r--r--include/iomanip23
-rw-r--r--include/ios21
-rw-r--r--include/istream180
-rw-r--r--include/iterator411
-rw-r--r--include/limits8
-rw-r--r--include/limits.h65
-rw-r--r--include/list134
-rw-r--r--include/locale88
-rw-r--r--include/locale.h45
-rw-r--r--include/math.h57
-rw-r--r--include/memory466
-rw-r--r--include/module.modulemap564
-rw-r--r--include/mutex4
-rw-r--r--include/new112
-rw-r--r--include/numeric66
-rw-r--r--include/optional1314
-rw-r--r--include/ostream89
-rw-r--r--include/queue6
-rw-r--r--include/random3
-rw-r--r--include/ratio24
-rw-r--r--include/regex101
-rw-r--r--include/scoped_allocator91
-rw-r--r--include/set4
-rw-r--r--include/sstream54
-rw-r--r--include/stack6
-rw-r--r--include/stdexcept120
-rw-r--r--include/stdint.h121
-rw-r--r--include/streambuf302
-rw-r--r--include/string1204
-rw-r--r--include/string_view754
-rw-r--r--include/support/android/locale_bionic.h4
-rw-r--r--include/support/win32/locale_win32.h11
-rw-r--r--include/support/win32/math_win32.h117
-rw-r--r--include/support/win32/support.h22
-rw-r--r--include/support/xlocale/__posix_l_fallback.h4
-rw-r--r--include/system_error31
-rw-r--r--include/thread31
-rw-r--r--include/tuple157
-rw-r--r--include/type_traits310
-rw-r--r--include/typeinfo18
-rw-r--r--include/unordered_map26
-rw-r--r--include/utility354
-rw-r--r--include/valarray6
-rw-r--r--include/variant1568
-rw-r--r--include/vector143
-rw-r--r--lib/CMakeLists.txt184
-rw-r--r--lib/abi/3.9/x86_64-apple-darwin16.0.abilist2448
-rw-r--r--lib/abi/3.9/x86_64-linux-gnu.abilist2010
-rw-r--r--lib/abi/CHANGELOG.TXT135
-rw-r--r--lib/abi/CMakeLists.txt28
-rw-r--r--lib/abi/README.TXT8
-rw-r--r--lib/abi/x86_64-apple-darwin16.0.0.abilist2375
-rw-r--r--lib/abi/x86_64-unknown-linux-gnu.abilist1905
-rwxr-xr-xlib/buildit2
-rw-r--r--src/algorithm.cpp2
-rw-r--r--src/any.cpp9
-rw-r--r--src/chrono.cpp83
-rw-r--r--src/condition_variable.cpp6
-rw-r--r--src/debug.cpp100
-rw-r--r--src/exception.cpp4
-rw-r--r--src/experimental/filesystem/directory_iterator.cpp4
-rw-r--r--src/experimental/filesystem/operations.cpp184
-rw-r--r--src/experimental/filesystem/path.cpp550
-rw-r--r--src/experimental/memory_resource.cpp17
-rw-r--r--src/include/atomic_support.h2
-rw-r--r--src/include/config_elast.h2
-rw-r--r--src/ios.cpp18
-rw-r--r--src/locale.cpp311
-rw-r--r--src/memory.cpp46
-rw-r--r--src/mutex.cpp9
-rw-r--r--src/new.cpp170
-rw-r--r--src/optional.cpp12
-rw-r--r--src/random.cpp2
-rw-r--r--src/stdexcept.cpp3
-rw-r--r--src/string.cpp8
-rw-r--r--src/strstream.cpp3
-rw-r--r--src/support/solaris/xlocale.cpp (renamed from src/support/solaris/xlocale.c)5
-rw-r--r--src/support/win32/locale_win32.cpp5
-rw-r--r--src/system_error.cpp3
-rw-r--r--src/thread.cpp10
-rw-r--r--src/typeinfo.cpp4
-rw-r--r--src/variant.cpp18
-rw-r--r--test/CMakeLists.txt31
-rw-r--r--test/libcxx/algorithms/debug_less.pass.cpp167
-rw-r--r--test/libcxx/atomics/atomics.align/align.pass.sh.cpp93
-rw-r--r--test/libcxx/atomics/libcpp-has-no-threads.fail.cpp1
-rw-r--r--test/libcxx/compiler.py195
-rw-r--r--test/libcxx/containers/sequences/deque/incomplete.pass.cpp1
-rw-r--r--test/libcxx/containers/sequences/list/db_iterators_6.pass.cpp33
-rw-r--r--test/libcxx/containers/sequences/list/db_iterators_7.pass.cpp33
-rw-r--r--test/libcxx/containers/sequences/list/db_iterators_9.pass.cpp59
-rw-r--r--test/libcxx/containers/sequences/list/list.special/db_swap_1.pass.cpp36
-rw-r--r--test/libcxx/containers/sequences/list/list.special/db_swap_2.pass.cpp36
-rw-r--r--test/libcxx/containers/sequences/vector/asan.pass.cpp8
-rw-r--r--test/libcxx/containers/sequences/vector/asan_throw.pass.cpp4
-rw-r--r--test/libcxx/debug/containers/db_associative_container_tests.pass.cpp64
-rw-r--r--test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp265
-rw-r--r--test/libcxx/debug/containers/db_string.pass.cpp96
-rw-r--r--test/libcxx/debug/containers/db_unord_container_tests.pass.cpp66
-rw-r--r--test/libcxx/debug/debug_abort.pass.cpp30
-rw-r--r--test/libcxx/debug/debug_throw.pass.cpp36
-rw-r--r--test/libcxx/debug/debug_throw_register.pass.cpp (renamed from test/libcxx/containers/sequences/list/db_cfront.pass.cpp)24
-rw-r--r--test/libcxx/depr/depr.c.headers/ciso646.pass.cpp (renamed from test/std/utilities/utility/forward/forward1.fail.cpp)14
-rw-r--r--test/libcxx/depr/depr.c.headers/complex.h.pass.cpp (renamed from test/std/utilities/utility/forward/forward3.fail.cpp)15
-rw-r--r--test/libcxx/depr/depr.c.headers/locale_h.pass.cpp20
-rw-r--r--test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp23
-rw-r--r--test/libcxx/double_include.sh.cpp89
-rw-r--r--test/libcxx/experimental/any/small_type.pass.cpp2
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp7
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp2
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp2
-rw-r--r--test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp19
-rw-r--r--test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp74
-rw-r--r--test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp70
-rw-r--r--test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp5
-rw-r--r--test/libcxx/iterators/trivial_iterators.pass.cpp4
-rw-r--r--test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp77
-rw-r--r--test/libcxx/libcpp_version.pass.cpp28
-rw-r--r--test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp4
-rw-r--r--test/libcxx/modules/cinttypes_exports.sh.cpp21
-rw-r--r--test/libcxx/modules/clocale_exports.sh.cpp24
-rw-r--r--test/libcxx/modules/cstdint_exports.sh.cpp (renamed from test/std/utilities/utility/forward/forward4.fail.cpp)18
-rw-r--r--test/libcxx/modules/inttypes_h_exports.sh.cpp20
-rw-r--r--test/libcxx/modules/stdint_h_exports.sh.cpp20
-rw-r--r--test/libcxx/numerics/c.math/constexpr-fns.pass.cpp32
-rw-r--r--test/libcxx/numerics/c.math/ctgmath.pass.cpp24
-rw-r--r--test/libcxx/numerics/c.math/tgmath_h.pass.cpp20
-rw-r--r--test/libcxx/numerics/c.math/version_cmath.pass.cpp (renamed from test/std/numerics/c.math/version_cmath.pass.cpp)0
-rw-r--r--test/libcxx/numerics/complex.number/ccmplx/ccomplex.pass.cpp21
-rw-r--r--test/libcxx/strings/iterators.exceptions.pass.cpp24
-rw-r--r--test/libcxx/strings/iterators.noexcept.pass.cpp1
-rw-r--r--test/libcxx/test/config.py216
-rw-r--r--test/libcxx/test/format.py103
-rw-r--r--test/libcxx/test/target_info.py5
-rw-r--r--test/libcxx/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp2
-rw-r--r--test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp1
-rw-r--r--test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/native_handle.pass.cpp2
-rw-r--r--test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/native_handle.pass.cpp2
-rw-r--r--test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp1
-rw-r--r--test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp1
-rw-r--r--test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp1
-rw-r--r--test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp1
-rw-r--r--test/libcxx/thread/thread.threads/thread.thread.class/thread.thread.member/native_handle.pass.cpp2
-rw-r--r--test/libcxx/thread/thread.threads/thread.thread.class/types.pass.cpp2
-rw-r--r--test/libcxx/utilities/any/size_and_alignment.pass.cpp23
-rw-r--r--test/libcxx/utilities/any/small_type.pass.cpp114
-rw-r--r--test/libcxx/utilities/any/version.pass.cpp (renamed from test/std/utilities/utility/forward/forward6.fail.cpp)12
-rw-r--r--test/libcxx/utilities/function.objects/func.require/bullet_1_2_3.pass.cpp3
-rw-r--r--test/libcxx/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp74
-rw-r--r--test/libcxx/utilities/optional/optional.object/optional.object.assign/move.pass.cpp71
-rw-r--r--test/libcxx/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp59
-rw-r--r--test/libcxx/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp60
-rw-r--r--test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp66
-rw-r--r--test/libcxx/utilities/optional/version.pass.cpp20
-rw-r--r--test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp33
-rw-r--r--test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.pass.cpp71
-rw-r--r--test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/disable_reduced_arity_initialization_extension.pass.cpp108
-rw-r--r--test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/enable_reduced_arity_initialization_extension.pass.cpp117
-rw-r--r--test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp131
-rw-r--r--test/libcxx/utilities/variant/variant.variant/variant.assign/copy.pass.cpp208
-rw-r--r--test/libcxx/utilities/variant/variant.variant/variant.assign/move.pass.cpp197
-rw-r--r--test/libcxx/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp120
-rw-r--r--test/libcxx/utilities/variant/variant.variant/variant.ctor/move.pass.cpp153
-rw-r--r--test/libcxx/utilities/variant/version.pass.cpp20
-rw-r--r--test/lit.cfg9
-rw-r--r--test/lit.site.cfg.in6
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp2
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp2
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp2
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp112
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.fail.cpp41
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.pass.cpp160
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.stable.pass.cpp55
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp8
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp8
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp10
-rw-r--r--test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp35
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp8
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp9
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp2
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp80
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp79
-rw-r--r--test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.clamp/clamp.comp.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.clamp/clamp.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap.pass.cpp2
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp18
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap.pass.cpp2
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp2
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap.pass.cpp2
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp2
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp2
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp2
-rw-r--r--test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp2
-rw-r--r--test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp6
-rw-r--r--test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp2
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp8
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp8
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp2
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp8
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/min_init_list_comp.pass.cpp8
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp8
-rw-r--r--test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp9
-rw-r--r--test/std/algorithms/alg.sorting/alg.nth.element/nth_element.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp9
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy_comp.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp4
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp9
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp11
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp5
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp11
-rw-r--r--test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp3
-rw-r--r--test/std/atomics/atomics.flag/default.pass.cpp4
-rw-r--r--test/std/atomics/atomics.types.generic/address.pass.cpp4
-rw-r--r--test/std/atomics/atomics.types.generic/bool.pass.cpp4
-rw-r--r--test/std/atomics/atomics.types.generic/integral.pass.cpp6
-rw-r--r--test/std/containers/associative/map/map.access/at.pass.cpp10
-rw-r--r--test/std/containers/associative/map/map.access/iterator.pass.cpp36
-rw-r--r--test/std/containers/associative/map/map.access/max_size.pass.cpp38
-rw-r--r--test/std/containers/associative/map/map.cons/compare_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.cons/copy.pass.cpp5
-rw-r--r--test/std/containers/associative/map/map.cons/copy_assign.pass.cpp13
-rw-r--r--test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp3
-rw-r--r--test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp3
-rw-r--r--test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp3
-rw-r--r--test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/associative/map/map.ops/count.pass.cpp3
-rw-r--r--test/std/containers/associative/map/map.ops/count1.fail.cpp5
-rw-r--r--test/std/containers/associative/map/map.ops/count2.fail.cpp5
-rw-r--r--test/std/containers/associative/map/map.ops/count3.fail.cpp5
-rw-r--r--test/std/containers/associative/map/map.ops/equal_range.pass.cpp3
-rw-r--r--test/std/containers/associative/map/map.ops/equal_range1.fail.cpp5
-rw-r--r--test/std/containers/associative/map/map.ops/equal_range2.fail.cpp5
-rw-r--r--test/std/containers/associative/map/map.ops/equal_range3.fail.cpp5
-rw-r--r--test/std/containers/associative/map/map.ops/find.pass.cpp3
-rw-r--r--test/std/containers/associative/map/map.ops/find1.fail.cpp5
-rw-r--r--test/std/containers/associative/map/map.ops/find2.fail.cpp5
-rw-r--r--test/std/containers/associative/map/map.ops/find3.fail.cpp5
-rw-r--r--test/std/containers/associative/map/map.ops/lower_bound.pass.cpp3
-rw-r--r--test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp3
-rw-r--r--test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp3
-rw-r--r--test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp3
-rw-r--r--test/std/containers/associative/map/map.ops/upper_bound.pass.cpp3
-rw-r--r--test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp3
-rw-r--r--test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp3
-rw-r--r--test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp3
-rw-r--r--test/std/containers/associative/map/map.special/non_member_swap.pass.cpp8
-rw-r--r--test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp28
-rw-r--r--test/std/containers/associative/multimap/iterator.pass.cpp28
-rw-r--r--test/std/containers/associative/multimap/max_size.pass.cpp38
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/copy.pass.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/iter_iter.pass.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/count.pass.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/find.pass.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp5
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp3
-rw-r--r--test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp8
-rw-r--r--test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp30
-rw-r--r--test/std/containers/associative/multiset/count.pass.cpp3
-rw-r--r--test/std/containers/associative/multiset/equal_range.pass.cpp3
-rw-r--r--test/std/containers/associative/multiset/find.pass.cpp3
-rw-r--r--test/std/containers/associative/multiset/insert_initializer_list.pass.cpp5
-rw-r--r--test/std/containers/associative/multiset/iterator.pass.cpp28
-rw-r--r--test/std/containers/associative/multiset/lower_bound.pass.cpp3
-rw-r--r--test/std/containers/associative/multiset/max_size.pass.cpp35
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/compare_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/copy.pass.cpp5
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp3
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp3
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp3
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp3
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/associative/multiset/multiset.special/non_member_swap.pass.cpp8
-rw-r--r--test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp28
-rw-r--r--test/std/containers/associative/multiset/upper_bound.pass.cpp3
-rw-r--r--test/std/containers/associative/set/count.pass.cpp23
-rw-r--r--test/std/containers/associative/set/equal_range.pass.cpp3
-rw-r--r--test/std/containers/associative/set/find.pass.cpp3
-rw-r--r--test/std/containers/associative/set/insert_initializer_list.pass.cpp5
-rw-r--r--test/std/containers/associative/set/iterator.pass.cpp36
-rw-r--r--test/std/containers/associative/set/lower_bound.pass.cpp3
-rw-r--r--test/std/containers/associative/set/max_size.pass.cpp35
-rw-r--r--test/std/containers/associative/set/set.cons/compare_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/associative/set/set.cons/copy.pass.cpp5
-rw-r--r--test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp3
-rw-r--r--test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp3
-rw-r--r--test/std/containers/associative/set/set.cons/iter_iter_alloc.pass.cpp3
-rw-r--r--test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp3
-rw-r--r--test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/associative/set/set.special/non_member_swap.pass.cpp8
-rw-r--r--test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp28
-rw-r--r--test/std/containers/associative/set/upper_bound.pass.cpp3
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_default.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter.pass.cpp3
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp.pass.cpp3
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp3
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/ctor_container.pass.cpp3
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/ctor_default.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp3
-rw-r--r--test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp18
-rw-r--r--test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp3
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/ctor_container.pass.cpp3
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/ctor_default.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp3
-rw-r--r--test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp16
-rw-r--r--test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/array.tuple/get.fail.cpp5
-rw-r--r--test/std/containers/sequences/array/at.pass.cpp17
-rw-r--r--test/std/containers/sequences/array/iterators.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.capacity/access.pass.cpp16
-rw-r--r--test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp47
-rw-r--r--test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp9
-rw-r--r--test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp9
-rw-r--r--test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp5
-rw-r--r--test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp5
-rw-r--r--test/std/containers/sequences/deque/deque.cons/copy.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.cons/default.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp3
-rw-r--r--test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp13
-rw-r--r--test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp5
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp5
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/sequences/deque/deque.cons/size.pass.cpp31
-rw-r--r--test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp7
-rw-r--r--test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp3
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp3
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp21
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp20
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp7
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp7
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp29
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp5
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp7
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp7
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp5
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp5
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp5
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp5
-rw-r--r--test/std/containers/sequences/deque/deque.special/swap.pass.cpp8
-rw-r--r--test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp18
-rw-r--r--test/std/containers/sequences/deque/iterators.pass.cpp3
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/copy.pass.cpp11
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/copy_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp3
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp5
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/range.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/range_alloc.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp21
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.iter/iterators.pass.cpp3
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp20
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp2
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp17
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp5
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_one.pass.cpp5
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp32
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp32
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp18
-rw-r--r--test/std/containers/sequences/forwardlist/max_size.pass.cpp37
-rw-r--r--test/std/containers/sequences/list/iterators.pass.cpp7
-rw-r--r--test/std/containers/sequences/list/list.capacity/max_size.pass.cpp47
-rw-r--r--test/std/containers/sequences/list/list.cons/copy.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp4
-rw-r--r--test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp3
-rw-r--r--test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp5
-rw-r--r--test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp5
-rw-r--r--test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/sequences/list/list.cons/size_type.pass.cpp22
-rw-r--r--test/std/containers/sequences/list/list.cons/size_value_alloc.pass.cpp5
-rw-r--r--test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp20
-rw-r--r--test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp20
-rw-r--r--test/std/containers/sequences/list/list.modifiers/insert_iter_size_value.pass.cpp4
-rw-r--r--test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.ops/remove.pass.cpp80
-rw-r--r--test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp18
-rw-r--r--test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp3
-rw-r--r--test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp3
-rw-r--r--test/std/containers/sequences/vector.bool/construct_size.pass.cpp3
-rw-r--r--test/std/containers/sequences/vector.bool/copy.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp3
-rw-r--r--test/std/containers/sequences/vector.bool/emplace_back.pass.cpp29
-rw-r--r--test/std/containers/sequences/vector.bool/find.pass.cpp5
-rw-r--r--test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp25
-rw-r--r--test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp9
-rw-r--r--test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp9
-rw-r--r--test/std/containers/sequences/vector.bool/iterators.pass.cpp3
-rw-r--r--test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp9
-rw-r--r--test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp9
-rw-r--r--test/std/containers/sequences/vector.bool/push_back.pass.cpp5
-rw-r--r--test/std/containers/sequences/vector.bool/swap.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp18
-rw-r--r--test/std/containers/sequences/vector/contiguous.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/iterators.pass.cpp3
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp48
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp5
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp5
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp16
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp8
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp3
-rw-r--r--test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp5
-rw-r--r--test/std/containers/sequences/vector/vector.cons/copy.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp3
-rw-r--r--test/std/containers/sequences/vector/vector.data/data.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.data/data_const.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp38
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp34
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp51
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp53
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp51
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp51
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp51
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp49
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp55
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp34
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp33
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp35
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp22
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp38
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/push_back_exception_safety.pass.cpp14
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp38
-rw-r--r--test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp56
-rw-r--r--test/std/containers/sequences/vector/vector.special/swap.pass.cpp14
-rw-r--r--test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp18
-rw-r--r--test/std/containers/stack_allocator.h66
-rw-r--r--test/std/containers/unord/unord.map/bucket.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.map/bucket_count.pass.cpp8
-rw-r--r--test/std/containers/unord/unord.map/bucket_size.pass.cpp21
-rw-r--r--test/std/containers/unord/unord.map/iterators.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.map/max_size.pass.cpp41
-rw-r--r--test/std/containers/unord/unord.map/rehash.pass.cpp13
-rw-r--r--test/std/containers/unord/unord.map/reserve.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.map/swap_member.pass.cpp177
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp18
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp26
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/compare_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/copy.pass.cpp24
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/copy_alloc.pass.cpp18
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/default.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/hash_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp18
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/move.pass.cpp26
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp22
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp3
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/range.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/range_size.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash_equal.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash_equal_allocator.pass.cpp18
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/size.fail.cpp5
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/size.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/size_hash.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal_allocator.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp10
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_rvalue.pass.cpp16
-rw-r--r--test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue.pass.cpp16
-rw-r--r--test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp43
-rw-r--r--test/std/containers/unord/unord.map/unord.map.swap/swap_non_member.pass.cpp177
-rw-r--r--test/std/containers/unord/unord.multimap/bucket.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multimap/bucket_count.pass.cpp6
-rw-r--r--test/std/containers/unord/unord.multimap/bucket_size.pass.cpp29
-rw-r--r--test/std/containers/unord/unord.multimap/iterators.fail.cpp6
-rw-r--r--test/std/containers/unord/unord.multimap/iterators.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.multimap/local_iterators.fail.cpp10
-rw-r--r--test/std/containers/unord/unord.multimap/max_size.pass.cpp43
-rw-r--r--test/std/containers/unord/unord.multimap/rehash.pass.cpp18
-rw-r--r--test/std/containers/unord/unord.multimap/reserve.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.multimap/scary.pass.cpp1
-rw-r--r--test/std/containers/unord/unord.multimap/swap_member.pass.cpp178
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/allocator.pass.cpp11
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.pass.cpp18
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp26
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/compare_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy.pass.cpp24
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy_alloc.pass.cpp18
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/hash_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp18
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp53
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp22
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp3
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal_allocator.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.fail.cpp5
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal_allocator.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp17
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp15
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_key.pass.cpp73
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp17
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_rvalue.pass.cpp16
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_rvalue.pass.cpp16
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp43
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp178
-rw-r--r--test/std/containers/unord/unord.multiset/bucket.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multiset/bucket_count.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.multiset/bucket_size.pass.cpp29
-rw-r--r--test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.multiset/iterators.fail.cpp6
-rw-r--r--test/std/containers/unord/unord.multiset/iterators.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.multiset/local_iterators.fail.cpp10
-rw-r--r--test/std/containers/unord/unord.multiset/max_size.pass.cpp40
-rw-r--r--test/std/containers/unord/unord.multiset/rehash.pass.cpp13
-rw-r--r--test/std/containers/unord/unord.multiset/reserve.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.multiset/scary.pass.cpp1
-rw-r--r--test/std/containers/unord/unord.multiset/swap_member.pass.cpp178
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/allocator.pass.cpp11
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp18
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp48
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/compare_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy.pass.cpp24
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy_alloc.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/hash_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp52
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp38
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp3
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal_allocator.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.fail.cpp5
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal_allocator.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp43
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp178
-rw-r--r--test/std/containers/unord/unord.set/bucket.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.set/bucket_count.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.set/bucket_size.pass.cpp21
-rw-r--r--test/std/containers/unord/unord.set/erase_const_iter.pass.cpp8
-rw-r--r--test/std/containers/unord/unord.set/iterators.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.set/max_size.pass.cpp36
-rw-r--r--test/std/containers/unord/unord.set/rehash.pass.cpp13
-rw-r--r--test/std/containers/unord/unord.set/reserve.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.set/swap_member.pass.cpp178
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/allocator.pass.cpp11
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp18
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp26
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/compare_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/copy.pass.cpp24
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/copy_alloc.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/hash_copy_constructible.fail.cpp2
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp52
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp13
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp3
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/range.pass.cpp20
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/range_size.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal_allocator.pass.cpp14
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/size.fail.cpp3
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/size.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/size_hash.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal_allocator.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp43
-rw-r--r--test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp178
-rw-r--r--test/std/depr/depr.c.headers/ciso646.pass.cpp4
-rw-r--r--test/std/depr/depr.c.headers/complex.h.pass.cpp4
-rw-r--r--test/std/depr/depr.c.headers/inttypes_h.pass.cpp86
-rw-r--r--test/std/depr/depr.c.headers/stdlib_h.pass.cpp2
-rw-r--r--test/std/depr/depr.c.headers/tgmath_h.pass.cpp4
-rw-r--r--test/std/diagnostics/syserr/is_error_code_enum.pass.cpp51
-rw-r--r--test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp51
-rw-r--r--test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp2
-rw-r--r--test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp44
-rw-r--r--test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp5
-rw-r--r--test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp18
-rw-r--r--test/std/experimental/any/any.class/any.assign/copy.pass.cpp2
-rw-r--r--test/std/experimental/any/any.class/any.assign/move.pass.cpp2
-rw-r--r--test/std/experimental/any/any.class/any.assign/value.pass.cpp2
-rw-r--r--test/std/experimental/any/any.class/any.cons/copy.pass.cpp2
-rw-r--r--test/std/experimental/any/any.class/any.cons/default.pass.cpp2
-rw-r--r--test/std/experimental/any/any.class/any.cons/move.pass.cpp2
-rw-r--r--test/std/experimental/any/any.class/any.cons/value.pass.cpp2
-rw-r--r--test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp2
-rw-r--r--test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp2
-rw-r--r--test/std/experimental/any/any.class/any.observers/empty.pass.cpp2
-rw-r--r--test/std/experimental/any/any.class/any.observers/type.pass.cpp2
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp2
-rw-r--r--test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp5
-rw-r--r--test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp7
-rw-r--r--test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp83
-rw-r--r--test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp71
-rw-r--r--test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp18
-rw-r--r--test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp116
-rw-r--r--test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp39
-rw-r--r--test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp2
-rw-r--r--test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp8
-rw-r--r--test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp2
-rw-r--r--test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp2
-rw-r--r--test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp2
-rw-r--r--test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp1
-rw-r--r--test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp6
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp77
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp30
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp1
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp15
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp15
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp15
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp25
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp29
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp6
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp1
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp1
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp1
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp1
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp1
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp1
-rw-r--r--test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp19
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp2
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp9
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp4
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp2
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp2
-rw-r--r--test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp2
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp5
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp5
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp5
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp4
-rw-r--r--test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp4
-rw-r--r--test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp4
-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.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.cpp132
-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.cpp131
-rw-r--r--test/std/experimental/optional/optional.nullops/less_equal.pass.cpp4
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp13
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp19
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp13
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp18
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp23
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp7
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp23
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp6
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp7
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp34
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp7
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp3
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp5
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp5
-rw-r--r--test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp18
-rw-r--r--test/std/experimental/optional/optional.specalg/swap.pass.cpp9
-rw-r--r--test/std/experimental/string.view/string.view.access/data.pass.cpp2
-rw-r--r--test/std/experimental/string.view/string.view.access/index.pass.cpp2
-rw-r--r--test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp2
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.cons/default.pass.cpp4
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp8
-rw-r--r--test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.iterators/begin.pass.cpp2
-rw-r--r--test/std/experimental/string.view/string.view.iterators/end.pass.cpp9
-rw-r--r--test/std/experimental/string.view/string.view.iterators/rend.pass.cpp7
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp4
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp4
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp4
-rw-r--r--test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp4
-rw-r--r--test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp4
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp3
-rw-r--r--test/std/experimental/string.view/string.view.ops/substr.pass.cpp1
-rw-r--r--test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp40
-rw-r--r--test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp48
-rw-r--r--test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp37
-rw-r--r--test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp50
-rw-r--r--test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp49
-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/propagate_const/propagate_const.class/propagate_const.ctors/move_ctor.pass.cpp1
-rw-r--r--test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp2
-rw-r--r--test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp1
-rw-r--r--test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp32
-rw-r--r--test/std/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp3
-rw-r--r--test/std/input.output/file.streams/c.files/cinttypes.pass.cpp86
-rw-r--r--test/std/input.output/file.streams/c.files/cstdio.pass.cpp4
-rw-r--r--test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp4
-rw-r--r--test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp18
-rw-r--r--test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp18
-rw-r--r--test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp12
-rw-r--r--test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp12
-rw-r--r--test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp21
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp10
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/bool.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/double.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/float.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/int.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long_double.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long_long.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp2
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/short.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_int.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_long.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_long_long.pass.cpp6
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_short.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp2
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp2
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_pointer.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp2
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp2
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/signed_char.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/signed_char_pointer.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/unsigned_char.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/unsigned_char_pointer.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/basic_ios.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/ios_base.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/ostream.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp4
-rw-r--r--test/std/input.output/iostream.format/output.streams/ostream_sentry/destruct.pass.cpp5
-rw-r--r--test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp1
-rw-r--r--test/std/input.output/iostream.forward/iosfwd.pass.cpp231
-rw-r--r--test/std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp5
-rw-r--r--test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp8
-rw-r--r--test/std/input.output/iostreams.base/ios/iostate.flags/bool.pass.cpp9
-rw-r--r--test/std/input.output/iostreams.base/ios/iostate.flags/clear.pass.cpp6
-rw-r--r--test/std/input.output/iostreams.base/ios/iostate.flags/exceptions_iostate.pass.cpp5
-rw-r--r--test/std/input.output/iostreams.base/ios/iostate.flags/setstate.pass.cpp6
-rw-r--r--test/std/input.output/iostreams.base/is_error_code_enum_io_errc.pass.cpp25
-rw-r--r--test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.fail.cpp4
-rw-r--r--test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp8
-rw-r--r--test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp4
-rw-r--r--test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp8
-rw-r--r--test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp4
-rw-r--r--test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp8
-rw-r--r--test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp2
-rw-r--r--test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp2
-rw-r--r--test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp3
-rw-r--r--test/std/iterators/iterator.range/begin-end.fail.cpp4
-rw-r--r--test/std/iterators/iterator.range/begin-end.pass.cpp19
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp11
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/minus.pass.cpp14
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/plus.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.+/difference_type.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.+=/difference_type.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.-/difference_type.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.-=/difference_type.pass.cpp12
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_eq.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_gt.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_gte.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_lt.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_lte.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_neq.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/convert.pass.cpp12
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp9
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/iter.pass.cpp11
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.decr/post.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.decr/pre.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/pre.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.index/difference_type.pass.cpp44
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/op_arrow.pass.cpp15
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp37
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op=/move_iterator.pass.cpp13
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp11
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.pass.cpp13
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.pass.cpp14
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp14
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op!=/test.pass.cpp17
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/post.pass.cpp18
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/pre.pass.cpp19
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+/difference_type.pass.cpp18
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+=/difference_type.pass.cpp14
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/post.pass.cpp18
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/pre.pass.cpp19
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-/difference_type.pass.cpp18
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-=/difference_type.pass.cpp14
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op.star/op_star.pass.cpp17
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op==/test.pass.cpp18
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opdiff/test.pass.cpp16
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt/test.pass.cpp17
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt=/test.pass.cpp17
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opindex/difference_type.pass.cpp11
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt/test.pass.cpp17
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt=/test.pass.cpp17
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opref/op_arrow.pass.cpp32
-rw-r--r--test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opsum/difference_type.pass.cpp18
-rw-r--r--test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/copy.pass.cpp4
-rw-r--r--test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp31
-rw-r--r--test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp15
-rw-r--r--test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp22
-rw-r--r--test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp22
-rw-r--r--test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp22
-rw-r--r--test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/copy.pass.cpp1
-rw-r--r--test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp4
-rw-r--r--test/std/language.support/support.dynamic/align_val_t.pass.cpp34
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp89
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp80
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp82
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp83
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp85
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp5
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp7
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp14
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp13
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp8
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp8
-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.array/sized_delete_array_fsizeddeallocation.sh.cpp8
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp90
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new.pass.cpp6
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp80
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp82
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp84
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp85
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow.pass.cpp7
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp13
-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.cpp8
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp14
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp15
-rw-r--r--test/std/language.support/support.exception/except.nested/assign.pass.cpp5
-rw-r--r--test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp5
-rw-r--r--test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp5
-rw-r--r--test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp6
-rw-r--r--test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp2
-rw-r--r--test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp2
-rw-r--r--test/std/language.support/support.exception/propagation/current_exception.pass.cpp2
-rw-r--r--test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp2
-rw-r--r--test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp2
-rw-r--r--test/std/language.support/support.exception/uncaught/uncaught_exception.pass.cpp2
-rw-r--r--test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp2
-rw-r--r--test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp15
-rw-r--r--test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp6
-rw-r--r--test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp15
-rw-r--r--test/std/language.support/support.limits/limits/numeric.limits.members/infinity.pass.cpp2
-rw-r--r--test/std/language.support/support.runtime/cstdlib.pass.cpp2
-rw-r--r--test/std/language.support/support.types/nullptr_t.pass.cpp25
-rw-r--r--test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp1
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp7
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp13
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp1
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp3
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp3
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp1
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp30
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp33
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp32
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp37
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp21
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp18
-rw-r--r--test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp1
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp13
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp21
-rw-r--r--test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp29
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp27
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp14
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp37
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp12
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_long.pass.cpp3
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp2
-rw-r--r--test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp1
-rw-r--r--test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp13
-rw-r--r--test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp14
-rw-r--r--test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp2
-rw-r--r--test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp3
-rw-r--r--test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp1
-rw-r--r--test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp4
-rw-r--r--test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp9
-rw-r--r--test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp1
-rw-r--r--test/std/localization/locales/locale.global.templates/use_facet.pass.cpp6
-rw-r--r--test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp5
-rw-r--r--test/std/localization/locales/locale/locale.members/combine.pass.cpp5
-rw-r--r--test/std/numerics/c.math/ctgmath.pass.cpp5
-rw-r--r--test/std/numerics/c.math/tgmath_h.pass.cpp4
-rw-r--r--test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp4
-rw-r--r--test/std/numerics/complex.number/cmplx.over/UDT_is_rejected.fail.cpp74
-rw-r--r--test/std/numerics/complex.number/cmplx.over/arg.pass.cpp2
-rw-r--r--test/std/numerics/complex.number/cmplx.over/imag.pass.cpp5
-rw-r--r--test/std/numerics/complex.number/cmplx.over/norm.pass.cpp2
-rw-r--r--test/std/numerics/complex.number/cmplx.over/real.pass.cpp5
-rw-r--r--test/std/numerics/complex.number/complex.members/real_imag.pass.cpp4
-rw-r--r--test/std/numerics/complex.number/complex.ops/complex_equals_complex.pass.cpp4
-rw-r--r--test/std/numerics/complex.number/complex.ops/complex_equals_scalar.pass.cpp4
-rw-r--r--test/std/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp4
-rw-r--r--test/std/numerics/complex.number/complex.ops/complex_not_equals_scalar.pass.cpp4
-rw-r--r--test/std/numerics/complex.number/complex.ops/scalar_equals_complex.pass.cpp4
-rw-r--r--test/std/numerics/complex.number/complex.ops/scalar_not_equals_complex.pass.cpp4
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp1
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp1
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/log10.pass.cpp1
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp1
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp1
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp1
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp1
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp1
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp1
-rw-r--r--test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp1
-rw-r--r--test/std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp1
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.access/access.pass.cpp4
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.access/const_access.pass.cpp2
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp9
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp9
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.assign/move_assign.pass.cpp9
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.assign/value_assign.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/and_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/and_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/divide_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/divide_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/minus_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/minus_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/modulo_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/modulo_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/or_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/or_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/plus_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/plus_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/shift_left_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/shift_left_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/shift_right_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/shift_right_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/times_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/times_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/xor_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cassign/xor_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp9
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp4
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cons/move.pass.cpp9
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.cons/pointer_size.pass.cpp9
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.members/resize.pass.cpp7
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.members/swap.pass.cpp21
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.unary/bit_not.pass.cpp9
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.unary/negate.pass.cpp11
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.unary/not.pass.cpp5
-rw-r--r--test/std/numerics/numarray/template.valarray/valarray.unary/plus.pass.cpp11
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_valarray_value.pass.cpp5
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_value_valarray.pass.cpp5
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_valarray_value.pass.cpp5
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_value_valarray.pass.cpp5
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.special/swap.pass.cpp21
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/abs_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/acos_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/asin_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/cos_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/cosh_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/exp_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/log10_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/log_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_valarray_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_valarray_value.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_value_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sin_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sinh_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sqrt_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/tan_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/tanh_valarray.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.range/end_const.pass.cpp3
-rw-r--r--test/std/numerics/numarray/valarray.range/end_non_const.pass.cpp3
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool3.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp132
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp25
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp131
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp18
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp8
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp8
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp18
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp8
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp8
-rw-r--r--test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp9
-rw-r--r--test/std/numerics/rand/rand.device/ctor.pass.cpp5
-rw-r--r--test/std/numerics/rand/rand.device/entropy.pass.cpp1
-rw-r--r--test/std/numerics/rand/rand.device/eval.pass.cpp4
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval.pass.cpp5
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval_param.pass.cpp5
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp38
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval_param.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp12
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval_param.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp16
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval_param.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval.pass.cpp7
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval_param.pass.cpp7
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp2
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp2
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp10
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval_param.pass.cpp10
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval.pass.cpp3
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval_param.pass.cpp3
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval_param.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval.pass.cpp7
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval_param.pass.cpp3
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp8
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval_param.pass.cpp8
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval_param.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval_param.pass.cpp6
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval.pass.cpp7
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval_param.pass.cpp7
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp44
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp5
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp66
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp12
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp21
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval_param.pass.cpp3
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp23
-rw-r--r--test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval_param.pass.cpp3
-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.cpp2
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp2
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/seed_result_type.pass.cpp2
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp25
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp18
-rw-r--r--test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp18
-rw-r--r--test/std/numerics/rand/rand.predef/default_random_engine.pass.cpp4
-rw-r--r--test/std/re/re.alg/re.alg.match/awk.pass.cpp7
-rw-r--r--test/std/re/re.alg/re.alg.match/basic.pass.cpp52
-rw-r--r--test/std/re/re.alg/re.alg.match/ecma.pass.cpp126
-rw-r--r--test/std/re/re.alg/re.alg.match/extended.pass.cpp68
-rw-r--r--test/std/re/re.alg/re.alg.search/awk.pass.cpp72
-rw-r--r--test/std/re/re.alg/re.alg.search/basic.pass.cpp52
-rw-r--r--test/std/re/re.alg/re.alg.search/ecma.pass.cpp64
-rw-r--r--test/std/re/re.alg/re.alg.search/extended.pass.cpp68
-rw-r--r--test/std/re/re.alg/re.alg.search/grep.pass.cpp5
-rw-r--r--test/std/re/re.const/re.matchflag/match_not_null.pass.cpp46
-rw-r--r--test/std/re/re.regex/re.regex.assign/assign.pass.cpp3
-rw-r--r--test/std/re/re.regex/re.regex.construct/bad_backref.pass.cpp44
-rw-r--r--test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp2
-rw-r--r--test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp2
-rw-r--r--test/std/re/re.regex/re.regex.construct/ptr_size.pass.cpp39
-rw-r--r--test/std/re/re.regex/types.pass.cpp6
-rw-r--r--test/std/re/re.results/re.results.acc/begin_end.pass.cpp3
-rw-r--r--test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp3
-rw-r--r--test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp2
-rw-r--r--test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp2
-rw-r--r--test/std/re/re.traits/value.pass.cpp16
-rw-r--r--test/std/strings/basic.string/string.access/at.pass.cpp31
-rw-r--r--test/std/strings/basic.string/string.access/index.pass.cpp4
-rw-r--r--test/std/strings/basic.string/string.capacity/capacity.pass.cpp7
-rw-r--r--test/std/strings/basic.string/string.capacity/max_size.pass.cpp2
-rw-r--r--test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp2
-rw-r--r--test/std/strings/basic.string/string.capacity/reserve.pass.cpp19
-rw-r--r--test/std/strings/basic.string/string.capacity/resize_size.pass.cpp18
-rw-r--r--test/std/strings/basic.string/string.capacity/resize_size_char.pass.cpp18
-rw-r--r--test/std/strings/basic.string/string.cons/T_size_size.pass.cpp186
-rw-r--r--test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp8
-rw-r--r--test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp5
-rw-r--r--test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp5
-rw-r--r--test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp17
-rw-r--r--test/std/strings/basic.string/string.cons/string_view.fail.cpp23
-rw-r--r--test/std/strings/basic.string/string.cons/string_view.pass.cpp89
-rw-r--r--test/std/strings/basic.string/string.cons/substr.pass.cpp64
-rw-r--r--test/std/strings/basic.string/string.iterators/end.pass.cpp5
-rw-r--r--test/std/strings/basic.string/string.iterators/rend.pass.cpp5
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/T_size_size.pass.cpp200
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp26
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/pointer.pass.cpp16
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/pointer_size.pass.cpp16
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/string_size_size.pass.cpp35
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_append/string_view.pass.cpp83
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/T_size_size.pass.cpp195
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp26
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp14
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp16
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/string_size_size.pass.cpp35
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/string_view.pass.cpp105
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp21
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp43
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp25
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_T_size_size.pass.cpp1842
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_pointer.pass.cpp38
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_pointer_size.pass.cpp38
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_size_char.pass.cpp22
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp22
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_insert/size_string_size_size.pass.cpp43
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp30
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp16
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp16
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_T_size_size.pass.cpp6022
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp22
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp22
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp22
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp22
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp43
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp15
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_op!=/string_string_view.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_op!=/string_view_string.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_operator==/string_string_view.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_operator==/string_view_string.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_opgt/string_string_view.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_opgt/string_view_string.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_opgt=/string_string_view.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_opgt=/string_view_string.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_oplt/string_string_view.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_oplt/string_view_string.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_oplt=/string_string_view.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.nonmembers/string_oplt=/string_view_string.pass.cpp70
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp5993
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp22
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp22
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp22
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp49
-rw-r--r--test/std/strings/basic.string/string.ops/string_substr/substr.pass.cpp17
-rw-r--r--test/std/strings/basic.string/string.require/contiguous.pass.cpp2
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign3.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign3.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign3.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp1
-rw-r--r--test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp1
-rw-r--r--test/std/strings/string.conversions/stod.pass.cpp23
-rw-r--r--test/std/strings/string.conversions/stof.pass.cpp19
-rw-r--r--test/std/strings/string.conversions/stoi.pass.cpp5
-rw-r--r--test/std/strings/string.conversions/stol.pass.cpp5
-rw-r--r--test/std/strings/string.conversions/stold.pass.cpp25
-rw-r--r--test/std/strings/string.conversions/stoll.pass.cpp5
-rw-r--r--test/std/strings/string.conversions/stoul.pass.cpp5
-rw-r--r--test/std/strings/string.conversions/stoull.pass.cpp5
-rw-r--r--test/std/strings/string.view/nothing_to_do.pass.cpp12
-rw-r--r--test/std/strings/string.view/string.view.access/at.pass.cpp63
-rw-r--r--test/std/strings/string.view/string.view.access/back.pass.cpp50
-rw-r--r--test/std/strings/string.view/string.view.access/data.pass.cpp50
-rw-r--r--test/std/strings/string.view/string.view.access/front.pass.cpp50
-rw-r--r--test/std/strings/string.view/string.view.access/index.pass.cpp53
-rw-r--r--test/std/strings/string.view/string.view.capacity/capacity.pass.cpp89
-rw-r--r--test/std/strings/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp69
-rw-r--r--test/std/strings/string.view/string.view.comparison/opeq.string_view.string.pass.cpp51
-rw-r--r--test/std/strings/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp62
-rw-r--r--test/std/strings/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp72
-rw-r--r--test/std/strings/string.view/string.view.comparison/opge.string_view.string.pass.cpp50
-rw-r--r--test/std/strings/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp65
-rw-r--r--test/std/strings/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp72
-rw-r--r--test/std/strings/string.view/string.view.comparison/opgt.string_view.string.pass.cpp50
-rw-r--r--test/std/strings/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp65
-rw-r--r--test/std/strings/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp72
-rw-r--r--test/std/strings/string.view/string.view.comparison/ople.string_view.string.pass.cpp50
-rw-r--r--test/std/strings/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp65
-rw-r--r--test/std/strings/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp72
-rw-r--r--test/std/strings/string.view/string.view.comparison/oplt.string_view.string.pass.cpp50
-rw-r--r--test/std/strings/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp65
-rw-r--r--test/std/strings/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp70
-rw-r--r--test/std/strings/string.view/string.view.comparison/opne.string_view.string.pass.cpp50
-rw-r--r--test/std/strings/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp62
-rw-r--r--test/std/strings/string.view/string.view.cons/default.pass.cpp48
-rw-r--r--test/std/strings/string.view/string.view.cons/from_literal.pass.cpp65
-rw-r--r--test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp83
-rw-r--r--test/std/strings/string.view/string.view.cons/from_string.pass.cpp56
-rw-r--r--test/std/strings/string.view/string.view.cons/from_string1.fail.cpp32
-rw-r--r--test/std/strings/string.view/string.view.cons/from_string2.fail.cpp32
-rw-r--r--test/std/strings/string.view/string.view.find/find_char_size.pass.cpp85
-rw-r--r--test/std/strings/string.view/string.view.find/find_first_not_of_char_size.pass.cpp85
-rw-r--r--test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp166
-rw-r--r--test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/strings/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp148
-rw-r--r--test/std/strings/string.view/string.view.find/find_first_of_char_size.pass.cpp83
-rw-r--r--test/std/strings/string.view/string.view.find/find_first_of_pointer_size.pass.cpp166
-rw-r--r--test/std/strings/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/strings/string.view/string.view.find/find_first_of_string_view_size.pass.cpp148
-rw-r--r--test/std/strings/string.view/string.view.find/find_last_not_of_char_size.pass.cpp83
-rw-r--r--test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp166
-rw-r--r--test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp148
-rw-r--r--test/std/strings/string.view/string.view.find/find_last_of_char_size.pass.cpp83
-rw-r--r--test/std/strings/string.view/string.view.find/find_last_of_pointer_size.pass.cpp166
-rw-r--r--test/std/strings/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp393
-rw-r--r--test/std/strings/string.view/string.view.find/find_last_of_string_view_size.pass.cpp148
-rw-r--r--test/std/strings/string.view/string.view.find/find_pointer_size.pass.cpp172
-rw-r--r--test/std/strings/string.view/string.view.find/find_pointer_size_size.pass.cpp394
-rw-r--r--test/std/strings/string.view/string.view.find/find_string_view_size.pass.cpp165
-rw-r--r--test/std/strings/string.view/string.view.find/rfind_char_size.pass.cpp84
-rw-r--r--test/std/strings/string.view/string.view.find/rfind_pointer_size.pass.cpp172
-rw-r--r--test/std/strings/string.view/string.view.find/rfind_pointer_size_size.pass.cpp393
-rw-r--r--test/std/strings/string.view/string.view.find/rfind_string_view_size.pass.cpp165
-rw-r--r--test/std/strings/string.view/string.view.hash/string_view.pass.cpp55
-rw-r--r--test/std/strings/string.view/string.view.io/stream_insert.pass.cpp58
-rw-r--r--test/std/strings/string.view/string.view.iterators/begin.pass.cpp79
-rw-r--r--test/std/strings/string.view/string.view.iterators/end.pass.cpp88
-rw-r--r--test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp61
-rw-r--r--test/std/strings/string.view/string.view.iterators/rend.pass.cpp69
-rw-r--r--test/std/strings/string.view/string.view.modifiers/clear.pass.cpp67
-rw-r--r--test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp78
-rw-r--r--test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp78
-rw-r--r--test/std/strings/string.view/string.view.modifiers/swap.pass.cpp76
-rw-r--r--test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp214
-rw-r--r--test/std/strings/string.view/string.view.ops/compare.pointer.pass.cpp127
-rw-r--r--test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp452
-rw-r--r--test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp401
-rw-r--r--test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp1352
-rw-r--r--test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp5847
-rw-r--r--test/std/strings/string.view/string.view.ops/compare.sv.pass.cpp122
-rw-r--r--test/std/strings/string.view/string.view.ops/copy.pass.cpp102
-rw-r--r--test/std/strings/string.view/string.view.ops/substr.pass.cpp121
-rw-r--r--test/std/strings/string.view/string.view.synop/nothing_to_do.pass.cpp12
-rw-r--r--test/std/strings/string.view/string.view.template/nothing_to_do.pass.cpp12
-rw-r--r--test/std/thread/futures/futures.async/async.pass.cpp6
-rw-r--r--test/std/thread/futures/futures.future_error/code.pass.cpp14
-rw-r--r--test/std/thread/futures/futures.future_error/what.pass.cpp10
-rw-r--r--test/std/thread/futures/futures.overview/is_error_code_enum_future_errc.pass.cpp6
-rw-r--r--test/std/thread/futures/futures.promise/dtor.pass.cpp11
-rw-r--r--test/std/thread/futures/futures.promise/get_future.pass.cpp5
-rw-r--r--test/std/thread/futures/futures.promise/move_assign.pass.cpp8
-rw-r--r--test/std/thread/futures/futures.promise/move_ctor.pass.cpp8
-rw-r--r--test/std/thread/futures/futures.promise/set_exception.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp3
-rw-r--r--test/std/thread/futures/futures.promise/set_lvalue.pass.cpp5
-rw-r--r--test/std/thread/futures/futures.promise/set_value_const.pass.cpp11
-rw-r--r--test/std/thread/futures/futures.promise/set_value_void.pass.cpp2
-rw-r--r--test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp6
-rw-r--r--test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp6
-rw-r--r--test/std/thread/futures/futures.shared_future/get.pass.cpp9
-rw-r--r--test/std/thread/futures/futures.task/futures.task.members/ctor1.fail.cpp7
-rw-r--r--test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp8
-rw-r--r--test/std/thread/futures/futures.task/futures.task.members/get_future.pass.cpp5
-rw-r--r--test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp15
-rw-r--r--test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp15
-rw-r--r--test/std/thread/futures/futures.task/futures.task.members/reset.pass.cpp7
-rw-r--r--test/std/thread/futures/futures.unique_future/get.pass.cpp9
-rw-r--r--test/std/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp75
-rw-r--r--test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp1
-rw-r--r--test/std/thread/thread.condition/thread.condition.condvarany/wait_for_pred.pass.cpp6
-rw-r--r--test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp20
-rw-r--r--test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp13
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_adopt_lock.pass.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp1
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp5
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp8
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.lock/types.pass.cpp6
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp7
-rw-r--r--test/std/thread/thread.mutex/thread.once/thread.once.callonce/race.pass.cpp48
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp1
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp11
-rw-r--r--test/std/thread/thread.threads/thread.thread.class/thread.thread.member/get_id.pass.cpp3
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp6
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp6
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp9
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp139
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp155
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp156
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp155
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp147
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp139
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp4
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp6
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.types/is_always_equal.pass.cpp7
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp5
-rw-r--r--test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp6
-rw-r--r--test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp4
-rw-r--r--test/std/utilities/allocator.adaptor/scoped.adaptor.operators/eq.pass.cpp6
-rw-r--r--test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp4
-rw-r--r--test/std/utilities/allocator.adaptor/types.pass.cpp6
-rw-r--r--test/std/utilities/any/any.class/any.assign/copy.pass.cpp197
-rw-r--r--test/std/utilities/any/any.class/any.assign/move.pass.cpp108
-rw-r--r--test/std/utilities/any/any.class/any.assign/value.pass.cpp209
-rw-r--r--test/std/utilities/any/any.class/any.cons/copy.pass.cpp100
-rw-r--r--test/std/utilities/any/any.class/any.cons/default.pass.cpp47
-rw-r--r--test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp194
-rw-r--r--test/std/utilities/any/any.class/any.cons/move.pass.cpp104
-rw-r--r--test/std/utilities/any/any.class/any.cons/value.pass.cpp154
-rw-r--r--test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp262
-rw-r--r--test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp63
-rw-r--r--test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp133
-rw-r--r--test/std/utilities/any/any.class/any.observers/has_value.pass.cpp64
-rw-r--r--test/std/utilities/any/any.class/any.observers/type.pass.cpp41
-rw-r--r--test/std/utilities/any/any.class/not_literal_type.pass.cpp21
-rw-r--r--test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp171
-rw-r--r--test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp313
-rw-r--r--test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp66
-rw-r--r--test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp46
-rw-r--r--test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp58
-rw-r--r--test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp37
-rw-r--r--test/std/utilities/any/any.nonmembers/make_any.pass.cpp140
-rw-r--r--test/std/utilities/any/any.nonmembers/swap.pass.cpp40
-rw-r--r--test/std/utilities/function.objects/arithmetic.operations/divides.pass.cpp8
-rw-r--r--test/std/utilities/function.objects/arithmetic.operations/minus.pass.cpp8
-rw-r--r--test/std/utilities/function.objects/arithmetic.operations/modulus.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp8
-rw-r--r--test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp8
-rw-r--r--test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp8
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.bind/bind_return_type.pass.cpp8
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp2
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp2
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp26
-rw-r--r--test/std/utilities/function.objects/bitwise.operations/bit_and.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/bitwise.operations/bit_or.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp6
-rw-r--r--test/std/utilities/function.objects/func.invoke/invoke_feature_test_macro.pass.cpp39
-rw-r--r--test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp28
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.fail.cpp25
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp29
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp15
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp21
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp21
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.fail.cpp25
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp3
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.fail.cpp (renamed from test/libcxx/containers/sequences/list/db_iterators_8.pass.cpp)26
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp24
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.fail.cpp (renamed from test/libcxx/containers/sequences/list/db_back.pass.cpp)28
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp1
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.fail.cpp (renamed from test/libcxx/containers/sequences/list/db_cback.pass.cpp)23
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp3
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.fail.cpp60
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp3
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp119
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp175
-rw-r--r--test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/refwrap/type_properties.pass.cpp6
-rw-r--r--test/std/utilities/function.objects/unord.hash/enum.pass.cpp7
-rw-r--r--test/std/utilities/function.objects/unord.hash/integral.pass.cpp4
-rw-r--r--test/std/utilities/function.objects/unord.hash/non_enum.pass.cpp38
-rw-r--r--test/std/utilities/intseq/intseq.intseq/integer_seq.fail.cpp6
-rw-r--r--test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp3
-rw-r--r--test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.fail.cpp3
-rw-r--r--test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp5
-rw-r--r--test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp17
-rw-r--r--test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp10
-rw-r--r--test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp5
-rw-r--r--test/std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp6
-rw-r--r--test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp20
-rw-r--r--test/std/utilities/memory/allocator.traits/allocator.traits.members/select_on_container_copy_construction.pass.cpp6
-rw-r--r--test/std/utilities/memory/allocator.traits/rebind_traits.pass.cpp8
-rw-r--r--test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp38
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp34
-rw-r--r--test/std/utilities/memory/default.allocator/allocator_types.pass.cpp4
-rw-r--r--test/std/utilities/memory/pointer.traits/rebind.pass.cpp4
-rw-r--r--test/std/utilities/memory/specialized.algorithms/specialized.addressof/addressof.temp.fail.cpp26
-rw-r--r--test/std/utilities/memory/specialized.algorithms/specialized.addressof/constexpr_addressof.pass.cpp2
-rw-r--r--test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy.pass.cpp47
-rw-r--r--test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_at.pass.cpp78
-rw-r--r--test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_n.pass.cpp49
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/uninitialized_default_construct.pass.cpp112
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/uninitialized_default_construct_n.pass.cpp116
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct.pass.cpp111
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct_n.pass.cpp115
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp13
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp13
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp13
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp13
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.move/uninitialized_move.pass.cpp114
-rw-r--r--test/std/utilities/memory/specialized.algorithms/uninitialized.move/uninitialized_move_n.pass.cpp117
-rw-r--r--test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp3
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp1
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp11
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp6
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp2
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp42
-rw-r--r--test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp42
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp4
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp4
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator_throw.pass.cpp2
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp2
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp2
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp2
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp2
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp16
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp16
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp3
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp7
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp3
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp6
-rw-r--r--test/std/utilities/meta/meta.help/integral_constant.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp20
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp209
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp13
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp11
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp8
-rw-r--r--test/std/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp8
-rw-r--r--test/std/utilities/meta/meta.unary.prop.query/void_t_feature_test_macro.pass.cpp36
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer_no_variadics.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp7
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp193
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp4
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp20
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp36
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp2
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp2
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_assignable.pass.cpp2
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp9
-rw-r--r--test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_swappable_with.pass.cpp2
-rw-r--r--test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp23
-rw-r--r--test/std/utilities/optional/optional.bad_optional_access/derive.pass.cpp25
-rw-r--r--test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp53
-rw-r--r--test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp55
-rw-r--r--test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp55
-rw-r--r--test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp55
-rw-r--r--test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp55
-rw-r--r--test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp53
-rw-r--r--test/std/utilities/optional/optional.hash/hash.pass.cpp48
-rw-r--r--test/std/utilities/optional/optional.nullops/equal.pass.cpp39
-rw-r--r--test/std/utilities/optional/optional.nullops/greater.pass.cpp39
-rw-r--r--test/std/utilities/optional/optional.nullops/greater_equal.pass.cpp39
-rw-r--r--test/std/utilities/optional/optional.nullops/less_equal.pass.cpp40
-rw-r--r--test/std/utilities/optional/optional.nullops/less_than.pass.cpp39
-rw-r--r--test/std/utilities/optional/optional.nullops/not_equal.pass.cpp39
-rw-r--r--test/std/utilities/optional/optional.nullopt/not_brace_initializable.fail.cpp25
-rw-r--r--test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp38
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/assign_value.pass.cpp273
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/const_optional_U.pass.cpp254
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp102
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp237
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp113
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/move.pass.cpp174
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp67
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/optional_U.pass.cpp268
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp143
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp128
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/const_optional_U.pass.cpp134
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp155
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/default.pass.cpp81
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/explicit_const_optional_U.pass.cpp121
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/explicit_optional_U.pass.cpp84
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp148
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp116
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp201
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp73
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/optional_U.pass.cpp93
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp153
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp68
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp61
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/bool.pass.cpp37
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp73
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp69
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp69
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp73
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/has_value.pass.cpp37
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp72
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp76
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp73
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/value_const.fail.cpp (renamed from test/libcxx/containers/sequences/list/db_front.pass.cpp)33
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp64
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp64
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/value_or.pass.cpp68
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/value_or_const.pass.cpp77
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp72
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.swap/swap.pass.cpp306
-rw-r--r--test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp50
-rw-r--r--test/std/utilities/optional/optional.object/special_member_gen.pass.cpp74
-rw-r--r--test/std/utilities/optional/optional.object/types.pass.cpp38
-rw-r--r--test/std/utilities/optional/optional.relops/equal.pass.cpp74
-rw-r--r--test/std/utilities/optional/optional.relops/greater_equal.pass.cpp70
-rw-r--r--test/std/utilities/optional/optional.relops/greater_than.pass.cpp70
-rw-r--r--test/std/utilities/optional/optional.relops/less_equal.pass.cpp70
-rw-r--r--test/std/utilities/optional/optional.relops/less_than.pass.cpp70
-rw-r--r--test/std/utilities/optional/optional.relops/not_equal.pass.cpp74
-rw-r--r--test/std/utilities/optional/optional.specalg/make_optional.pass.cpp51
-rw-r--r--test/std/utilities/optional/optional.specalg/make_optional_explicit.pass.cpp45
-rw-r--r--test/std/utilities/optional/optional.specalg/make_optional_explicit_initializer_list.pass.cpp53
-rw-r--r--test/std/utilities/optional/optional.specalg/swap.pass.cpp352
-rw-r--r--test/std/utilities/optional/optional.syn/optional_in_place_t.fail.cpp26
-rw-r--r--test/std/utilities/optional/optional.syn/optional_includes_initializer_list.pass.cpp (renamed from test/std/utilities/utility/forward/forward2.fail.cpp)17
-rw-r--r--test/std/utilities/optional/optional.syn/optional_nullopt_t.fail.cpp29
-rw-r--r--test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp5
-rw-r--r--test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp31
-rw-r--r--test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp31
-rw-r--r--test/std/utilities/template.bitset/bitset.members/set_one.pass.cpp35
-rw-r--r--test/std/utilities/template.bitset/bitset.members/test.pass.cpp31
-rw-r--r--test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp2
-rw-r--r--test/std/utilities/time/rep.h10
-rw-r--r--test/std/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp6
-rw-r--r--test/std/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp4
-rw-r--r--test/std/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp4
-rw-r--r--test/std/utilities/time/time.point/time.point.cons/convert.pass.cpp4
-rw-r--r--test/std/utilities/time/time.point/time.point.cons/default.pass.cpp3
-rw-r--r--test/std/utilities/time/time.point/time.point.cons/duration.pass.cpp4
-rw-r--r--test/std/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp4
-rw-r--r--test/std/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp17
-rw-r--r--test/std/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp5
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp8
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp6
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp26
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp34
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp50
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp69
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp6
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp2
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp88
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp24
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_pair.pass.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp12
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp6
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp18
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp40
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp30
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp35
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp2
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move_pair.pass.cpp6
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp6
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.creation/make_tuple.pass.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp3
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.cpp2
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp2
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp6
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp26
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp2
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.rel/eq.pass.cpp56
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.rel/lt.pass.cpp62
-rw-r--r--test/std/utilities/utility/exchange/exchange.pass.cpp4
-rw-r--r--test/std/utilities/utility/forward/forward.fail.cpp53
-rw-r--r--test/std/utilities/utility/forward/forward.pass.cpp114
-rw-r--r--test/std/utilities/utility/forward/forward5.fail.cpp25
-rw-r--r--test/std/utilities/utility/forward/forward_03.pass.cpp58
-rw-r--r--test/std/utilities/utility/forward/move.fail.cpp (renamed from test/std/utilities/utility/forward/move_only.pass.cpp)21
-rw-r--r--test/std/utilities/utility/forward/move.pass.cpp121
-rw-r--r--test/std/utilities/utility/forward/move_copy.pass.cpp61
-rw-r--r--test/std/utilities/utility/forward/move_only1.fail.cpp52
-rw-r--r--test/std/utilities/utility/forward/move_only2.fail.cpp52
-rw-r--r--test/std/utilities/utility/forward/move_only3.fail.cpp49
-rw-r--r--test/std/utilities/utility/forward/move_only4.fail.cpp52
-rw-r--r--test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp4
-rw-r--r--test/std/utilities/utility/pairs/pair.astuple/get_const_rv.pass.cpp4
-rw-r--r--test/std/utilities/utility/pairs/pair.astuple/get_non_const.pass.cpp2
-rw-r--r--test/std/utilities/utility/pairs/pair.astuple/get_rv.pass.cpp6
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/U_V.pass.cpp74
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp2
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp101
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_pair_cxx03.pass.cpp49
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp68
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp6
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/assign_tuple.pass.cpp140
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp76
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/const_first_const_second_cxx03.pass.cpp42
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp149
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V_cxx03.pass.cpp29
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp4
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp16
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp32
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp2
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/not_constexpr_cxx11.fail.cpp57
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp139
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/special_member_generation_test.pass.cpp127
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp4
-rw-r--r--test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp6
-rw-r--r--test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp28
-rw-r--r--test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp17
-rw-r--r--test/std/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp4
-rw-r--r--test/std/utilities/utility/utility.inplace/inplace.pass.cpp74
-rw-r--r--test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp37
-rw-r--r--test/std/utilities/variant/variant.general/nothing_to_do.pass.cpp11
-rw-r--r--test/std/utilities/variant/variant.get/get_if_index.pass.cpp132
-rw-r--r--test/std/utilities/variant/variant.get/get_if_type.pass.cpp130
-rw-r--r--test/std/utilities/variant/variant.get/get_index.pass.cpp287
-rw-r--r--test/std/utilities/variant/variant.get/get_type.pass.cpp287
-rw-r--r--test/std/utilities/variant/variant.get/holds_alternative.pass.cpp38
-rw-r--r--test/std/utilities/variant/variant.hash/hash.pass.cpp124
-rw-r--r--test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp77
-rw-r--r--test/std/utilities/variant/variant.helpers/variant_size.pass.cpp44
-rw-r--r--test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp55
-rw-r--r--test/std/utilities/variant/variant.monostate/monostate.pass.cpp28
-rw-r--r--test/std/utilities/variant/variant.relops/relops.pass.cpp227
-rw-r--r--test/std/utilities/variant/variant.synopsis/variant_npos.pass.cpp21
-rw-r--r--test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp232
-rw-r--r--test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp397
-rw-r--r--test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp319
-rw-r--r--test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp112
-rw-r--r--test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp159
-rw-r--r--test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp112
-rw-r--r--test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp103
-rw-r--r--test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp103
-rw-r--r--test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp113
-rw-r--r--test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_init_list_args.pass.cpp110
-rw-r--r--test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp197
-rw-r--r--test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp75
-rw-r--r--test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp137
-rw-r--r--test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp85
-rw-r--r--test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp138
-rw-r--r--test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp85
-rw-r--r--test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp58
-rw-r--r--test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp51
-rw-r--r--test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp591
-rw-r--r--test/std/utilities/variant/variant.variant/variant_array.fail.cpp33
-rw-r--r--test/std/utilities/variant/variant.variant/variant_empty.fail.cpp26
-rw-r--r--test/std/utilities/variant/variant.variant/variant_reference.fail.cpp28
-rw-r--r--test/std/utilities/variant/variant.variant/variant_void.fail.cpp33
-rw-r--r--test/std/utilities/variant/variant.visit/visit.pass.cpp291
-rw-r--r--test/support/any_helpers.h163
-rw-r--r--test/support/archetypes.hpp379
-rw-r--r--test/support/archetypes.ipp169
-rw-r--r--test/support/container_test_types.h2
-rw-r--r--test/support/controlled_allocators.hpp502
-rw-r--r--test/support/count_new.hpp26
-rw-r--r--test/support/debug_mode_helper.h382
-rw-r--r--test/support/demangle.h49
-rw-r--r--test/support/experimental_any_helpers.h326
-rw-r--r--test/support/external_threads.cpp10
-rw-r--r--test/support/filesystem_test_helper.hpp1
-rw-r--r--test/support/is_transparent.h4
-rw-r--r--test/support/min_allocator.h38
-rw-r--r--test/support/nasty_containers.hpp104
-rw-r--r--test/support/test.support/test_demangle.pass.cpp38
-rw-r--r--test/support/test.support/test_macros_header_rtti.pass.cpp1
-rw-r--r--test/support/test_allocator.h157
-rw-r--r--test/support/test_iterators.h24
-rw-r--r--test/support/test_macros.h73
-rw-r--r--test/support/test_memory_resource.hpp356
-rw-r--r--test/support/type_id.h52
-rw-r--r--test/support/uses_alloc_types.hpp168
-rw-r--r--test/support/variant_test_helpers.hpp81
-rw-r--r--test/ubsan_blacklist.txt1
-rwxr-xr-xutils/gen_link_script/gen_link_script.py24
-rw-r--r--utils/google-benchmark/.gitignore46
-rw-r--r--utils/google-benchmark/AUTHORS35
-rw-r--r--utils/google-benchmark/CMakeLists.txt179
-rw-r--r--utils/google-benchmark/CONTRIBUTING.md58
-rw-r--r--utils/google-benchmark/CONTRIBUTORS53
-rw-r--r--utils/google-benchmark/LICENSE202
-rw-r--r--utils/google-benchmark/README.LLVM6
-rw-r--r--utils/google-benchmark/README.md597
-rw-r--r--utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake37
-rw-r--r--utils/google-benchmark/cmake/CXXFeatureCheck.cmake44
-rw-r--r--utils/google-benchmark/cmake/GetGitVersion.cmake51
-rw-r--r--utils/google-benchmark/cmake/gnu_posix_regex.cpp12
-rw-r--r--utils/google-benchmark/cmake/posix_regex.cpp14
-rw-r--r--utils/google-benchmark/cmake/std_regex.cpp10
-rw-r--r--utils/google-benchmark/cmake/steady_clock.cpp7
-rw-r--r--utils/google-benchmark/cmake/thread_safety_attributes.cpp4
-rw-r--r--utils/google-benchmark/include/benchmark/benchmark.h21
-rw-r--r--utils/google-benchmark/include/benchmark/benchmark_api.h864
-rw-r--r--utils/google-benchmark/include/benchmark/macros.h66
-rw-r--r--utils/google-benchmark/include/benchmark/reporter.h219
-rw-r--r--utils/google-benchmark/src/CMakeLists.txt44
-rw-r--r--utils/google-benchmark/src/arraysize.h33
-rw-r--r--utils/google-benchmark/src/benchmark.cc667
-rw-r--r--utils/google-benchmark/src/benchmark_api_internal.h47
-rw-r--r--utils/google-benchmark/src/benchmark_register.cc439
-rw-r--r--utils/google-benchmark/src/check.h71
-rw-r--r--utils/google-benchmark/src/colorprint.cc188
-rw-r--r--utils/google-benchmark/src/colorprint.h33
-rw-r--r--utils/google-benchmark/src/commandlineflags.cc218
-rw-r--r--utils/google-benchmark/src/commandlineflags.h79
-rw-r--r--utils/google-benchmark/src/complexity.cc284
-rw-r--r--utils/google-benchmark/src/complexity.h61
-rw-r--r--utils/google-benchmark/src/console_reporter.cc132
-rw-r--r--utils/google-benchmark/src/csv_reporter.cc108
-rw-r--r--utils/google-benchmark/src/cycleclock.h145
-rw-r--r--utils/google-benchmark/src/internal_macros.h42
-rw-r--r--utils/google-benchmark/src/json_reporter.cc163
-rw-r--r--utils/google-benchmark/src/log.h73
-rw-r--r--utils/google-benchmark/src/mutex.h155
-rw-r--r--utils/google-benchmark/src/re.h126
-rw-r--r--utils/google-benchmark/src/reporter.cc68
-rw-r--r--utils/google-benchmark/src/sleep.cc50
-rw-r--r--utils/google-benchmark/src/sleep.h17
-rw-r--r--utils/google-benchmark/src/stat.h306
-rw-r--r--utils/google-benchmark/src/string_util.cc168
-rw-r--r--utils/google-benchmark/src/string_util.h40
-rw-r--r--utils/google-benchmark/src/sysinfo.cc348
-rw-r--r--utils/google-benchmark/src/sysinfo.h10
-rw-r--r--utils/google-benchmark/src/timers.cc195
-rw-r--r--utils/google-benchmark/src/timers.h48
-rw-r--r--utils/google-benchmark/test/CMakeLists.txt139
-rw-r--r--utils/google-benchmark/test/basic_test.cc99
-rw-r--r--utils/google-benchmark/test/benchmark_test.cc241
-rw-r--r--utils/google-benchmark/test/complexity_test.cc167
-rw-r--r--utils/google-benchmark/test/cxx03_test.cc42
-rw-r--r--utils/google-benchmark/test/diagnostics_test.cc64
-rw-r--r--utils/google-benchmark/test/donotoptimize_test.cc33
-rw-r--r--utils/google-benchmark/test/filter_test.cc104
-rw-r--r--utils/google-benchmark/test/fixture_test.cc49
-rw-r--r--utils/google-benchmark/test/map_test.cc56
-rw-r--r--utils/google-benchmark/test/multiple_ranges_test.cc74
-rw-r--r--utils/google-benchmark/test/options_test.cc43
-rw-r--r--utils/google-benchmark/test/output_test.h71
-rw-r--r--utils/google-benchmark/test/output_test_helper.cc234
-rw-r--r--utils/google-benchmark/test/register_benchmark_test.cc148
-rw-r--r--utils/google-benchmark/test/reporter_output_test.cc256
-rw-r--r--utils/google-benchmark/test/skip_with_error_test.cc150
-rw-r--r--utils/google-benchmark/tools/compare_bench.py30
-rw-r--r--utils/google-benchmark/tools/gbench/Inputs/test1_run1.json46
-rw-r--r--utils/google-benchmark/tools/gbench/Inputs/test1_run2.json46
-rw-r--r--utils/google-benchmark/tools/gbench/__init__.py8
-rw-r--r--utils/google-benchmark/tools/gbench/report.py141
-rw-r--r--utils/google-benchmark/tools/gbench/util.py130
-rwxr-xr-xutils/merge_archives.py130
-rw-r--r--utils/sym_check/sym_check/extract.py10
-rw-r--r--utils/sym_check/sym_check/util.py169
-rwxr-xr-xutils/sym_check/sym_diff.py13
-rwxr-xr-xutils/sym_check/sym_extract.py5
-rw-r--r--www/cxx1z_status.html158
-rw-r--r--www/debug_mode.html162
-rw-r--r--www/index.html6
-rw-r--r--www/results.Linux.html513
-rw-r--r--www/results.Windows.html487
-rw-r--r--www/upcoming_meeting.html222
2037 files changed, 100003 insertions, 13791 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 000000000000..b708c8117c6b
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,11 @@
+BasedOnStyle: LLVM
+
+---
+Language: Cpp
+
+AlwaysBreakTemplateDeclarations: true
+
+# Disable formatting options which may break tests.
+SortIncludes: false
+ReflowComments: false
+---
diff --git a/.gitignore b/.gitignore
index b26d5f7aa908..49657ed8102f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,3 +52,10 @@ docs/_build/
# PyBuilder
target/
+
+# MSVC libraries test harness
+env.lst
+keep.lst
+
+# Editor by-products
+.vscode/
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d618e8358cae..823bfb5cd9b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,23 +19,17 @@ set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
)
-# Find the LLVM sources and simulate LLVM CMake options.
-include(HandleOutOfTreeLLVM)
-if (LIBCXX_BUILT_STANDALONE)
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
project(libcxx CXX C)
set(PACKAGE_NAME libcxx)
- set(PACKAGE_VERSION trunk-svn)
+ set(PACKAGE_VERSION 4.0.0svn)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org")
-endif ()
-if (LIBCXX_BUILT_STANDALONE AND NOT LLVM_FOUND)
- message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: "
- "llvm-config not found and LLVM_PATH not defined.\n"
- "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config "
- "or -DLLVM_PATH=path/to/llvm-source-root.")
+ # Find the LLVM sources and simulate LLVM CMake options.
+ include(HandleOutOfTreeLLVM)
endif()
# Require out of source build.
@@ -48,23 +42,49 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
#===============================================================================
# Setup CMake Options
#===============================================================================
+include(CMakeDependentOption)
# Basic options ---------------------------------------------------------------
option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
+option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON)
option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON)
option(LIBCXX_ENABLE_FILESYSTEM
"Build filesystem as part of libc++experimental.a" ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY})
option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
+
+# Benchmark options -----------------------------------------------------------
+option(LIBCXX_INCLUDE_BENCHMARKS "Build the libc++ benchmarks and their dependancies" ON)
+set(LIBCXX_BENCHMARK_NATIVE_STDLIB "" CACHE STRING
+ "Build the benchmarks against the specified native STL.
+ The value must be one of libc++/libstdc++")
+set(LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN "" CACHE STRING
+ "Use alternate GCC toolchain when building the native benchmarks")
+
+if (LIBCXX_BENCHMARK_NATIVE_STDLIB)
+ if (NOT (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libc++"
+ OR LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++"))
+ message(FATAL_ERROR "Invalid value for LIBCXX_BENCHMARK_NATIVE_STDLIB: "
+ "'${LIBCXX_BENCHMARK_NATIVE_STDLIB}'")
+ endif()
+endif()
+
option(LIBCXX_INCLUDE_DOCS "Build the libc++ documentation." ${LLVM_INCLUDE_DOCS})
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)
option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON)
-option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY "Install libc++experimental.a" OFF)
+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++.")
option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
+option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
+
+if (NOT LIBCXX_ENABLE_SHARED AND NOT LIBCXX_ENABLE_STATIC)
+ message(FATAL_ERROR "libc++ must be built as either a shared or static library.")
+endif()
# ABI Library options ---------------------------------------------------------
set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
@@ -74,17 +94,24 @@ set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
# Setup the default options if LIBCXX_CXX_ABI is not specified.
if (NOT LIBCXX_CXX_ABI)
- if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND
- IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
+ find_path(
+ LIBCXX_LIBCXXABI_INCLUDES_INTERNAL
+ cxxabi.h
+ PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxxabi/include
+ ${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
+ NO_DEFAULT_PATH
+ )
+ if (NOT DEFINED LIBCXX_STANDALONE_BUILD AND
+ IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
- set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")
+ set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_INTREE 1)
- else ()
+ else()
set(LIBCXX_CXX_ABI_LIBNAME "none")
- endif ()
-else ()
+ endif()
+else()
set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")
-endif ()
+endif()
# Use a static copy of the ABI library when linking libc++. This option
# cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT.
@@ -129,6 +156,9 @@ 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_EXTERNAL_THREAD_API
+ "Build libc++ with an externalized threading API.
+ This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON." OFF)
# Misc options ----------------------------------------------------------------
# FIXME: Turn -pedantic back ON. It is currently off because it warns
@@ -186,6 +216,11 @@ if(LIBCXX_HAS_PTHREAD_API AND NOT LIBCXX_ENABLE_THREADS)
" when LIBCXX_ENABLE_THREADS is also set to ON.")
endif()
+if(LIBCXX_HAS_EXTERNAL_THREAD_API AND NOT LIBCXX_ENABLE_THREADS)
+ message(FATAL_ERROR "LIBCXX_HAS_EXTERNAL_THREAD_API can only be set to ON"
+ " when LIBCXX_ENABLE_THREADS is also set to ON.")
+endif()
+
# Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE
# is ON.
if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE)
@@ -209,6 +244,9 @@ if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
else()
message(WARNING "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option")
endif()
+ if (LIBCXX_ENABLE_STATIC AND NOT PYTHONINTERP_FOUND)
+ message(FATAL_ERROR "LIBCXX_ENABLE_STATIC_ABI_LIBRARY requires python but it was not found.")
+ endif()
endif()
if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
@@ -251,9 +289,13 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
# LIBCXX_CXX_FLAGS: General flags for both the compiler and linker.
# LIBCXX_COMPILE_FLAGS: Compile only flags.
# LIBCXX_LINK_FLAGS: Linker only flags.
+# LIBCXX_LIBRARIES: libraries libc++ is linked to.
+# LIBCXX_INTERFACE_LIBRARIES: Libraries that must be linked when using libc++
+# These libraries are exposed in the linker script.
set(LIBCXX_COMPILE_FLAGS "")
set(LIBCXX_LINK_FLAGS "")
set(LIBCXX_LIBRARIES "")
+set(LIBCXX_INTERFACE_LIBRARIES "")
# Include macros for adding and removing libc++ flags.
include(HandleLibcxxFlags)
@@ -266,10 +308,17 @@ add_target_flags_if(LIBCXX_BUILD_32_BITS "-m32")
add_target_flags_if(LIBCXX_TARGET_TRIPLE "-target ${LIBCXX_TARGET_TRIPLE}")
add_target_flags_if(LIBCXX_SYSROOT "--sysroot=${LIBCXX_SYSROOT}")
add_target_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}")
+if (LIBCXX_TARGET_TRIPLE)
+ set(TARGET_TRIPLE "${LIBCXX_TARGET_TRIPLE}")
+endif()
# Configure compiler.
include(config-ix)
+if (LIBCXX_USE_COMPILER_RT)
+ list(APPEND LIBCXX_LINK_FLAGS "-rtlib=compiler-rt")
+endif()
+
# Configure coverage options.
if (LIBCXX_GENERATE_COVERAGE)
include(CodeCoverage)
@@ -284,9 +333,12 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
include(HandleLibCXXABI) # Setup the ABI library flags
-# Remove flags that may have snuck in.
-remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG
- -stdlib=libc++ -stdlib=libstdc++ -lc++abi -m32)
+if (NOT LIBCXX_STANDALONE_BUILD)
+ # Remove flags that may have snuck in.
+ remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG
+ -lc++abi -m32)
+endif()
+remove_flags(-stdlib=libc++ -stdlib=libstdc++)
# FIXME(EricWF): See the FIXME on LIBCXX_ENABLE_PEDANTIC.
# Remove the -pedantic flag and -Wno-pedantic and -pedantic-errors
@@ -294,9 +346,18 @@ remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG
remove_flags(-Wno-pedantic -pedantic-errors -pedantic)
# Required flags ==============================================================
-add_compile_flags_if_supported(-std=c++11)
-if (NOT MSVC AND NOT LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG)
- message(FATAL_ERROR "C++11 is required but the compiler does not support -std=c++11")
+set(LIBCXX_STANDARD_VER c++11 CACHE INTERNAL "internal option to change build dialect")
+if (LIBCXX_HAS_MUSL_LIBC)
+ # musl's pthread implementations uses volatile types in their structs which is
+ # not a constexpr in C++11 but is in C++14, so we use C++14 with musl.
+ set(LIBCXX_STANDARD_VER c++14 CACHE INTERNAL "internal option to change build dialect")
+endif()
+add_compile_flags_if_supported(-std=${LIBCXX_STANDARD_VER})
+mangle_name("LIBCXX_SUPPORTS_STD_EQ_${LIBCXX_STANDARD_VER}_FLAG" SUPPORTS_DIALECT_NAME)
+if(NOT ${SUPPORTS_DIALECT_NAME})
+ if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND NOT "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
+ message(FATAL_ERROR "C++11 or greater is required but the compiler does not support ${LIBCXX_STANDARD_VER}")
+ endif()
endif()
# On all systems the system c++ standard library headers need to be excluded.
@@ -305,14 +366,30 @@ endif()
# headers
add_compile_flags_if_supported(-nostdinc++)
+# Hide all inline function definitions which have not explicitly been marked
+# visible. This prevents new definitions for inline functions from appearing in
+# the dylib when get ODR used by another function.
+add_compile_flags_if_supported(-fvisibility-inlines-hidden)
+
+# Let the library headers know they are currently being used to build the
+# library.
+add_definitions(-D_LIBCPP_BUILDING_LIBRARY)
# Warning flags ===============================================================
add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
add_compile_flags_if_supported(
- -Wall -W -Wwrite-strings
- -Wno-unused-parameter -Wno-long-long -Wno-user-defined-literals
- -Wno-covered-switch-default
+ -Wall -Wextra -W -Wwrite-strings
+ -Wno-unused-parameter -Wno-long-long
-Werror=return-type)
+if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ add_compile_flags_if_supported(
+ -Wno-user-defined-literals
+ -Wno-covered-switch-default)
+elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+ add_compile_flags_if_supported(
+ -Wno-literal-suffix
+ -Wno-c++14-compat)
+endif()
if (LIBCXX_ENABLE_WERROR)
add_compile_flags_if_supported(-Werror)
add_compile_flags_if_supported(-WX)
@@ -346,6 +423,17 @@ if (NOT LIBCXX_ENABLE_RTTI)
add_compile_flags_if_supported(-fno-rtti)
endif()
+# Threading flags =============================================================
+if (LIBCXX_HAS_EXTERNAL_THREAD_API AND LIBCXX_ENABLE_SHARED)
+ # Need to allow unresolved symbols if this is to work with shared library builds
+ if (APPLE)
+ add_link_flags("-undefined dynamic_lookup")
+ else()
+ # Relax this restriction from HandleLLVMOptions
+ string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
+ endif()
+endif()
+
# Assertion flags =============================================================
define_if(LIBCXX_ENABLE_ASSERTIONS -UNDEBUG)
define_if_not(LIBCXX_ENABLE_ASSERTIONS -DNDEBUG)
@@ -357,11 +445,21 @@ endif()
# Feature flags ===============================================================
define_if(MSVC -D_CRT_SECURE_NO_WARNINGS)
+# Modules flags ===============================================================
+# FIXME The libc++ sources are fundamentally non-modular. They need special
+# versions of the headers in order to provide C++03 and legacy ABI definitions.
+# NOTE: The public headers can be used with modules in all other contexts.
+if (LLVM_ENABLE_MODULES)
+ # Ignore that the rest of the modules flags are now unused.
+ add_compile_flags_if_supported(-Wno-unused-command-line-argument)
+ add_compile_flags(-fno-modules)
+endif()
+
# Sanitizer flags =============================================================
-# Configure for sanitizers. If LIBCXX_BUILT_STANDALONE then we have to do
+# Configure for sanitizers. If LIBCXX_STANDALONE_BUILD then we have to do
# the flag translation ourselves. Othewise LLVM's CMakeList.txt will handle it.
-if (LIBCXX_BUILT_STANDALONE)
+if (LIBCXX_STANDALONE_BUILD)
set(LLVM_USE_SANITIZER "" CACHE STRING
"Define the sanitizer used to build the library and tests")
# NOTE: LLVM_USE_SANITIZER checks for a UNIX like system instead of MSVC.
@@ -407,16 +505,29 @@ config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCPP_HAS_NO_MONOTONIC_CLOC
config_define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS)
config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCPP_HAS_THREAD_API_PTHREAD)
+config_define_if(LIBCXX_HAS_EXTERNAL_THREAD_API _LIBCPP_HAS_THREAD_API_EXTERNAL)
config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC)
+# By default libc++ on Windows expects to use a shared library, which requires
+# the headers to use DLL import/export semantics. However when building a
+# static library only we modify the headers to disable DLL import/export.
+if (DEFINED WIN32 AND LIBCXX_ENABLE_STATIC AND NOT LIBCXX_ENABLE_SHARED)
+ message(STATUS "Generating custom __config for non-DLL Windows build")
+ config_define(ON _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+endif()
+
if (LIBCXX_NEEDS_SITE_CONFIG)
- configure_file(
- include/__config_site.in
- ${LIBCXX_BINARY_DIR}/__config_site
- @ONLY)
+ configure_file("include/__config_site.in"
+ "${LIBCXX_BINARY_DIR}/__config_site"
+ @ONLY)
+
# Provide the config definitions by included the generated __config_site
# file at compile time.
- add_compile_flags("-include ${LIBCXX_BINARY_DIR}/__config_site")
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
+ add_compile_flags("/FI\"${LIBCXX_BINARY_DIR}/__config_site\"")
+ else()
+ add_compile_flags("-include ${LIBCXX_BINARY_DIR}/__config_site")
+ endif()
endif()
#===============================================================================
@@ -426,8 +537,13 @@ include_directories(include)
add_subdirectory(include)
add_subdirectory(lib)
+
+if (LIBCXX_INCLUDE_BENCHMARKS)
+ add_subdirectory(benchmarks)
+endif()
if (LIBCXX_INCLUDE_TESTS)
add_subdirectory(test)
+ add_subdirectory(lib/abi)
endif()
if (LIBCXX_INCLUDE_DOCS)
add_subdirectory(docs)
diff --git a/NOTES.TXT b/NOTES.TXT
new file mode 100644
index 000000000000..f0597de64ae8
--- /dev/null
+++ b/NOTES.TXT
@@ -0,0 +1,28 @@
+//===---------------------------------------------------------------------===//
+// Notes relating to various libc++ tasks
+//===---------------------------------------------------------------------===//
+
+This file contains notes about various libc++ tasks and processes.
+
+//===---------------------------------------------------------------------===//
+// Post-Release TODO
+//===---------------------------------------------------------------------===//
+
+These notes contain a list of things that must be done after branching for
+an LLVM release.
+
+1. Update _LIBCPP_VERSION in `__config`
+2. Update the __libcpp_version file.
+3. Update the version number in `docs/conf.py`
+4. Create ABI lists for the previous release under `lib/abi`
+
+//===---------------------------------------------------------------------===//
+// Adding a new header TODO
+//===---------------------------------------------------------------------===//
+
+These notes contain a list of things that must be done upon adding a new header
+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.
diff --git a/TODO.TXT b/TODO.TXT
index bdb94de343d6..998f81ba6eb8 100644
--- a/TODO.TXT
+++ b/TODO.TXT
@@ -1,46 +1,19 @@
This is meant to be a general place to list things that should be done "someday"
-3.8 Release Goals
-=================
-* LFTS v1 (EricWF, MClow)
-* Filesystem TS (EricWF)
-* ASIO TS (MClow)
-* <regex> Improvements (MClow)
-* Setup ABI Versioning policy (EricWF)
-* Fix PR19302 - Fix UB in list and __tree.
-
-
-ABI Related Tasks
-=================
-* Explicitly manage and verify symbols exported from the dylib.
-* Explore using namespaces for managing symbol visibility.
-* Introduce and document ABI versioning/evolution policy.
-
CXX Runtime Library Tasks
=========================
-* Cleanup #ifdef hell in sources files that supports the different ABI libraries.
* Fix that CMake always link to /usr/lib/libc++abi.dylib on OS X.
-* Fix selection of ABI symbol list on OS X.
-* Have CMake generate linker scripts for libc++.so that it properly links the
- runtime library.
* Look into mirroring libsupc++'s typeinfo vtable layout when libsupc++/libstdc++
is used as the runtime library.
-* Audit libraries that CMake links into libc++. Are they all required?
* Investigate and document interoperability between libc++ and libstdc++ on
linux. Do this for every supported c++ runtime library.
Atomic Related Tasks
====================
-* Enable mixing of clang and GCC atomics internally. Currently some
- parts of libc++ use atomics only when clang provides them.
- (see memory@5380 for an example)
-* Audit use of libatomic builtins in <atomic> with GCC.
* future should use <atomic> for synchronization.
Test Suite Tasks
================
-* Move all libc++ specific tests from test/std into test/libcxx.
-* Improve how LIT handles compiler warnings.
* Improve the quality and portability of the locale test data.
* Convert failure tests to use Clang Verify.
@@ -50,7 +23,4 @@ Misc Tasks
* run clang-tidy on libc++
* Document the "conditionally-supported" bits of libc++
* Look at basic_string's move assignment operator, re LWG 2063 and POCMA
-* libc++ is missing try_emplace
* Put a static_assert in std::allocator to deny const/volatile types (LWG 2447)
-* Document support (or lack of) for C++11 libraries in C++03.
-* Document supported compilers.
diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt
new file mode 100644
index 000000000000..a4105be08340
--- /dev/null
+++ b/benchmarks/CMakeLists.txt
@@ -0,0 +1,154 @@
+include(ExternalProject)
+include(CheckCXXCompilerFlag)
+
+#==============================================================================
+# Build Google Benchmark for libc++
+#==============================================================================
+
+set(BENCHMARK_LIBCXX_COMPILE_FLAGS
+ -Wno-unused-command-line-argument
+ -nostdinc++
+ -isystem ${LIBCXX_SOURCE_DIR}/include
+ -L${LIBCXX_LIBRARY_DIR}
+ -Wl,-rpath,${LIBCXX_LIBRARY_DIR}
+ )
+if (DEFINED LIBCXX_CXX_ABI_LIBRARY_PATH)
+ list(APPEND BENCHMARK_LIBCXX_COMPILE_FLAGS
+ -L${LIBCXX_CXX_ABI_LIBRARY_PATH}
+ -Wl,-rpath,${LIBCXX_CXX_ABI_LIBRARY_PATH})
+endif()
+split_list(BENCHMARK_LIBCXX_COMPILE_FLAGS)
+
+ExternalProject_Add(google-benchmark-libcxx
+ EXCLUDE_FROM_ALL ON
+ DEPENDS cxx
+ PREFIX benchmark-libcxx
+ SOURCE_DIR ${LIBCXX_SOURCE_DIR}/utils/google-benchmark
+ INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx
+ CMAKE_CACHE_ARGS
+ -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
+ -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
+ -DCMAKE_BUILD_TYPE:STRING=RELEASE
+ -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DCMAKE_CXX_FLAGS:STRING=${BENCHMARK_LIBCXX_COMPILE_FLAGS}
+ -DBENCHMARK_USE_LIBCXX:BOOL=ON
+ -DBENCHMARK_ENABLE_TESTING:BOOL=OFF)
+
+#==============================================================================
+# Build Google Benchmark for the native stdlib
+#==============================================================================
+set(BENCHMARK_NATIVE_TARGET_FLAGS)
+if (LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN)
+ set(BENCHMARK_NATIVE_TARGET_FLAGS
+ -gcc-toolchain ${LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN})
+endif()
+split_list(BENCHMARK_NATIVE_TARGET_FLAGS)
+
+if (LIBCXX_BENCHMARK_NATIVE_STDLIB)
+ ExternalProject_Add(google-benchmark-native
+ EXCLUDE_FROM_ALL ON
+ PREFIX benchmark-native
+ SOURCE_DIR ${LIBCXX_SOURCE_DIR}/utils/google-benchmark
+ INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native
+ CMAKE_CACHE_ARGS
+ -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
+ -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
+ -DCMAKE_CXX_FLAGS:STRING=${BENCHMARK_NATIVE_TARGET_FLAGS}
+ -DCMAKE_BUILD_TYPE:STRING=RELEASE
+ -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DBENCHMARK_ENABLE_TESTING:BOOL=OFF)
+endif()
+
+#==============================================================================
+# Benchmark tests configuration
+#==============================================================================
+add_custom_target(cxx-benchmarks)
+
+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
+ -I${BENCHMARK_LIBCXX_INSTALL}/include
+ -I${LIBCXX_SOURCE_DIR}/test/support
+)
+set(BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS
+ -nostdinc++
+ -isystem ${LIBCXX_SOURCE_DIR}/include
+ ${BENCHMARK_TEST_COMPILE_FLAGS}
+ -Wno-user-defined-literals
+)
+set(BENCHMARK_TEST_LIBCXX_LINK_FLAGS
+ -nodefaultlibs
+ -L${BENCHMARK_LIBCXX_INSTALL}/lib/
+)
+set(BENCHMARK_TEST_NATIVE_COMPILE_FLAGS
+ ${BENCHMARK_NATIVE_TARGET_FLAGS}
+ ${BENCHMARK_TEST_COMPILE_FLAGS}
+)
+set(BENCHMARK_TEST_NATIVE_LINK_FLAGS
+ ${BENCHMARK_NATIVE_TARGET_FLAGS}
+ -L${BENCHMARK_NATIVE_INSTALL}/lib
+)
+split_list(BENCHMARK_TEST_COMPILE_FLAGS)
+split_list(BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS)
+split_list(BENCHMARK_TEST_LIBCXX_LINK_FLAGS)
+split_list(BENCHMARK_TEST_NATIVE_COMPILE_FLAGS)
+split_list(BENCHMARK_TEST_NATIVE_LINK_FLAGS)
+macro(add_benchmark_test name source_file)
+ set(libcxx_target ${name}_libcxx)
+ add_executable(${libcxx_target} EXCLUDE_FROM_ALL ${source_file})
+ add_dependencies(${libcxx_target} cxx google-benchmark-libcxx)
+ add_dependencies(cxx-benchmarks ${libcxx_target})
+ if (LIBCXX_ENABLE_SHARED)
+ target_link_libraries(${libcxx_target} cxx_shared)
+ else()
+ target_link_libraries(${libcxx_target} cxx_static)
+ endif()
+ if (TARGET cxx_experimental)
+ target_link_libraries(${libcxx_target} cxx_experimental)
+ endif()
+ target_link_libraries(${libcxx_target} -lbenchmark)
+ set_target_properties(${libcxx_target}
+ PROPERTIES
+ OUTPUT_NAME "${name}.libcxx.out"
+ COMPILE_FLAGS "${BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS}"
+ LINK_FLAGS "${BENCHMARK_TEST_LIBCXX_LINK_FLAGS}")
+ if (LIBCXX_BENCHMARK_NATIVE_STDLIB)
+ set(native_target ${name}_native)
+ add_executable(${native_target} EXCLUDE_FROM_ALL ${source_file})
+ add_dependencies(${native_target} google-benchmark-native
+ google-benchmark-libcxx)
+ target_link_libraries(${native_target} -lbenchmark)
+ if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++")
+ target_link_libraries(${native_target} -lstdc++fs)
+ elseif (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libc++")
+ target_link_libraries(${native_target} -lc++experimental)
+ endif()
+ if (LIBCXX_HAS_PTHREAD_LIB)
+ target_link_libraries(${native_target} -pthread)
+ endif()
+ add_dependencies(cxx-benchmarks ${native_target})
+ set_target_properties(${native_target}
+ PROPERTIES
+ OUTPUT_NAME "${name}.native.out"
+ INCLUDE_DIRECTORIES ""
+ COMPILE_FLAGS "${BENCHMARK_TEST_NATIVE_COMPILE_FLAGS}"
+ LINK_FLAGS "${BENCHMARK_TEST_NATIVE_LINK_FLAGS}")
+ endif()
+endmacro()
+
+
+#==============================================================================
+# Register Benchmark tests
+#==============================================================================
+file(GLOB BENCHMARK_TESTS "*.bench.cpp")
+foreach(test_path ${BENCHMARK_TESTS})
+ get_filename_component(test_file "${test_path}" NAME)
+ string(REPLACE ".bench.cpp" "" test_name "${test_file}")
+ if (NOT DEFINED ${test_name}_REPORTED)
+ message(STATUS "Adding Benchmark: ${test_file}")
+ # Only report the adding of the benchmark once.
+ set(${test_name}_REPORTED ON CACHE INTERNAL "")
+ endif()
+ add_benchmark_test(${test_name} ${test_file})
+endforeach()
diff --git a/benchmarks/ContainerBenchmarks.hpp b/benchmarks/ContainerBenchmarks.hpp
new file mode 100644
index 000000000000..dc268e7ebca3
--- /dev/null
+++ b/benchmarks/ContainerBenchmarks.hpp
@@ -0,0 +1,113 @@
+#ifndef BENCHMARK_CONTAINER_BENCHMARKS_HPP
+#define BENCHMARK_CONTAINER_BENCHMARKS_HPP
+
+#include <cassert>
+
+#include "benchmark/benchmark_api.h"
+
+namespace ContainerBenchmarks {
+
+
+template <class Container, class GenInputs>
+void BM_ConstructIterIter(benchmark::State& st, Container, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto begin = in.begin();
+ const auto end = in.end();
+ benchmark::DoNotOptimize(&in);
+ while (st.KeepRunning()) {
+ Container c(begin, end);
+ benchmark::DoNotOptimize(c.data());
+ }
+}
+
+template <class Container, class GenInputs>
+void BM_InsertValue(benchmark::State& st, Container c, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto end = in.end();
+ while (st.KeepRunning()) {
+ c.clear();
+ for (auto it = in.begin(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.insert(*it).first));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+template <class Container, class GenInputs>
+void BM_InsertValueRehash(benchmark::State& st, Container c, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto end = in.end();
+ while (st.KeepRunning()) {
+ c.clear();
+ c.rehash(16);
+ for (auto it = in.begin(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.insert(*it).first));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+
+template <class Container, class GenInputs>
+void BM_InsertDuplicate(benchmark::State& st, Container c, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto end = in.end();
+ c.insert(in.begin(), in.end());
+ benchmark::DoNotOptimize(&c);
+ benchmark::DoNotOptimize(&in);
+ while (st.KeepRunning()) {
+ for (auto it = in.begin(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.insert(*it).first));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+
+template <class Container, class GenInputs>
+void BM_EmplaceDuplicate(benchmark::State& st, Container c, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto end = in.end();
+ c.insert(in.begin(), in.end());
+ benchmark::DoNotOptimize(&c);
+ benchmark::DoNotOptimize(&in);
+ while (st.KeepRunning()) {
+ for (auto it = in.begin(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.emplace(*it).first));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+template <class Container, class GenInputs>
+static void BM_Find(benchmark::State& st, Container c, GenInputs gen) {
+ auto in = gen(st.range(0));
+ c.insert(in.begin(), in.end());
+ benchmark::DoNotOptimize(&(*c.begin()));
+ const auto end = in.data() + in.size();
+ while (st.KeepRunning()) {
+ for (auto it = in.data(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.find(*it)));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+template <class Container, class GenInputs>
+static void BM_FindRehash(benchmark::State& st, Container c, GenInputs gen) {
+ c.rehash(8);
+ auto in = gen(st.range(0));
+ c.insert(in.begin(), in.end());
+ benchmark::DoNotOptimize(&(*c.begin()));
+ const auto end = in.data() + in.size();
+ while (st.KeepRunning()) {
+ for (auto it = in.data(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.find(*it)));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+} // end namespace ContainerBenchmarks
+
+#endif // BENCHMARK_CONTAINER_BENCHMARKS_HPP
diff --git a/benchmarks/GenerateInput.hpp b/benchmarks/GenerateInput.hpp
new file mode 100644
index 000000000000..9d5adac4af4f
--- /dev/null
+++ b/benchmarks/GenerateInput.hpp
@@ -0,0 +1,142 @@
+#ifndef BENCHMARK_GENERATE_INPUT_HPP
+#define BENCHMARK_GENERATE_INPUT_HPP
+
+#include <algorithm>
+#include <random>
+#include <vector>
+#include <string>
+#include <climits>
+#include <cstddef>
+
+static const char Letters[] = {
+ '0','1','2','3','4',
+ '5','6','7','8','9',
+ 'A','B','C','D','E','F',
+ 'G','H','I','J','K',
+ 'L','M','N','O','P',
+ 'Q','R','S','T','U',
+ 'V','W','X','Y','Z',
+ 'a','b','c','d','e','f',
+ 'g','h','i','j','k',
+ 'l','m','n','o','p',
+ 'q','r','s','t','u',
+ 'v','w','x','y','z'
+};
+static const std::size_t LettersSize = sizeof(Letters);
+
+inline std::default_random_engine& getRandomEngine() {
+ static std::default_random_engine RandEngine(std::random_device{}());
+ 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;
+ return dist(getRandomEngine());
+}
+
+inline std::string getRandomString(std::size_t Len) {
+ std::string str(Len, 0);
+ std::generate_n(str.begin(), Len, &getRandomChar);
+ return str;
+}
+
+template <class IntT>
+inline std::vector<IntT> getDuplicateIntegerInputs(size_t N) {
+ std::vector<IntT> inputs(N, static_cast<IntT>(-1));
+ return inputs;
+}
+
+template <class IntT>
+inline std::vector<IntT> getSortedIntegerInputs(size_t N) {
+ std::vector<IntT> inputs;
+ for (size_t i=0; i < N; i += 1)
+ inputs.push_back(i);
+ return inputs;
+}
+
+template <class IntT>
+std::vector<IntT> getSortedLargeIntegerInputs(size_t N) {
+ std::vector<IntT> inputs;
+ for (size_t i=0; i < N; ++i) {
+ inputs.push_back(i + N);
+ }
+ return inputs;
+}
+
+template <class IntT>
+std::vector<IntT> getSortedTopBitsIntegerInputs(size_t N) {
+ std::vector<IntT> inputs = getSortedIntegerInputs<IntT>(N);
+ for (auto& E : inputs) E <<= ((sizeof(IntT) / 2) * CHAR_BIT);
+ return inputs;
+}
+
+template <class IntT>
+inline std::vector<IntT> getReverseSortedIntegerInputs(size_t N) {
+ std::vector<IntT> inputs;
+ std::size_t i = N;
+ while (i > 0) {
+ --i;
+ inputs.push_back(i);
+ }
+ return inputs;
+}
+
+template <class IntT>
+std::vector<IntT> getPipeOrganIntegerInputs(size_t N) {
+ std::vector<IntT> v; v.reserve(N);
+ for (size_t i = 0; i < N/2; ++i) v.push_back(i);
+ for (size_t i = N/2; i < N; ++i) v.push_back(N - i);
+ return v;
+}
+
+
+template <class IntT>
+std::vector<IntT> getRandomIntegerInputs(size_t N) {
+ std::vector<IntT> inputs;
+ for (size_t i=0; i < N; ++i) {
+ inputs.push_back(getRandomInteger<IntT>());
+ }
+ return inputs;
+}
+
+inline std::vector<std::string> getDuplicateStringInputs(size_t N) {
+ std::vector<std::string> inputs(N, getRandomString(1024));
+ return inputs;
+}
+
+inline std::vector<std::string> getRandomStringInputs(size_t N) {
+ std::vector<std::string> inputs;
+ for (size_t i=0; i < N; ++i) {
+ inputs.push_back(getRandomString(1024));
+ }
+ return inputs;
+}
+
+inline std::vector<std::string> getSortedStringInputs(size_t N) {
+ std::vector<std::string> inputs = getRandomStringInputs(N);
+ std::sort(inputs.begin(), inputs.end());
+ return inputs;
+}
+
+inline std::vector<std::string> getReverseSortedStringInputs(size_t N) {
+ std::vector<std::string> inputs = getSortedStringInputs(N);
+ std::reverse(inputs.begin(), inputs.end());
+ return inputs;
+}
+
+inline std::vector<const char*> getRandomCStringInputs(size_t N) {
+ static std::vector<std::string> inputs = getRandomStringInputs(N);
+ std::vector<const char*> cinputs;
+ for (auto const& str : inputs)
+ cinputs.push_back(str.c_str());
+ return cinputs;
+}
+
+
+#endif // BENCHMARK_GENERATE_INPUT_HPP
diff --git a/benchmarks/algorithms.bench.cpp b/benchmarks/algorithms.bench.cpp
new file mode 100644
index 000000000000..745cc1727184
--- /dev/null
+++ b/benchmarks/algorithms.bench.cpp
@@ -0,0 +1,62 @@
+#include <unordered_set>
+#include <vector>
+#include <cstdint>
+
+#include "benchmark/benchmark_api.h"
+#include "GenerateInput.hpp"
+
+constexpr std::size_t TestNumInputs = 1024;
+
+template <class GenInputs>
+void BM_Sort(benchmark::State& st, GenInputs gen) {
+ using ValueType = typename decltype(gen(0))::value_type;
+ const auto in = gen(st.range(0));
+ std::vector<ValueType> inputs[5];
+ auto reset_inputs = [&]() {
+ for (auto& C : inputs) {
+ C = in;
+ benchmark::DoNotOptimize(C.data());
+ }
+ };
+ reset_inputs();
+ while (st.KeepRunning()) {
+ for (auto& I : inputs) {
+ std::sort(I.data(), I.data() + I.size());
+ benchmark::DoNotOptimize(I.data());
+ }
+ st.PauseTiming();
+ reset_inputs();
+ benchmark::ClobberMemory();
+ st.ResumeTiming();
+ }
+}
+
+BENCHMARK_CAPTURE(BM_Sort, random_uint32,
+ getRandomIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, sorted_ascending_uint32,
+ getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, sorted_descending_uint32,
+ getReverseSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, single_element_uint32,
+ getDuplicateIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, pipe_organ_uint32,
+ getPipeOrganIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, random_strings,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, sorted_ascending_strings,
+ getSortedStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, sorted_descending_strings,
+ getReverseSortedStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, single_element_strings,
+ getDuplicateStringInputs)->Arg(TestNumInputs);
+
+
+BENCHMARK_MAIN()
diff --git a/benchmarks/filesystem.bench.cpp b/benchmarks/filesystem.bench.cpp
new file mode 100644
index 000000000000..f7949a163a7f
--- /dev/null
+++ b/benchmarks/filesystem.bench.cpp
@@ -0,0 +1,138 @@
+#include <experimental/filesystem>
+
+#include "benchmark/benchmark_api.h"
+#include "GenerateInput.hpp"
+#include "test_iterators.h"
+
+namespace fs = std::experimental::filesystem;
+
+static const size_t TestNumInputs = 1024;
+
+
+template <class GenInputs>
+void BM_PathConstructString(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ benchmark::DoNotOptimize(PP.native().data());
+ while (st.KeepRunning()) {
+ const path P(PP.native());
+ benchmark::DoNotOptimize(P.native().data());
+ }
+}
+BENCHMARK_CAPTURE(BM_PathConstructString, large_string,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+
+template <class GenInputs>
+void BM_PathConstructCStr(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ benchmark::DoNotOptimize(PP.native().data());
+ while (st.KeepRunning()) {
+ const path P(PP.native().c_str());
+ benchmark::DoNotOptimize(P.native().data());
+ }
+}
+BENCHMARK_CAPTURE(BM_PathConstructCStr, large_string,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+
+template <template <class...> class ItType, class GenInputs>
+void BM_PathConstructIter(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ using Iter = ItType<std::string::const_iterator>;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ auto Start = Iter(PP.native().begin());
+ auto End = Iter(PP.native().end());
+ benchmark::DoNotOptimize(PP.native().data());
+ benchmark::DoNotOptimize(Start);
+ benchmark::DoNotOptimize(End);
+ while (st.KeepRunning()) {
+ const path P(Start, End);
+ benchmark::DoNotOptimize(P.native().data());
+ }
+}
+template <class GenInputs>
+void BM_PathConstructInputIter(benchmark::State &st, GenInputs gen) {
+ BM_PathConstructIter<input_iterator>(st, gen);
+}
+template <class GenInputs>
+void BM_PathConstructForwardIter(benchmark::State &st, GenInputs gen) {
+ BM_PathConstructIter<forward_iterator>(st, gen);
+}
+BENCHMARK_CAPTURE(BM_PathConstructInputIter, large_string,
+ getRandomStringInputs)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_PathConstructForwardIter, large_string,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+
+template <class GenInputs>
+void BM_PathIterateMultipleTimes(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ benchmark::DoNotOptimize(PP.native().data());
+ while (st.KeepRunning()) {
+ for (auto &E : PP) {
+ benchmark::DoNotOptimize(E.native().data());
+ }
+ benchmark::ClobberMemory();
+ }
+}
+BENCHMARK_CAPTURE(BM_PathIterateMultipleTimes, iterate_elements,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+
+template <class GenInputs>
+void BM_PathIterateOnce(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ benchmark::DoNotOptimize(PP.native().data());
+ while (st.KeepRunning()) {
+ const path P = PP.native();
+ for (auto &E : P) {
+ benchmark::DoNotOptimize(E.native().data());
+ }
+ benchmark::ClobberMemory();
+ }
+}
+BENCHMARK_CAPTURE(BM_PathIterateOnce, iterate_elements,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+template <class GenInputs>
+void BM_PathIterateOnceBackwards(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ benchmark::DoNotOptimize(PP.native().data());
+ while (st.KeepRunning()) {
+ const path P = PP.native();
+ const auto B = P.begin();
+ auto I = P.end();
+ while (I != B) {
+ --I;
+ benchmark::DoNotOptimize(*I);
+ }
+ benchmark::DoNotOptimize(*I);
+ }
+}
+BENCHMARK_CAPTURE(BM_PathIterateOnceBackwards, iterate_elements,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_MAIN()
diff --git a/benchmarks/string.bench.cpp b/benchmarks/string.bench.cpp
new file mode 100644
index 000000000000..ef8923916883
--- /dev/null
+++ b/benchmarks/string.bench.cpp
@@ -0,0 +1,49 @@
+#include <unordered_set>
+#include <vector>
+#include <cstdint>
+
+#include "benchmark/benchmark_api.h"
+#include "GenerateInput.hpp"
+
+constexpr std::size_t MAX_STRING_LEN = 8 << 14;
+
+// Benchmark when there is no match.
+static void BM_StringFindNoMatch(benchmark::State &state) {
+ std::string s1(state.range(0), '-');
+ std::string s2(8, '*');
+ while (state.KeepRunning())
+ benchmark::DoNotOptimize(s1.find(s2));
+}
+BENCHMARK(BM_StringFindNoMatch)->Range(10, MAX_STRING_LEN);
+
+// Benchmark when the string matches first time.
+static void BM_StringFindAllMatch(benchmark::State &state) {
+ std::string s1(MAX_STRING_LEN, '-');
+ std::string s2(state.range(0), '-');
+ while (state.KeepRunning())
+ benchmark::DoNotOptimize(s1.find(s2));
+}
+BENCHMARK(BM_StringFindAllMatch)->Range(1, MAX_STRING_LEN);
+
+// Benchmark when the string matches somewhere in the end.
+static void BM_StringFindMatch1(benchmark::State &state) {
+ std::string s1(MAX_STRING_LEN / 2, '*');
+ s1 += std::string(state.range(0), '-');
+ std::string s2(state.range(0), '-');
+ while (state.KeepRunning())
+ benchmark::DoNotOptimize(s1.find(s2));
+}
+BENCHMARK(BM_StringFindMatch1)->Range(1, MAX_STRING_LEN / 4);
+
+// Benchmark when the string matches somewhere from middle to the end.
+static void BM_StringFindMatch2(benchmark::State &state) {
+ std::string s1(MAX_STRING_LEN / 2, '*');
+ s1 += std::string(state.range(0), '-');
+ s1 += std::string(state.range(0), '*');
+ std::string s2(state.range(0), '-');
+ while (state.KeepRunning())
+ benchmark::DoNotOptimize(s1.find(s2));
+}
+BENCHMARK(BM_StringFindMatch2)->Range(1, MAX_STRING_LEN / 4);
+
+BENCHMARK_MAIN()
diff --git a/benchmarks/unordered_set_operations.bench.cpp b/benchmarks/unordered_set_operations.bench.cpp
index c9ee689f69d3..e2afdde56dc4 100644
--- a/benchmarks/unordered_set_operations.bench.cpp
+++ b/benchmarks/unordered_set_operations.bench.cpp
@@ -1,44 +1,306 @@
#include <unordered_set>
#include <vector>
+#include <functional>
#include <cstdint>
+#include <cstdlib>
+#include <cstring>
#include "benchmark/benchmark_api.h"
-template <class IntT>
-std::vector<IntT> getInputs(size_t N) {
- std::vector<IntT> inputs;
- for (size_t i=0; i < N; ++i) {
- inputs.push_back(i);
- }
- return inputs;
+#include "ContainerBenchmarks.hpp"
+#include "GenerateInput.hpp"
+
+using namespace ContainerBenchmarks;
+
+constexpr std::size_t TestNumInputs = 1024;
+
+template <class _Size>
+inline __attribute__((__always_inline__))
+_Size loadword(const void* __p) {
+ _Size __r;
+ std::memcpy(&__r, __p, sizeof(__r));
+ return __r;
}
-template <class Container, class Inputs>
-void BM_SetInsert(benchmark::State& st, Container c, Inputs const& in) {
- const auto end = in.end();
- while (st.KeepRunning()) {
- c.clear();
- for (auto it = in.begin(); it != end; ++it) {
- benchmark::DoNotOptimize(c.insert(*it));
- }
- benchmark::DoNotOptimize(c);
- }
+inline __attribute__((__always_inline__))
+std::size_t rotate_by_at_least_1(std::size_t __val, int __shift) {
+ return (__val >> __shift) | (__val << (64 - __shift));
}
-BENCHMARK_CAPTURE(BM_SetInsert, uint32_insert,
- std::unordered_set<uint32_t>{}, getInputs<uint32_t>(1024));
-template <class Container, class Inputs>
-void BM_SetFind(benchmark::State& st, Container c, Inputs const& in) {
- c.insert(in.begin(), in.end());
- const auto end = in.end();
+inline __attribute__((__always_inline__))
+std::size_t hash_len_16(std::size_t __u, std::size_t __v) {
+ const std::size_t __mul = 0x9ddfea08eb382d69ULL;
+ std::size_t __a = (__u ^ __v) * __mul;
+ __a ^= (__a >> 47);
+ std::size_t __b = (__v ^ __a) * __mul;
+ __b ^= (__b >> 47);
+ __b *= __mul;
+ return __b;
+}
+
+
+template <std::size_t _Len>
+inline __attribute__((__always_inline__))
+std::size_t hash_len_0_to_8(const char* __s) {
+ static_assert(_Len == 4 || _Len == 8, "");
+ const uint64_t __a = loadword<uint32_t>(__s);
+ const uint64_t __b = loadword<uint32_t>(__s + _Len - 4);
+ return hash_len_16(_Len + (__a << 3), __b);
+}
+
+struct UInt32Hash {
+ UInt32Hash() = default;
+ inline __attribute__((__always_inline__))
+ std::size_t operator()(uint32_t data) const {
+ return hash_len_0_to_8<4>(reinterpret_cast<const char*>(&data));
+ }
+};
+
+struct UInt64Hash {
+ UInt64Hash() = default;
+ inline __attribute__((__always_inline__))
+ std::size_t operator()(uint64_t data) const {
+ return hash_len_0_to_8<8>(reinterpret_cast<const char*>(&data));
+ }
+};
+
+struct UInt128Hash {
+ UInt128Hash() = default;
+ inline __attribute__((__always_inline__))
+ std::size_t operator()(__uint128_t data) const {
+ const __uint128_t __mask = static_cast<std::size_t>(-1);
+ const std::size_t __a = (std::size_t)(data & __mask);
+ const std::size_t __b = (std::size_t)((data & (__mask << 64)) >> 64);
+ return hash_len_16(__a, rotate_by_at_least_1(__b + 16, 16)) ^ __b;
+ }
+};
+
+struct UInt32Hash2 {
+ UInt32Hash2() = default;
+ inline __attribute__((__always_inline__))
+ std::size_t operator()(uint32_t data) const {
+ const uint32_t __m = 0x5bd1e995;
+ const uint32_t __r = 24;
+ uint32_t __h = 4;
+ uint32_t __k = data;
+ __k *= __m;
+ __k ^= __k >> __r;
+ __k *= __m;
+ __h *= __m;
+ __h ^= __k;
+ __h ^= __h >> 13;
+ __h *= __m;
+ __h ^= __h >> 15;
+ return __h;
+ }
+};
+
+struct UInt64Hash2 {
+ UInt64Hash2() = default;
+ inline __attribute__((__always_inline__))
+ std::size_t operator()(uint64_t data) const {
+ return hash_len_0_to_8<8>(reinterpret_cast<const char*>(&data));
+ }
+};
+
+//----------------------------------------------------------------------------//
+// BM_Hash
+// ---------------------------------------------------------------------------//
+
+template <class HashFn, class GenInputs>
+void BM_Hash(benchmark::State& st, HashFn fn, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto end = in.data() + in.size();
+ std::size_t last_hash = 0;
+ benchmark::DoNotOptimize(&last_hash);
while (st.KeepRunning()) {
- for (auto it = in.begin(); it != end; ++it) {
- benchmark::DoNotOptimize(c.find(*it));
+ for (auto it = in.data(); it != end; ++it) {
+ benchmark::DoNotOptimize(last_hash += fn(*it));
}
+ benchmark::ClobberMemory();
}
}
-BENCHMARK_CAPTURE(BM_SetFind, uint32_lookup,
- std::unordered_set<uint32_t>{}, getInputs<uint32_t>(1024));
+BENCHMARK_CAPTURE(BM_Hash,
+ uint32_random_std_hash,
+ std::hash<uint32_t>{},
+ getRandomIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Hash,
+ uint32_random_custom_hash,
+ UInt32Hash{},
+ getRandomIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Hash,
+ uint32_top_std_hash,
+ std::hash<uint32_t>{},
+ getSortedTopBitsIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Hash,
+ uint32_top_custom_hash,
+ UInt32Hash{},
+ getSortedTopBitsIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
+
+
+//----------------------------------------------------------------------------//
+// BM_InsertValue
+// ---------------------------------------------------------------------------//
+
+
+// Sorted Assending //
+BENCHMARK_CAPTURE(BM_InsertValue,
+ unordered_set_uint32,
+ std::unordered_set<uint32_t>{},
+ getRandomIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_InsertValue,
+ unordered_set_uint32_sorted,
+ std::unordered_set<uint32_t>{},
+ getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+// Top Bytes //
+BENCHMARK_CAPTURE(BM_InsertValue,
+ unordered_set_top_bits_uint32,
+ std::unordered_set<uint32_t>{},
+ getSortedTopBitsIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_InsertValueRehash,
+ unordered_set_top_bits_uint32,
+ std::unordered_set<uint32_t, UInt32Hash>{},
+ getSortedTopBitsIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+// String //
+BENCHMARK_CAPTURE(BM_InsertValue,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_InsertValueRehash,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+//----------------------------------------------------------------------------//
+// BM_Find
+// ---------------------------------------------------------------------------//
+
+// Random //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_random_uint64,
+ std::unordered_set<uint64_t>{},
+ getRandomIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_random_uint64,
+ std::unordered_set<uint64_t, UInt64Hash>{},
+ getRandomIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+// Sorted //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_sorted_uint64,
+ std::unordered_set<uint64_t>{},
+ getSortedIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_sorted_uint64,
+ std::unordered_set<uint64_t, UInt64Hash>{},
+ getSortedIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+
+// Sorted //
+#if 1
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_sorted_uint128,
+ std::unordered_set<__uint128_t, UInt128Hash>{},
+ getSortedTopBitsIntegerInputs<__uint128_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_sorted_uint128,
+ std::unordered_set<__uint128_t, UInt128Hash>{},
+ getSortedTopBitsIntegerInputs<__uint128_t>)->Arg(TestNumInputs);
+#endif
+
+// Sorted //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_sorted_uint32,
+ std::unordered_set<uint32_t>{},
+ getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_sorted_uint32,
+ std::unordered_set<uint32_t, UInt32Hash2>{},
+ getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+// Sorted Ascending //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_sorted_large_uint64,
+ std::unordered_set<uint64_t>{},
+ getSortedLargeIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_sorted_large_uint64,
+ std::unordered_set<uint64_t, UInt64Hash>{},
+ getSortedLargeIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+
+// Top Bits //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_top_bits_uint64,
+ std::unordered_set<uint64_t>{},
+ getSortedTopBitsIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_top_bits_uint64,
+ std::unordered_set<uint64_t, UInt64Hash>{},
+ getSortedTopBitsIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+// String //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+///////////////////////////////////////////////////////////////////////////////
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_int,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<int>)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_int,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<int>)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_int_insert_arg,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<int>)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_string_insert_arg,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_int_insert_arg,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<unsigned>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_string_arg,
+ std::unordered_set<std::string>{},
+ getRandomCStringInputs)->Arg(TestNumInputs);
BENCHMARK_MAIN()
diff --git a/benchmarks/util_smartptr.bench.cpp b/benchmarks/util_smartptr.bench.cpp
new file mode 100644
index 000000000000..ad3f03a0448a
--- /dev/null
+++ b/benchmarks/util_smartptr.bench.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+#include <memory>
+
+#include "benchmark/benchmark_api.h"
+
+static void BM_SharedPtrCreateDestroy(benchmark::State& st) {
+ while (st.KeepRunning()) {
+ auto sp = std::make_shared<int>(42);
+ benchmark::DoNotOptimize(sp.get());
+ }
+}
+BENCHMARK(BM_SharedPtrCreateDestroy);
+
+static void BM_SharedPtrIncDecRef(benchmark::State& st) {
+ auto sp = std::make_shared<int>(42);
+ benchmark::DoNotOptimize(sp.get());
+ while (st.KeepRunning()) {
+ std::shared_ptr<int> sp2(sp);
+ benchmark::ClobberMemory();
+ }
+}
+BENCHMARK(BM_SharedPtrIncDecRef);
+
+static void BM_WeakPtrIncDecRef(benchmark::State& st) {
+ auto sp = std::make_shared<int>(42);
+ benchmark::DoNotOptimize(sp.get());
+ while (st.KeepRunning()) {
+ std::weak_ptr<int> wp(sp);
+ benchmark::ClobberMemory();
+ }
+}
+BENCHMARK(BM_WeakPtrIncDecRef);
+
+BENCHMARK_MAIN()
diff --git a/benchmarks/vector_operations.bench.cpp b/benchmarks/vector_operations.bench.cpp
new file mode 100644
index 000000000000..004e801f0be5
--- /dev/null
+++ b/benchmarks/vector_operations.bench.cpp
@@ -0,0 +1,32 @@
+#include <vector>
+#include <functional>
+#include <cstdint>
+#include <cstdlib>
+#include <cstring>
+
+#include "benchmark/benchmark_api.h"
+
+#include "ContainerBenchmarks.hpp"
+#include "GenerateInput.hpp"
+
+using namespace ContainerBenchmarks;
+
+constexpr std::size_t TestNumInputs = 1024;
+
+BENCHMARK_CAPTURE(BM_ConstructIterIter,
+ vector_char,
+ std::vector<char>{},
+ getRandomIntegerInputs<char>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_ConstructIterIter,
+ vector_size_t,
+ std::vector<size_t>{},
+ getRandomIntegerInputs<size_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_ConstructIterIter,
+ vector_string,
+ std::vector<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+
+BENCHMARK_MAIN()
diff --git a/cmake/Modules/CheckLibcxxAtomic.cmake b/cmake/Modules/CheckLibcxxAtomic.cmake
index 4ff343236fea..a7ae667a1558 100644
--- a/cmake/Modules/CheckLibcxxAtomic.cmake
+++ b/cmake/Modules/CheckLibcxxAtomic.cmake
@@ -9,10 +9,16 @@ INCLUDE(CheckCXXSourceCompiles)
function(check_cxx_atomics varname)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
- set(CMAKE_REQUIRED_FLAGS "-std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include")
+ set(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()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
+ endif()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize-coverage OR CMAKE_CXX_FLAGS MATCHES -fsanitize-coverage)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters")
+ endif()
check_cxx_source_compiles("
#include <cstdint>
#include <atomic>
diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake
index c655adff718e..39f2aa575b43 100644
--- a/cmake/Modules/HandleLibCXXABI.cmake
+++ b/cmake/Modules/HandleLibCXXABI.cmake
@@ -28,9 +28,11 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
set(LIBCXX_CXX_ABI_LIBRARY ${abilib})
set(LIBCXX_ABILIB_FILES ${abifiles})
- file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include")
+ # The place in the build tree where we store out-of-source headers.
+ set(LIBCXX_BUILD_HEADERS_ROOT "${CMAKE_BINARY_DIR}/include/c++-build")
+ file(MAKE_DIRECTORY "${LIBCXX_BUILD_HEADERS_ROOT}")
foreach(_d ${abidirs})
- file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/${_d}")
+ file(MAKE_DIRECTORY "${LIBCXX_BUILD_HEADERS_ROOT}/${_d}")
endforeach()
foreach(fpath ${LIBCXX_ABILIB_FILES})
@@ -41,16 +43,16 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
get_filename_component(dstdir ${fpath} PATH)
get_filename_component(ifile ${fpath} NAME)
file(COPY "${incpath}/${fpath}"
- DESTINATION "${CMAKE_BINARY_DIR}/include/${dstdir}"
+ DESTINATION "${LIBCXX_BUILD_HEADERS_ROOT}/${dstdir}"
)
if (LIBCXX_INSTALL_HEADERS)
- install(FILES "${CMAKE_BINARY_DIR}/include/${fpath}"
+ install(FILES "${LIBCXX_BUILD_HEADERS_ROOT}/${fpath}"
DESTINATION include/c++/v1/${dstdir}
COMPONENT libcxx
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
endif()
- list(APPEND abilib_headers "${CMAKE_BINARY_DIR}/include/${fpath}")
+ list(APPEND abilib_headers "${LIBCXX_BUILD_HEADERS_ROOT}/${fpath}")
endif()
endforeach()
if (NOT found)
@@ -58,9 +60,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
endif()
endforeach()
- add_custom_target(LIBCXX_CXX_ABI_DEPS DEPENDS ${abilib_headers})
- include_directories("${CMAKE_BINARY_DIR}/include")
-
+ include_directories("${LIBCXX_BUILD_HEADERS_ROOT}")
endmacro()
diff --git a/cmake/Modules/HandleLibcxxFlags.cmake b/cmake/Modules/HandleLibcxxFlags.cmake
index 325c1bdf7bcb..7077c6e38264 100644
--- a/cmake/Modules/HandleLibcxxFlags.cmake
+++ b/cmake/Modules/HandleLibcxxFlags.cmake
@@ -188,6 +188,14 @@ macro(add_library_flags_if condition)
endif()
endmacro()
+# Add a list of libraries or link flags to 'LIBCXX_LIBRARIES'.
+macro(add_interface_library)
+ foreach(lib ${ARGN})
+ list(APPEND LIBCXX_LIBRARIES ${lib})
+ list(APPEND LIBCXX_INTERFACE_LIBRARIES ${lib})
+ endforeach()
+endmacro()
+
# Turn a comma separated CMake list into a space separated string.
macro(split_list listname)
string(REPLACE ";" " " ${listname} "${${listname}}")
diff --git a/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake
index 9c5dd8109261..c772143244ae 100644
--- a/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -1,15 +1,18 @@
macro(find_llvm_parts)
# Rely on llvm-config.
set(CONFIG_OUTPUT)
- find_program(LLVM_CONFIG "llvm-config")
+ if(NOT LLVM_CONFIG_PATH)
+ find_program(LLVM_CONFIG_PATH "llvm-config")
+ endif()
if(DEFINED LLVM_PATH)
set(LLVM_INCLUDE_DIR ${LLVM_INCLUDE_DIR} CACHE PATH "Path to llvm/include")
set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree")
set(LLVM_MAIN_SRC_DIR ${LLVM_PATH})
set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules")
- elseif(LLVM_CONFIG)
- message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
- set(CONFIG_COMMAND ${LLVM_CONFIG}
+ elseif(LLVM_CONFIG_PATH)
+ message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}")
+ set(LIBCXX_USING_INSTALLED_LLVM 1)
+ set(CONFIG_COMMAND ${LLVM_CONFIG_PATH}
"--includedir"
"--prefix"
"--src-root")
@@ -38,34 +41,48 @@ macro(find_llvm_parts)
set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
else()
set(LLVM_FOUND OFF)
+ message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: "
+ "llvm-config not found and LLVM_PATH not defined.\n"
+ "Reconfigure with -DLLVM_CONFIG_PATH=path/to/llvm-config "
+ "or -DLLVM_PATH=path/to/llvm-source-root.")
return()
endif()
- if (NOT EXISTS ${LLVM_MAIN_SRC_DIR})
- set(LLVM_FOUND OFF)
- message(WARNING "Not found: ${LLVM_MAIN_SRC_DIR}")
- return()
- endif()
-
- if(NOT EXISTS ${LLVM_CMAKE_PATH})
+ if (EXISTS "${LLVM_CMAKE_PATH}")
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+ elseif (EXISTS "${LLVM_MAIN_SRC_DIR}/cmake/modules")
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
+ else()
set(LLVM_FOUND OFF)
- message(WARNING "Not found: ${LLVM_CMAKE_PATH}")
+ message(WARNING "Neither ${LLVM_CMAKE_PATH} nor ${LLVM_MAIN_SRC_DIR}/cmake/modules found")
return()
endif()
- list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
- list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
-
set(LLVM_FOUND ON)
endmacro(find_llvm_parts)
-
-if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
- set(LIBCXX_BUILT_STANDALONE 1)
+macro(configure_out_of_tree_llvm)
message(STATUS "Configuring for standalone build.")
+ set(LIBCXX_STANDALONE_BUILD 1)
find_llvm_parts()
+ # Add LLVM Functions --------------------------------------------------------
+ if (LLVM_FOUND AND LIBCXX_USING_INSTALLED_LLVM)
+ include(LLVMConfig) # For TARGET_TRIPLE
+ else()
+ if (WIN32)
+ set(LLVM_ON_UNIX 0)
+ set(LLVM_ON_WIN32 1)
+ else()
+ set(LLVM_ON_UNIX 1)
+ set(LLVM_ON_WIN32 0)
+ endif()
+ endif()
+ if (LLVM_FOUND)
+ include(AddLLVM OPTIONAL)
+ endif()
+
# LLVM Options --------------------------------------------------------------
include(FindPythonInterp)
if( NOT PYTHONINTERP_FOUND )
@@ -95,36 +112,14 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# Required doc configuration
if (LLVM_ENABLE_SPHINX)
- message(STATUS "Sphinx enabled.")
find_package(Sphinx REQUIRED)
- else()
- message(STATUS "Sphinx disabled.")
endif()
- # FIXME - This is cribbed from HandleLLVMOptions.cmake.
- if(WIN32)
+ if (LLVM_ON_UNIX AND NOT APPLE)
+ set(LLVM_HAVE_LINK_VERSION_SCRIPT 1)
+ else()
set(LLVM_HAVE_LINK_VERSION_SCRIPT 0)
- if(CYGWIN)
- set(LLVM_ON_WIN32 0)
- set(LLVM_ON_UNIX 1)
- else(CYGWIN)
- set(LLVM_ON_WIN32 1)
- set(LLVM_ON_UNIX 0)
- endif(CYGWIN)
- else(WIN32)
- if(UNIX)
- set(LLVM_ON_WIN32 0)
- set(LLVM_ON_UNIX 1)
- if(APPLE)
- set(LLVM_HAVE_LINK_VERSION_SCRIPT 0)
- else(APPLE)
- set(LLVM_HAVE_LINK_VERSION_SCRIPT 1)
- endif(APPLE)
- else(UNIX)
- MESSAGE(SEND_ERROR "Unable to determine platform")
- endif(UNIX)
- endif(WIN32)
+ endif()
+endmacro(configure_out_of_tree_llvm)
- # Add LLVM Functions --------------------------------------------------------
- include(AddLLVM OPTIONAL)
-endif()
+configure_out_of_tree_llvm()
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 3e6c3599d23d..4f13b787ae35 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -1,6 +1,51 @@
include(CheckLibraryExists)
include(CheckCXXCompilerFlag)
-include(CheckLibcxxAtomic)
+
+if(WIN32 AND NOT MINGW)
+ # NOTE(compnerd) this is technically a lie, there is msvcrt, but for now, lets
+ # let the default linking take care of that.
+ set(LIBCXX_HAS_C_LIB NO)
+else()
+ check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
+endif()
+
+if (NOT LIBCXX_USE_COMPILER_RT)
+ if(WIN32 AND NOT MINGW)
+ set(LIBCXX_HAS_GCC_S_LIB NO)
+ else()
+ check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
+ endif()
+endif()
+
+# libc++ is built with -nodefaultlibs, so we want all our checks to also
+# use this option, otherwise we may end up with an inconsistency between
+# the flags we think we require during configuration (if the checks are
+# performed without -nodefaultlibs) and the flags that are actually
+# required during compilation (which has the -nodefaultlibs). libc is
+# required for the link to go through. We remove sanitizers from the
+# configuration checks to avoid spurious link errors.
+check_cxx_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
+if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs")
+ if (LIBCXX_HAS_C_LIB)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES c)
+ endif ()
+ if (LIBCXX_USE_COMPILER_RT)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES -rtlib=compiler-rt)
+ elseif (LIBCXX_HAS_GCC_S_LIB)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)
+ endif ()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
+ endif ()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize-coverage OR CMAKE_CXX_FLAGS MATCHES -fsanitize-coverage)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters")
+ endif ()
+endif ()
+
+if(NOT WIN32 OR MINGW)
+ include(CheckLibcxxAtomic)
+endif()
# Check compiler flags
@@ -13,8 +58,14 @@ check_cxx_compiler_flag(/GR- LIBCXX_HAS_NO_GR_FLAG)
# Check libraries
-check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
-check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
-check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
-check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
-check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
+if(WIN32 AND NOT MINGW)
+ # TODO(compnerd) do we want to support an emulation layer that allows for the
+ # use of pthread-win32 or similar libraries to emulate pthreads on Windows?
+ set(LIBCXX_HAS_PTHREAD_LIB NO)
+ set(LIBCXX_HAS_M_LIB NO)
+ set(LIBCXX_HAS_RT_LIB NO)
+else()
+ check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
+ check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
+ check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
+endif()
diff --git a/docs/BuildingLibcxx.rst b/docs/BuildingLibcxx.rst
index 36866b13ef7b..b00bbdd78f64 100644
--- a/docs/BuildingLibcxx.rst
+++ b/docs/BuildingLibcxx.rst
@@ -49,7 +49,7 @@ The basic steps needed to build libc++ are:
For more information about configuring libc++ see :ref:`CMake Options`.
* ``make cxx`` --- will build libc++ and libc++abi.
- * ``make check-libcxx check-libcxxabi`` --- will run the test suites.
+ * ``make check-cxx check-cxxabi`` --- will run the test suites.
Shared libraries for libc++ and libc++ abi should now be present in llvm/build/lib.
See :ref:`using an alternate libc++ installation <alternate libcxx>`
@@ -60,7 +60,7 @@ The basic steps needed to build libc++ are:
careful not to replace it. Remember Use the CMake option ``CMAKE_INSTALL_PREFIX`` to
select a safe place to install libc++.
- * ``make install-libcxx install-libcxxabi`` --- Will install the libraries and the headers
+ * ``make install-cxx install-cxxabi`` --- Will install the libraries and the headers
.. warning::
* Replacing your systems libc++ installation could render the system non-functional.
@@ -144,19 +144,26 @@ libc++ specific options
**Default**: ``OFF``
- Build libc++ as a 32 bit library. Also see :option:`LLVM_BUILD_32_BITS`.
+ Build libc++ as a 32 bit library. Also see `LLVM_BUILD_32_BITS`.
.. option:: LIBCXX_ENABLE_SHARED:BOOL
**Default**: ``ON``
- Build libc++ as a shared library. If ``OFF`` is specified then libc++ is
- built as a static library.
+ Build libc++ as a shared library. Either `LIBCXX_ENABLE_SHARED` or
+ `LIBCXX_ENABLE_STATIC` has to be enabled.
+
+.. option:: LIBCXX_ENABLE_STATIC:BOOL
+
+ **Default**: ``ON``
+
+ Build libc++ as a static library. Either `LIBCXX_ENABLE_SHARED` or
+ `LIBCXX_ENABLE_STATIC` has to be enabled.
.. option:: LIBCXX_LIBDIR_SUFFIX:STRING
Extra suffix to append to the directory where libraries are to be installed.
- This option overrides :option:`LLVM_LIBDIR_SUFFIX`.
+ This option overrides `LLVM_LIBDIR_SUFFIX`.
.. _libc++experimental options:
@@ -172,7 +179,7 @@ libc++experimental Specific Options
.. option:: LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY:BOOL
- **Default**: ``OFF``
+ **Default**: ``LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY AND LIBCXX_INSTALL_LIBRARY``
Install libc++experimental.a alongside libc++.
@@ -227,7 +234,7 @@ ABI Library Specific Options
libc++abi is the C++ ABI library used.
-libc++ Feature options
+libc++ Feature Options
----------------------
.. option:: LIBCXX_ENABLE_EXCEPTIONS:BOOL
@@ -242,9 +249,32 @@ libc++ Feature options
Build libc++ with run time type information.
+.. option:: LIBCXX_INCLUDE_BENCHMARKS:BOOL
-libc++ Feature options
-----------------------
+ **Default**: ``ON``
+
+ Build the libc++ benchmark tests and the Google Benchmark library needed
+ to support them.
+
+.. option:: LIBCXX_BENCHMARK_NATIVE_STDLIB:STRING
+
+ **Default**:: ``""``
+
+ **Values**:: ``libc++``, ``libstdc++``
+
+ Build the libc++ benchmark tests and Google Benchmark library against the
+ specified standard library on the platform. On linux this can be used to
+ compare libc++ to libstdc++ by building the benchmark tests against both
+ standard libraries.
+
+.. option:: LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN:STRING
+
+ Use the specified GCC toolchain and standard library when building the native
+ stdlib benchmark tests.
+
+
+libc++ ABI Feature Options
+--------------------------
The following options allow building libc++ for a different ABI version.
diff --git a/docs/DesignDocs/DebugMode.rst b/docs/DesignDocs/DebugMode.rst
new file mode 100644
index 000000000000..166c733e6630
--- /dev/null
+++ b/docs/DesignDocs/DebugMode.rst
@@ -0,0 +1,100 @@
+==========
+Debug Mode
+==========
+
+.. contents::
+ :local
+
+.. _using-debug-mode:
+
+Using Debug Mode
+================
+
+Libc++ provides a debug mode that enables assertions meant to detect incorrect
+usage of the standard library. By default these assertions are disabled but
+they can be enabled using the ``_LIBCPP_DEBUG`` macro.
+
+**_LIBCPP_DEBUG** Macro
+-----------------------
+
+**_LIBCPP_DEBUG**:
+ This macro is used to enable assertions and iterator debugging checks within
+ libc++. By default it is undefined.
+
+ **Values**: ``0``, ``1``
+
+ Defining ``_LIBCPP_DEBUG`` to ``0`` or greater enables most of libc++'s
+ assertions. Defining ``_LIBCPP_DEBUG`` to ``1`` enables "iterator debugging"
+ which provides additional assertions about the validity of iterators used by
+ the program.
+
+ Note that this option has no effect on libc++'s ABI
+
+**_LIBCPP_DEBUG_USE_EXCEPTIONS**:
+ When this macro is defined ``_LIBCPP_ASSERT`` failures throw
+ ``__libcpp_debug_exception`` instead of aborting. Additionally this macro
+ disables exception specifications on functions containing ``_LIBCPP_ASSERT``
+ checks. This allows assertion failures to correctly throw through these
+ functions.
+
+Handling Assertion Failures
+---------------------------
+
+When a debug assertion fails the assertion handler is called via the
+``std::__libcpp_debug_function`` function pointer. It is possible to override
+this function pointer using a different handler function. Libc++ provides two
+different assertion handlers, the default handler
+``std::__libcpp_abort_debug_handler`` which aborts the program, and
+``std::__libcpp_throw_debug_handler`` which throws an instance of
+``std::__libcpp_debug_exception``. Libc++ can be changed to use the throwing
+assertion handler as follows:
+
+.. code-block:: cpp
+
+ #define _LIBCPP_DEBUG 1
+ #include <string>
+ int main() {
+ std::__libcpp_debug_function = std::__libcpp_throw_debug_function;
+ try {
+ std::string::iterator bad_it;
+ std::string str("hello world");
+ str.insert(bad_it, '!'); // causes debug assertion
+ } catch (std::__libcpp_debug_exception const&) {
+ return EXIT_SUCCESS;
+ }
+ return EXIT_FAILURE;
+ }
+
+Debug Mode Checks
+=================
+
+Libc++'s debug mode offers two levels of checking. The first enables various
+precondition checks throughout libc++. The second additionally enables
+"iterator debugging" which checks the validity of iterators used by the program.
+
+Basic Checks
+============
+
+These checks are enabled when ``_LIBCPP_DEBUG`` is defined to either 0 or 1.
+
+The following checks are enabled by ``_LIBCPP_DEBUG``:
+
+ * FIXME: Update this list
+
+Iterator Debugging Checks
+=========================
+
+These checks are enabled when ``_LIBCPP_DEBUG`` is defined to 1.
+
+The following containers and STL classes support iterator debugging:
+
+ * ``std::string``
+ * ``std::vector<T>`` (``T != bool``)
+ * ``std::list``
+ * ``std::unordered_map``
+ * ``std::unordered_multimap``
+ * ``std::unordered_set``
+ * ``std::unordered_multiset``
+
+The remaining containers do not currently support iterator debugging.
+Patches welcome.
diff --git a/docs/DesignDocs/VisibilityMacros.rst b/docs/DesignDocs/VisibilityMacros.rst
new file mode 100644
index 000000000000..2ee07142d85c
--- /dev/null
+++ b/docs/DesignDocs/VisibilityMacros.rst
@@ -0,0 +1,127 @@
+========================
+Symbol Visibility Macros
+========================
+
+.. contents::
+ :local:
+
+Overview
+========
+
+Libc++ uses various "visibility" macros in order to provide a stable ABI in
+both the library and the headers. These macros work by changing the
+visibility and inlining characteristics of the symbols they are applied to.
+
+Visibility Macros
+=================
+
+**_LIBCPP_HIDDEN**
+ Mark a symbol as hidden so it will not be exported from shared libraries.
+
+**_LIBCPP_FUNC_VIS**
+ Mark a symbol as being exported by the libc++ library. This attribute must
+ be applied to the declaration of all functions exported by the libc++ dylib.
+
+**_LIBCPP_OVERRIDABLE_FUNC_VIS**
+ Mark a symbol as being exported by the libc++ library, but allow it to be
+ overridden locally. On non-Windows, this is equivalent to `_LIBCPP_FUNC_VIS`.
+ This macro is applied to all `operator new` and `operator delete` overloads.
+
+ **Windows Behavior**: Any symbol marked `dllimport` cannot be overridden
+ locally, since `dllimport` indicates the symbol should be bound to a separate
+ DLL. All `operator new` and `operator delete` overloads are required to be
+ locally overridable, and therefore must not be marked `dllimport`. On Windows,
+ 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_TYPE_VIS**
+ Mark a type's typeinfo and vtable as having default visibility.
+ `_LIBCPP_TYPE_VIS`. This macro has no effect on the visibility of the
+ type's member functions. This attribute cannot be used on class templates.
+
+ **GCC Behavior**: GCC does not support Clang's `type_visibility(...)`
+ attribute. With GCC the `visibility(...)` attribute is used and member
+ functions are affected.
+
+**_LIBCPP_TYPE_VIS_ONLY**
+ The same as `_LIBCPP_TYPE_VIS` except that it may be applied to templates.
+
+ **Windows Behavior**: DLLs do not support dllimport/export on class templates.
+ The macro has an empty definition on this platform.
+
+ Note: This macro should be renamed `_LIBCPP_TEMPLATE_TYPE_VIS`.
+
+**_LIBCPP_ENUM_VIS**
+ Mark the typeinfo of an enum as having default visibility. This attribute
+ should be applied to all enum declarations.
+
+ **Windows Behavior**: DLLs do not support importing or exporting enumeration
+ typeinfo. The macro has an empty definition on this platform.
+
+ **GCC Behavior**: GCC un-hides the typeinfo for enumerations by default, even
+ if `-fvisibility=hidden` is specified. Additionally applying a visibility
+ attribute to an enum class results in a warning. The macro has an empty
+ definition with GCC.
+
+**_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS**
+ Mark the member functions, typeinfo, and vtable of the type named in
+ a `_LIBCPP_EXTERN_TEMPLATE` declaration as being exported by the libc++ library.
+ This attribute must be specified on all extern class template declarations.
+
+ This macro is used to override the `_LIBCPP_TYPE_VIS_ONLY` attribute
+ specified on the primary template and to export the member functions produced
+ by the explicit instantiation in the dylib.
+
+ **GCC Behavior**: GCC ignores visibility attributes applied the type in
+ extern template declarations and applying an attribute results in a warning.
+ However since `_LIBCPP_TYPE_VIS_ONLY` is the same as `_LIBCPP_TYPE_VIS` the
+ visibility is already correct. The macro has an empty definition with GCC.
+
+ **Windows Behavior**: `extern template` and `dllexport` are fundamentally
+ incompatible *on a template class* on Windows; the former suppresses
+ instantiation, while the latter forces it. Specifying both on the same
+ declaration makes the template class be instantiated, which is not desirable
+ inside headers. This macro therefore expands to `dllimport` outside of libc++
+ but nothing inside of it (rather than expanding to `dllexport`); instead, the
+ explicit instantiations themselves are marked as exported. Note that this
+ applies *only* to extern template *classes*. Extern template *functions* obey
+ regular import/export semantics, and applying `dllexport` directly to the
+ extern template declaration is the correct thing to do for them.
+
+**_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS**
+ Mark the member functions, typeinfo, and vtable of an explicit instantiation
+ of a class template as being exported by the libc++ library. This attribute
+ must be specified on all template class explicit instantiations.
+
+ It is only necessary to mark the explicit instantiation itself (as opposed to
+ the extern template declaration) as exported on Windows, as discussed above.
+ On all other platforms, this macro has an empty definition.
+
+**_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY**
+ Mark a member function of a class template as visible and always inline. This
+ macro should only be applied to member functions of class templates that are
+ externally instantiated. It is important that these symbols are not marked
+ as hidden as that will prevent the dylib definition from being found.
+
+ This macro is used to maintain ABI compatibility for symbols that have been
+ historically exported by the libc++ library but are now marked inline.
+
+**_LIBCPP_EXCEPTION_ABI**
+ Mark the member functions, typeinfo, and vtable of the type as being exported
+ by the libc++ library. This macro must be applied to all *exception types*.
+ Exception types should be defined directly in namespace `std` and not the
+ versioning namespace. This allows throwing and catching some exception types
+ between libc++ and libstdc++.
+
+Links
+=====
+
+* `[cfe-dev] Visibility in libc++ - 1 <http://lists.llvm.org/pipermail/cfe-dev/2013-July/030610.html>`_
+* `[cfe-dev] Visibility in libc++ - 2 <http://lists.llvm.org/pipermail/cfe-dev/2013-August/031195.html>`_
+* `[libcxx] Visibility fixes for Windows <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130805/085461.html>`_
diff --git a/docs/Makefile.sphinx b/docs/Makefile.sphinx
index 2ca1e4d3faf2..ae37a34b54ee 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 =
+SPHINXOPTS = -n -W
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
diff --git a/docs/TestingLibcxx.rst b/docs/TestingLibcxx.rst
index 9226ae17023e..e4292764c4d0 100644
--- a/docs/TestingLibcxx.rst
+++ b/docs/TestingLibcxx.rst
@@ -98,56 +98,64 @@ configuration. Passing the option on the command line will override the default.
.. program:: lit
-.. option:: --cxx_under_test=<path/to/compiler>
+.. option:: cxx_under_test=<path/to/compiler>
Specify the compiler used to build the tests.
+.. option:: cxx_stdlib_under_test=<stdlib name>
+
+ **Values**: libc++, libstdc++
+
+ Specify the C++ standard library being tested. Unless otherwise specified
+ libc++ is used. This option is intended to allow running the libc++ test
+ suite against other standard library implementations.
+
.. option:: std=<standard version>
**Values**: c++98, c++03, c++11, c++14, c++1z
Change the standard version used when building the tests.
-.. option:: --libcxx_site_config=<path/to/lit.site.cfg>
+.. option:: libcxx_site_config=<path/to/lit.site.cfg>
Specify the site configuration to use when running the tests. This option
overrides the enviroment variable LIBCXX_SITE_CONFIG.
-.. option:: --libcxx_headers=<path/to/headers>
+.. option:: cxx_headers=<path/to/headers>
- Specify the libc++ headers that are tested. By default the headers in the
- source tree are used.
+ Specify the c++ standard library headers that are tested. By default the
+ headers in the source tree are used.
-.. option:: --cxx_library_root=<path/to/lib/>
+.. option:: cxx_library_root=<path/to/lib/>
Specify the directory of the libc++ library to be tested. By default the
library folder of the build directory is used. This option cannot be used
- when use_system_lib is provided.
+ when use_system_cxx_lib is provided.
-.. option:: --cxx_runtime_root=<path/to/lib/>
+.. option:: cxx_runtime_root=<path/to/lib/>
Specify the directory of the libc++ library to use at runtime. This directory
is not added to the linkers search path. This can be used to compile tests
against one version of libc++ and run them using another. The default value
for this option is `cxx_library_root`. This option cannot be used
- when use_system_lib is provided.
+ when use_system_cxx_lib is provided.
-.. option:: --use_system_lib=<bool>
+.. option:: use_system_cxx_lib=<bool>
**Default**: False
Enable or disable testing against the installed version of libc++ library.
Note: This does not use the installed headers.
-.. option:: --use_lit_shell=<bool>
+.. option:: use_lit_shell=<bool>
Enable or disable the use of LIT's internal shell in ShTests. If the
environment variable LIT_USE_INTERNAL_SHELL is present then that is used as
the default value. Otherwise the default value is True on Windows and False
on every other platform.
-.. option:: --no_default_flags=<bool>
+.. option:: no_default_flags=<bool>
**Default**: False
@@ -155,16 +163,16 @@ configuration. Passing the option on the command line will override the default.
option is used only flags specified using the compile_flags and link_flags
will be used.
-.. option:: --compile_flags="<list-of-args>"
+.. option:: compile_flags="<list-of-args>"
Specify additional compile flags as a space delimited string.
Note: This options should not be used to change the standard version used.
-.. option:: --link_flags="<list-of-args>"
+.. option:: link_flags="<list-of-args>"
Specify additional link flags as a space delimited string.
-.. option:: --debug_level=<level>
+.. option:: debug_level=<level>
**Values**: 0, 1
@@ -191,10 +199,68 @@ Environment Variables
.. envvar:: LIBCXX_SITE_CONFIG=<path/to/lit.site.cfg>
Specify the site configuration to use when running the tests.
- Also see :option:`libcxx_site_config`.
+ Also see `libcxx_site_config`.
.. envvar:: LIBCXX_COLOR_DIAGNOSTICS
If ``LIBCXX_COLOR_DIAGNOSTICS`` is defined then the test suite will attempt
to use color diagnostic outputs from the compiler.
- Also see :option:`color_diagnostics`.
+ Also see `color_diagnostics`.
+
+Benchmarks
+==========
+
+Libc++ contains benchmark tests separately from the test of the test suite.
+The benchmarks are written using the `Google Benchmark`_ library, a copy of which
+is stored in the libc++ repository.
+
+For more information about using the Google Benchmark library see the
+`official documentation <https://github.com/google/benchmark>`_.
+
+.. _`Google Benchmark`: https://github.com/google/benchmark
+
+Building Benchmarks
+-------------------
+
+The benchmark tests are not built by default. The benchmarks can be built using
+the ``cxx-benchmarks`` target.
+
+An example build would look like:
+
+.. code-block:: bash
+
+ $ cd build
+ $ cmake [options] <path to libcxx sources>
+ $ make cxx-benchmarks
+
+This will build all of the benchmarks under ``<libcxx-src>/benchmarks`` to be
+built against the just-built libc++. The compiled tests are output into
+``build/benchmarks``.
+
+The benchmarks can also be built against the platforms native standard library
+using the ``-DLIBCXX_BUILD_BENCHMARKS_NATIVE_STDLIB=ON`` CMake option. This
+is useful for comparing the performance of libc++ to other standard libraries.
+The compiled benchmarks are named ``<test>.libcxx.out`` if they test libc++ and
+``<test>.native.out`` otherwise.
+
+Also See:
+
+ * :ref:`Building Libc++ <build instructions>`
+ * :ref:`CMake Options`
+
+Running Benchmarks
+------------------
+
+The benchmarks must be run manually by the user. Currently there is no way
+to run them as part of the build.
+
+For example:
+
+.. code-block:: bash
+
+ $ cd build/benchmarks
+ $ make cxx-benchmarks
+ $ ./algorithms.libcxx.out # Runs all the benchmarks
+ $ ./algorithms.libcxx.out --benchmark_filter=BM_Sort.* # Only runs the sort benchmarks
+
+For more information about running benchmarks see `Google Benchmark`_.
diff --git a/docs/UsingLibcxx.rst b/docs/UsingLibcxx.rst
index 514ed14b7464..de87c9c159de 100644
--- a/docs/UsingLibcxx.rst
+++ b/docs/UsingLibcxx.rst
@@ -123,3 +123,53 @@ supported by libc++ they may be useful to users.
Known 3rd Party Implementations Include:
* `Koutheir's libc++ pretty-printers <https://github.com/koutheir/libcxx-pretty-printers>`_.
+
+
+Libc++ Configuration Macros
+===========================
+
+Libc++ provides a number of configuration macros which can be used to enable
+or disable extended libc++ behavior, including enabling "debug mode" or
+thread safety annotations.
+
+**_LIBCPP_DEBUG**:
+ See :ref:`using-debug-mode` for more information.
+
+**_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS**:
+ This macro is used to enable -Wthread-safety annotations on libc++'s
+ ``std::mutex`` and ``std::lock_guard``. By default these annotations are
+ disabled and must be manually enabled by the user.
+
+**_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS**:
+ This macro is used to disable all visibility annotations inside libc++.
+ Defining this macro and then building libc++ with hidden visibility gives a
+ build of libc++ which does not export any symbols, which can be useful when
+ building statically for inclusion into another library.
+
+**_LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION**:
+ This macro is used to re-enable an extension in `std::tuple` which allowed
+ it to be implicitly constructed from fewer initializers than contained
+ elements. Elements without an initializer are default constructed. For example:
+
+ .. code-block:: cpp
+
+ std::tuple<std::string, int, std::error_code> foo() {
+ return {"hello world", 42}; // default constructs error_code
+ }
+
+
+ Since libc++ 4.0 this extension has been disabled by default. This macro
+ may be defined to re-enable it in order to support existing code that depends
+ on the extension. New use of this extension should be discouraged.
+ See `PR 27374 <http://llvm.org/PR27374>`_ for more information.
+
+ Note: The "reduced-arity-initialization" extension is still offered but only
+ for explicit conversions. Example:
+
+ .. code-block:: cpp
+
+ auto foo() {
+ using Tup = std::tuple<std::string, int, std::error_code>;
+ return Tup{"hello world", 42}; // explicit constructor called. OK.
+ }
+
diff --git a/docs/conf.py b/docs/conf.py
index e385406b9923..cd793dd02221 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -47,9 +47,9 @@ copyright = u'2011-2016, LLVM Project'
# built documents.
#
# The short X.Y version.
-version = '3.9'
+version = '4.0'
# The full version, including alpha/beta/rc tags.
-release = '3.9'
+release = '4.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 b0c8b813f57f..8f21a27fe763 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -127,13 +127,14 @@ Design Documents
.. toctree::
:maxdepth: 1
+ DesignDocs/DebugMode
DesignDocs/CapturingConfigInfo
DesignDocs/ABIVersioning
+ DesignDocs/VisibilityMacros
* `<atomic> design <http://libcxx.llvm.org/atomic_design.html>`_
* `<type_traits> design <http://libcxx.llvm.org/type_traits_design.html>`_
-* `Status of debug mode <http://libcxx.llvm.org/debug_mode.html>`_
* `Notes by Marshall Clow`__
.. __: https://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 219d1b730839..7b574353193d 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -10,16 +10,18 @@ set(LIBCXX_HEADER_PATTERN
${LIBCXX_SUPPORT_HEADER_PATTERN}
)
-file(COPY .
- DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1"
- FILES_MATCHING
- ${LIBCXX_HEADER_PATTERN}
- )
+if(NOT LIBCXX_USING_INSTALLED_LLVM AND LLVM_BINARY_DIR)
+ file(COPY .
+ DESTINATION "${LLVM_BINARY_DIR}/include/c++/v1"
+ FILES_MATCHING
+ ${LIBCXX_HEADER_PATTERN}
+ )
+endif()
if (LIBCXX_INSTALL_HEADERS)
install(DIRECTORY .
DESTINATION include/c++/v1
- COMPONENT libcxx-headers
+ COMPONENT cxx-headers
FILES_MATCHING
${LIBCXX_HEADER_PATTERN}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
@@ -27,7 +29,7 @@ if (LIBCXX_INSTALL_HEADERS)
if (LIBCXX_NEEDS_SITE_CONFIG)
set(UNIX_CAT cat)
- if (WIN32)
+ if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
set(UNIX_CAT type)
endif()
# Generate and install a custom __config header. The new header is created
@@ -47,17 +49,20 @@ if (LIBCXX_INSTALL_HEADERS)
DESTINATION include/c++/v1
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
RENAME __config
- COMPONENT libcxx-headers)
+ COMPONENT cxx-headers)
endif()
if (NOT CMAKE_CONFIGURATION_TYPES)
# this target is just needed as a placeholder for the distribution target
- add_custom_target(libcxx-headers)
- add_custom_target(install-libcxx-headers
- DEPENDS libcxx-headers ${generated_config_deps}
+ add_custom_target(cxx-headers)
+ add_custom_target(install-cxx-headers
+ DEPENDS cxx-headers ${generated_config_deps}
COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=libcxx-headers
+ -DCMAKE_INSTALL_COMPONENT=cxx-headers
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+
+ add_custom_target(libcxx-headers)
+ add_custom_target(install-libcxx-headers DEPENDS install-cxx-headers)
endif()
endif()
diff --git a/include/__bit_reference b/include/__bit_reference
index 5659ed068246..8f245463c91d 100644
--- a/include/__bit_reference
+++ b/include/__bit_reference
@@ -163,7 +163,7 @@ __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
{
typedef __bit_iterator<_Cp, _IsConst> _It;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ static const int __bits_per_word = _It::__bits_per_word;
// do first partial word
if (__first.__ctz_ != 0)
{
@@ -199,7 +199,7 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
{
typedef __bit_iterator<_Cp, _IsConst> _It;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ const int __bits_per_word = _It::__bits_per_word;
// do first partial word
if (__first.__ctz_ != 0)
{
@@ -251,7 +251,7 @@ __count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
typedef __bit_iterator<_Cp, _IsConst> _It;
typedef typename _It::__storage_type __storage_type;
typedef typename _It::difference_type difference_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ const int __bits_per_word = _It::__bits_per_word;
difference_type __r = 0;
// do first partial word
if (__first.__ctz_ != 0)
@@ -282,7 +282,7 @@ __count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_typ
typedef __bit_iterator<_Cp, _IsConst> _It;
typedef typename _It::__storage_type __storage_type;
typedef typename _It::difference_type difference_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ const int __bits_per_word = _It::__bits_per_word;
difference_type __r = 0;
// do first partial word
if (__first.__ctz_ != 0)
@@ -324,7 +324,7 @@ __fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
{
typedef __bit_iterator<_Cp, false> _It;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ const int __bits_per_word = _It::__bits_per_word;
// do first partial word
if (__first.__ctz_ != 0)
{
@@ -354,7 +354,7 @@ __fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
{
typedef __bit_iterator<_Cp, false> _It;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ const int __bits_per_word = _It::__bits_per_word;
// do first partial word
if (__first.__ctz_ != 0)
{
@@ -412,7 +412,7 @@ __copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsCon
typedef __bit_iterator<_Cp, _IsConst> _In;
typedef typename _In::difference_type difference_type;
typedef typename _In::__storage_type __storage_type;
- static const unsigned __bits_per_word = _In::__bits_per_word;
+ const int __bits_per_word = _In::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -461,7 +461,7 @@ __copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsC
typedef __bit_iterator<_Cp, _IsConst> _In;
typedef typename _In::difference_type difference_type;
typedef typename _In::__storage_type __storage_type;
- static const unsigned __bits_per_word = _In::__bits_per_word;
+ static const int __bits_per_word = _In::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -551,7 +551,7 @@ __copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_C
typedef __bit_iterator<_Cp, _IsConst> _In;
typedef typename _In::difference_type difference_type;
typedef typename _In::__storage_type __storage_type;
- static const unsigned __bits_per_word = _In::__bits_per_word;
+ const int __bits_per_word = _In::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -600,7 +600,7 @@ __copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<
typedef __bit_iterator<_Cp, _IsConst> _In;
typedef typename _In::difference_type difference_type;
typedef typename _In::__storage_type __storage_type;
- static const unsigned __bits_per_word = _In::__bits_per_word;
+ const int __bits_per_word = _In::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -718,7 +718,7 @@ __swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1,
typedef __bit_iterator<__C1, false> _I1;
typedef typename _I1::difference_type difference_type;
typedef typename _I1::__storage_type __storage_type;
- static const unsigned __bits_per_word = _I1::__bits_per_word;
+ const int __bits_per_word = _I1::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -768,7 +768,7 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
typedef __bit_iterator<__C1, false> _I1;
typedef typename _I1::difference_type difference_type;
typedef typename _I1::__storage_type __storage_type;
- static const unsigned __bits_per_word = _I1::__bits_per_word;
+ const int __bits_per_word = _I1::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -959,7 +959,7 @@ __equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1>
typedef __bit_iterator<_Cp, _IC1> _It;
typedef typename _It::difference_type difference_type;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ static const int __bits_per_word = _It::__bits_per_word;
difference_type __n = __last1 - __first1;
if (__n > 0)
{
@@ -1041,7 +1041,7 @@ __equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __
typedef __bit_iterator<_Cp, _IC1> _It;
typedef typename _It::difference_type difference_type;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ static const int __bits_per_word = _It::__bits_per_word;
difference_type __n = __last1 - __first1;
if (__n > 0)
{
diff --git a/include/__config b/include/__config
index 3edb9de017ab..321e71778228 100644
--- a/include/__config
+++ b/include/__config
@@ -27,14 +27,14 @@
#define _GNUC_VER 0
#endif
-#define _LIBCPP_VERSION 3900
+#define _LIBCPP_VERSION 4000
#ifndef _LIBCPP_ABI_VERSION
#define _LIBCPP_ABI_VERSION 1
#endif
#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
-// Change short string represention so that string data starts at offset 0,
+// Change short string representation so that string data starts at offset 0,
// improving its alignment in some cases.
#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
// Fix deque iterator type in order to support incomplete types.
@@ -43,9 +43,15 @@
#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
+// Fix undefined behavior in how __hash_table stores it's 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_VARIADIC_LOCK_GUARD
+// 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
#elif _LIBCPP_ABI_VERSION == 1
// Feature macros for disabling pre ABI v1 features. All of these options
// are deprecated.
@@ -64,6 +70,9 @@
#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION)
+#if __cplusplus < 201103L
+#define _LIBCPP_CXX03_LANG
+#endif
#ifndef __has_attribute
#define __has_attribute(__x) 0
@@ -83,6 +92,13 @@
#define __is_identifier(__x) 1
#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)
+#endif // defined(__linux__)
#ifdef __LITTLE_ENDIAN__
#if __LITTLE_ENDIAN__
@@ -200,90 +216,6 @@
#define _LIBCPP_NO_CFI
#endif
-#ifdef _WIN32
-
-// only really useful for a DLL
-#ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally...
-# ifdef cxx_EXPORTS
-# define _LIBCPP_HIDDEN
-# define _LIBCPP_FUNC_VIS __declspec(dllexport)
-# define _LIBCPP_TYPE_VIS __declspec(dllexport)
-# else
-# define _LIBCPP_HIDDEN
-# define _LIBCPP_FUNC_VIS __declspec(dllimport)
-# define _LIBCPP_TYPE_VIS __declspec(dllimport)
-# endif
-#else
-# define _LIBCPP_HIDDEN
-# define _LIBCPP_FUNC_VIS
-# define _LIBCPP_TYPE_VIS
-#endif
-
-#define _LIBCPP_TYPE_VIS_ONLY
-#define _LIBCPP_FUNC_VIS_ONLY
-
-#ifndef _LIBCPP_INLINE_VISIBILITY
-# ifdef _LIBCPP_MSVC
-# define _LIBCPP_INLINE_VISIBILITY __forceinline
-# else // MinGW GCC and Clang
-# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
-# endif
-#endif
-
-#ifndef _LIBCPP_EXCEPTION_ABI
-#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
-#endif
-
-#ifndef _LIBCPP_ALWAYS_INLINE
-# ifdef _LIBCPP_MSVC
-# define _LIBCPP_ALWAYS_INLINE __forceinline
-# endif
-#endif
-
-#endif // _WIN32
-
-#ifndef _LIBCPP_HIDDEN
-#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
-#endif
-
-#ifndef _LIBCPP_FUNC_VIS
-#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
-#endif
-
-#ifndef _LIBCPP_TYPE_VIS
-# if __has_attribute(__type_visibility__)
-# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default")))
-# else
-# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
-# endif
-#endif
-
-#ifndef _LIBCPP_PREFERRED_OVERLOAD
-# if __has_attribute(__enable_if__)
-# define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, "")))
-# endif
-#endif
-
-#ifndef _LIBCPP_TYPE_VIS_ONLY
-# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS
-#endif
-
-#ifndef _LIBCPP_FUNC_VIS_ONLY
-# define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS
-#endif
-
-#ifndef _LIBCPP_INLINE_VISIBILITY
-#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
-#endif
-
-#ifndef _LIBCPP_EXCEPTION_ABI
-#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
-#endif
-
-#ifndef _LIBCPP_ALWAYS_INLINE
-#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
-#endif
-
#if defined(__clang__)
// _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for
@@ -302,10 +234,6 @@
# define _ALIGNAS(x) __attribute__((__aligned__(x)))
#endif
-#if !__has_feature(cxx_alias_templates)
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-#endif
-
#if __cplusplus < 201103L
typedef __char16_t char16_t;
typedef __char32_t char32_t;
@@ -333,14 +261,6 @@ typedef __char32_t char32_t;
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
#endif
-#if !(__has_feature(cxx_default_function_template_args))
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
-#endif
-
-#if !(__has_feature(cxx_defaulted_functions))
-#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
-#endif // !(__has_feature(cxx_defaulted_functions))
-
#if !(__has_feature(cxx_deleted_functions))
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
#endif // !(__has_feature(cxx_deleted_functions))
@@ -350,33 +270,25 @@ typedef __char32_t char32_t;
#endif
#if !(__has_feature(cxx_nullptr))
-#define _LIBCPP_HAS_NO_NULLPTR
+# if __has_extension(cxx_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))
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
#endif
-#if !(__has_feature(cxx_static_assert))
-#define _LIBCPP_HAS_NO_STATIC_ASSERT
-#endif
-
#if !(__has_feature(cxx_auto_type))
#define _LIBCPP_HAS_NO_AUTO_TYPE
#endif
-#if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return)
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#endif
-
#if !(__has_feature(cxx_variadic_templates))
#define _LIBCPP_HAS_NO_VARIADICS
#endif
-#if !(__has_feature(cxx_trailing_return))
-#define _LIBCPP_HAS_NO_TRAILING_RETURN
-#endif
-
#if !(__has_feature(cxx_generalized_initializers))
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#endif
@@ -415,12 +327,12 @@ typedef __char32_t char32_t;
#if defined(__FreeBSD__)
#define _LIBCPP_HAS_QUICK_EXIT
#define _LIBCPP_HAS_C11_FEATURES
-#elif defined(__ANDROID__)
+#elif defined(__Fuchsia__)
#define _LIBCPP_HAS_QUICK_EXIT
+#define _LIBCPP_HAS_C11_FEATURES
#elif defined(__linux__)
#if !defined(_LIBCPP_HAS_MUSL_LIBC)
-# include <features.h>
-#if __GLIBC_PREREQ(2, 15)
+#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
#define _LIBCPP_HAS_QUICK_EXIT
#endif
#if __GLIBC_PREREQ(2, 17)
@@ -504,34 +416,25 @@ namespace std {
#endif
#ifndef __GXX_EXPERIMENTAL_CXX0X__
-
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
#define _LIBCPP_HAS_NO_DECLTYPE
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
-#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
#define _LIBCPP_HAS_NO_NULLPTR
-#define _LIBCPP_HAS_NO_STATIC_ASSERT
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
#define _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
#define _LIBCPP_HAS_NO_NOEXCEPT
#else // __GXX_EXPERIMENTAL_CXX0X__
#if _GNUC_VER < 403
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#define _LIBCPP_HAS_NO_STATIC_ASSERT
#endif
#if _GNUC_VER < 404
#define _LIBCPP_HAS_NO_DECLTYPE
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
-#define _LIBCPP_HAS_NO_TRAILING_RETURN
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
@@ -540,12 +443,6 @@ namespace std {
#if _GNUC_VER < 406
#define _LIBCPP_HAS_NO_NOEXCEPT
#define _LIBCPP_HAS_NO_NULLPTR
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-#endif
-
-#if _GNUC_VER < 407
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#endif
#endif // __GXX_EXPERIMENTAL_CXX0X__
@@ -566,21 +463,17 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
#elif defined(_LIBCPP_MSVC)
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
#define _LIBCPP_HAS_NO_CONSTEXPR
#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
-#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#define _LIBCPP_HAS_NO_NOEXCEPT
#define __alignof__ __alignof
#define _LIBCPP_NORETURN __declspec(noreturn)
#define _ALIGNAS(x) __declspec(align(x))
#define _LIBCPP_HAS_NO_VARIADICS
-
-
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
#define _LIBCPP_END_NAMESPACE_STD }
#define _VSTD std
@@ -598,9 +491,6 @@ namespace std {
#define _ATTRIBUTE(x) __attribute__((x))
#define _LIBCPP_NORETURN __attribute__((noreturn))
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#define _LIBCPP_HAS_NO_NOEXCEPT
#define _LIBCPP_HAS_NO_NULLPTR
@@ -626,6 +516,141 @@ namespace std {
#endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__
+
+#ifdef _WIN32
+#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
+#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
+#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
+#endif
+
+#define _LIBCPP_TYPE_VIS _LIBCPP_DLL_VIS
+#define _LIBCPP_FUNC_VIS _LIBCPP_DLL_VIS
+#define _LIBCPP_EXCEPTION_ABI _LIBCPP_DLL_VIS
+#define _LIBCPP_HIDDEN
+#define _LIBCPP_TYPE_VIS_ONLY
+#define _LIBCPP_FUNC_VIS_ONLY
+#define _LIBCPP_ENUM_VIS
+#if defined(_LIBCPP_MSVC)
+# define _LIBCPP_INLINE_VISIBILITY __forceinline
+# define _LIBCPP_ALWAYS_INLINE __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__))
+#endif
+#endif // _WIN32
+
+#ifndef _LIBCPP_HIDDEN
+#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
+#else
+#define _LIBCPP_HIDDEN
+#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
+#endif
+
+#ifndef _LIBCPP_TYPE_VIS
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+# if __has_attribute(__type_visibility__)
+# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default")))
+# else
+# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
+# endif
+# else
+# define _LIBCPP_TYPE_VIS
+# endif
+#endif
+
+#ifndef _LIBCPP_TYPE_VIS_ONLY
+# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS
+#endif
+
+#ifndef _LIBCPP_FUNC_VIS_ONLY
+# define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS
+#endif
+
+#ifndef _LIBCPP_OVERRIDABLE_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
+#endif
+
+#ifndef _LIBCPP_ENUM_VIS
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
+# define _LIBCPP_ENUM_VIS __attribute__ ((__type_visibility__("default")))
+# else
+# define _LIBCPP_ENUM_VIS
+# endif
+#endif
+
+#ifndef _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
+# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __attribute__ ((__type_visibility__("default")))
+# else
+# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
+# endif
+#endif
+
+#ifndef _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__))
+#else
+#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
+#endif
+#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
+#endif
+
+#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
+#endif
+
+#ifndef _LIBCPP_PREFERRED_OVERLOAD
+# if __has_attribute(__enable_if__)
+# define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, "")))
+# endif
+#endif
+
#ifndef _LIBCPP_HAS_NO_NOEXCEPT
# define _NOEXCEPT noexcept
# define _NOEXCEPT_(x) noexcept(x)
@@ -634,6 +659,17 @@ namespace std {
# define _NOEXCEPT_(x)
#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)
+#else
+# define _NOEXCEPT_DEBUG _NOEXCEPT
+# define _NOEXCEPT_DEBUG_(x) _NOEXCEPT_(x)
+#endif
+
#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef unsigned short char16_t;
typedef unsigned int char32_t;
@@ -643,8 +679,10 @@ typedef unsigned int char32_t;
#define _LIBCPP_HAS_NO_INT128
#endif
-#ifdef _LIBCPP_HAS_NO_STATIC_ASSERT
-
+#ifdef _LIBCPP_CXX03_LANG
+# 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> {};
@@ -653,8 +691,8 @@ 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 // _LIBCPP_HAS_NO_STATIC_ASSERT
+# endif // __has_extension(c_static_assert)
+#endif // _LIBCPP_CXX03_LANG
#ifdef _LIBCPP_HAS_NO_DECLTYPE
// GCC 4.6 provides __decltype in all standard modes.
@@ -671,7 +709,7 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_CONSTEXPR constexpr
#endif
-#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifdef _LIBCPP_CXX03_LANG
#define _LIBCPP_DEFAULT {}
#else
#define _LIBCPP_DEFAULT = default;
@@ -689,7 +727,8 @@ template <unsigned> struct __static_assert_check {};
#define _NOALIAS
#endif
-#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__)
+#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || \
+ (!defined(_LIBCPP_CXX03_LANG) && defined(__GNUC__)) // All supported GCC versions
# define _LIBCPP_EXPLICIT explicit
#else
# define _LIBCPP_EXPLICIT
@@ -708,7 +747,7 @@ template <unsigned> struct __static_assert_check {};
_LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
};
#else // _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS 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
@@ -742,7 +781,7 @@ 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(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION)
+#if !defined(_WIN32) && !defined(__BIONIC__) && !defined(_NEWLIB_VERSION)
#define _LIBCPP_HAS_CATOPEN 1
#endif
#endif
@@ -795,6 +834,11 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_CONSTEXPR_AFTER_CXX14
#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
+#endif
+
#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
# define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
#else
@@ -802,7 +846,7 @@ template <unsigned> struct __static_assert_check {};
#endif
#ifndef _LIBCPP_HAS_NO_ASAN
-extern "C" void __sanitizer_annotate_contiguous_container(
+_LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
const void *, const void *, const void *, const void *);
#endif
@@ -823,8 +867,11 @@ extern "C" void __sanitizer_annotate_contiguous_container(
#endif
// Thread API
-#if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+#if !defined(_LIBCPP_HAS_NO_THREADS) && \
+ !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && \
+ !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
# if defined(__FreeBSD__) || \
+ defined(__Fuchsia__) || \
defined(__NetBSD__) || \
defined(__linux__) || \
defined(__APPLE__) || \
@@ -841,6 +888,11 @@ extern "C" void __sanitizer_annotate_contiguous_container(
_LIBCPP_HAS_NO_THREADS is not defined.
#endif
+#if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+# error _LIBCPP_HAS_EXTERNAL_THREAD_API 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.
@@ -861,11 +913,12 @@ extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_HAS_NO_STDOUT
#endif
-#if defined(__ANDROID__) || defined(__CloudABI__) || defined(_LIBCPP_HAS_MUSL_LIBC)
+#if defined(__BIONIC__) || defined(__CloudABI__) || \
+ defined(_LIBCPP_HAS_MUSL_LIBC)
#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
#endif
-// Thread-unsafe functions such as strtok(), mbtowc() and localtime()
+// Thread-unsafe functions such as strtok() and localtime()
// are not available.
#ifdef __CloudABI__
#define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
@@ -886,17 +939,25 @@ extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
#endif
-#if __cplusplus < 201103L
-#define _LIBCPP_CXX03_LANG
+#if (defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS) && defined(__clang__) \
+ && __has_attribute(acquire_capability))
+#define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
+#endif
+
+#if __has_attribute(require_constant_initialization)
+#define _LIBCPP_SAFE_STATIC __attribute__((__require_constant_initialization__))
#else
-#if defined(_LIBCPP_HAS_NO_VARIADIC_TEMPLATES) || defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-#error Libc++ requires a feature complete C++11 compiler in C++11 or greater.
+#define _LIBCPP_SAFE_STATIC
#endif
+
+#if !__has_builtin(__builtin_addressof) && _GNUC_VER < 700
+#define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
#endif
-#if (defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS) && defined(__clang__) \
- && __has_attribute(acquire_capability))
-#define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
+#if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
+#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
+#endif
#endif
#endif // __cplusplus
diff --git a/include/__config_site.in b/include/__config_site.in
index 6c2b7bb446d7..f2a1986888ba 100644
--- a/include/__config_site.in
+++ b/include/__config_site.in
@@ -20,5 +20,7 @@
#cmakedefine _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
#cmakedefine _LIBCPP_HAS_MUSL_LIBC
#cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD
+#cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL
+#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
#endif // _LIBCPP_CONFIG_SITE
diff --git a/include/__debug b/include/__debug
index a21f9a89884b..f8c1129a3694 100644
--- a/include/__debug
+++ b/include/__debug
@@ -17,23 +17,103 @@
#pragma GCC system_header
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
+#if defined(_LIBCPP_HAS_NO_NULLPTR)
+# include <cstddef>
+#endif
+
+#if _LIBCPP_DEBUG_LEVEL >= 1 || defined(_LIBCPP_BUILDING_LIBRARY)
# include <cstdlib>
# include <cstdio>
# include <cstddef>
-# ifndef _LIBCPP_ASSERT
-# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::fprintf(stderr, "%s\n", m), _VSTD::abort()))
-# endif
+# include <exception>
+#endif
+
+#if _LIBCPP_DEBUG_LEVEL >= 1 && !defined(_LIBCPP_ASSERT)
+# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : \
+ _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
+#endif
+
+#if _LIBCPP_DEBUG_LEVEL >= 2
+#ifndef _LIBCPP_DEBUG_ASSERT
+#define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(x, m)
+#endif
+#define _LIBCPP_DEBUG_MODE(...) __VA_ARGS__
#endif
#ifndef _LIBCPP_ASSERT
# define _LIBCPP_ASSERT(x, m) ((void)0)
#endif
+#ifndef _LIBCPP_DEBUG_ASSERT
+# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
+#endif
+#ifndef _LIBCPP_DEBUG_MODE
+#define _LIBCPP_DEBUG_MODE(...) ((void)0)
+#endif
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL < 1
+class _LIBCPP_EXCEPTION_ABI __libcpp_debug_exception;
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
+struct _LIBCPP_TYPE_VIS_ONLY __libcpp_debug_info {
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ __libcpp_debug_info()
+ : __file_(nullptr), __line_(-1), __pred_(nullptr), __msg_(nullptr) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ __libcpp_debug_info(const char* __f, int __l, const char* __p, const char* __m)
+ : __file_(__f), __line_(__l), __pred_(__p), __msg_(__m) {}
+ const char* __file_;
+ int __line_;
+ const char* __pred_;
+ const char* __msg_;
+};
+
+/// __libcpp_debug_function_type - The type of the assertion failure handler.
+typedef void(*__libcpp_debug_function_type)(__libcpp_debug_info const&);
+
+/// __libcpp_debug_function - The handler function called when a _LIBCPP_ASSERT
+/// fails.
+extern __libcpp_debug_function_type __libcpp_debug_function;
+
+/// __libcpp_abort_debug_function - A debug handler that aborts when called.
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS
+void __libcpp_abort_debug_function(__libcpp_debug_info const&);
+
+/// __libcpp_throw_debug_function - A debug handler that throws
+/// an instance of __libcpp_debug_exception when called.
+ _LIBCPP_NORETURN _LIBCPP_FUNC_VIS
+void __libcpp_throw_debug_function(__libcpp_debug_info const&);
+
+/// __libcpp_set_debug_function - Set the debug handler to the specified
+/// function.
+_LIBCPP_FUNC_VIS
+bool __libcpp_set_debug_function(__libcpp_debug_function_type __func);
+
+// Setup the throwing debug handler during dynamic initialization.
+#if _LIBCPP_DEBUG_LEVEL >= 1 && defined(_LIBCPP_DEBUG_USE_EXCEPTIONS)
+# if defined(_LIBCPP_NO_EXCEPTIONS)
+# error _LIBCPP_DEBUG_USE_EXCEPTIONS cannot be used when exceptions are disabled.
+# endif
+static bool __init_dummy = __libcpp_set_debug_function(__libcpp_throw_debug_function);
+#endif
+
+#if _LIBCPP_DEBUG_LEVEL >= 1 || defined(_LIBCPP_BUILDING_LIBRARY)
+class _LIBCPP_EXCEPTION_ABI __libcpp_debug_exception : public exception {
+public:
+ __libcpp_debug_exception() _NOEXCEPT;
+ explicit __libcpp_debug_exception(__libcpp_debug_info const& __i);
+ __libcpp_debug_exception(__libcpp_debug_exception const&);
+ ~__libcpp_debug_exception() _NOEXCEPT;
+ const char* what() const _NOEXCEPT;
+private:
+ struct __libcpp_debug_exception_imp;
+ __libcpp_debug_exception_imp *__imp_;
+};
+#endif
+
+#if _LIBCPP_DEBUG_LEVEL >= 2 || defined(_LIBCPP_BUILDING_LIBRARY)
+
struct _LIBCPP_TYPE_VIS __c_node;
struct _LIBCPP_TYPE_VIS __i_node
@@ -102,7 +182,7 @@ struct _C_node
};
template <class _Cont>
-bool
+inline bool
_C_node<_Cont>::__dereferenceable(const void* __i) const
{
typedef typename _Cont::const_iterator iterator;
@@ -112,7 +192,7 @@ _C_node<_Cont>::__dereferenceable(const void* __i) const
}
template <class _Cont>
-bool
+inline bool
_C_node<_Cont>::__decrementable(const void* __i) const
{
typedef typename _Cont::const_iterator iterator;
@@ -122,7 +202,7 @@ _C_node<_Cont>::__decrementable(const void* __i) const
}
template <class _Cont>
-bool
+inline bool
_C_node<_Cont>::__addable(const void* __i, ptrdiff_t __n) const
{
typedef typename _Cont::const_iterator iterator;
@@ -132,7 +212,7 @@ _C_node<_Cont>::__addable(const void* __i, ptrdiff_t __n) const
}
template <class _Cont>
-bool
+inline bool
_C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const
{
typedef typename _Cont::const_iterator iterator;
@@ -214,9 +294,9 @@ _LIBCPP_FUNC_VIS __libcpp_db* __get_db();
_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db();
-_LIBCPP_END_NAMESPACE_STD
+#endif // _LIBCPP_DEBUG_LEVEL >= 2 || defined(_LIBCPP_BUILDING_LIBRARY)
-#endif
+_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_DEBUG_H
diff --git a/include/__functional_03 b/include/__functional_03
index 4edbb0996ca0..a1cec8bcac95 100644
--- a/include/__functional_03
+++ b/include/__functional_03
@@ -642,6 +642,8 @@ template<class _Rp>
void
function<_Rp()>::swap(function& __f)
{
+ if (_VSTD::addressof(__f) == this)
+ return;
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
{
typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
@@ -679,10 +681,8 @@ template<class _Rp>
_Rp
function<_Rp()>::operator()() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0)
- throw bad_function_call();
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_bad_function_call();
return (*__f_)();
}
@@ -918,6 +918,8 @@ template<class _Rp, class _A0>
void
function<_Rp(_A0)>::swap(function& __f)
{
+ if (_VSTD::addressof(__f) == this)
+ return;
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
{
typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
@@ -955,10 +957,8 @@ template<class _Rp, class _A0>
_Rp
function<_Rp(_A0)>::operator()(_A0 __a0) const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0)
- throw bad_function_call();
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_bad_function_call();
return (*__f_)(__a0);
}
@@ -1194,6 +1194,8 @@ template<class _Rp, class _A0, class _A1>
void
function<_Rp(_A0, _A1)>::swap(function& __f)
{
+ if (_VSTD::addressof(__f) == this)
+ return;
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
{
typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
@@ -1231,10 +1233,8 @@ template<class _Rp, class _A0, class _A1>
_Rp
function<_Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0)
- throw bad_function_call();
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_bad_function_call();
return (*__f_)(__a0, __a1);
}
@@ -1470,6 +1470,8 @@ template<class _Rp, class _A0, class _A1, class _A2>
void
function<_Rp(_A0, _A1, _A2)>::swap(function& __f)
{
+ if (_VSTD::addressof(__f) == this)
+ return;
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
{
typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
@@ -1507,10 +1509,8 @@ template<class _Rp, class _A0, class _A1, class _A2>
_Rp
function<_Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0)
- throw bad_function_call();
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_bad_function_call();
return (*__f_)(__a0, __a1, __a2);
}
diff --git a/include/__functional_base b/include/__functional_base
index 1a08ea29deea..6e2cfefc5972 100644
--- a/include/__functional_base
+++ b/include/__functional_base
@@ -625,6 +625,11 @@ struct _LIBCPP_TYPE_VIS_ONLY uses_allocator
{
};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp, class _Alloc>
+constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
+#endif
+
#ifndef _LIBCPP_HAS_NO_VARIADICS
// allocator construction
@@ -632,7 +637,8 @@ struct _LIBCPP_TYPE_VIS_ONLY uses_allocator
template <class _Tp, class _Alloc, class ..._Args>
struct __uses_alloc_ctor_imp
{
- static const bool __ua = uses_allocator<_Tp, _Alloc>::value;
+ typedef typename __uncvref<_Alloc>::type _RawAlloc;
+ static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value;
static const bool __ic =
is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
static const int value = __ua ? 2 - __ic : 0;
@@ -650,6 +656,7 @@ void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, con
new (__storage) _Tp (_VSTD::forward<_Args>(__args)...);
}
+// FIXME: This 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_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
@@ -657,6 +664,7 @@ void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, con
new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...);
}
+// FIXME: This 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_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
@@ -664,6 +672,7 @@ 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)
diff --git a/include/__hash_table b/include/__hash_table
index 08bc519ae17f..9a0d441b37b8 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -59,9 +59,38 @@ size_t __next_prime(size_t __n);
template <class _NodePtr>
struct __hash_node_base
{
+ typedef typename pointer_traits<_NodePtr>::element_type __node_type;
typedef __hash_node_base __first_node;
+ typedef typename __rebind_pointer<_NodePtr, __first_node>::type __node_base_pointer;
+ typedef _NodePtr __node_pointer;
+
+#if defined(_LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB)
+ typedef __node_base_pointer __next_pointer;
+#else
+ typedef typename conditional<
+ is_pointer<__node_pointer>::value,
+ __node_base_pointer,
+ __node_pointer>::type __next_pointer;
+#endif
+
+ __next_pointer __next_;
+
+ _LIBCPP_INLINE_VISIBILITY
+ __next_pointer __ptr() _NOEXCEPT {
+ return static_cast<__next_pointer>(
+ pointer_traits<__node_base_pointer>::pointer_to(*this));
+ }
- _NodePtr __next_;
+ _LIBCPP_INLINE_VISIBILITY
+ __node_pointer __upcast() _NOEXCEPT {
+ return static_cast<__node_pointer>(
+ pointer_traits<__node_base_pointer>::pointer_to(*this));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ size_t __hash() const _NOEXCEPT {
+ return static_cast<__node_type const&>(*this).__hash_;
+ }
_LIBCPP_INLINE_VISIBILITY __hash_node_base() _NOEXCEPT : __next_(nullptr) {}
};
@@ -75,7 +104,7 @@ struct __hash_node
{
typedef _Tp __node_value_type;
- size_t __hash_;
+ size_t __hash_;
__node_value_type __value_;
};
@@ -219,11 +248,14 @@ public:
typedef typename __rebind_pointer<_NodePtr, __node_base_type>::type
__node_base_pointer;
+ typedef typename __node_base_type::__next_pointer __next_pointer;
+
typedef _Tp __node_value_type;
typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type
__node_value_type_pointer;
typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type
__const_node_value_type_pointer;
+
private:
static_assert(!is_const<__node_type>::value,
"_NodePtr should never be a pointer to const");
@@ -233,8 +265,6 @@ private:
_NodePtr>::value), "_VoidPtr does not rebind to _NodePtr.");
};
-
-
template <class _HashIterator>
struct __hash_node_types_from_iterator;
template <class _NodePtr>
@@ -258,9 +288,10 @@ template <class _NodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_iterator
{
typedef __hash_node_types<_NodePtr> _NodeTypes;
- typedef _NodePtr __node_pointer;
+ typedef _NodePtr __node_pointer;
+ typedef typename _NodeTypes::__next_pointer __next_pointer;
- __node_pointer __node_;
+ __next_pointer __node_;
public:
typedef forward_iterator_tag iterator_category;
@@ -269,18 +300,11 @@ public:
typedef value_type& reference;
typedef typename _NodeTypes::__node_value_type_pointer pointer;
- _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
- : __node_(nullptr)
-#endif
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__insert_i(this);
-#endif
+ _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) {
+ _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
}
#if _LIBCPP_DEBUG_LEVEL >= 2
-
_LIBCPP_INLINE_VISIBILITY
__hash_iterator(const __hash_iterator& __i)
: __node_(__i.__node_)
@@ -304,35 +328,26 @@ public:
}
return *this;
}
-
#endif // _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container iterator");
-#endif
- return __node_->__value_;
- }
+ reference operator*() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+ "Attempted to dereference a non-dereferenceable unordered container iterator");
+ return __node_->__upcast()->__value_;
+ }
+
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ pointer operator->() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container iterator");
-#endif
- return pointer_traits<pointer>::pointer_to(__node_->__value_);
- }
+ return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
+ }
_LIBCPP_INLINE_VISIBILITY
- __hash_iterator& operator++()
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ __hash_iterator& operator++() {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to increment non-incrementable unordered container iterator");
-#endif
__node_ = __node_->__next_;
return *this;
}
@@ -357,18 +372,17 @@ public:
private:
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- __hash_iterator(__node_pointer __node, const void* __c) _NOEXCEPT
+ __hash_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
: __node_(__node)
{
__get_db()->__insert_ic(this, __c);
}
#else
_LIBCPP_INLINE_VISIBILITY
- __hash_iterator(__node_pointer __node) _NOEXCEPT
+ __hash_iterator(__next_pointer __node) _NOEXCEPT
: __node_(__node)
{}
#endif
-
template <class, class, class, class> friend class __hash_table;
template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;
@@ -381,9 +395,10 @@ class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator
{
static_assert(!is_const<typename pointer_traits<_NodePtr>::element_type>::value, "");
typedef __hash_node_types<_NodePtr> _NodeTypes;
- typedef _NodePtr __node_pointer;
+ typedef _NodePtr __node_pointer;
+ typedef typename _NodeTypes::__next_pointer __next_pointer;
- __node_pointer __node_;
+ __next_pointer __node_;
public:
typedef __hash_iterator<_NodePtr> __non_const_iterator;
@@ -395,26 +410,18 @@ public:
typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
- _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
- : __node_(nullptr)
-#endif
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__insert_i(this);
-#endif
+ _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {
+ _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
}
+
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
: __node_(__x.__node_)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__iterator_copy(this, &__x);
-#endif
+ _LIBCPP_DEBUG_MODE(__get_db()->__iterator_copy(this, &__x));
}
#if _LIBCPP_DEBUG_LEVEL >= 2
-
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator(const __hash_const_iterator& __i)
: __node_(__i.__node_)
@@ -438,35 +445,25 @@ public:
}
return *this;
}
-
#endif // _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ reference operator*() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container const_iterator");
-#endif
- return __node_->__value_;
- }
+ return __node_->__upcast()->__value_;
+ }
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ pointer operator->() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container const_iterator");
-#endif
- return pointer_traits<pointer>::pointer_to(__node_->__value_);
- }
+ return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
+ }
_LIBCPP_INLINE_VISIBILITY
- __hash_const_iterator& operator++()
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment non-incrementable unordered container const_iterator");
-#endif
+ __hash_const_iterator& operator++() {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+ "Attempted to increment non-incrementable unordered container const_iterator");
__node_ = __node_->__next_;
return *this;
}
@@ -491,18 +488,17 @@ public:
private:
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- __hash_const_iterator(__node_pointer __node, const void* __c) _NOEXCEPT
+ __hash_const_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
: __node_(__node)
{
__get_db()->__insert_ic(this, __c);
}
#else
_LIBCPP_INLINE_VISIBILITY
- __hash_const_iterator(__node_pointer __node) _NOEXCEPT
+ __hash_const_iterator(__next_pointer __node) _NOEXCEPT
: __node_(__node)
{}
#endif
-
template <class, class, class, class> friend class __hash_table;
template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_map;
@@ -513,9 +509,10 @@ template <class _NodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_local_iterator
{
typedef __hash_node_types<_NodePtr> _NodeTypes;
- typedef _NodePtr __node_pointer;
+ typedef _NodePtr __node_pointer;
+ typedef typename _NodeTypes::__next_pointer __next_pointer;
- __node_pointer __node_;
+ __next_pointer __node_;
size_t __bucket_;
size_t __bucket_count_;
@@ -526,15 +523,11 @@ public:
typedef value_type& reference;
typedef typename _NodeTypes::__node_value_type_pointer pointer;
- _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__insert_i(this);
-#endif
+ _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {
+ _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
}
#if _LIBCPP_DEBUG_LEVEL >= 2
-
_LIBCPP_INLINE_VISIBILITY
__hash_local_iterator(const __hash_local_iterator& __i)
: __node_(__i.__node_),
@@ -562,37 +555,28 @@ public:
}
return *this;
}
-
#endif // _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ reference operator*() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container local_iterator");
-#endif
- return __node_->__value_;
- }
+ return __node_->__upcast()->__value_;
+ }
+
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container local_iterator");
-#endif
- return pointer_traits<pointer>::pointer_to(__node_->__value_);
- }
+ pointer operator->() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+ "Attempted to dereference a non-dereferenceable unordered container local_iterator");
+ return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
+ }
_LIBCPP_INLINE_VISIBILITY
- __hash_local_iterator& operator++()
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ __hash_local_iterator& operator++() {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to increment non-incrementable unordered container local_iterator");
-#endif
__node_ = __node_->__next_;
- if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_)
+ if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
__node_ = nullptr;
return *this;
}
@@ -617,7 +601,7 @@ public:
private:
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- __hash_local_iterator(__node_pointer __node, size_t __bucket,
+ __hash_local_iterator(__next_pointer __node, size_t __bucket,
size_t __bucket_count, const void* __c) _NOEXCEPT
: __node_(__node),
__bucket_(__bucket),
@@ -629,7 +613,7 @@ private:
}
#else
_LIBCPP_INLINE_VISIBILITY
- __hash_local_iterator(__node_pointer __node, size_t __bucket,
+ __hash_local_iterator(__next_pointer __node, size_t __bucket,
size_t __bucket_count) _NOEXCEPT
: __node_(__node),
__bucket_(__bucket),
@@ -648,9 +632,10 @@ template <class _ConstNodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator
{
typedef __hash_node_types<_ConstNodePtr> _NodeTypes;
- typedef _ConstNodePtr __node_pointer;
+ typedef _ConstNodePtr __node_pointer;
+ typedef typename _NodeTypes::__next_pointer __next_pointer;
- __node_pointer __node_;
+ __next_pointer __node_;
size_t __bucket_;
size_t __bucket_count_;
@@ -670,11 +655,8 @@ public:
typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
- _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__insert_i(this);
-#endif
+ _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {
+ _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
}
_LIBCPP_INLINE_VISIBILITY
@@ -683,13 +665,10 @@ public:
__bucket_(__x.__bucket_),
__bucket_count_(__x.__bucket_count_)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__iterator_copy(this, &__x);
-#endif
+ _LIBCPP_DEBUG_MODE(__get_db()->__iterator_copy(this, &__x));
}
#if _LIBCPP_DEBUG_LEVEL >= 2
-
_LIBCPP_INLINE_VISIBILITY
__hash_const_local_iterator(const __hash_const_local_iterator& __i)
: __node_(__i.__node_),
@@ -717,37 +696,28 @@ public:
}
return *this;
}
-
#endif // _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ reference operator*() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
-#endif
- return __node_->__value_;
- }
+ return __node_->__upcast()->__value_;
+ }
+
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ pointer operator->() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
-#endif
- return pointer_traits<pointer>::pointer_to(__node_->__value_);
- }
+ return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
+ }
_LIBCPP_INLINE_VISIBILITY
- __hash_const_local_iterator& operator++()
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ __hash_const_local_iterator& operator++() {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to increment non-incrementable unordered container const_local_iterator");
-#endif
__node_ = __node_->__next_;
- if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_)
+ if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
__node_ = nullptr;
return *this;
}
@@ -772,7 +742,7 @@ public:
private:
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- __hash_const_local_iterator(__node_pointer __node, size_t __bucket,
+ __hash_const_local_iterator(__next_pointer __node, size_t __bucket,
size_t __bucket_count, const void* __c) _NOEXCEPT
: __node_(__node),
__bucket_(__bucket),
@@ -784,7 +754,7 @@ private:
}
#else
_LIBCPP_INLINE_VISIBILITY
- __hash_const_local_iterator(__node_pointer __node, size_t __bucket,
+ __hash_const_local_iterator(__next_pointer __node, size_t __bucket,
size_t __bucket_count) _NOEXCEPT
: __node_(__node),
__bucket_(__bucket),
@@ -927,6 +897,7 @@ public:
typedef typename _NodeTypes::__node_pointer __node_const_pointer;
typedef typename _NodeTypes::__node_base_type __first_node;
typedef typename _NodeTypes::__node_base_pointer __node_base_pointer;
+ typedef typename _NodeTypes::__next_pointer __next_pointer;
private:
// check for sane allocator pointer rebinding semantics. Rebinding the
@@ -942,11 +913,11 @@ private:
private:
- typedef typename __rebind_alloc_helper<__node_traits, __node_pointer>::type __pointer_allocator;
+ typedef typename __rebind_alloc_helper<__node_traits, __next_pointer>::type __pointer_allocator;
typedef __bucket_list_deallocator<__pointer_allocator> __bucket_list_deleter;
- typedef unique_ptr<__node_pointer[], __bucket_list_deleter> __bucket_list;
+ typedef unique_ptr<__next_pointer[], __bucket_list_deleter> __bucket_list;
typedef allocator_traits<__pointer_allocator> __pointer_alloc_traits;
- typedef typename __bucket_list_deleter::pointer __node_pointer_pointer;
+ typedef typename __bucket_list_deleter::pointer __node_pointer_pointer;
// --- Member data begin ---
__bucket_list __bucket_list_;
@@ -1033,8 +1004,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
{
- return allocator_traits<__pointer_allocator>::max_size(
- __bucket_list_.get_deleter().__alloc());
+ return std::min<size_type>(
+ __node_traits::max_size(__node_alloc()),
+ numeric_limits<difference_type >::max()
+ );
}
pair<iterator, bool> __node_insert_unique(__node_pointer __nd);
@@ -1129,6 +1102,7 @@ public:
#else // !defined(_LIBCPP_CXX03_LANG)
template <class _Key, class _Args>
+ _LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> __emplace_unique_key_args(_Key const&, _Args& __args);
iterator __insert_multi(const __container_value_type& __x);
@@ -1207,7 +1181,7 @@ public:
void swap(__hash_table& __u)
#if _LIBCPP_STD_VER <= 11
- _NOEXCEPT_(
+ _NOEXCEPT_DEBUG_(
__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value
&& (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value
|| __is_nothrow_swappable<__pointer_allocator>::value)
@@ -1215,12 +1189,12 @@ public:
|| __is_nothrow_swappable<__node_allocator>::value)
);
#else
- _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value);
+ _NOEXCEPT_DEBUG_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value);
#endif
_LIBCPP_INLINE_VISIBILITY
size_type max_bucket_count() const _NOEXCEPT
- {return __pointer_alloc_traits::max_size(__bucket_list_.get_deleter().__alloc());}
+ {return max_size(); }
size_type bucket_size(size_type __n) const;
_LIBCPP_INLINE_VISIBILITY float load_factor() const _NOEXCEPT
{
@@ -1347,8 +1321,8 @@ private:
void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
#endif // _LIBCPP_CXX03_LANG
- void __deallocate(__node_pointer __np) _NOEXCEPT;
- __node_pointer __detach() _NOEXCEPT;
+ void __deallocate(__next_pointer __np) _NOEXCEPT;
+ __next_pointer __detach() _NOEXCEPT;
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_map;
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
@@ -1439,8 +1413,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
{
if (size() > 0)
{
- __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
- static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash(), bucket_count())] =
+ __p1_.first().__ptr();
__u.__p1_.first().__next_ = nullptr;
__u.size() = 0;
}
@@ -1463,8 +1437,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
{
__p1_.first().__next_ = __u.__p1_.first().__next_;
__u.__p1_.first().__next_ = nullptr;
- __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
- static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash(), bucket_count())] =
+ __p1_.first().__ptr();
size() = __u.size();
__u.size() = 0;
}
@@ -1518,13 +1492,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(const __hash_table& __u)
template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__node_pointer __np)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__next_pointer __np)
_NOEXCEPT
{
__node_allocator& __na = __node_alloc();
while (__np != nullptr)
{
- __node_pointer __next = __np->__next_;
+ __next_pointer __next = __np->__next_;
#if _LIBCPP_DEBUG_LEVEL >= 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
for (__i_node** __p = __c->end_; __p != __c->beg_; )
@@ -1540,21 +1514,22 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__node_pointer __np)
}
__get_db()->unlock();
#endif
- __node_traits::destroy(__na, _NodeTypes::__get_ptr(__np->__value_));
- __node_traits::deallocate(__na, __np, 1);
+ __node_pointer __real_np = __np->__upcast();
+ __node_traits::destroy(__na, _NodeTypes::__get_ptr(__real_np->__value_));
+ __node_traits::deallocate(__na, __real_np, 1);
__np = __next;
}
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_pointer
+typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__next_pointer
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach() _NOEXCEPT
{
size_type __bc = bucket_count();
for (size_type __i = 0; __i < __bc; ++__i)
__bucket_list_[__i] = nullptr;
size() = 0;
- __node_pointer __cache = __p1_.first().__next_;
+ __next_pointer __cache = __p1_.first().__next_;
__p1_.first().__next_ = nullptr;
return __cache;
}
@@ -1582,8 +1557,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
__p1_.first().__next_ = __u.__p1_.first().__next_;
if (size() > 0)
{
- __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
- static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash(), bucket_count())] =
+ __p1_.first().__ptr();
__u.__p1_.first().__next_ = nullptr;
__u.size() = 0;
}
@@ -1606,7 +1581,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
max_load_factor() = __u.max_load_factor();
if (bucket_count() != 0)
{
- __node_pointer __cache = __detach();
+ __next_pointer __cache = __detach();
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
@@ -1614,9 +1589,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
const_iterator __i = __u.begin();
while (__cache != nullptr && __u.size() != 0)
{
- __cache->__value_ = _VSTD::move(__u.remove(__i++)->__value_);
- __node_pointer __next = __cache->__next_;
- __node_insert_multi(__cache);
+ __cache->__upcast()->__value_ =
+ _VSTD::move(__u.remove(__i++)->__value_);
+ __next_pointer __next = __cache->__next_;
+ __node_insert_multi(__cache->__upcast());
__cache = __next;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1669,16 +1645,16 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first
if (bucket_count() != 0)
{
- __node_pointer __cache = __detach();
+ __next_pointer __cache = __detach();
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
- __cache->__value_ = *__first;
- __node_pointer __next = __cache->__next_;
- __node_insert_unique(__cache);
+ __cache->__upcast()->__value_ = *__first;
+ __next_pointer __next = __cache->__next_;
+ __node_insert_unique(__cache->__upcast());
__cache = __next;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1709,16 +1685,16 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
" or the nodes value type");
if (bucket_count() != 0)
{
- __node_pointer __cache = __detach();
+ __next_pointer __cache = __detach();
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
- __cache->__value_ = *__first;
- __node_pointer __next = __cache->__next_;
- __node_insert_multi(__cache);
+ __cache->__upcast()->__value_ = *__first;
+ __next_pointer __next = __cache->__next_;
+ __node_insert_multi(__cache->__upcast());
__cache = __next;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1805,7 +1781,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
__nd->__hash_ = hash_function()(__nd->__value_);
size_type __bc = bucket_count();
bool __inserted = false;
- __node_pointer __ndptr;
+ __next_pointer __ndptr;
size_t __chash;
if (__bc != 0)
{
@@ -1814,10 +1790,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
if (__ndptr != nullptr)
{
for (__ndptr = __ndptr->__next_; __ndptr != nullptr &&
- __constrain_hash(__ndptr->__hash_, __bc) == __chash;
+ __constrain_hash(__ndptr->__hash(), __bc) == __chash;
__ndptr = __ndptr->__next_)
{
- if (key_eq()(__ndptr->__value_, __nd->__value_))
+ if (key_eq()(__ndptr->__upcast()->__value_, __nd->__value_))
goto __done;
}
}
@@ -1831,23 +1807,23 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
__chash = __constrain_hash(__nd->__hash_, __bc);
}
// insert_after __bucket_list_[__chash], or __first_node if bucket is null
- __node_pointer __pn = __bucket_list_[__chash];
+ __next_pointer __pn = __bucket_list_[__chash];
if (__pn == nullptr)
{
- __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __pn =__p1_.first().__ptr();
__nd->__next_ = __pn->__next_;
- __pn->__next_ = __nd;
+ __pn->__next_ = __nd->__ptr();
// fix up __bucket_list_
__bucket_list_[__chash] = __pn;
if (__nd->__next_ != nullptr)
- __bucket_list_[__constrain_hash(__nd->__next_->__hash_, __bc)] = __nd;
+ __bucket_list_[__constrain_hash(__nd->__next_->__hash(), __bc)] = __nd->__ptr();
}
else
{
__nd->__next_ = __pn->__next_;
- __pn->__next_ = __nd;
+ __pn->__next_ = __nd->__ptr();
}
- __ndptr = __nd;
+ __ndptr = __nd->__ptr();
// increment size
++size();
__inserted = true;
@@ -1873,21 +1849,22 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
__bc = bucket_count();
}
size_t __chash = __constrain_hash(__cp->__hash_, __bc);
- __node_pointer __pn = __bucket_list_[__chash];
+ __next_pointer __pn = __bucket_list_[__chash];
if (__pn == nullptr)
{
- __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __pn =__p1_.first().__ptr();
__cp->__next_ = __pn->__next_;
- __pn->__next_ = __cp;
+ __pn->__next_ = __cp->__ptr();
// fix up __bucket_list_
__bucket_list_[__chash] = __pn;
if (__cp->__next_ != nullptr)
- __bucket_list_[__constrain_hash(__cp->__next_->__hash_, __bc)] = __cp;
+ __bucket_list_[__constrain_hash(__cp->__next_->__hash(), __bc)]
+ = __cp->__ptr();
}
else
{
for (bool __found = false; __pn->__next_ != nullptr &&
- __constrain_hash(__pn->__next_->__hash_, __bc) == __chash;
+ __constrain_hash(__pn->__next_->__hash(), __bc) == __chash;
__pn = __pn->__next_)
{
// __found key_eq() action
@@ -1895,8 +1872,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
// true true loop
// false true set __found to true
// true false break
- if (__found != (__pn->__next_->__hash_ == __cp->__hash_ &&
- key_eq()(__pn->__next_->__value_, __cp->__value_)))
+ if (__found != (__pn->__next_->__hash() == __cp->__hash_ &&
+ key_eq()(__pn->__next_->__upcast()->__value_, __cp->__value_)))
{
if (!__found)
__found = true;
@@ -1905,19 +1882,19 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
}
}
__cp->__next_ = __pn->__next_;
- __pn->__next_ = __cp;
+ __pn->__next_ = __cp->__ptr();
if (__cp->__next_ != nullptr)
{
- size_t __nhash = __constrain_hash(__cp->__next_->__hash_, __bc);
+ size_t __nhash = __constrain_hash(__cp->__next_->__hash(), __bc);
if (__nhash != __chash)
- __bucket_list_[__nhash] = __cp;
+ __bucket_list_[__nhash] = __cp->__ptr();
}
}
++size();
#if _LIBCPP_DEBUG_LEVEL >= 2
- return iterator(__cp, this);
+ return iterator(__cp->__ptr(), this);
#else
- return iterator(__cp);
+ return iterator(__cp->__ptr());
#endif
}
@@ -1933,8 +1910,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
#endif
if (__p != end() && key_eq()(*__p, __cp->__value_))
{
- __node_pointer __np = __p.__node_;
- __cp->__hash_ = __np->__hash_;
+ __next_pointer __np = __p.__node_;
+ __cp->__hash_ = __np->__hash();
size_type __bc = bucket_count();
if (size()+1 > __bc * max_load_factor() || __bc == 0)
{
@@ -1943,16 +1920,16 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
__bc = bucket_count();
}
size_t __chash = __constrain_hash(__cp->__hash_, __bc);
- __node_pointer __pp = __bucket_list_[__chash];
+ __next_pointer __pp = __bucket_list_[__chash];
while (__pp->__next_ != __np)
__pp = __pp->__next_;
__cp->__next_ = __np;
- __pp->__next_ = __cp;
+ __pp->__next_ = static_cast<__next_pointer>(__cp);
++size();
#if _LIBCPP_DEBUG_LEVEL >= 2
- return iterator(__cp, this);
+ return iterator(static_cast<__next_pointer>(__cp), this);
#else
- return iterator(__cp);
+ return iterator(static_cast<__next_pointer>(__cp));
#endif
}
return __node_insert_multi(__cp);
@@ -1963,13 +1940,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _Key, class ..._Args>
-_LIBCPP_INLINE_VISIBILITY
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args)
#else
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _Key, class _Args>
-_LIBCPP_INLINE_VISIBILITY
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args& __args)
#endif
@@ -1978,7 +1953,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&
size_t __hash = hash_function()(__k);
size_type __bc = bucket_count();
bool __inserted = false;
- __node_pointer __nd;
+ __next_pointer __nd;
size_t __chash;
if (__bc != 0)
{
@@ -1987,10 +1962,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&
if (__nd != nullptr)
{
for (__nd = __nd->__next_; __nd != nullptr &&
- __constrain_hash(__nd->__hash_, __bc) == __chash;
+ (__nd->__hash() == __hash || __constrain_hash(__nd->__hash(), __bc) == __chash);
__nd = __nd->__next_)
{
- if (key_eq()(__nd->__value_, __k))
+ if (key_eq()(__nd->__upcast()->__value_, __k))
goto __done;
}
}
@@ -2009,23 +1984,24 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&
__chash = __constrain_hash(__hash, __bc);
}
// insert_after __bucket_list_[__chash], or __first_node if bucket is null
- __node_pointer __pn = __bucket_list_[__chash];
+ __next_pointer __pn = __bucket_list_[__chash];
if (__pn == nullptr)
{
- __pn = static_cast<__node_pointer>(static_cast<__void_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())));
+ __pn = __p1_.first().__ptr();
__h->__next_ = __pn->__next_;
- __pn->__next_ = __h.get();
+ __pn->__next_ = __h.get()->__ptr();
// fix up __bucket_list_
__bucket_list_[__chash] = __pn;
if (__h->__next_ != nullptr)
- __bucket_list_[__constrain_hash(__h->__next_->__hash_, __bc)] = __h.get();
+ __bucket_list_[__constrain_hash(__h->__next_->__hash(), __bc)]
+ = __h.get()->__ptr();
}
else
{
__h->__next_ = __pn->__next_;
- __pn->__next_ = __h.get();
+ __pn->__next_ = static_cast<__next_pointer>(__h.get());
}
- __nd = __h.release();
+ __nd = static_cast<__next_pointer>(__h.release());
// increment size
++size();
__inserted = true;
@@ -2149,17 +2125,17 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)
{
for (size_type __i = 0; __i < __nbc; ++__i)
__bucket_list_[__i] = nullptr;
- __node_pointer __pp(static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())));
- __node_pointer __cp = __pp->__next_;
+ __next_pointer __pp = __p1_.first().__ptr();
+ __next_pointer __cp = __pp->__next_;
if (__cp != nullptr)
{
- size_type __chash = __constrain_hash(__cp->__hash_, __nbc);
+ size_type __chash = __constrain_hash(__cp->__hash(), __nbc);
__bucket_list_[__chash] = __pp;
size_type __phash = __chash;
for (__pp = __cp, __cp = __cp->__next_; __cp != nullptr;
__cp = __pp->__next_)
{
- __chash = __constrain_hash(__cp->__hash_, __nbc);
+ __chash = __constrain_hash(__cp->__hash(), __nbc);
if (__chash == __phash)
__pp = __cp;
else
@@ -2172,9 +2148,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)
}
else
{
- __node_pointer __np = __cp;
+ __next_pointer __np = __cp;
for (; __np->__next_ != nullptr &&
- key_eq()(__cp->__value_, __np->__next_->__value_);
+ key_eq()(__cp->__upcast()->__value_,
+ __np->__next_->__upcast()->__value_);
__np = __np->__next_)
;
__pp->__next_ = __np->__next_;
@@ -2198,15 +2175,16 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k)
if (__bc != 0)
{
size_t __chash = __constrain_hash(__hash, __bc);
- __node_pointer __nd = __bucket_list_[__chash];
+ __next_pointer __nd = __bucket_list_[__chash];
if (__nd != nullptr)
{
for (__nd = __nd->__next_; __nd != nullptr &&
- (__nd->__hash_ == __hash
- || __constrain_hash(__nd->__hash_, __bc) == __chash);
+ (__nd->__hash() == __hash
+ || __constrain_hash(__nd->__hash(), __bc) == __chash);
__nd = __nd->__next_)
{
- if ((__nd->__hash_ == __hash) && key_eq()(__nd->__value_, __k))
+ if ((__nd->__hash() == __hash)
+ && key_eq()(__nd->__upcast()->__value_, __k))
#if _LIBCPP_DEBUG_LEVEL >= 2
return iterator(__nd, this);
#else
@@ -2228,14 +2206,16 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const
if (__bc != 0)
{
size_t __chash = __constrain_hash(__hash, __bc);
- __node_const_pointer __nd = __bucket_list_[__chash];
+ __next_pointer __nd = __bucket_list_[__chash];
if (__nd != nullptr)
{
for (__nd = __nd->__next_; __nd != nullptr &&
- (__hash == __nd->__hash_ || __constrain_hash(__nd->__hash_, __bc) == __chash);
+ (__hash == __nd->__hash()
+ || __constrain_hash(__nd->__hash(), __bc) == __chash);
__nd = __nd->__next_)
{
- if ((__nd->__hash_ == __hash) && key_eq()(__nd->__value_, __k))
+ if ((__nd->__hash() == __hash)
+ && key_eq()(__nd->__upcast()->__value_, __k))
#if _LIBCPP_DEBUG_LEVEL >= 2
return const_iterator(__nd, this);
#else
@@ -2320,7 +2300,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
{
- __node_pointer __np = __p.__node_;
+ __next_pointer __np = __p.__node_;
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered container erase(iterator) called with an iterator not"
@@ -2354,7 +2334,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,
++__first;
erase(__p);
}
- __node_pointer __np = __last.__node_;
+ __next_pointer __np = __last.__node_;
#if _LIBCPP_DEBUG_LEVEL >= 2
return iterator (__np, this);
#else
@@ -2398,26 +2378,27 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
__hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
{
// current node
- __node_pointer __cn = __p.__node_;
+ __next_pointer __cn = __p.__node_;
size_type __bc = bucket_count();
- size_t __chash = __constrain_hash(__cn->__hash_, __bc);
+ size_t __chash = __constrain_hash(__cn->__hash(), __bc);
// find previous node
- __node_pointer __pn = __bucket_list_[__chash];
+ __next_pointer __pn = __bucket_list_[__chash];
for (; __pn->__next_ != __cn; __pn = __pn->__next_)
;
// Fix up __bucket_list_
// if __pn is not in same bucket (before begin is not in same bucket) &&
// if __cn->__next_ is not in same bucket (nullptr is not in same bucket)
- if (__pn == static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()))
- || __constrain_hash(__pn->__hash_, __bc) != __chash)
+ if (__pn == __p1_.first().__ptr()
+ || __constrain_hash(__pn->__hash(), __bc) != __chash)
{
- if (__cn->__next_ == nullptr || __constrain_hash(__cn->__next_->__hash_, __bc) != __chash)
+ if (__cn->__next_ == nullptr
+ || __constrain_hash(__cn->__next_->__hash(), __bc) != __chash)
__bucket_list_[__chash] = nullptr;
}
// if __cn->__next_ is not in same bucket (nullptr is in same bucket)
if (__cn->__next_ != nullptr)
{
- size_t __nhash = __constrain_hash(__cn->__next_->__hash_, __bc);
+ size_t __nhash = __constrain_hash(__cn->__next_->__hash(), __bc);
if (__nhash != __chash)
__bucket_list_[__nhash] = __pn;
}
@@ -2427,20 +2408,20 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
--size();
#if _LIBCPP_DEBUG_LEVEL >= 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
+ for (__i_node** __dp = __c->end_; __dp != __c->beg_; )
{
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
+ --__dp;
+ iterator* __i = static_cast<iterator*>((*__dp)->__i_);
if (__i->__node_ == __cn)
{
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ (*__dp)->__c_ = nullptr;
+ if (--__c->end_ != __dp)
+ memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*));
}
}
__get_db()->unlock();
#endif
- return __node_holder(__cn, _Dp(__node_alloc(), true));
+ return __node_holder(__cn->__upcast(), _Dp(__node_alloc(), true));
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -2543,7 +2524,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
#if _LIBCPP_STD_VER <= 11
- _NOEXCEPT_(
+ _NOEXCEPT_DEBUG_(
__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value
&& (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value
|| __is_nothrow_swappable<__pointer_allocator>::value)
@@ -2551,9 +2532,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
|| __is_nothrow_swappable<__node_allocator>::value)
)
#else
- _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value)
+ _NOEXCEPT_DEBUG_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value)
#endif
{
+ _LIBCPP_ASSERT(__node_traits::propagate_on_container_swap::value ||
+ this->__node_alloc() == __u.__node_alloc(),
+ "list::swap: Either propagate_on_container_swap must be true"
+ " or the allocators must compare equal");
{
__node_pointer_pointer __npp = __bucket_list_.release();
__bucket_list_.reset(__u.__bucket_list_.release());
@@ -2567,11 +2552,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
__p2_.swap(__u.__p2_);
__p3_.swap(__u.__p3_);
if (size() > 0)
- __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
- static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash(), bucket_count())] =
+ __p1_.first().__ptr();
if (__u.size() > 0)
- __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash_, __u.bucket_count())] =
- static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__u.__p1_.first()));
+ __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash(), __u.bucket_count())] =
+ __u.__p1_.first().__ptr();
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->swap(this, &__u);
#endif
@@ -2583,13 +2568,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::bucket_size(size_type __n) const
{
_LIBCPP_ASSERT(__n < bucket_count(),
"unordered container::bucket_size(n) called with n >= bucket_count()");
- __node_const_pointer __np = __bucket_list_[__n];
+ __next_pointer __np = __bucket_list_[__n];
size_type __bc = bucket_count();
size_type __r = 0;
if (__np != nullptr)
{
for (__np = __np->__next_; __np != nullptr &&
- __constrain_hash(__np->__hash_, __bc) == __n;
+ __constrain_hash(__np->__hash(), __bc) == __n;
__np = __np->__next_, ++__r)
;
}
diff --git a/include/__libcpp_version b/include/__libcpp_version
new file mode 100644
index 000000000000..a2113715a3e8
--- /dev/null
+++ b/include/__libcpp_version
@@ -0,0 +1 @@
+4000 \ No newline at end of file
diff --git a/include/__locale b/include/__locale
index 7bc701dda6e3..535ee165f652 100644
--- a/include/__locale
+++ b/include/__locale
@@ -165,10 +165,9 @@ template <class _Facet>
locale
locale::combine(const locale& __other) const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!_VSTD::has_facet<_Facet>(__other))
- throw runtime_error("locale::combine: locale missing facet");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_runtime_error("locale::combine: locale missing facet");
+
return locale(*this, &const_cast<_Facet&>(_VSTD::use_facet<_Facet>(__other)));
}
@@ -270,8 +269,8 @@ collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
return static_cast<long>(__h);
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS collate<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS collate<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>)
// template <class CharT> class collate_byname;
@@ -1179,12 +1178,12 @@ codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname()
{
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<char, char, mbstate_t>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>)
-_LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
template <size_t _Np>
struct __narrow_to_utf8
diff --git a/include/__mutex_base b/include/__mutex_base
index 38a76ac6f2ec..59458ecdf7b8 100644
--- a/include/__mutex_base
+++ b/include/__mutex_base
@@ -43,7 +43,7 @@ class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mut
public:
_LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
- constexpr mutex() _NOEXCEPT _LIBCPP_DEFAULT
+ constexpr mutex() _NOEXCEPT = default;
#else
mutex() _NOEXCEPT {__m_ = (__libcpp_mutex_t)_LIBCPP_MUTEX_INITIALIZER;}
#endif
@@ -300,7 +300,7 @@ class _LIBCPP_TYPE_VIS condition_variable
public:
_LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
- constexpr condition_variable() _NOEXCEPT _LIBCPP_DEFAULT
+ constexpr condition_variable() _NOEXCEPT = default;
#else
condition_variable() _NOEXCEPT {__cv_ = (__libcpp_condvar_t)_LIBCPP_CONDVAR_INITIALIZER;}
#endif
diff --git a/include/__nullptr b/include/__nullptr
index 95415a6325a3..38ee379eff9d 100644
--- a/include/__nullptr
+++ b/include/__nullptr
@@ -42,10 +42,6 @@ struct _LIBCPP_TYPE_VIS_ONLY nullptr_t
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_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<(nullptr_t, nullptr_t) {return false;}
- 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_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>=(nullptr_t, nullptr_t) {return true;}
};
inline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);}
diff --git a/include/__refstring b/include/__refstring
index 61ccc75122a5..7f417a03c491 100644
--- a/include/__refstring
+++ b/include/__refstring
@@ -11,6 +11,7 @@
#define _LIBCPP___REFSTRING
#include <__config>
+#include <stdexcept>
#include <cstddef>
#include <cstring>
#ifdef __APPLE__
@@ -20,119 +21,106 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_HIDDEN __libcpp_refstring
-{
-private:
- const char* str_;
+namespace __refstring_imp { namespace {
+typedef int count_t;
- typedef int count_t;
+struct _Rep_base {
+ std::size_t len;
+ std::size_t cap;
+ count_t count;
+};
- struct _Rep_base
- {
- std::size_t len;
- std::size_t cap;
- count_t count;
- };
-
- static
- _Rep_base*
- rep_from_data(const char *data_) _NOEXCEPT
- {
- char *data = const_cast<char *>(data_);
- return reinterpret_cast<_Rep_base *>(data - sizeof(_Rep_base));
- }
- static
- char *
- data_from_rep(_Rep_base *rep) _NOEXCEPT
- {
- char *data = reinterpret_cast<char *>(rep);
- return data + sizeof(*rep);
- }
+inline _Rep_base* rep_from_data(const char *data_) noexcept {
+ char *data = const_cast<char *>(data_);
+ return reinterpret_cast<_Rep_base *>(data - sizeof(_Rep_base));
+}
-#ifdef __APPLE__
- static
- const char*
- compute_gcc_empty_string_storage() _NOEXCEPT
- {
- void* handle = dlopen("/usr/lib/libstdc++.6.dylib", RTLD_NOLOAD);
- if (handle == nullptr)
- return nullptr;
- void* sym = dlsym(handle, "_ZNSs4_Rep20_S_empty_rep_storageE");
- if (sym == nullptr)
- return nullptr;
- return data_from_rep(reinterpret_cast<_Rep_base *>(sym));
- }
-
- static
- const char*
- get_gcc_empty_string_storage() _NOEXCEPT
- {
- static const char* p = compute_gcc_empty_string_storage();
- return p;
- }
+inline char * data_from_rep(_Rep_base *rep) noexcept {
+ char *data = reinterpret_cast<char *>(rep);
+ return data + sizeof(*rep);
+}
- bool
- uses_refcount() const
- {
- return str_ != get_gcc_empty_string_storage();
- }
-#else
- bool
- uses_refcount() const
- {
- return true;
- }
+#if defined(__APPLE__)
+inline
+const char* compute_gcc_empty_string_storage() _NOEXCEPT
+{
+ void* handle = dlopen("/usr/lib/libstdc++.6.dylib", RTLD_NOLOAD);
+ if (handle == nullptr)
+ return nullptr;
+ void* sym = dlsym(handle, "_ZNSs4_Rep20_S_empty_rep_storageE");
+ if (sym == nullptr)
+ return nullptr;
+ return data_from_rep(reinterpret_cast<_Rep_base *>(sym));
+}
+
+inline
+const char*
+get_gcc_empty_string_storage() _NOEXCEPT
+{
+ static const char* p = compute_gcc_empty_string_storage();
+ return p;
+}
#endif
-public:
- explicit __libcpp_refstring(const char* msg) {
- std::size_t len = strlen(msg);
- _Rep_base* rep = static_cast<_Rep_base *>(::operator new(sizeof(*rep) + len + 1));
- rep->len = len;
- rep->cap = len;
- rep->count = 0;
- char *data = data_from_rep(rep);
- std::memcpy(data, msg, len + 1);
- str_ = data;
- }
-
- __libcpp_refstring(const __libcpp_refstring& s) _NOEXCEPT : str_(s.str_)
- {
- if (uses_refcount())
- __sync_add_and_fetch(&rep_from_data(str_)->count, 1);
- }
-
- __libcpp_refstring& operator=(const __libcpp_refstring& s) _NOEXCEPT
+}} // namespace __refstring_imp
+
+using namespace __refstring_imp;
+
+inline
+__libcpp_refstring::__libcpp_refstring(const char* msg) {
+ std::size_t len = strlen(msg);
+ _Rep_base* rep = static_cast<_Rep_base *>(::operator new(sizeof(*rep) + len + 1));
+ rep->len = len;
+ rep->cap = len;
+ rep->count = 0;
+ char *data = data_from_rep(rep);
+ std::memcpy(data, msg, len + 1);
+ __imp_ = data;
+}
+
+inline
+__libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) _NOEXCEPT
+ : __imp_(s.__imp_)
+{
+ if (__uses_refcount())
+ __sync_add_and_fetch(&rep_from_data(__imp_)->count, 1);
+}
+
+inline
+__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) _NOEXCEPT {
+ bool adjust_old_count = __uses_refcount();
+ struct _Rep_base *old_rep = rep_from_data(__imp_);
+ __imp_ = s.__imp_;
+ if (__uses_refcount())
+ __sync_add_and_fetch(&rep_from_data(__imp_)->count, 1);
+ if (adjust_old_count)
{
- bool adjust_old_count = uses_refcount();
- struct _Rep_base *old_rep = rep_from_data(str_);
- str_ = s.str_;
- if (uses_refcount())
- __sync_add_and_fetch(&rep_from_data(str_)->count, 1);
- if (adjust_old_count)
+ if (__sync_add_and_fetch(&old_rep->count, count_t(-1)) < 0)
{
- if (__sync_add_and_fetch(&old_rep->count, count_t(-1)) < 0)
- {
- ::operator delete(old_rep);
- }
+ ::operator delete(old_rep);
}
- return *this;
}
-
- ~__libcpp_refstring()
- {
- if (uses_refcount())
- {
- _Rep_base* rep = rep_from_data(str_);
- if (__sync_add_and_fetch(&rep->count, count_t(-1)) < 0)
- {
- ::operator delete(rep);
- }
+ return *this;
+}
+
+inline
+__libcpp_refstring::~__libcpp_refstring() {
+ if (__uses_refcount()) {
+ _Rep_base* rep = rep_from_data(__imp_);
+ if (__sync_add_and_fetch(&rep->count, count_t(-1)) < 0) {
+ ::operator delete(rep);
}
}
+}
- const char* c_str() const _NOEXCEPT {return str_;}
-};
+inline
+bool __libcpp_refstring::__uses_refcount() const {
+#ifdef __APPLE__
+ return __imp_ != get_gcc_empty_string_storage();
+#else
+ return true;
+#endif
+}
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/__std_stream b/include/__std_stream
index f867cd23bdd5..fb5a346f10d8 100644
--- a/include/__std_stream
+++ b/include/__std_stream
@@ -297,7 +297,7 @@ __stdoutbuf<_CharT>::overflow(int_type __c)
return traits_type::eof();
if (__r == codecvt_base::partial)
{
- pbase = (char_type*)__e;
+ pbase = const_cast<char_type*>(__e);
}
}
else
diff --git a/include/__string b/include/__string
new file mode 100644
index 000000000000..b612d6ba627d
--- /dev/null
+++ b/include/__string
@@ -0,0 +1,766 @@
+// -*- C++ -*-
+//===-------------------------- __string ----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___STRING
+#define _LIBCPP___STRING
+
+/*
+ string synopsis
+
+namespace std
+{
+
+template <class charT>
+struct char_traits
+{
+ typedef charT char_type;
+ typedef ... int_type;
+ typedef streamoff off_type;
+ typedef streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static void assign(char_type& c1, const char_type& c2) noexcept;
+ static constexpr bool eq(char_type c1, char_type c2) noexcept;
+ static constexpr bool lt(char_type c1, char_type c2) noexcept;
+
+ static int compare(const char_type* s1, const char_type* s2, size_t n);
+ static size_t length(const char_type* s);
+ static const char_type* find(const char_type* s, size_t n, const char_type& a);
+ static char_type* move(char_type* s1, const char_type* s2, size_t n);
+ static char_type* copy(char_type* s1, const char_type* s2, size_t n);
+ static char_type* assign(char_type* s, size_t n, char_type a);
+
+ static constexpr int_type not_eof(int_type c) noexcept;
+ static constexpr char_type to_char_type(int_type c) noexcept;
+ static constexpr int_type to_int_type(char_type c) noexcept;
+ static constexpr bool eq_int_type(int_type c1, int_type c2) noexcept;
+ static constexpr int_type eof() noexcept;
+};
+
+template <> struct char_traits<char>;
+template <> struct char_traits<wchar_t>;
+
+} // std
+
+*/
+
+#include <__config>
+#include <algorithm> // for search and min
+#include <cstdio> // For EOF.
+#include <memory> // for __murmur2_or_cityhash
+
+#include <__undef_min_max>
+
+#include <__debug>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// char_traits
+
+template <class _CharT>
+struct _LIBCPP_TYPE_VIS_ONLY char_traits
+{
+ typedef _CharT char_type;
+ typedef int int_type;
+ typedef streamoff off_type;
+ typedef streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
+ {__c1 = __c2;}
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 < __c2;}
+
+ static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
+ _LIBCPP_INLINE_VISIBILITY
+ static size_t length(const char_type* __s);
+ _LIBCPP_INLINE_VISIBILITY
+ static const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
+ static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* assign(char_type* __s, size_t __n, char_type __a);
+
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ {return eq_int_type(__c, eof()) ? ~eof() : __c;}
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ {return char_type(__c);}
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ {return int_type(__c);}
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ {return int_type(EOF);}
+};
+
+template <class _CharT>
+int
+char_traits<_CharT>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
+{
+ for (; __n; --__n, ++__s1, ++__s2)
+ {
+ if (lt(*__s1, *__s2))
+ return -1;
+ if (lt(*__s2, *__s1))
+ return 1;
+ }
+ return 0;
+}
+
+template <class _CharT>
+inline
+size_t
+char_traits<_CharT>::length(const char_type* __s)
+{
+ size_t __len = 0;
+ for (; !eq(*__s, char_type(0)); ++__s)
+ ++__len;
+ return __len;
+}
+
+template <class _CharT>
+inline
+const _CharT*
+char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a)
+{
+ for (; __n; --__n)
+ {
+ if (eq(*__s, __a))
+ return __s;
+ ++__s;
+ }
+ return 0;
+}
+
+template <class _CharT>
+_CharT*
+char_traits<_CharT>::move(char_type* __s1, const char_type* __s2, size_t __n)
+{
+ char_type* __r = __s1;
+ if (__s1 < __s2)
+ {
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ }
+ else if (__s2 < __s1)
+ {
+ __s1 += __n;
+ __s2 += __n;
+ for (; __n; --__n)
+ assign(*--__s1, *--__s2);
+ }
+ return __r;
+}
+
+template <class _CharT>
+inline
+_CharT*
+char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n)
+{
+ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ char_type* __r = __s1;
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ return __r;
+}
+
+template <class _CharT>
+inline
+_CharT*
+char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
+{
+ char_type* __r = __s;
+ for (; __n; --__n, ++__s)
+ assign(*__s, __a);
+ return __r;
+}
+
+// char_traits<char>
+
+template <>
+struct _LIBCPP_TYPE_VIS_ONLY char_traits<char>
+{
+ typedef char char_type;
+ typedef int int_type;
+ typedef streamoff off_type;
+ typedef streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
+ {__c1 = __c2;}
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ {return (unsigned char)__c1 < (unsigned char)__c2;}
+
+ static inline int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+ {return __n == 0 ? 0 : memcmp(__s1, __s2, __n);}
+ static inline size_t length(const char_type* __s) _NOEXCEPT {return strlen(__s);}
+ static inline const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
+ {return __n == 0 ? NULL : (const char_type*) memchr(__s, to_int_type(__a), __n);}
+ static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+ {return __n == 0 ? __s1 : (char_type*) memmove(__s1, __s2, __n);}
+ static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ return __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);
+ }
+ static inline char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
+ {return __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);}
+
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ {return eq_int_type(__c, eof()) ? ~eof() : __c;}
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ {return char_type(__c);}
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ {return int_type((unsigned char)__c);}
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ {return int_type(EOF);}
+};
+
+// char_traits<wchar_t>
+
+template <>
+struct _LIBCPP_TYPE_VIS_ONLY char_traits<wchar_t>
+{
+ typedef wchar_t char_type;
+ typedef wint_t int_type;
+ typedef streamoff off_type;
+ typedef streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
+ {__c1 = __c2;}
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 < __c2;}
+
+ static inline int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+ {return __n == 0 ? 0 : wmemcmp(__s1, __s2, __n);}
+ static inline size_t length(const char_type* __s) _NOEXCEPT
+ {return wcslen(__s);}
+ static inline const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
+ {return __n == 0 ? NULL : (const char_type*)wmemchr(__s, __a, __n);}
+ static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+ {return __n == 0 ? __s1 : (char_type*)wmemmove(__s1, __s2, __n);}
+ static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ return __n == 0 ? __s1 : (char_type*)wmemcpy(__s1, __s2, __n);
+ }
+ static inline char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
+ {return __n == 0 ? __s : (char_type*)wmemset(__s, __a, __n);}
+
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ {return eq_int_type(__c, eof()) ? ~eof() : __c;}
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ {return char_type(__c);}
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ {return int_type(__c);}
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ {return int_type(WEOF);}
+};
+
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+
+template <>
+struct _LIBCPP_TYPE_VIS_ONLY char_traits<char16_t>
+{
+ typedef char16_t char_type;
+ typedef uint_least16_t int_type;
+ typedef streamoff off_type;
+ typedef u16streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
+ {__c1 = __c2;}
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 < __c2;}
+
+ _LIBCPP_INLINE_VISIBILITY
+ static int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static size_t length(const char_type* __s) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT;
+
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ {return eq_int_type(__c, eof()) ? ~eof() : __c;}
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ {return char_type(__c);}
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ {return int_type(__c);}
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ {return int_type(0xFFFF);}
+};
+
+inline
+int
+char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ for (; __n; --__n, ++__s1, ++__s2)
+ {
+ if (lt(*__s1, *__s2))
+ return -1;
+ if (lt(*__s2, *__s1))
+ return 1;
+ }
+ return 0;
+}
+
+inline
+size_t
+char_traits<char16_t>::length(const char_type* __s) _NOEXCEPT
+{
+ size_t __len = 0;
+ for (; !eq(*__s, char_type(0)); ++__s)
+ ++__len;
+ return __len;
+}
+
+inline
+const char16_t*
+char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
+{
+ for (; __n; --__n)
+ {
+ if (eq(*__s, __a))
+ return __s;
+ ++__s;
+ }
+ return 0;
+}
+
+inline
+char16_t*
+char_traits<char16_t>::move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ char_type* __r = __s1;
+ if (__s1 < __s2)
+ {
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ }
+ else if (__s2 < __s1)
+ {
+ __s1 += __n;
+ __s2 += __n;
+ for (; __n; --__n)
+ assign(*--__s1, *--__s2);
+ }
+ return __r;
+}
+
+inline
+char16_t*
+char_traits<char16_t>::copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ char_type* __r = __s1;
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ return __r;
+}
+
+inline
+char16_t*
+char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
+{
+ char_type* __r = __s;
+ for (; __n; --__n, ++__s)
+ assign(*__s, __a);
+ return __r;
+}
+
+template <>
+struct _LIBCPP_TYPE_VIS_ONLY char_traits<char32_t>
+{
+ typedef char32_t char_type;
+ typedef uint_least32_t int_type;
+ typedef streamoff off_type;
+ typedef u32streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
+ {__c1 = __c2;}
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 < __c2;}
+
+ _LIBCPP_INLINE_VISIBILITY
+ static int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static size_t length(const char_type* __s) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT;
+
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ {return eq_int_type(__c, eof()) ? ~eof() : __c;}
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ {return char_type(__c);}
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ {return int_type(__c);}
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ {return int_type(0xFFFFFFFF);}
+};
+
+inline
+int
+char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ for (; __n; --__n, ++__s1, ++__s2)
+ {
+ if (lt(*__s1, *__s2))
+ return -1;
+ if (lt(*__s2, *__s1))
+ return 1;
+ }
+ return 0;
+}
+
+inline
+size_t
+char_traits<char32_t>::length(const char_type* __s) _NOEXCEPT
+{
+ size_t __len = 0;
+ for (; !eq(*__s, char_type(0)); ++__s)
+ ++__len;
+ return __len;
+}
+
+inline
+const char32_t*
+char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
+{
+ for (; __n; --__n)
+ {
+ if (eq(*__s, __a))
+ return __s;
+ ++__s;
+ }
+ return 0;
+}
+
+inline
+char32_t*
+char_traits<char32_t>::move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ char_type* __r = __s1;
+ if (__s1 < __s2)
+ {
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ }
+ else if (__s2 < __s1)
+ {
+ __s1 += __n;
+ __s2 += __n;
+ for (; __n; --__n)
+ assign(*--__s1, *--__s2);
+ }
+ return __r;
+}
+
+inline
+char32_t*
+char_traits<char32_t>::copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ char_type* __r = __s1;
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ return __r;
+}
+
+inline
+char32_t*
+char_traits<char32_t>::assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
+{
+ char_type* __r = __s;
+ for (; __n; --__n, ++__s)
+ assign(*__s, __a);
+ return __r;
+}
+
+#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+
+// helper fns for basic_string and string_view
+
+// __str_find
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find(const _CharT *__p, _SizeT __sz,
+ _CharT __c, _SizeT __pos) _NOEXCEPT
+{
+ if (__pos >= __sz)
+ return __npos;
+ const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);
+ if (__r == 0)
+ return __npos;
+ return static_cast<_SizeT>(__r - __p);
+}
+
+template <class _CharT, class _Traits>
+inline _LIBCPP_CONSTEXPR_AFTER_CXX11 const _CharT *
+__search_substring(const _CharT *__first1, const _CharT *__last1,
+ const _CharT *__first2, const _CharT *__last2) {
+ // Take advantage of knowing source and pattern lengths.
+ // Stop short when source is smaller than pattern.
+ const ptrdiff_t __len2 = __last2 - __first2;
+ if (__len2 == 0)
+ return __first1;
+
+ ptrdiff_t __len1 = __last1 - __first1;
+ if (__len1 < __len2)
+ return __last1;
+
+ // First element of __first2 is loop invariant.
+ _CharT __f2 = *__first2;
+ while (true) {
+ __len1 = __last1 - __first1;
+ // Check whether __first1 still has at least __len2 bytes.
+ if (__len1 < __len2)
+ return __last1;
+
+ // Find __f2 the first byte matching in __first1.
+ __first1 = _Traits::find(__first1, __len1 - __len2 + 1, __f2);
+ if (__first1 == 0)
+ return __last1;
+
+ // It is faster to compare from the first byte of __first1 even if we
+ // already know that it matches the first byte of __first2: this is because
+ // __first2 is most likely aligned, as it is user's "pattern" string, and
+ // __first1 + 1 is most likely not aligned, as the match is in the middle of
+ // the string.
+ if (_Traits::compare(__first1, __first2, __len2) == 0)
+ return __first1;
+
+ ++__first1;
+ }
+}
+
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+{
+ if (__pos > __sz)
+ return __npos;
+
+ if (__n == 0) // There is nothing to search, just return __pos.
+ return __pos;
+
+ const _CharT *__r = __search_substring<_CharT, _Traits>(
+ __p + __pos, __p + __sz, __s, __s + __n);
+
+ if (__r == __p + __sz)
+ return __npos;
+ return static_cast<_SizeT>(__r - __p);
+}
+
+
+// __str_rfind
+
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_rfind(const _CharT *__p, _SizeT __sz,
+ _CharT __c, _SizeT __pos) _NOEXCEPT
+{
+ if (__sz < 1)
+ return __npos;
+ if (__pos < __sz)
+ ++__pos;
+ else
+ __pos = __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __p;)
+ {
+ if (_Traits::eq(*--__ps, __c))
+ return static_cast<_SizeT>(__ps - __p);
+ }
+ return __npos;
+}
+
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_rfind(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+{
+ __pos = _VSTD::min(__pos, __sz);
+ if (__n < __sz - __pos)
+ __pos += __n;
+ else
+ __pos = __sz;
+ const _CharT* __r = _VSTD::__find_end(
+ __p, __p + __pos, __s, __s + __n, _Traits::eq,
+ random_access_iterator_tag(), random_access_iterator_tag());
+ if (__n > 0 && __r == __p + __pos)
+ return __npos;
+ return static_cast<_SizeT>(__r - __p);
+}
+
+// __str_find_first_of
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_first_of(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+{
+ if (__pos >= __sz || __n == 0)
+ return __npos;
+ const _CharT* __r = _VSTD::__find_first_of_ce
+ (__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq );
+ if (__r == __p + __sz)
+ return __npos;
+ return static_cast<_SizeT>(__r - __p);
+}
+
+
+// __str_find_last_of
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_last_of(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+ {
+ if (__n != 0)
+ {
+ if (__pos < __sz)
+ ++__pos;
+ else
+ __pos = __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __p;)
+ {
+ const _CharT* __r = _Traits::find(__s, __n, *--__ps);
+ if (__r)
+ return static_cast<_SizeT>(__ps - __p);
+ }
+ }
+ return __npos;
+}
+
+
+// __str_find_first_not_of
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+{
+ if (__pos < __sz)
+ {
+ const _CharT* __pe = __p + __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
+ if (_Traits::find(__s, __n, *__ps) == 0)
+ return static_cast<_SizeT>(__ps - __p);
+ }
+ return __npos;
+}
+
+
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
+ _CharT __c, _SizeT __pos) _NOEXCEPT
+{
+ if (__pos < __sz)
+ {
+ const _CharT* __pe = __p + __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
+ if (!_Traits::eq(*__ps, __c))
+ return static_cast<_SizeT>(__ps - __p);
+ }
+ return __npos;
+}
+
+
+// __str_find_last_not_of
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+{
+ if (__pos < __sz)
+ ++__pos;
+ else
+ __pos = __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __p;)
+ if (_Traits::find(__s, __n, *--__ps) == 0)
+ return static_cast<_SizeT>(__ps - __p);
+ return __npos;
+}
+
+
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
+ _CharT __c, _SizeT __pos) _NOEXCEPT
+{
+ if (__pos < __sz)
+ ++__pos;
+ else
+ __pos = __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __p;)
+ if (!_Traits::eq(*--__ps, __c))
+ return static_cast<_SizeT>(__ps - __p);
+ return __npos;
+}
+
+template<class _Ptr>
+inline _LIBCPP_INLINE_VISIBILITY
+size_t __do_string_hash(_Ptr __p, _Ptr __e)
+{
+ typedef typename iterator_traits<_Ptr>::value_type value_type;
+ return __murmur2_or_cityhash<size_t>()(__p, (__e-__p)*sizeof(value_type));
+}
+
+template <class _CharT, class _Iter, class _Traits=char_traits<_CharT> >
+struct __quoted_output_proxy
+{
+ _Iter __first;
+ _Iter __last;
+ _CharT __delim;
+ _CharT __escape;
+
+ __quoted_output_proxy(_Iter __f, _Iter __l, _CharT __d, _CharT __e)
+ : __first(__f), __last(__l), __delim(__d), __escape(__e) {}
+ // This would be a nice place for a string_ref
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___STRING
diff --git a/include/__threading_support b/include/__threading_support
index c9a4ea9d0947..36f1701f178c 100644
--- a/include/__threading_support
+++ b/include/__threading_support
@@ -19,20 +19,91 @@
#ifndef _LIBCPP_HAS_NO_THREADS
-#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+#ifndef __libcpp_has_include
+ #ifndef __has_include
+ #define __libcpp_has_include(x) 0
+ #else
+ #define __libcpp_has_include(x) __has_include(x)
+ #endif
+#endif
+
+#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) && \
+ __libcpp_has_include(<__external_threading>)
+#include <__external_threading>
+#else
#include <pthread.h>
#include <sched.h>
+
+#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+#define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS
+#else
+#define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
-#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
-
// Mutex
-#define _LIBCPP_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
typedef pthread_mutex_t __libcpp_mutex_t;
+#define _LIBCPP_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_recursive_mutex_init(__libcpp_mutex_t* __m);
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_mutex_lock(__libcpp_mutex_t* __m);
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_mutex_trylock(__libcpp_mutex_t* __m);
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_mutex_unlock(__libcpp_mutex_t* __m);
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_mutex_destroy(__libcpp_mutex_t* __m);
+
+// Condition variable
+typedef pthread_cond_t __libcpp_condvar_t;
+#define _LIBCPP_CONDVAR_INITIALIZER PTHREAD_COND_INITIALIZER
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_condvar_signal(__libcpp_condvar_t* __cv);
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_condvar_broadcast(__libcpp_condvar_t* __cv);
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m);
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_condvar_timedwait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m, timespec* __ts);
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv);
+
+// Thread id
+typedef pthread_t __libcpp_thread_id;
+_LIBCPP_THREAD_ABI_VISIBILITY
+bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2);
+_LIBCPP_THREAD_ABI_VISIBILITY
+bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2);
+
+// Thread
+typedef pthread_t __libcpp_thread_t;
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_thread_create(__libcpp_thread_t* __t, void* (*__func)(void*), void* __arg);
+_LIBCPP_THREAD_ABI_VISIBILITY
+__libcpp_thread_id __libcpp_thread_get_current_id();
+_LIBCPP_THREAD_ABI_VISIBILITY
+__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t* __t);
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_thread_join(__libcpp_thread_t* __t);
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_thread_detach(__libcpp_thread_t* __t);
+_LIBCPP_THREAD_ABI_VISIBILITY
+void __libcpp_thread_yield();
+
+// Thread local storage
+typedef pthread_key_t __libcpp_tls_key;
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_tls_create(__libcpp_tls_key* __key, void (*__at_exit)(void*));
+_LIBCPP_THREAD_ABI_VISIBILITY
+void* __libcpp_tls_get(__libcpp_tls_key __key);
+_LIBCPP_THREAD_ABI_VISIBILITY
+void __libcpp_tls_set(__libcpp_tls_key __key, void* __p);
+
+#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) || defined(_LIBCPP_BUILDING_EXTERNAL_THREADS)
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_recursive_mutex_init(__libcpp_mutex_t* __m)
{
pthread_mutexattr_t attr;
@@ -59,147 +130,117 @@ int __libcpp_recursive_mutex_init(__libcpp_mutex_t* __m)
return 0;
}
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_mutex_lock(__libcpp_mutex_t* __m)
{
return pthread_mutex_lock(__m);
}
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_mutex_trylock(__libcpp_mutex_t* __m)
{
return pthread_mutex_trylock(__m);
}
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_mutex_unlock(__libcpp_mutex_t* __m)
{
return pthread_mutex_unlock(__m);
}
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_mutex_destroy(__libcpp_mutex_t* __m)
{
return pthread_mutex_destroy(__m);
}
// Condition variable
-#define _LIBCPP_CONDVAR_INITIALIZER PTHREAD_COND_INITIALIZER
-typedef pthread_cond_t __libcpp_condvar_t;
-
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_condvar_signal(__libcpp_condvar_t* __cv)
{
return pthread_cond_signal(__cv);
}
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_condvar_broadcast(__libcpp_condvar_t* __cv)
{
return pthread_cond_broadcast(__cv);
}
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m)
{
return pthread_cond_wait(__cv, __m);
}
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_condvar_timedwait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m, timespec* __ts)
{
return pthread_cond_timedwait(__cv, __m, __ts);
}
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv)
{
return pthread_cond_destroy(__cv);
}
-// Thread id
-typedef pthread_t __libcpp_thread_id;
-
// Returns non-zero if the thread ids are equal, otherwise 0
-inline _LIBCPP_ALWAYS_INLINE
bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2)
{
return pthread_equal(t1, t2) != 0;
}
// Returns non-zero if t1 < t2, otherwise 0
-inline _LIBCPP_ALWAYS_INLINE
bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2)
{
return t1 < t2;
}
// Thread
-typedef pthread_t __libcpp_thread_t;
-
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_thread_create(__libcpp_thread_t* __t, void* (*__func)(void*), void* __arg)
{
return pthread_create(__t, 0, __func, __arg);
}
-inline _LIBCPP_ALWAYS_INLINE
__libcpp_thread_id __libcpp_thread_get_current_id()
{
return pthread_self();
}
-inline _LIBCPP_ALWAYS_INLINE
__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t* __t)
{
return *__t;
}
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_thread_join(__libcpp_thread_t* __t)
{
return pthread_join(*__t, 0);
}
-inline _LIBCPP_ALWAYS_INLINE
int __libcpp_thread_detach(__libcpp_thread_t* __t)
{
return pthread_detach(*__t);
}
-inline _LIBCPP_ALWAYS_INLINE
void __libcpp_thread_yield()
{
sched_yield();
}
// Thread local storage
-typedef pthread_key_t __libcpp_tl_key;
-
-inline _LIBCPP_ALWAYS_INLINE
-int __libcpp_tl_create(__libcpp_tl_key* __key, void (*__at_exit)(void*))
+int __libcpp_tls_create(__libcpp_tls_key* __key, void (*__at_exit)(void*))
{
return pthread_key_create(__key, __at_exit);
}
-inline _LIBCPP_ALWAYS_INLINE
-void* __libcpp_tl_get(__libcpp_tl_key __key)
+void* __libcpp_tls_get(__libcpp_tls_key __key)
{
return pthread_getspecific(__key);
}
-inline _LIBCPP_ALWAYS_INLINE
-void __libcpp_tl_set(__libcpp_tl_key __key, void* __p)
+void __libcpp_tls_set(__libcpp_tls_key __key, void* __p)
{
pthread_setspecific(__key, __p);
}
-#else // !_LIBCPP_HAS_THREAD_API_PTHREAD
- #error "No thread API selected."
-#endif
+#endif // _LIBCPP_HAS_THREAD_API_PTHREAD || _LIBCPP_BUILDING_EXTERNAL_THREADS
_LIBCPP_END_NAMESPACE_STD
+#endif // !_LIBCPP_HAS_THREAD_API_EXTERNAL || !__libcpp_has_include(<__external_threading>)
+
#endif // _LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_THREADING_SUPPORT
diff --git a/include/__tree b/include/__tree
index b560bf071e81..485a6c13af40 100644
--- a/include/__tree
+++ b/include/__tree
@@ -1106,19 +1106,22 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
- {return __node_traits::max_size(__node_alloc());}
+ {return std::min<size_type>(
+ __node_traits::max_size(__node_alloc()),
+ numeric_limits<difference_type >::max());}
void clear() _NOEXCEPT;
void swap(__tree& __t)
+#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(
__is_nothrow_swappable<value_compare>::value
-#if _LIBCPP_STD_VER <= 11
&& (!__node_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<__node_allocator>::value)
-#endif
);
-
+#else
+ _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value);
+#endif
#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class ..._Args>
@@ -1425,7 +1428,7 @@ private:
__node_alloc() = __t.__node_alloc();
}
_LIBCPP_INLINE_VISIBILITY
- void __copy_assign_alloc(const __tree& __t, false_type) {}
+ void __copy_assign_alloc(const __tree&, false_type) {}
void __move_assign(__tree& __t, false_type);
void __move_assign(__tree& __t, true_type)
@@ -1445,7 +1448,7 @@ private:
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
{__node_alloc() = _VSTD::move(__t.__node_alloc());}
_LIBCPP_INLINE_VISIBILITY
- void __move_assign_alloc(__tree& __t, false_type) _NOEXCEPT {}
+ void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}
__node_pointer __detach();
static __node_pointer __detach(__node_pointer);
@@ -1797,13 +1800,15 @@ __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT
template <class _Tp, class _Compare, class _Allocator>
void
__tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
+#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(
__is_nothrow_swappable<value_compare>::value
-#if _LIBCPP_STD_VER <= 11
&& (!__node_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<__node_allocator>::value)
-#endif
)
+#else
+ _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value)
+#endif
{
using _VSTD::swap;
swap(__begin_node_, __t.__begin_node_);
diff --git a/include/__tuple b/include/__tuple
index cc9fbbebc096..775d7340b54d 100644
--- a/include/__tuple
+++ b/include/__tuple
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY tuple_size;
+template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY tuple_size {};
template <class _Tp>
class _LIBCPP_TYPE_VIS_ONLY tuple_size<const _Tp>
@@ -146,6 +146,12 @@ template <class ..._Tp> class _LIBCPP_TYPE_VIS_ONLY tuple;
template <class... _Tp> struct __tuple_like<tuple<_Tp...> > : true_type {};
+template <class ..._Tp>
+class _LIBCPP_TYPE_VIS_ONLY tuple_size<tuple<_Tp...> >
+ : public integral_constant<size_t, sizeof...(_Tp)>
+{
+};
+
template <size_t _Ip, class ..._Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, tuple<_Tp...> >::type&
@@ -368,7 +374,7 @@ template <bool ..._Preds>
struct __all_dummy;
template <bool ..._Pred>
-using __all = is_same<__all_dummy<_Pred...>, __all_dummy<(_Pred, true)...>>;
+using __all = is_same<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>>;
struct __tuple_sfinae_base {
template <template <class, class...> class _Trait,
@@ -431,8 +437,105 @@ struct __tuple_assignable<_Tp, _Up, true, true>
>
{};
+
+template <size_t _Ip, class ..._Tp>
+class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, tuple<_Tp...> >
+{
+public:
+ typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
+};
+
+#if _LIBCPP_STD_VER > 11
+template <size_t _Ip, class ..._Tp>
+using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type;
+#endif
+
#endif // _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
+template <bool _IsTuple, class _SizeTrait, size_t _Expected>
+struct __tuple_like_with_size_imp : false_type {};
+
+template <class _SizeTrait, size_t _Expected>
+struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected>
+ : integral_constant<bool, _SizeTrait::value == _Expected> {};
+
+template <class _Tuple, size_t _ExpectedSize,
+ class _RawTuple = typename __uncvref<_Tuple>::type>
+using __tuple_like_with_size = __tuple_like_with_size_imp<
+ __tuple_like<_RawTuple>::value,
+ tuple_size<_RawTuple>, _ExpectedSize
+ >;
+
+struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail {
+ template <class ...>
+ static constexpr bool __enable_default() { return false; }
+ template <class ...>
+ static constexpr bool __enable_explicit() { return false; }
+ template <class ...>
+ static constexpr bool __enable_implicit() { return false; }
+ template <class ...>
+ static constexpr bool __enable_assign() { return false; }
+};
+#endif
+
+#if _LIBCPP_STD_VER > 14
+
+template <bool _CanCopy, bool _CanMove>
+struct __sfinae_ctor_base {};
+template <>
+struct __sfinae_ctor_base<false, false> {
+ __sfinae_ctor_base() = default;
+ __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
+ __sfinae_ctor_base(__sfinae_ctor_base &&) = delete;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
+};
+template <>
+struct __sfinae_ctor_base<true, false> {
+ __sfinae_ctor_base() = default;
+ __sfinae_ctor_base(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base(__sfinae_ctor_base &&) = delete;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
+};
+template <>
+struct __sfinae_ctor_base<false, true> {
+ __sfinae_ctor_base() = default;
+ __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
+ __sfinae_ctor_base(__sfinae_ctor_base &&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
+};
+
+template <bool _CanCopy, bool _CanMove>
+struct __sfinae_assign_base {};
+template <>
+struct __sfinae_assign_base<false, false> {
+ __sfinae_assign_base() = default;
+ __sfinae_assign_base(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base(__sfinae_assign_base &&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
+ __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
+};
+template <>
+struct __sfinae_assign_base<true, false> {
+ __sfinae_assign_base() = default;
+ __sfinae_assign_base(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base(__sfinae_assign_base &&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
+};
+template <>
+struct __sfinae_assign_base<false, true> {
+ __sfinae_assign_base() = default;
+ __sfinae_assign_base(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base(__sfinae_assign_base &&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
+ __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default;
+};
+#endif // _LIBCPP_STD_VER > 14
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___TUPLE
diff --git a/include/algorithm b/include/algorithm
index 7a6db7abd26d..189991efbee0 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -89,7 +89,7 @@ template <class InputIterator1, class InputIterator2>
template <class InputIterator1, class InputIterator2>
pair<InputIterator1, InputIterator2>
- mismatch(InputIterator1 first1, InputIterator1 last1,
+ mismatch(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2); // **C++14**
template <class InputIterator1, class InputIterator2, class BinaryPredicate>
@@ -109,7 +109,7 @@ template <class InputIterator1, class InputIterator2>
template <class InputIterator1, class InputIterator2>
bool
- equal(InputIterator1 first1, InputIterator1 last1,
+ equal(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2); // **C++14**
template <class InputIterator1, class InputIterator2, class BinaryPredicate>
@@ -288,6 +288,12 @@ template <class RandomAccessIterator, class RandomNumberGenerator>
random_shuffle(RandomAccessIterator first, RandomAccessIterator last,
RandomNumberGenerator& rand); // deprecated in C++14
+template<class PopulationIterator, class SampleIterator,
+ class Distance, class UniformRandomBitGenerator>
+ SampleIterator sample(PopulationIterator first, PopulationIterator last,
+ SampleIterator out, Distance n,
+ UniformRandomBitGenerator&& g); // C++17
+
template<class RandomAccessIterator, class UniformRandomNumberGenerator>
void shuffle(RandomAccessIterator first, RandomAccessIterator last,
UniformRandomNumberGenerator&& g);
@@ -688,7 +694,7 @@ struct __equal_to<_T1, const _T1>
template <class _T1, class _T2 = _T1>
struct __less
{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ _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
@@ -749,14 +755,28 @@ struct __debug_less
{
_Compare __comp_;
__debug_less(_Compare& __c) : __comp_(__c) {}
+
template <class _Tp, class _Up>
bool operator()(const _Tp& __x, const _Up& __y)
{
bool __r = __comp_(__x, __y);
if (__r)
- _LIBCPP_ASSERT(!__comp_(__y, __x), "Comparator does not induce a strict weak ordering");
+ __do_compare_assert(0, __y, __x);
return __r;
}
+
+ template <class _LHS, class _RHS>
+ inline _LIBCPP_INLINE_VISIBILITY
+ decltype((void)_VSTD::declval<_Compare&>()(
+ _VSTD::declval<_LHS const&>(), _VSTD::declval<_RHS const&>()))
+ __do_compare_assert(int, _LHS const& __l, _RHS const& __r) {
+ _LIBCPP_ASSERT(!__comp_(__l, __r),
+ "Comparator does not induce a strict weak ordering");
+ }
+
+ template <class _LHS, class _RHS>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __do_compare_assert(long, _LHS const&, _RHS const&) {}
};
#endif // _LIBCPP_DEBUG
@@ -857,7 +877,7 @@ for_each(_InputIterator __first, _InputIterator __last, _Function __f)
{
for (; __first != __last; ++__first)
__f(*__first);
- return _LIBCPP_EXPLICIT_MOVE(__f); // explicitly moved for (emulated) C++03
+ return __f;
}
// find
@@ -1215,7 +1235,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first
template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-__equal(_InputIterator1 __first1, _InputIterator1 __last1,
+__equal(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred,
input_iterator_tag, input_iterator_tag )
{
@@ -1228,8 +1248,8 @@ __equal(_InputIterator1 __first1, _InputIterator1 __last1,
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
+__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
random_access_iterator_tag, random_access_iterator_tag )
{
if ( _VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))
@@ -1242,11 +1262,11 @@ __equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
inline _LIBCPP_INLINE_VISIBILITY
bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1,
+equal(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred )
{
return _VSTD::__equal<typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first1, __last1, __first2, __last2, __pred,
+ (__first1, __last1, __first2, __last2, __pred,
typename iterator_traits<_InputIterator1>::iterator_category(),
typename iterator_traits<_InputIterator2>::iterator_category());
}
@@ -1254,7 +1274,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1,
template <class _InputIterator1, class _InputIterator2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1,
+equal(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2)
{
typedef typename iterator_traits<_InputIterator1>::value_type __v1;
@@ -1328,7 +1348,7 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
template<class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
bool
__is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
_BinaryPredicate __pred,
forward_iterator_tag, forward_iterator_tag )
{
@@ -1379,7 +1399,7 @@ __next_iter:;
template<class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
bool
__is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1,
- _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2,
+ _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2,
_BinaryPredicate __pred,
random_access_iterator_tag, random_access_iterator_tag )
{
@@ -1458,7 +1478,7 @@ __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
}
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCPP_CONSTEXPR_AFTER_CXX11
pair<_RandomAccessIterator1, _RandomAccessIterator1>
__search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
_RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
@@ -1474,9 +1494,9 @@ __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
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)
{
-#if !_LIBCPP_UNROLL_LOOPS
while (true)
{
if (__first1 == __s)
@@ -1485,40 +1505,9 @@ __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
break;
++__first1;
}
-#else // !_LIBCPP_UNROLL_LOOPS
- for (_D1 __loop_unroll = (__s - __first1) / 4; __loop_unroll > 0; --__loop_unroll)
- {
- if (__pred(*__first1, *__first2))
- goto __phase2;
- if (__pred(*++__first1, *__first2))
- goto __phase2;
- if (__pred(*++__first1, *__first2))
- goto __phase2;
- if (__pred(*++__first1, *__first2))
- goto __phase2;
- ++__first1;
- }
- switch (__s - __first1)
- {
- case 3:
- if (__pred(*__first1, *__first2))
- break;
- ++__first1;
- case 2:
- if (__pred(*__first1, *__first2))
- break;
- ++__first1;
- case 1:
- if (__pred(*__first1, *__first2))
- break;
- case 0:
- return make_pair(__last1, __last1);
- }
- __phase2:
-#endif // !_LIBCPP_UNROLL_LOOPS
+
_RandomAccessIterator1 __m1 = __first1;
_RandomAccessIterator2 __m2 = __first2;
-#if !_LIBCPP_UNROLL_LOOPS
while (true)
{
if (++__m2 == __last2)
@@ -1530,43 +1519,6 @@ __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
break;
}
}
-#else // !_LIBCPP_UNROLL_LOOPS
- ++__m2;
- ++__m1;
- for (_D2 __loop_unroll = (__last2 - __m2) / 4; __loop_unroll > 0; --__loop_unroll)
- {
- if (!__pred(*__m1, *__m2))
- goto __continue;
- if (!__pred(*++__m1, *++__m2))
- goto __continue;
- if (!__pred(*++__m1, *++__m2))
- goto __continue;
- if (!__pred(*++__m1, *++__m2))
- goto __continue;
- ++__m1;
- ++__m2;
- }
- switch (__last2 - __m2)
- {
- case 3:
- if (!__pred(*__m1, *__m2))
- break;
- ++__m1;
- ++__m2;
- case 2:
- if (!__pred(*__m1, *__m2))
- break;
- ++__m1;
- ++__m2;
- case 1:
- if (!__pred(*__m1, *__m2))
- break;
- case 0:
- return make_pair(__first1, __first1 + __len2);
- }
- __continue:
- ++__first1;
-#endif // !_LIBCPP_UNROLL_LOOPS
}
}
@@ -1729,6 +1681,20 @@ __unwrap_iter(__wrap_iter<_Tp*> __i)
return __i.base();
}
+#else
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if
+<
+ is_trivially_copy_assignable<_Tp>::value,
+ __wrap_iter<_Tp*>
+>::type
+__unwrap_iter(__wrap_iter<_Tp*> __i)
+{
+ return __i;
+}
+
#endif // _LIBCPP_DEBUG_LEVEL < 2
template <class _InputIterator, class _OutputIterator>
@@ -1802,7 +1768,9 @@ _BidirectionalIterator2
copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
_BidirectionalIterator2 __result)
{
- return _VSTD::__copy_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
+ return _VSTD::__copy_backward(__unwrap_iter(__first),
+ __unwrap_iter(__last),
+ __unwrap_iter(__result));
}
// copy_if
@@ -2417,7 +2385,7 @@ __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIt
template<typename _Integral>
inline _LIBCPP_INLINE_VISIBILITY
_Integral
-__gcd(_Integral __x, _Integral __y)
+__algo_gcd(_Integral __x, _Integral __y)
{
do
{
@@ -2442,7 +2410,7 @@ __rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran
_VSTD::swap_ranges(__first, __middle, __middle);
return __middle;
}
- const difference_type __g = _VSTD::__gcd(__m1, __m2);
+ const difference_type __g = _VSTD::__algo_gcd(__m1, __m2);
for (_RandomAccessIterator __p = __first + __g; __p != __first;)
{
value_type __t(_VSTD::move(*--__p));
@@ -2785,7 +2753,7 @@ minmax(initializer_list<_Tp> __t, _Compare __comp)
__result.second = *__first;
++__first;
}
-
+
while (__first != __last)
{
_Tp __prev = *__first++;
@@ -2797,7 +2765,7 @@ minmax(initializer_list<_Tp> __t, _Compare __comp)
if ( __comp(__prev, __result.first)) __result.first = __prev;
if (!__comp(*__first, __result.second)) __result.second = *__first;
}
-
+
__first++;
}
return __result;
@@ -3128,6 +3096,78 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
}
}
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+_LIBCPP_INLINE_VISIBILITY
+_SampleIterator __sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __out,
+ _Distance __n,
+ _UniformRandomNumberGenerator & __g,
+ input_iterator_tag) {
+
+ _Distance __k = 0;
+ for (; __first != __last && __k < __n; ++__first, (void)++__k)
+ __out[__k] = *__first;
+ _Distance __sz = __k;
+ for (; __first != __last; ++__first, (void)++__k) {
+ _Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, __k)(__g);
+ if (__r < __sz)
+ __out[__r] = *__first;
+ }
+ return __out + _VSTD::min(__n, __k);
+}
+
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+_LIBCPP_INLINE_VISIBILITY
+_SampleIterator __sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __out,
+ _Distance __n,
+ _UniformRandomNumberGenerator& __g,
+ forward_iterator_tag) {
+ _Distance __unsampled_sz = _VSTD::distance(__first, __last);
+ for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) {
+ _Distance __r =
+ _VSTD::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g);
+ if (__r < __n) {
+ *__out++ = *__first;
+ --__n;
+ }
+ }
+ return __out;
+}
+
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+_LIBCPP_INLINE_VISIBILITY
+_SampleIterator __sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __out,
+ _Distance __n, _UniformRandomNumberGenerator& __g) {
+ typedef typename iterator_traits<_PopulationIterator>::iterator_category
+ _PopCategory;
+ typedef typename iterator_traits<_PopulationIterator>::difference_type
+ _Difference;
+ static_assert(__is_forward_iterator<_PopulationIterator>::value ||
+ __is_random_access_iterator<_SampleIterator>::value,
+ "SampleIterator must meet the requirements of RandomAccessIterator");
+ typedef typename common_type<_Distance, _Difference>::type _CommonType;
+ _LIBCPP_ASSERT(__n >= 0, "N must be a positive number.");
+ return _VSTD::__sample(
+ __first, __last, __out, _CommonType(__n),
+ __g, _PopCategory());
+}
+
+#if _LIBCPP_STD_VER > 14
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+inline _LIBCPP_INLINE_VISIBILITY
+_SampleIterator sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __out,
+ _Distance __n, _UniformRandomNumberGenerator&& __g) {
+ return _VSTD::__sample(__first, __last, __out, __n, __g);
+}
+#endif // _LIBCPP_STD_VER > 14
+
template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>
void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -4423,7 +4463,7 @@ __buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator
::new(__p) value_type(_VSTD::move(*__i));
typedef reverse_iterator<_BidirectionalIterator> _RBi;
typedef reverse_iterator<value_type*> _Rv;
- __half_inplace_merge(_Rv(__p), _Rv(__buff),
+ __half_inplace_merge(_Rv(__p), _Rv(__buff),
_RBi(__middle), _RBi(__first),
_RBi(__last), __negate<_Compare>(__comp));
}
@@ -4871,7 +4911,8 @@ push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
template <class _Compare, class _RandomAccessIterator>
void
-__sift_down(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+__sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
+ _Compare __comp,
typename iterator_traits<_RandomAccessIterator>::difference_type __len,
_RandomAccessIterator __start)
{
diff --git a/include/any b/include/any
new file mode 100644
index 000000000000..1f70c4ff9b8d
--- /dev/null
+++ b/include/any
@@ -0,0 +1,663 @@
+// -*- C++ -*-
+//===------------------------------ any -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_ANY
+#define _LIBCPP_ANY
+
+/*
+ any synopsis
+
+namespace std {
+
+ class bad_any_cast : public bad_cast
+ {
+ public:
+ virtual const char* what() const noexcept;
+ };
+
+ class any
+ {
+ public:
+
+ // 6.3.1 any construct/destruct
+ any() noexcept;
+
+ any(const any& other);
+ any(any&& other) noexcept;
+
+ template <class ValueType>
+ any(ValueType&& value);
+
+ ~any();
+
+ // 6.3.2 any assignments
+ any& operator=(const any& rhs);
+ any& operator=(any&& rhs) noexcept;
+
+ template <class ValueType>
+ any& operator=(ValueType&& rhs);
+
+ // 6.3.3 any modifiers
+ void reset() noexcept;
+ void swap(any& rhs) noexcept;
+
+ // 6.3.4 any observers
+ bool has_value() const noexcept;
+ const type_info& type() const noexcept;
+ };
+
+ // 6.4 Non-member functions
+ void swap(any& x, any& y) noexcept;
+
+ template <class T, class ...Args>
+ any make_any(Args&& ...args);
+ template <class T, class U, class ...Args>
+ any make_any(initializer_list<U>, Args&& ...args);
+
+ template<class ValueType>
+ ValueType any_cast(const any& operand);
+ template<class ValueType>
+ ValueType any_cast(any& operand);
+ template<class ValueType>
+ ValueType any_cast(any&& operand);
+
+ template<class ValueType>
+ const ValueType* any_cast(const any* operand) noexcept;
+ template<class ValueType>
+ ValueType* any_cast(any* operand) noexcept;
+
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+*/
+
+#include <experimental/__config>
+#include <memory>
+#include <new>
+#include <typeinfo>
+#include <type_traits>
+#include <cstdlib>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+namespace std {
+class _LIBCPP_EXCEPTION_ABI bad_any_cast : public bad_cast
+{
+public:
+ virtual const char* what() const _NOEXCEPT;
+};
+} // namespace std
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_any_cast()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_any_cast();
+#else
+ _VSTD::abort();
+#endif
+}
+
+// Forward declarations
+class _LIBCPP_TYPE_VIS_ONLY any;
+
+template <class _ValueType>
+_LIBCPP_INLINE_VISIBILITY
+add_pointer_t<add_const_t<_ValueType>>
+any_cast(any const *) _NOEXCEPT;
+
+template <class _ValueType>
+_LIBCPP_INLINE_VISIBILITY
+add_pointer_t<_ValueType> any_cast(any *) _NOEXCEPT;
+
+namespace __any_imp
+{
+ using _Buffer = aligned_storage_t<3*sizeof(void*), alignment_of<void*>::value>;
+
+ template <class _Tp>
+ using _IsSmallObject = integral_constant<bool
+ , sizeof(_Tp) <= sizeof(_Buffer)
+ && alignment_of<_Buffer>::value
+ % alignment_of<_Tp>::value == 0
+ && is_nothrow_move_constructible<_Tp>::value
+ >;
+
+ enum class _Action {
+ _Destroy,
+ _Copy,
+ _Move,
+ _Get,
+ _TypeInfo
+ };
+
+ template <class _Tp> struct _SmallHandler;
+ template <class _Tp> struct _LargeHandler;
+
+ template <class _Tp>
+ struct _LIBCPP_TYPE_VIS_ONLY __unique_typeinfo { static constexpr int __id = 0; };
+ template <class _Tp> constexpr int __unique_typeinfo<_Tp>::__id;
+
+ template <class _Tp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr const void* __get_fallback_typeid() {
+ return &__unique_typeinfo<decay_t<_Tp>>::__id;
+ }
+
+ template <class _Tp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ bool __compare_typeid(type_info const* __id, const void* __fallback_id)
+ {
+#if !defined(_LIBCPP_NO_RTTI)
+ if (__id && *__id == typeid(_Tp))
+ return true;
+#endif
+ if (!__id && __fallback_id == __any_imp::__get_fallback_typeid<_Tp>())
+ return true;
+ return false;
+ }
+
+ template <class _Tp>
+ using _Handler = conditional_t<
+ _IsSmallObject<_Tp>::value, _SmallHandler<_Tp>, _LargeHandler<_Tp>>;
+
+} // namespace __any_imp
+
+class _LIBCPP_TYPE_VIS_ONLY any
+{
+public:
+ // construct/destruct
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr any() _NOEXCEPT : __h(nullptr) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ any(any const & __other) : __h(nullptr)
+ {
+ if (__other.__h) __other.__call(_Action::_Copy, this);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ any(any && __other) _NOEXCEPT : __h(nullptr)
+ {
+ if (__other.__h) __other.__call(_Action::_Move, this);
+ }
+
+ template <
+ class _ValueType
+ , class _Tp = decay_t<_ValueType>
+ , class = enable_if_t<
+ !is_same<_Tp, any>::value &&
+ !__is_inplace_type<_ValueType>::value &&
+ is_copy_constructible<_Tp>::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ any(_ValueType && __value);
+
+ template <class _ValueType, class ..._Args,
+ class _Tp = decay_t<_ValueType>,
+ class = enable_if_t<
+ is_constructible<_Tp, _Args...>::value &&
+ is_copy_constructible<_Tp>::value
+ >
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ explicit any(in_place_type_t<_ValueType>, _Args&&... __args);
+
+ template <class _ValueType, class _Up, class ..._Args,
+ class _Tp = decay_t<_ValueType>,
+ class = enable_if_t<
+ is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
+ is_copy_constructible<_Tp>::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ explicit any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&... __args);
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~any() { this->reset(); }
+
+ // assignments
+ _LIBCPP_INLINE_VISIBILITY
+ any & operator=(any const & __rhs) {
+ any(__rhs).swap(*this);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ any & operator=(any && __rhs) _NOEXCEPT {
+ any(_VSTD::move(__rhs)).swap(*this);
+ return *this;
+ }
+
+ template <
+ class _ValueType
+ , class _Tp = decay_t<_ValueType>
+ , class = enable_if_t<
+ !is_same<_Tp, any>::value
+ && is_copy_constructible<_Tp>::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ any & operator=(_ValueType && __rhs);
+
+ template <class _ValueType, class ..._Args,
+ class _Tp = decay_t<_ValueType>,
+ class = enable_if_t<
+ is_constructible<_Tp, _Args...>::value &&
+ is_copy_constructible<_Tp>::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ void emplace(_Args&&... args);
+
+ template <class _ValueType, class _Up, class ..._Args,
+ class _Tp = decay_t<_ValueType>,
+ class = enable_if_t<
+ is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
+ is_copy_constructible<_Tp>::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ void emplace(initializer_list<_Up>, _Args&&...);
+
+ // 6.3.3 any modifiers
+ _LIBCPP_INLINE_VISIBILITY
+ void reset() _NOEXCEPT { if (__h) this->__call(_Action::_Destroy); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(any & __rhs) _NOEXCEPT;
+
+ // 6.3.4 any observers
+ _LIBCPP_INLINE_VISIBILITY
+ bool has_value() const _NOEXCEPT { return __h != nullptr; }
+
+#if !defined(_LIBCPP_NO_RTTI)
+ _LIBCPP_INLINE_VISIBILITY
+ const type_info & type() const _NOEXCEPT {
+ if (__h) {
+ return *static_cast<type_info const *>(this->__call(_Action::_TypeInfo));
+ } else {
+ return typeid(void);
+ }
+ }
+#endif
+
+private:
+ typedef __any_imp::_Action _Action;
+ using _HandleFuncPtr = void* (*)(_Action, any const *, any *, const type_info *,
+ const void* __fallback_info);
+
+ union _Storage {
+ constexpr _Storage() : __ptr(nullptr) {}
+ void * __ptr;
+ __any_imp::_Buffer __buf;
+ };
+
+ _LIBCPP_ALWAYS_INLINE
+ void * __call(_Action __a, any * __other = nullptr,
+ type_info const * __info = nullptr,
+ const void* __fallback_info = nullptr) const
+ {
+ return __h(__a, this, __other, __info, __fallback_info);
+ }
+
+ _LIBCPP_ALWAYS_INLINE
+ void * __call(_Action __a, any * __other = nullptr,
+ type_info const * __info = nullptr,
+ const void* __fallback_info = nullptr)
+ {
+ return __h(__a, this, __other, __info, __fallback_info);
+ }
+
+ template <class>
+ friend struct __any_imp::_SmallHandler;
+ template <class>
+ friend struct __any_imp::_LargeHandler;
+
+ template <class _ValueType>
+ friend add_pointer_t<add_const_t<_ValueType>>
+ any_cast(any const *) _NOEXCEPT;
+
+ template <class _ValueType>
+ friend add_pointer_t<_ValueType>
+ any_cast(any *) _NOEXCEPT;
+
+ _HandleFuncPtr __h = nullptr;
+ _Storage __s;
+};
+
+namespace __any_imp
+{
+ template <class _Tp>
+ struct _LIBCPP_TYPE_VIS_ONLY _SmallHandler
+ {
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __handle(_Action __act, any const * __this, any * __other,
+ type_info const * __info, const void* __fallback_info)
+ {
+ switch (__act)
+ {
+ case _Action::_Destroy:
+ __destroy(const_cast<any &>(*__this));
+ return nullptr;
+ case _Action::_Copy:
+ __copy(*__this, *__other);
+ return nullptr;
+ case _Action::_Move:
+ __move(const_cast<any &>(*__this), *__other);
+ return nullptr;
+ case _Action::_Get:
+ return __get(const_cast<any &>(*__this), __info, __fallback_info);
+ case _Action::_TypeInfo:
+ return __type_info();
+ }
+ }
+
+ template <class ..._Args>
+ _LIBCPP_INLINE_VISIBILITY
+ static void __create(any & __dest, _Args&&... __args) {
+ ::new (static_cast<void*>(&__dest.__s.__buf)) _Tp(_VSTD::forward<_Args>(__args)...);
+ __dest.__h = &_SmallHandler::__handle;
+ }
+
+ private:
+ _LIBCPP_INLINE_VISIBILITY
+ static void __destroy(any & __this) {
+ _Tp & __value = *static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf));
+ __value.~_Tp();
+ __this.__h = nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void __copy(any const & __this, any & __dest) {
+ _SmallHandler::__create(__dest, *static_cast<_Tp const *>(
+ static_cast<void const *>(&__this.__s.__buf)));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void __move(any & __this, any & __dest) {
+ _SmallHandler::__create(__dest, _VSTD::move(
+ *static_cast<_Tp*>(static_cast<void*>(&__this.__s.__buf))));
+ __destroy(__this);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __get(any & __this,
+ type_info const * __info,
+ const void* __fallback_id)
+ {
+ if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_id))
+ return static_cast<void*>(&__this.__s.__buf);
+ return nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __type_info()
+ {
+#if !defined(_LIBCPP_NO_RTTI)
+ return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
+#else
+ return nullptr;
+#endif
+ }
+ };
+
+ template <class _Tp>
+ struct _LIBCPP_TYPE_VIS_ONLY _LargeHandler
+ {
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __handle(_Action __act, any const * __this,
+ any * __other, type_info const * __info,
+ void const* __fallback_info)
+ {
+ switch (__act)
+ {
+ case _Action::_Destroy:
+ __destroy(const_cast<any &>(*__this));
+ return nullptr;
+ case _Action::_Copy:
+ __copy(*__this, *__other);
+ return nullptr;
+ case _Action::_Move:
+ __move(const_cast<any &>(*__this), *__other);
+ return nullptr;
+ case _Action::_Get:
+ return __get(const_cast<any &>(*__this), __info, __fallback_info);
+ case _Action::_TypeInfo:
+ return __type_info();
+ }
+ }
+
+ template <class ..._Args>
+ _LIBCPP_INLINE_VISIBILITY
+ static void __create(any & __dest, _Args&&... __args) {
+ typedef allocator<_Tp> _Alloc;
+ typedef __allocator_destructor<_Alloc> _Dp;
+ _Alloc __a;
+ unique_ptr<_Tp, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ ::new ((void*)__hold.get()) _Tp(_VSTD::forward<_Args>(__args)...);
+ __dest.__s.__ptr = __hold.release();
+ __dest.__h = &_LargeHandler::__handle;
+ }
+
+ private:
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void __destroy(any & __this){
+ delete static_cast<_Tp*>(__this.__s.__ptr);
+ __this.__h = nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void __copy(any const & __this, any & __dest) {
+ _LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s.__ptr));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void __move(any & __this, any & __dest) {
+ __dest.__s.__ptr = __this.__s.__ptr;
+ __dest.__h = &_LargeHandler::__handle;
+ __this.__h = nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __get(any & __this, type_info const * __info,
+ void const* __fallback_info)
+ {
+ if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_info))
+ return static_cast<void*>(__this.__s.__ptr);
+ return nullptr;
+
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __type_info()
+ {
+#if !defined(_LIBCPP_NO_RTTI)
+ return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
+#else
+ return nullptr;
+#endif
+ }
+ };
+
+} // namespace __any_imp
+
+
+template <class _ValueType, class _Tp, class>
+any::any(_ValueType && __v) : __h(nullptr)
+{
+ __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_ValueType>(__v));
+}
+
+template <class _ValueType, class ..._Args, class _Tp, class>
+any::any(in_place_type_t<_ValueType>, _Args&&... __args) {
+ __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...);
+};
+
+template <class _ValueType, class _Up, class ..._Args, class _Tp, class>
+any::any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) {
+ __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _ValueType, class, class>
+inline _LIBCPP_INLINE_VISIBILITY
+any & any::operator=(_ValueType && __v)
+{
+ any(_VSTD::forward<_ValueType>(__v)).swap(*this);
+ return *this;
+}
+
+template <class _ValueType, class ..._Args, class _Tp, class>
+inline _LIBCPP_INLINE_VISIBILITY
+void any::emplace(_Args&&... __args) {
+ reset();
+ __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _ValueType, class _Up, class ..._Args, class _Tp, class>
+inline _LIBCPP_INLINE_VISIBILITY
+void any::emplace(initializer_list<_Up> __il, _Args&&... __args) {
+ reset();
+ __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void any::swap(any & __rhs) _NOEXCEPT
+{
+ if (this == &__rhs)
+ return;
+ if (__h && __rhs.__h) {
+ any __tmp;
+ __rhs.__call(_Action::_Move, &__tmp);
+ this->__call(_Action::_Move, &__rhs);
+ __tmp.__call(_Action::_Move, this);
+ }
+ else if (__h) {
+ this->__call(_Action::_Move, &__rhs);
+ }
+ else if (__rhs.__h) {
+ __rhs.__call(_Action::_Move, this);
+ }
+}
+
+// 6.4 Non-member functions
+
+inline _LIBCPP_INLINE_VISIBILITY
+void swap(any & __lhs, any & __rhs) _NOEXCEPT
+{
+ __lhs.swap(__rhs);
+}
+
+template <class _Tp, class ..._Args>
+inline _LIBCPP_INLINE_VISIBILITY
+any make_any(_Args&&... __args) {
+ return any(in_place_type<_Tp>, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _Tp, class _Up, class ..._Args>
+inline _LIBCPP_INLINE_VISIBILITY
+any make_any(initializer_list<_Up> __il, _Args&&... __args) {
+ return any(in_place_type<_Tp>, __il, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+_ValueType any_cast(any const & __v)
+{
+ using _RawValueType = __uncvref_t<_ValueType>;
+ static_assert(is_constructible<_ValueType, _RawValueType const &>::value,
+ "ValueType is required to be a const lvalue reference "
+ "or a CopyConstructible type");
+ auto __tmp = _VSTD::any_cast<add_const_t<_RawValueType>>(&__v);
+ if (__tmp == nullptr)
+ __throw_bad_any_cast();
+ return static_cast<_ValueType>(*__tmp);
+}
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+_ValueType any_cast(any & __v)
+{
+ using _RawValueType = __uncvref_t<_ValueType>;
+ static_assert(is_constructible<_ValueType, _RawValueType &>::value,
+ "ValueType is required to be an lvalue reference "
+ "or a CopyConstructible type");
+ auto __tmp = _VSTD::any_cast<_RawValueType>(&__v);
+ if (__tmp == nullptr)
+ __throw_bad_any_cast();
+ return static_cast<_ValueType>(*__tmp);
+}
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+_ValueType any_cast(any && __v)
+{
+ using _RawValueType = __uncvref_t<_ValueType>;
+ static_assert(is_constructible<_ValueType, _RawValueType>::value,
+ "ValueType is required to be an rvalue reference "
+ "or a CopyConstructible type");
+ auto __tmp = _VSTD::any_cast<_RawValueType>(&__v);
+ if (__tmp == nullptr)
+ __throw_bad_any_cast();
+ return static_cast<_ValueType>(_VSTD::move(*__tmp));
+}
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+add_pointer_t<add_const_t<_ValueType>>
+any_cast(any const * __any) _NOEXCEPT
+{
+ static_assert(!is_reference<_ValueType>::value,
+ "_ValueType may not be a reference.");
+ return _VSTD::any_cast<_ValueType>(const_cast<any *>(__any));
+}
+
+template <class _RetType>
+inline _LIBCPP_INLINE_VISIBILITY
+_RetType __pointer_or_func_cast(void* __p, /*IsFunction*/false_type) noexcept {
+ return static_cast<_RetType>(__p);
+}
+
+template <class _RetType>
+inline _LIBCPP_INLINE_VISIBILITY
+_RetType __pointer_or_func_cast(void*, /*IsFunction*/true_type) noexcept {
+ return nullptr;
+}
+
+template <class _ValueType>
+add_pointer_t<_ValueType>
+any_cast(any * __any) _NOEXCEPT
+{
+ using __any_imp::_Action;
+ static_assert(!is_reference<_ValueType>::value,
+ "_ValueType may not be a reference.");
+ typedef typename add_pointer<_ValueType>::type _ReturnType;
+ if (__any && __any->__h) {
+ void *__p = __any->__call(_Action::_Get, nullptr,
+#if !defined(_LIBCPP_NO_RTTI)
+ &typeid(_ValueType),
+#else
+ nullptr,
+#endif
+ __any_imp::__get_fallback_typeid<_ValueType>());
+ return _VSTD::__pointer_or_func_cast<_ReturnType>(
+ __p, is_function<_ValueType>{});
+ }
+ return nullptr;
+}
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_ANY
diff --git a/include/array b/include/array
index 719286d52ea3..d3f8463cf664 100644
--- a/include/array
+++ b/include/array
@@ -108,9 +108,6 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
#include <iterator>
#include <algorithm>
#include <stdexcept>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
- #include <cassert>
-#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -209,11 +206,8 @@ typename array<_Tp, _Size>::reference
array<_Tp, _Size>::at(size_type __n)
{
if (__n >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("array::at");
-#else
- assert(!"array::at out_of_range");
-#endif
+ __throw_out_of_range("array::at");
+
return __elems_[__n];
}
@@ -223,11 +217,7 @@ typename array<_Tp, _Size>::const_reference
array<_Tp, _Size>::at(size_type __n) const
{
if (__n >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("array::at");
-#else
- assert(!"array::at out_of_range");
-#endif
+ __throw_out_of_range("array::at");
return __elems_[__n];
}
diff --git a/include/atomic b/include/atomic
index 11f2152e5bc6..7e3fac81b801 100644
--- a/include/atomic
+++ b/include/atomic
@@ -557,7 +557,6 @@ void atomic_signal_fence(memory_order m) noexcept;
#endif
#if _LIBCPP_STD_VER > 14
-// FIXME: use the right feature test macro value as chose by SG10.
# define __cpp_lib_atomic_is_always_lock_free 201603L
#endif
@@ -580,11 +579,11 @@ struct __gcc_atomic_t {
#endif
_LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
__gcc_atomic_t() _NOEXCEPT = default;
#else
__gcc_atomic_t() _NOEXCEPT : __a_value() {}
-#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_CONSTEXPR explicit __gcc_atomic_t(_Tp value) _NOEXCEPT
: __a_value(value) {}
_Tp __a_value;
@@ -936,11 +935,11 @@ struct __atomic_base // false
{return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
_LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
__atomic_base() _NOEXCEPT = default;
#else
__atomic_base() _NOEXCEPT : __a_() {}
-#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
@@ -1691,11 +1690,11 @@ typedef struct atomic_flag
{__c11_atomic_store(&__a_, false, __m);}
_LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
atomic_flag() _NOEXCEPT = default;
#else
atomic_flag() _NOEXCEPT : __a_() {}
-#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
diff --git a/include/bitset b/include/bitset
index 3f9b964e45ac..edc6c133c328 100644
--- a/include/bitset
+++ b/include/bitset
@@ -125,9 +125,6 @@ template <size_t N> struct hash<std::bitset<N>>;
#include <stdexcept>
#include <iosfwd>
#include <__functional_base>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
- #include <cassert>
-#endif
#include <__undef_min_max>
@@ -262,7 +259,7 @@ __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
#if __SIZEOF_SIZE_T__ == 8
: __first_{__v}
#elif __SIZEOF_SIZE_T__ == 4
- : __first_{__v, __v >> __bits_per_word}
+ : __first_{static_cast<__storage_type>(__v), static_cast<__storage_type>(__v >> __bits_per_word)}
#else
#error This constructor has not been ported to this platform
#endif
@@ -326,11 +323,8 @@ __bitset<_N_words, _Size>::to_ulong(false_type) const
const_iterator __e = __make_iter(_Size);
const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
if (__i != __e)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw overflow_error("bitset to_ulong overflow error");
-#else
- assert(!"bitset to_ulong overflow error");
-#endif
+ __throw_overflow_error("bitset to_ulong overflow error");
+
return __first_[0];
}
@@ -349,11 +343,8 @@ __bitset<_N_words, _Size>::to_ullong(false_type) const
const_iterator __e = __make_iter(_Size);
const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
if (__i != __e)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw overflow_error("bitset to_ullong overflow error");
-#else
- assert(!"bitset to_ullong overflow error");
-#endif
+ __throw_overflow_error("bitset to_ullong overflow error");
+
return to_ullong(true_type());
}
@@ -763,11 +754,8 @@ bitset<_Size>::bitset(const _CharT* __str,
size_t __rlen = _VSTD::min(__n, char_traits<_CharT>::length(__str));
for (size_t __i = 0; __i < __rlen; ++__i)
if (__str[__i] != __zero && __str[__i] != __one)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw invalid_argument("bitset string ctor has invalid argument");
-#else
- assert(!"bitset string ctor has invalid argument");
-#endif
+ __throw_invalid_argument("bitset string ctor has invalid argument");
+
size_t _Mp = _VSTD::min(__rlen, _Size);
size_t __i = 0;
for (; __i < _Mp; ++__i)
@@ -789,19 +777,13 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
_CharT __zero, _CharT __one)
{
if (__pos > __str.size())
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("bitset string pos out of range");
-#else
- assert(!"bitset string pos out of range");
-#endif
+ __throw_out_of_range("bitset string pos out of range");
+
size_t __rlen = _VSTD::min(__n, __str.size() - __pos);
for (size_t __i = __pos; __i < __pos + __rlen; ++__i)
if (!_Traits::eq(__str[__i], __zero) && !_Traits::eq(__str[__i], __one))
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw invalid_argument("bitset string ctor has invalid argument");
-#else
- assert(!"bitset string ctor has invalid argument");
-#endif
+ __throw_invalid_argument("bitset string ctor has invalid argument");
+
size_t _Mp = _VSTD::min(__rlen, _Size);
size_t __i = 0;
for (; __i < _Mp; ++__i)
@@ -876,11 +858,8 @@ bitset<_Size>&
bitset<_Size>::set(size_t __pos, bool __val)
{
if (__pos >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("bitset set argument out of range");
-#else
- assert(!"bitset set argument out of range");
-#endif
+ __throw_out_of_range("bitset set argument out of range");
+
(*this)[__pos] = __val;
return *this;
}
@@ -899,11 +878,8 @@ bitset<_Size>&
bitset<_Size>::reset(size_t __pos)
{
if (__pos >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("bitset reset argument out of range");
-#else
- assert(!"bitset reset argument out of range");
-#endif
+ __throw_out_of_range("bitset reset argument out of range");
+
(*this)[__pos] = false;
return *this;
}
@@ -932,11 +908,8 @@ bitset<_Size>&
bitset<_Size>::flip(size_t __pos)
{
if (__pos >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("bitset flip argument out of range");
-#else
- assert(!"bitset flip argument out of range");
-#endif
+ __throw_out_of_range("bitset flip argument out of range");
+
reference r = base::__make_ref(__pos);
r = ~r;
return *this;
@@ -1027,11 +1000,8 @@ bool
bitset<_Size>::test(size_t __pos) const
{
if (__pos >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("bitset test argument out of range");
-#else
- assert(!"bitset test argument out of range");
-#endif
+ __throw_out_of_range("bitset test argument out of range");
+
return (*this)[__pos];
}
diff --git a/include/chrono b/include/chrono
index 68484e982432..74e359c58dc2 100644
--- a/include/chrono
+++ b/include/chrono
@@ -529,7 +529,7 @@ private:
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
duration() = default;
#else
duration() {}
@@ -1026,7 +1026,8 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
{
- return __lhs + (-__rhs);
+ typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Ret;
+ return _Ret(__lhs.time_since_epoch() -__rhs);
}
// duration operator-(time_point x, time_point y);
diff --git a/include/cmath b/include/cmath
index b3e959405e9e..724935623db7 100644
--- a/include/cmath
+++ b/include/cmath
@@ -331,7 +331,6 @@ using ::double_t;
using ::abs;
#endif
-#ifndef __sun__
using ::acos;
using ::acosf;
using ::asin;
@@ -346,58 +345,47 @@ using ::cos;
using ::cosf;
using ::cosh;
using ::coshf;
-#endif // __sun__
using ::exp;
using ::expf;
-#ifndef __sun__
using ::fabs;
using ::fabsf;
using ::floor;
using ::floorf;
-#endif //__sun__
using ::fmod;
using ::fmodf;
-#ifndef __sun__
using ::frexp;
using ::frexpf;
using ::ldexp;
using ::ldexpf;
-#endif // __sun__
using ::log;
using ::logf;
-#ifndef __sun__
using ::log10;
using ::log10f;
using ::modf;
using ::modff;
-#endif // __sun__
using ::pow;
using ::powf;
-#ifndef __sun__
using ::sin;
using ::sinf;
using ::sinh;
using ::sinhf;
-#endif // __sun__
using ::sqrt;
using ::sqrtf;
using ::tan;
using ::tanf;
-#ifndef __sun__
using ::tanh;
using ::tanhf;
-#ifndef _LIBCPP_MSVCRT
using ::acosh;
using ::acoshf;
using ::asinh;
@@ -406,7 +394,6 @@ using ::atanh;
using ::atanhf;
using ::cbrt;
using ::cbrtf;
-#endif
using ::copysign;
using ::copysignf;
@@ -449,14 +436,10 @@ using ::lrintf;
using ::lround;
using ::lroundf;
#endif // _LIBCPP_MSVCRT
-#endif // __sun__
-#ifndef _LIBCPP_MSVCRT
using ::nan;
using ::nanf;
-#endif // _LIBCPP_MSVCRT
-#ifndef __sun__
#ifndef _LIBCPP_MSVCRT
using ::nearbyint;
using ::nearbyintf;
@@ -504,13 +487,11 @@ using ::sinhl;
using ::sqrtl;
using ::tanl;
-#ifndef _LIBCPP_MSVCRT
using ::tanhl;
using ::acoshl;
using ::asinhl;
using ::atanhl;
using ::cbrtl;
-#endif // !_LIBCPP_MSVCRT
using ::copysignl;
@@ -547,11 +528,6 @@ using ::tgammal;
using ::truncl;
#endif // !_LIBCPP_MSVCRT
-#else
-using ::lgamma;
-using ::lgammaf;
-#endif // __sun__
-
#if _LIBCPP_STD_VER > 14
inline _LIBCPP_INLINE_VISIBILITY float hypot( float x, float y, float z ) { return sqrt(x*x + y*y + z*z); }
inline _LIBCPP_INLINE_VISIBILITY double hypot( double x, double y, double z ) { return sqrt(x*x + y*y + z*z); }
@@ -559,23 +535,83 @@ inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double x, long double y
template <class _A1, class _A2, class _A3>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::__lazy_enable_if
+typename __lazy_enable_if
<
- std::is_arithmetic<_A1>::value &&
- std::is_arithmetic<_A2>::value &&
- std::is_arithmetic<_A3>::value,
- std::__promote<_A1, _A2, _A3>
+ is_arithmetic<_A1>::value &&
+ is_arithmetic<_A2>::value &&
+ is_arithmetic<_A3>::value,
+ __promote<_A1, _A2, _A3>
>::type
hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
{
- typedef typename std::__promote<_A1, _A2, _A3>::type __result_type;
- static_assert((!(std::is_same<_A1, __result_type>::value &&
- std::is_same<_A2, __result_type>::value &&
- std::is_same<_A3, __result_type>::value)), "");
+ typedef typename __promote<_A1, _A2, _A3>::type __result_type;
+ static_assert((!(is_same<_A1, __result_type>::value &&
+ is_same<_A2, __result_type>::value &&
+ is_same<_A3, __result_type>::value)), "");
return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
}
#endif
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
+{
+#if __has_builtin(__builtin_isnan)
+ return __builtin_isnan(__lcpp_x);
+#else
+ return isnan(__lcpp_x);
+#endif
+}
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
+{
+ return isnan(__lcpp_x);
+}
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
+{
+#if __has_builtin(__builtin_isinf)
+ return __builtin_isinf(__lcpp_x);
+#else
+ return isinf(__lcpp_x);
+#endif
+}
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
+{
+ return isinf(__lcpp_x);
+}
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
+{
+#if __has_builtin(__builtin_isfinite)
+ return __builtin_isfinite(__lcpp_x);
+#else
+ return isfinite(__lcpp_x);
+#endif
+}
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
+{
+ return isfinite(__lcpp_x);
+}
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CMATH
diff --git a/include/complex b/include/complex
index f56138fa2d16..22f568f555e7 100644
--- a/include/complex
+++ b/include/complex
@@ -245,9 +245,6 @@ template<class T, class charT, class traits>
#include <stdexcept>
#include <cmath>
#include <sstream>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
- #include <cassert>
-#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -602,39 +599,39 @@ operator*(const complex<_Tp>& __z, const complex<_Tp>& __w)
_Tp __bc = __b * __c;
_Tp __x = __ac - __bd;
_Tp __y = __ad + __bc;
- if (isnan(__x) && isnan(__y))
+ if (__libcpp_isnan(__x) && __libcpp_isnan(__y))
{
bool __recalc = false;
- if (isinf(__a) || isinf(__b))
+ if (__libcpp_isinf(__a) || __libcpp_isinf(__b))
{
- __a = copysign(isinf(__a) ? _Tp(1) : _Tp(0), __a);
- __b = copysign(isinf(__b) ? _Tp(1) : _Tp(0), __b);
- if (isnan(__c))
+ __a = copysign(__libcpp_isinf(__a) ? _Tp(1) : _Tp(0), __a);
+ __b = copysign(__libcpp_isinf(__b) ? _Tp(1) : _Tp(0), __b);
+ if (__libcpp_isnan(__c))
__c = copysign(_Tp(0), __c);
- if (isnan(__d))
+ if (__libcpp_isnan(__d))
__d = copysign(_Tp(0), __d);
__recalc = true;
}
- if (isinf(__c) || isinf(__d))
+ if (__libcpp_isinf(__c) || __libcpp_isinf(__d))
{
- __c = copysign(isinf(__c) ? _Tp(1) : _Tp(0), __c);
- __d = copysign(isinf(__d) ? _Tp(1) : _Tp(0), __d);
- if (isnan(__a))
+ __c = copysign(__libcpp_isinf(__c) ? _Tp(1) : _Tp(0), __c);
+ __d = copysign(__libcpp_isinf(__d) ? _Tp(1) : _Tp(0), __d);
+ if (__libcpp_isnan(__a))
__a = copysign(_Tp(0), __a);
- if (isnan(__b))
+ if (__libcpp_isnan(__b))
__b = copysign(_Tp(0), __b);
__recalc = true;
}
- if (!__recalc && (isinf(__ac) || isinf(__bd) ||
- isinf(__ad) || isinf(__bc)))
+ if (!__recalc && (__libcpp_isinf(__ac) || __libcpp_isinf(__bd) ||
+ __libcpp_isinf(__ad) || __libcpp_isinf(__bc)))
{
- if (isnan(__a))
+ if (__libcpp_isnan(__a))
__a = copysign(_Tp(0), __a);
- if (isnan(__b))
+ if (__libcpp_isnan(__b))
__b = copysign(_Tp(0), __b);
- if (isnan(__c))
+ if (__libcpp_isnan(__c))
__c = copysign(_Tp(0), __c);
- if (isnan(__d))
+ if (__libcpp_isnan(__d))
__d = copysign(_Tp(0), __d);
__recalc = true;
}
@@ -677,7 +674,7 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& __w)
_Tp __c = __w.real();
_Tp __d = __w.imag();
_Tp __logbw = logb(fmax(fabs(__c), fabs(__d)));
- if (isfinite(__logbw))
+ if (__libcpp_isfinite(__logbw))
{
__ilogbw = static_cast<int>(__logbw);
__c = scalbn(__c, -__ilogbw);
@@ -686,24 +683,24 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& __w)
_Tp __denom = __c * __c + __d * __d;
_Tp __x = scalbn((__a * __c + __b * __d) / __denom, -__ilogbw);
_Tp __y = scalbn((__b * __c - __a * __d) / __denom, -__ilogbw);
- if (isnan(__x) && isnan(__y))
+ if (__libcpp_isnan(__x) && __libcpp_isnan(__y))
{
- if ((__denom == _Tp(0)) && (!isnan(__a) || !isnan(__b)))
+ if ((__denom == _Tp(0)) && (!__libcpp_isnan(__a) || !__libcpp_isnan(__b)))
{
__x = copysign(_Tp(INFINITY), __c) * __a;
__y = copysign(_Tp(INFINITY), __c) * __b;
}
- else if ((isinf(__a) || isinf(__b)) && isfinite(__c) && isfinite(__d))
+ else if ((__libcpp_isinf(__a) || __libcpp_isinf(__b)) && __libcpp_isfinite(__c) && __libcpp_isfinite(__d))
{
- __a = copysign(isinf(__a) ? _Tp(1) : _Tp(0), __a);
- __b = copysign(isinf(__b) ? _Tp(1) : _Tp(0), __b);
+ __a = copysign(__libcpp_isinf(__a) ? _Tp(1) : _Tp(0), __a);
+ __b = copysign(__libcpp_isinf(__b) ? _Tp(1) : _Tp(0), __b);
__x = _Tp(INFINITY) * (__a * __c + __b * __d);
__y = _Tp(INFINITY) * (__b * __c - __a * __d);
}
- else if (isinf(__logbw) && __logbw > _Tp(0) && isfinite(__a) && isfinite(__b))
+ else if (__libcpp_isinf(__logbw) && __logbw > _Tp(0) && __libcpp_isfinite(__a) && __libcpp_isfinite(__b))
{
- __c = copysign(isinf(__c) ? _Tp(1) : _Tp(0), __c);
- __d = copysign(isinf(__d) ? _Tp(1) : _Tp(0), __d);
+ __c = copysign(__libcpp_isinf(__c) ? _Tp(1) : _Tp(0), __c);
+ __d = copysign(__libcpp_isinf(__d) ? _Tp(1) : _Tp(0), __d);
__x = _Tp(0) * (__a * __c + __b * __d);
__y = _Tp(0) * (__b * __c - __a * __d);
}
@@ -795,45 +792,41 @@ operator!=(const _Tp& __x, const complex<_Tp>& __y)
// 26.3.7 values:
-// real
+template <class _Tp, bool = is_integral<_Tp>::value,
+ bool = is_floating_point<_Tp>::value
+ >
+struct __libcpp_complex_overload_traits {};
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_Tp
-real(const complex<_Tp>& __c)
+// Integral Types
+template <class _Tp>
+struct __libcpp_complex_overload_traits<_Tp, true, false>
{
- return __c.real();
-}
+ typedef double _ValueType;
+ typedef complex<double> _ComplexType;
+};
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-long double
-real(long double __re)
+// Floating point types
+template <class _Tp>
+struct __libcpp_complex_overload_traits<_Tp, false, true>
{
- return __re;
-}
+ typedef _Tp _ValueType;
+ typedef complex<_Tp> _ComplexType;
+};
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-double
-real(double __re)
-{
- return __re;
-}
+// real
template<class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-typename enable_if
-<
- is_integral<_Tp>::value,
- double
->::type
-real(_Tp __re)
+_Tp
+real(const complex<_Tp>& __c)
{
- return __re;
+ return __c.real();
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-float
-real(float __re)
+typename __libcpp_complex_overload_traits<_Tp>::_ValueType
+real(_Tp __re)
{
return __re;
}
@@ -848,35 +841,10 @@ imag(const complex<_Tp>& __c)
return __c.imag();
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-long double
-imag(long double __re)
-{
- return 0;
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-double
-imag(double __re)
-{
- return 0;
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-typename enable_if
-<
- is_integral<_Tp>::value,
- double
->::type
-imag(_Tp __re)
-{
- return 0;
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-float
-imag(float __re)
+typename __libcpp_complex_overload_traits<_Tp>::_ValueType
+imag(_Tp)
{
return 0;
}
@@ -901,25 +869,22 @@ arg(const complex<_Tp>& __c)
return atan2(__c.imag(), __c.real());
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-long double
-arg(long double __re)
+typename enable_if<
+ is_same<_Tp, long double>::value,
+ long double
+>::type
+arg(_Tp __re)
{
return atan2l(0.L, __re);
}
-inline _LIBCPP_INLINE_VISIBILITY
-double
-arg(double __re)
-{
- return atan2(0., __re);
-}
-
template<class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- is_integral<_Tp>::value,
+ is_integral<_Tp>::value || is_same<_Tp, double>::value,
double
>::type
arg(_Tp __re)
@@ -927,9 +892,13 @@ arg(_Tp __re)
return atan2(0., __re);
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-float
-arg(float __re)
+typename enable_if<
+ is_same<_Tp, float>::value,
+ float
+>::type
+arg(_Tp __re)
{
return atan2f(0.F, __re);
}
@@ -941,44 +910,20 @@ inline _LIBCPP_INLINE_VISIBILITY
_Tp
norm(const complex<_Tp>& __c)
{
- if (isinf(__c.real()))
+ if (__libcpp_isinf(__c.real()))
return abs(__c.real());
- if (isinf(__c.imag()))
+ if (__libcpp_isinf(__c.imag()))
return abs(__c.imag());
return __c.real() * __c.real() + __c.imag() * __c.imag();
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-long double
-norm(long double __re)
-{
- return __re * __re;
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-double
-norm(double __re)
-{
- return __re * __re;
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value,
- double
->::type
+typename __libcpp_complex_overload_traits<_Tp>::_ValueType
norm(_Tp __re)
{
- return (double)__re * __re;
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-float
-norm(float __re)
-{
- return __re * __re;
+ typedef typename __libcpp_complex_overload_traits<_Tp>::_ValueType _ValueType;
+ return static_cast<_ValueType>(__re) * __re;
}
// conj
@@ -991,38 +936,16 @@ conj(const complex<_Tp>& __c)
return complex<_Tp>(__c.real(), -__c.imag());
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-complex<long double>
-conj(long double __re)
-{
- return complex<long double>(__re);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-complex<double>
-conj(double __re)
-{
- return complex<double>(__re);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value,
- complex<double>
->::type
+typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
conj(_Tp __re)
{
- return complex<double>(__re);
+ typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
+ return _ComplexType(__re);
}
-inline _LIBCPP_INLINE_VISIBILITY
-complex<float>
-conj(float __re)
-{
- return complex<float>(__re);
-}
+
// proj
@@ -1032,48 +955,36 @@ complex<_Tp>
proj(const complex<_Tp>& __c)
{
std::complex<_Tp> __r = __c;
- if (isinf(__c.real()) || isinf(__c.imag()))
+ if (__libcpp_isinf(__c.real()) || __libcpp_isinf(__c.imag()))
__r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
return __r;
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-complex<long double>
-proj(long double __re)
-{
- if (isinf(__re))
- __re = abs(__re);
- return complex<long double>(__re);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-complex<double>
-proj(double __re)
+typename enable_if
+<
+ is_floating_point<_Tp>::value,
+ typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
+>::type
+proj(_Tp __re)
{
- if (isinf(__re))
+ if (__libcpp_isinf(__re))
__re = abs(__re);
- return complex<double>(__re);
+ return complex<_Tp>(__re);
}
-template<class _Tp>
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
is_integral<_Tp>::value,
- complex<double>
+ typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
>::type
proj(_Tp __re)
{
- return complex<double>(__re);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-complex<float>
-proj(float __re)
-{
- if (isinf(__re))
- __re = abs(__re);
- return complex<float>(__re);
+ typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
+ return _ComplexType(__re);
}
// polar
@@ -1082,25 +993,25 @@ template<class _Tp>
complex<_Tp>
polar(const _Tp& __rho, const _Tp& __theta = _Tp(0))
{
- if (isnan(__rho) || signbit(__rho))
+ if (__libcpp_isnan(__rho) || signbit(__rho))
return complex<_Tp>(_Tp(NAN), _Tp(NAN));
- if (isnan(__theta))
+ if (__libcpp_isnan(__theta))
{
- if (isinf(__rho))
+ if (__libcpp_isinf(__rho))
return complex<_Tp>(__rho, __theta);
return complex<_Tp>(__theta, __theta);
}
- if (isinf(__theta))
+ if (__libcpp_isinf(__theta))
{
- if (isinf(__rho))
+ if (__libcpp_isinf(__rho))
return complex<_Tp>(__rho, _Tp(NAN));
return complex<_Tp>(_Tp(NAN), _Tp(NAN));
}
_Tp __x = __rho * cos(__theta);
- if (isnan(__x))
+ if (__libcpp_isnan(__x))
__x = 0;
_Tp __y = __rho * sin(__theta);
- if (isnan(__y))
+ if (__libcpp_isnan(__y))
__y = 0;
return complex<_Tp>(__x, __y);
}
@@ -1131,13 +1042,13 @@ template<class _Tp>
complex<_Tp>
sqrt(const complex<_Tp>& __x)
{
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(_Tp(INFINITY), __x.imag());
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
if (__x.real() > _Tp(0))
- return complex<_Tp>(__x.real(), isnan(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.imag()));
- return complex<_Tp>(isnan(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.imag()));
+ return complex<_Tp>(__x.real(), __libcpp_isnan(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.imag()));
+ return complex<_Tp>(__libcpp_isnan(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.imag()));
}
return polar(sqrt(abs(__x)), arg(__x) / _Tp(2));
}
@@ -1149,21 +1060,21 @@ complex<_Tp>
exp(const complex<_Tp>& __x)
{
_Tp __i = __x.imag();
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
if (__x.real() < _Tp(0))
{
- if (!isfinite(__i))
+ if (!__libcpp_isfinite(__i))
__i = _Tp(1);
}
- else if (__i == 0 || !isfinite(__i))
+ else if (__i == 0 || !__libcpp_isfinite(__i))
{
- if (isinf(__i))
+ if (__libcpp_isinf(__i))
__i = _Tp(NAN);
return complex<_Tp>(__x.real(), __i);
}
}
- else if (isnan(__x.real()) && __x.imag() == 0)
+ else if (__libcpp_isnan(__x.real()) && __x.imag() == 0)
return __x;
_Tp __e = exp(__x.real());
return complex<_Tp>(__e * cos(__i), __e * sin(__i));
@@ -1221,23 +1132,23 @@ complex<_Tp>
asinh(const complex<_Tp>& __x)
{
const _Tp __pi(atan2(+0., -0.));
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
- if (isnan(__x.imag()))
+ if (__libcpp_isnan(__x.imag()))
return __x;
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
}
- if (isnan(__x.real()))
+ if (__libcpp_isnan(__x.real()))
{
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(__x.imag(), __x.real());
if (__x.imag() == 0)
return __x;
return complex<_Tp>(__x.real(), __x.real());
}
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) + _Tp(1)));
return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
@@ -1250,11 +1161,11 @@ complex<_Tp>
acosh(const complex<_Tp>& __x)
{
const _Tp __pi(atan2(+0., -0.));
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
- if (isnan(__x.imag()))
+ if (__libcpp_isnan(__x.imag()))
return complex<_Tp>(abs(__x.real()), __x.imag());
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
{
if (__x.real() > 0)
return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
@@ -1265,13 +1176,13 @@ acosh(const complex<_Tp>& __x)
return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
}
- if (isnan(__x.real()))
+ if (__libcpp_isnan(__x.real()))
{
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(abs(__x.imag()), __x.real());
return complex<_Tp>(__x.real(), __x.real());
}
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag()));
complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) - _Tp(1)));
return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
@@ -1284,21 +1195,21 @@ complex<_Tp>
atanh(const complex<_Tp>& __x)
{
const _Tp __pi(atan2(+0., -0.));
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
{
return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
}
- if (isnan(__x.imag()))
+ if (__libcpp_isnan(__x.imag()))
{
- if (isinf(__x.real()) || __x.real() == 0)
+ if (__libcpp_isinf(__x.real()) || __x.real() == 0)
return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
return complex<_Tp>(__x.imag(), __x.imag());
}
- if (isnan(__x.real()))
+ if (__libcpp_isnan(__x.real()))
{
return complex<_Tp>(__x.real(), __x.real());
}
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
}
@@ -1316,11 +1227,11 @@ template<class _Tp>
complex<_Tp>
sinh(const complex<_Tp>& __x)
{
- if (isinf(__x.real()) && !isfinite(__x.imag()))
+ if (__libcpp_isinf(__x.real()) && !__libcpp_isfinite(__x.imag()))
return complex<_Tp>(__x.real(), _Tp(NAN));
- if (__x.real() == 0 && !isfinite(__x.imag()))
+ if (__x.real() == 0 && !__libcpp_isfinite(__x.imag()))
return complex<_Tp>(__x.real(), _Tp(NAN));
- if (__x.imag() == 0 && !isfinite(__x.real()))
+ if (__x.imag() == 0 && !__libcpp_isfinite(__x.real()))
return __x;
return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
}
@@ -1331,13 +1242,13 @@ template<class _Tp>
complex<_Tp>
cosh(const complex<_Tp>& __x)
{
- if (isinf(__x.real()) && !isfinite(__x.imag()))
+ if (__libcpp_isinf(__x.real()) && !__libcpp_isfinite(__x.imag()))
return complex<_Tp>(abs(__x.real()), _Tp(NAN));
- if (__x.real() == 0 && !isfinite(__x.imag()))
+ if (__x.real() == 0 && !__libcpp_isfinite(__x.imag()))
return complex<_Tp>(_Tp(NAN), __x.real());
if (__x.real() == 0 && __x.imag() == 0)
return complex<_Tp>(_Tp(1), __x.imag());
- if (__x.imag() == 0 && !isfinite(__x.real()))
+ if (__x.imag() == 0 && !__libcpp_isfinite(__x.real()))
return complex<_Tp>(abs(__x.real()), __x.imag());
return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
}
@@ -1348,19 +1259,19 @@ template<class _Tp>
complex<_Tp>
tanh(const complex<_Tp>& __x)
{
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
- if (!isfinite(__x.imag()))
+ if (!__libcpp_isfinite(__x.imag()))
return complex<_Tp>(_Tp(1), _Tp(0));
return complex<_Tp>(_Tp(1), copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
}
- if (isnan(__x.real()) && __x.imag() == 0)
+ if (__libcpp_isnan(__x.real()) && __x.imag() == 0)
return __x;
_Tp __2r(_Tp(2) * __x.real());
_Tp __2i(_Tp(2) * __x.imag());
_Tp __d(cosh(__2r) + cos(__2i));
_Tp __2rsh(sinh(__2r));
- if (isinf(__2rsh) && isinf(__d))
+ if (__libcpp_isinf(__2rsh) && __libcpp_isinf(__d))
return complex<_Tp>(__2rsh > _Tp(0) ? _Tp(1) : _Tp(-1),
__2i > _Tp(0) ? _Tp(0) : _Tp(-0.));
return complex<_Tp>(__2rsh/__d, sin(__2i)/__d);
@@ -1383,11 +1294,11 @@ complex<_Tp>
acos(const complex<_Tp>& __x)
{
const _Tp __pi(atan2(+0., -0.));
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
- if (isnan(__x.imag()))
+ if (__libcpp_isnan(__x.imag()))
return complex<_Tp>(__x.imag(), __x.real());
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
{
if (__x.real() < _Tp(0))
return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
@@ -1397,13 +1308,13 @@ acos(const complex<_Tp>& __x)
return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
}
- if (isnan(__x.real()))
+ if (__libcpp_isnan(__x.real()))
{
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(__x.real(), -__x.imag());
return complex<_Tp>(__x.real(), __x.real());
}
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(__pi/_Tp(2), -__x.imag());
if (__x.real() == 0 && (__x.imag() == 0 || isnan(__x.imag())))
return complex<_Tp>(__pi/_Tp(2), -__x.imag());
diff --git a/include/cstdio b/include/cstdio
index 50fdd3457426..35941ce35156 100644
--- a/include/cstdio
+++ b/include/cstdio
@@ -98,6 +98,9 @@ void perror(const char* s);
#include <__config>
#include <stdio.h>
+#if defined(_LIBCPP_MSVCRT)
+#include <crtversion.h>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -118,11 +121,9 @@ using ::fscanf;
using ::snprintf;
using ::sprintf;
using ::sscanf;
-#ifndef _LIBCPP_MSVCRT
using ::vfprintf;
using ::vfscanf;
using ::vsscanf;
-#endif // _LIBCPP_MSVCRT
using ::vsnprintf;
using ::vsprintf;
using ::fgetc;
@@ -155,7 +156,8 @@ using ::tmpnam;
#ifndef _LIBCPP_HAS_NO_STDIN
using ::getchar;
-#if _LIBCPP_STD_VER <= 11
+#if _LIBCPP_STD_VER <= 11 && \
+ (!defined(_VC_CRT_MAJOR_VERSION) || _VC_CRT_MAJOR_VERSION < 14)
using ::gets;
#endif
using ::scanf;
diff --git a/include/cstdlib b/include/cstdlib
index 10ed231078d8..2ca25ed56ca6 100644
--- a/include/cstdlib
+++ b/include/cstdlib
@@ -89,6 +89,12 @@ void *aligned_alloc(size_t alignment, size_t size); // C11
#pragma GCC system_header
#endif
+#ifdef __GNUC__
+#define _LIBCPP_UNREACHABLE() __builtin_unreachable()
+#else
+#define _LIBCPP_UNREACHABLE() _VSTD::abort()
+#endif
+
_LIBCPP_BEGIN_NAMESPACE_STD
using ::size_t;
@@ -138,11 +144,9 @@ using ::ldiv;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
using ::lldiv;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
using ::mblen;
using ::mbtowc;
using ::wctomb;
-#endif
using ::mbstowcs;
using ::wcstombs;
#ifdef _LIBCPP_HAS_QUICK_EXIT
diff --git a/include/cwchar b/include/cwchar
index 52dde9e18021..d268e8bbd393 100644
--- a/include/cwchar
+++ b/include/cwchar
@@ -123,11 +123,9 @@ using ::fwscanf;
using ::swprintf;
using ::vfwprintf;
using ::vswprintf;
-#ifndef _LIBCPP_MSVCRT
using ::swscanf;
using ::vfwscanf;
using ::vswscanf;
-#endif // _LIBCPP_MSVCRT
using ::fgetwc;
using ::fgetws;
using ::fputwc;
@@ -137,10 +135,8 @@ using ::getwc;
using ::putwc;
using ::ungetwc;
using ::wcstod;
-#ifndef _LIBCPP_MSVCRT
using ::wcstof;
using ::wcstold;
-#endif // _LIBCPP_MSVCRT
using ::wcstol;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
using ::wcstoll;
@@ -182,9 +178,7 @@ using ::wcsrtombs;
#ifndef _LIBCPP_HAS_NO_STDIN
using ::getwchar;
-#ifndef _LIBCPP_MSVCRT
using ::vwscanf;
-#endif // _LIBCPP_MSVCRT
using ::wscanf;
#endif
diff --git a/include/deque b/include/deque
index 57650427645c..ed62edd3b3cd 100644
--- a/include/deque
+++ b/include/deque
@@ -110,8 +110,8 @@ public:
void push_front(value_type&& v);
void push_back(const value_type& v);
void push_back(value_type&& v);
- template <class... Args> void emplace_front(Args&&... args);
- template <class... Args> void emplace_back(Args&&... args);
+ template <class... Args> reference emplace_front(Args&&... args);
+ template <class... Args> reference emplace_back(Args&&... args);
template <class... Args> iterator emplace(const_iterator p, Args&&... args);
iterator insert(const_iterator p, const value_type& v);
iterator insert(const_iterator p, value_type&& v);
@@ -895,26 +895,22 @@ template <bool>
class __deque_base_common
{
protected:
- void __throw_length_error() const;
- void __throw_out_of_range() const;
+ _LIBCPP_NORETURN void __throw_length_error() const;
+ _LIBCPP_NORETURN void __throw_out_of_range() const;
};
template <bool __b>
void
__deque_base_common<__b>::__throw_length_error() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw length_error("deque");
-#endif
+ _VSTD::__throw_length_error("deque");
}
template <bool __b>
void
__deque_base_common<__b>::__throw_out_of_range() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("deque");
-#endif
+ _VSTD::__throw_out_of_range("deque");
}
template <class _Tp, class _Allocator>
@@ -1314,7 +1310,9 @@ public:
size_type size() const _NOEXCEPT {return __base::size();}
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
- {return __alloc_traits::max_size(__base::__alloc());}
+ {return std::min<size_type>(
+ __alloc_traits::max_size(__base::__alloc()),
+ numeric_limits<difference_type>::max());}
void resize(size_type __n);
void resize(size_type __n, const value_type& __v);
void shrink_to_fit() _NOEXCEPT;
@@ -1344,8 +1342,8 @@ public:
void push_back(const value_type& __v);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS
- template <class... _Args> void emplace_front(_Args&&... __args);
- template <class... _Args> void emplace_back(_Args&&... __args);
+ template <class... _Args> reference emplace_front(_Args&&... __args);
+ template <class... _Args> reference emplace_back(_Args&&... __args);
template <class... _Args> iterator emplace(const_iterator __p, _Args&&... __args);
#endif // _LIBCPP_HAS_NO_VARIADICS
void push_front(value_type&& __v);
@@ -1824,15 +1822,17 @@ deque<_Tp, _Allocator>::push_back(value_type&& __v)
template <class _Tp, class _Allocator>
template <class... _Args>
-void
+typename deque<_Tp, _Allocator>::reference
deque<_Tp, _Allocator>::emplace_back(_Args&&... __args)
{
allocator_type& __a = __base::__alloc();
if (__back_spare() == 0)
__add_back_capacity();
// __back_spare() >= 1
- __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
+ __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()),
+ _VSTD::forward<_Args>(__args)...);
++__base::size();
+ return *--__base::end();
}
#endif // _LIBCPP_HAS_NO_VARIADICS
@@ -1870,7 +1870,7 @@ deque<_Tp, _Allocator>::push_front(value_type&& __v)
template <class _Tp, class _Allocator>
template <class... _Args>
-void
+typename deque<_Tp, _Allocator>::reference
deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
{
allocator_type& __a = __base::__alloc();
@@ -1880,6 +1880,7 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
__alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
--__base::__start_;
++__base::size();
+ return *__base::begin();
}
#endif // _LIBCPP_HAS_NO_VARIADICS
@@ -2734,7 +2735,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
difference_type __pos = __f - __b;
iterator __p = __b + __pos;
allocator_type& __a = __base::__alloc();
- if (__pos <= (__base::size() - 1) / 2)
+ if (static_cast<size_t>(__pos) <= (__base::size() - 1) / 2)
{ // erase from front
_VSTD::move_backward(__b, __p, _VSTD::next(__p));
__alloc_traits::destroy(__a, _VSTD::addressof(*__b));
@@ -2772,7 +2773,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l)
if (__n > 0)
{
allocator_type& __a = __base::__alloc();
- if (__pos <= (__base::size() - __n) / 2)
+ if (static_cast<size_t>(__pos) <= (__base::size() - __n) / 2)
{ // erase from front
iterator __i = _VSTD::move_backward(__b, __p, __p + __n);
for (; __b != __i; ++__b)
diff --git a/include/exception b/include/exception
index 186d379f08f5..98e1f37f919e 100644
--- a/include/exception
+++ b/include/exception
@@ -79,11 +79,8 @@ template <class E> void rethrow_if_nested(const E& e);
#include <__config>
#include <cstddef>
-#include <type_traits>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
-#include <cstdio>
#include <cstdlib>
-#endif
+#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -165,7 +162,10 @@ make_exception_ptr(_Ep __e) _NOEXCEPT
{
return current_exception();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#else
+ ((void)__e);
+ _VSTD::abort();
+#endif
}
// nested_exception
@@ -209,6 +209,9 @@ throw_with_nested (_Tp& __t, typename enable_if<
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw __nested<typename remove_reference<_Tp>::type>(_VSTD::forward<_Tp>(__t));
+#else
+ ((void)__t);
+ // FIXME: Make this abort.
#endif
}
@@ -229,6 +232,9 @@ throw_with_nested (_Tp& __t, typename enable_if<
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw _VSTD::forward<_Tp>(__t);
+#else
+ ((void)__t);
+ // FIXME: Make this abort
#endif
}
@@ -255,19 +261,4 @@ rethrow_if_nested(const _Ep&, typename enable_if<
} // std
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Exception>
-_LIBCPP_INLINE_VISIBILITY
-inline void __libcpp_throw(_Exception const& __e) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw __e;
-#else
- _VSTD::fprintf(stderr, "%s\n", __e.what());
- _VSTD::abort();
-#endif
-}
-
-_LIBCPP_END_NAMESPACE_STD
-
#endif // _LIBCPP_EXCEPTION
diff --git a/include/experimental/algorithm b/include/experimental/algorithm
index 3902111c54ea..392ca1fa41c0 100644
--- a/include/experimental/algorithm
+++ b/include/experimental/algorithm
@@ -58,61 +58,11 @@ _ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searc
template <class _PopulationIterator, class _SampleIterator, class _Distance,
class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
-_SampleIterator __sample(_PopulationIterator __first,
- _PopulationIterator __last, _SampleIterator __out,
- _Distance __n,
- _UniformRandomNumberGenerator &&__g,
- input_iterator_tag) {
-
- _Distance __k = 0;
- for (; __first != __last && __k < __n; ++__first, (void)++__k)
- __out[__k] = *__first;
- _Distance __sz = __k;
- for (; __first != __last; ++__first, (void)++__k) {
- _Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, __k)(__g);
- if (__r < __sz)
- __out[__r] = *__first;
- }
- return __out + _VSTD::min(__n, __k);
-}
-
-template <class _PopulationIterator, class _SampleIterator, class _Distance,
- class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
-_SampleIterator __sample(_PopulationIterator __first,
- _PopulationIterator __last, _SampleIterator __out,
- _Distance __n,
- _UniformRandomNumberGenerator &&__g,
- forward_iterator_tag) {
- _Distance __unsampled_sz = _VSTD::distance(__first, __last);
- for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) {
- _Distance __r =
- _VSTD::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g);
- if (__r < __n) {
- *__out++ = *__first;
- --__n;
- }
- }
- return __out;
-}
-
-template <class _PopulationIterator, class _SampleIterator, class _Distance,
- class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
-_SampleIterator sample(_PopulationIterator __first,
- _PopulationIterator __last, _SampleIterator __out,
- _Distance __n, _UniformRandomNumberGenerator &&__g) {
- typedef typename iterator_traits<_PopulationIterator>::iterator_category
- _PopCategory;
- typedef typename iterator_traits<_PopulationIterator>::difference_type
- _Difference;
- typedef typename common_type<_Distance, _Difference>::type _CommonType;
- _LIBCPP_ASSERT(__n >= 0, "N must be a positive number.");
- return _VSTD_LFTS::__sample(
- __first, __last, __out, _CommonType(__n),
- _VSTD::forward<_UniformRandomNumberGenerator>(__g),
- _PopCategory());
+inline _LIBCPP_INLINE_VISIBILITY
+_SampleIterator sample(_PopulationIterator __first, _PopulationIterator __last,
+ _SampleIterator __out, _Distance __n,
+ _UniformRandomNumberGenerator &&__g) {
+ return _VSTD::__sample(__first, __last, __out, __n, __g);
}
_LIBCPP_END_NAMESPACE_LFTS
diff --git a/include/experimental/any b/include/experimental/any
index 4c732496c52b..9ecafad637df 100644
--- a/include/experimental/any
+++ b/include/experimental/any
@@ -82,7 +82,6 @@ inline namespace fundamentals_v1 {
#include <typeinfo>
#include <type_traits>
#include <cstdlib>
-#include <cassert>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -98,13 +97,13 @@ public:
#if _LIBCPP_STD_VER > 11 // C++ > 11
-_LIBCPP_NORETURN _LIBCPP_INLINE_VISIBILITY
-inline void __throw_bad_any_cast()
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_any_cast()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw bad_any_cast();
#else
- assert(!"bad_any_cast");
+ _VSTD::abort();
#endif
}
diff --git a/include/experimental/dynarray b/include/experimental/dynarray
index 4a06908e11b1..8ef45713ae4d 100644
--- a/include/experimental/dynarray
+++ b/include/experimental/dynarray
@@ -106,10 +106,6 @@ public:
#include <__undef___deallocate>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
- #include <cassert>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
@@ -142,13 +138,8 @@ private:
static inline _LIBCPP_INLINE_VISIBILITY value_type* __allocate ( size_t count )
{
if ( numeric_limits<size_t>::max() / sizeof (value_type) <= count )
- {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_array_length();
-#else
- assert(!"dynarray::allocation");
-#endif
- }
+ __throw_bad_array_length();
+
return static_cast<value_type *> (_VSTD::__allocate (sizeof(value_type) * count));
}
@@ -283,13 +274,8 @@ typename dynarray<_Tp>::reference
dynarray<_Tp>::at(size_type __n)
{
if (__n >= __size_)
- {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("dynarray::at");
-#else
- assert(!"dynarray::at out_of_range");
-#endif
- }
+ __throw_out_of_range("dynarray::at");
+
return data()[__n];
}
@@ -299,13 +285,8 @@ typename dynarray<_Tp>::const_reference
dynarray<_Tp>::at(size_type __n) const
{
if (__n >= __size_)
- {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("dynarray::at");
-#else
- assert(!"dynarray::at out_of_range");
-#endif
- }
+ __throw_out_of_range("dynarray::at");
+
return data()[__n];
}
diff --git a/include/experimental/filesystem b/include/experimental/filesystem
index 7de93fdf8f15..739918bb2cbe 100644
--- a/include/experimental/filesystem
+++ b/include/experimental/filesystem
@@ -228,7 +228,7 @@
#include <system_error>
#include <utility>
#include <iomanip> // for quoted
-#include <experimental/string_view>
+#include <string_view>
#include <__debug>
@@ -249,7 +249,7 @@ struct _LIBCPP_TYPE_VIS space_info
uintmax_t available;
};
-enum class _LIBCPP_TYPE_VIS file_type : signed char
+enum class _LIBCPP_ENUM_VIS file_type : signed char
{
none = 0,
not_found = -1,
@@ -263,7 +263,7 @@ enum class _LIBCPP_TYPE_VIS file_type : signed char
unknown = 8
};
-enum class _LIBCPP_TYPE_VIS perms : unsigned
+enum class _LIBCPP_ENUM_VIS perms : unsigned
{
none = 0,
@@ -323,7 +323,7 @@ _LIBCPP_INLINE_VISIBILITY
inline perms& operator^=(perms& _LHS, perms _RHS)
{ return _LHS = _LHS ^ _RHS; }
-enum class _LIBCPP_TYPE_VIS copy_options : unsigned short
+enum class _LIBCPP_ENUM_VIS copy_options : unsigned short
{
none = 0,
skip_existing = 1,
@@ -367,7 +367,7 @@ inline copy_options& operator^=(copy_options& _LHS, copy_options _RHS)
{ return _LHS = _LHS ^ _RHS; }
-enum class directory_options : unsigned char
+enum class _LIBCPP_ENUM_VIS directory_options : unsigned char
{
none = 0,
follow_directory_symlink = 1,
@@ -453,6 +453,9 @@ class _LIBCPP_TYPE_VIS directory_entry;
template <class _Tp> struct __can_convert_char {
static const bool value = false;
};
+template <class _Tp> struct __can_convert_char<const _Tp>
+ : public __can_convert_char<_Tp> {
+};
template <> struct __can_convert_char<char> {
static const bool value = true;
using __char_type = char;
@@ -498,6 +501,21 @@ struct __is_pathable_string<basic_string<_ECharT, _Traits, _Alloc>,
}
};
+
+template <class _ECharT, class _Traits>
+struct __is_pathable_string<basic_string_view<_ECharT, _Traits>,
+ _Void<typename __can_convert_char<_ECharT>::__char_type>>
+: public __can_convert_char<_ECharT>
+{
+ using _Str = basic_string_view<_ECharT, _Traits>;
+ using _Base = __can_convert_char<_ECharT>;
+ static _ECharT const* __range_begin(_Str const& __s) { return __s.data(); }
+ static _ECharT const* __range_end(_Str const& __s) { return __s.data() + __s.length(); }
+ static _ECharT __first_or_null(_Str const& __s) {
+ return __s.empty() ? _ECharT{} : __s[0];
+ }
+};
+
template <class _Source,
class _DS = typename decay<_Source>::type,
class _UnqualPtrType = typename remove_const<
@@ -605,13 +623,23 @@ struct _PathCVT {
template <>
struct _PathCVT<char> {
+
template <class _Iter>
- static void __append_range(string& __dest, _Iter __b, _Iter __e) {
+ static typename enable_if<
+ __is_exactly_input_iterator<_Iter>::value
+ >::type __append_range(string& __dest, _Iter __b, _Iter __e) {
for (; __b != __e; ++__b)
__dest.push_back(*__b);
}
template <class _Iter>
+ static typename enable_if<
+ __is_forward_iterator<_Iter>::value
+ >::type __append_range(string& __dest, _Iter __b, _Iter __e) {
+ __dest.__append_forward_unsafe(__b, __e);
+ }
+
+ template <class _Iter>
static void __append_range(string& __dest, _Iter __b, _NullSentinal) {
const char __sentinal = char{};
for (; *__b != __sentinal; ++__b)
@@ -622,7 +650,8 @@ struct _PathCVT<char> {
static void __append_source(string& __dest, _Source const& __s)
{
using _Traits = __is_pathable<_Source>;
- __append_range(__dest, _Traits::__range_begin(__s), _Traits::__range_end(__s));
+ __append_range(__dest, _Traits::__range_begin(__s),
+ _Traits::__range_end(__s));
}
};
@@ -642,6 +671,7 @@ class _LIBCPP_TYPE_VIS path
public:
typedef char value_type;
typedef basic_string<value_type> string_type;
+ typedef _VSTD::string_view __string_view;
static _LIBCPP_CONSTEXPR value_type preferred_separator = '/';
// constructors and destructor
@@ -740,6 +770,8 @@ private:
public:
// appends
path& operator/=(const path& __p) {
+ _LIBCPP_ASSERT(!__p.has_root_name(),
+ "cannot append to a path with a root name");
__append_sep_if_needed(__p.empty() ? char{} : __p.__pn_[0]);
__pn_ += __p.native();
return *this;
@@ -788,6 +820,12 @@ public:
}
_LIBCPP_INLINE_VISIBILITY
+ path& operator+=(__string_view __x) {
+ __pn_ += __x;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
path& operator+=(const value_type* __x) {
__pn_ += __x;
return *this;
@@ -799,7 +837,6 @@ public:
return *this;
}
-
template <class _ECharT>
typename enable_if<__can_convert_char<_ECharT>::value, path&>::type
operator+=(_ECharT __x)
@@ -837,7 +874,15 @@ public:
}
path& make_preferred() { return *this; }
- path& remove_filename() { return *this = parent_path(); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ path& remove_filename() {
+ if (__pn_.size() == __root_path_raw().size())
+ clear();
+ else
+ __pn_ = __parent_path();
+ return *this;
+ }
path& replace_filename(const path& __replacement) {
remove_filename();
@@ -896,37 +941,39 @@ public:
std::u32string generic_u32string() const { return string<char32_t>(); }
private:
- _LIBCPP_FUNC_VIS int __compare(const value_type*) const;
- _LIBCPP_FUNC_VIS string_view __root_name() const;
- _LIBCPP_FUNC_VIS string_view __root_directory() const;
- _LIBCPP_FUNC_VIS string_view __relative_path() const;
- _LIBCPP_FUNC_VIS string_view __parent_path() const;
- _LIBCPP_FUNC_VIS string_view __filename() const;
- _LIBCPP_FUNC_VIS string_view __stem() const;
- _LIBCPP_FUNC_VIS string_view __extension() const;
+ _LIBCPP_FUNC_VIS int __compare(__string_view) const;
+ _LIBCPP_FUNC_VIS __string_view __root_name() const;
+ _LIBCPP_FUNC_VIS __string_view __root_directory() const;
+ _LIBCPP_FUNC_VIS __string_view __root_path_raw() const;
+ _LIBCPP_FUNC_VIS __string_view __relative_path() const;
+ _LIBCPP_FUNC_VIS __string_view __parent_path() const;
+ _LIBCPP_FUNC_VIS __string_view __filename() const;
+ _LIBCPP_FUNC_VIS __string_view __stem() const;
+ _LIBCPP_FUNC_VIS __string_view __extension() const;
public:
// compare
- _LIBCPP_INLINE_VISIBILITY int compare(const path& __p) const _NOEXCEPT { return __compare(__p.c_str());}
- _LIBCPP_INLINE_VISIBILITY int compare(const string_type& __s) const { return __compare(__s.c_str()); }
+ _LIBCPP_INLINE_VISIBILITY int compare(const path& __p) const _NOEXCEPT { return __compare(__p.__pn_);}
+ _LIBCPP_INLINE_VISIBILITY int compare(const string_type& __s) const { return __compare(__s); }
+ _LIBCPP_INLINE_VISIBILITY int compare(__string_view __s) const { return __compare(__s); }
_LIBCPP_INLINE_VISIBILITY int compare(const value_type* __s) const { return __compare(__s); }
// decomposition
- _LIBCPP_INLINE_VISIBILITY path root_name() const { return __root_name().to_string(); }
- _LIBCPP_INLINE_VISIBILITY path root_directory() const { return __root_directory().to_string(); }
- _LIBCPP_INLINE_VISIBILITY path root_path() const { return root_name().append(__root_directory().to_string()); }
- _LIBCPP_INLINE_VISIBILITY path relative_path() const { return __relative_path().to_string(); }
- _LIBCPP_INLINE_VISIBILITY path parent_path() const { return __parent_path().to_string(); }
- _LIBCPP_INLINE_VISIBILITY path filename() const { return __filename().to_string(); }
- _LIBCPP_INLINE_VISIBILITY path stem() const { return __stem().to_string();}
- _LIBCPP_INLINE_VISIBILITY path extension() const { return __extension().to_string(); }
+ _LIBCPP_INLINE_VISIBILITY path root_name() const { return string_type(__root_name()); }
+ _LIBCPP_INLINE_VISIBILITY path root_directory() const { return string_type(__root_directory()); }
+ _LIBCPP_INLINE_VISIBILITY path root_path() const { return root_name().append(string_type(__root_directory())); }
+ _LIBCPP_INLINE_VISIBILITY path relative_path() const { return string_type(__relative_path()); }
+ _LIBCPP_INLINE_VISIBILITY path parent_path() const { return string_type(__parent_path()); }
+ _LIBCPP_INLINE_VISIBILITY path filename() const { return string_type(__filename()); }
+ _LIBCPP_INLINE_VISIBILITY path stem() const { return string_type(__stem());}
+ _LIBCPP_INLINE_VISIBILITY path extension() const { return string_type(__extension()); }
// query
_LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT { return __pn_.empty(); }
_LIBCPP_INLINE_VISIBILITY bool has_root_name() const { return !__root_name().empty(); }
_LIBCPP_INLINE_VISIBILITY bool has_root_directory() const { return !__root_directory().empty(); }
- _LIBCPP_INLINE_VISIBILITY bool has_root_path() const { return !(__root_name().empty() && __root_directory().empty()); }
+ _LIBCPP_INLINE_VISIBILITY bool has_root_path() const { return !__root_path_raw().empty(); }
_LIBCPP_INLINE_VISIBILITY bool has_relative_path() const { return !__relative_path().empty(); }
_LIBCPP_INLINE_VISIBILITY bool has_parent_path() const { return !__parent_path().empty(); }
_LIBCPP_INLINE_VISIBILITY bool has_filename() const { return !__filename().empty(); }
@@ -945,7 +992,7 @@ public:
private:
inline _LIBCPP_INLINE_VISIBILITY
- path& __assign_view(string_view const& __s) noexcept { __pn_ = __s.to_string(); return *this; }
+ path& __assign_view(__string_view const& __s) noexcept { __pn_ = string_type(__s); return *this; }
string_type __pn_;
};
@@ -1047,7 +1094,8 @@ public:
typedef const path& reference;
public:
_LIBCPP_INLINE_VISIBILITY
- iterator() : __elem_(), __path_ptr_(nullptr), __pos_(0) {}
+ iterator() : __stashed_elem_(), __path_ptr_(nullptr),
+ __entry_(), __state_(__singular) {}
iterator(const iterator&) = default;
~iterator() = default;
@@ -1056,16 +1104,20 @@ public:
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {
- return __elem_;
+ return __stashed_elem_;
}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const {
- return &__elem_;
+ return &__stashed_elem_;
}
_LIBCPP_INLINE_VISIBILITY
iterator& operator++() {
+ _LIBCPP_ASSERT(__state_ != __singular,
+ "attempting to increment a singular iterator");
+ _LIBCPP_ASSERT(__state_ != __at_end,
+ "attempting to increment the end iterator");
return __increment();
}
@@ -1078,6 +1130,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator& operator--() {
+ _LIBCPP_ASSERT(__state_ != __singular,
+ "attempting to decrement a singular iterator");
+ _LIBCPP_ASSERT(__entry_.data() != __path_ptr_->native().data(),
+ "attempting to decrement the begin iterator");
return __decrement();
}
@@ -1090,20 +1146,26 @@ public:
private:
friend class path;
+
+ static constexpr unsigned char __singular = 0;
+ static constexpr unsigned char __at_end = 6;
+
+ inline _LIBCPP_INLINE_VISIBILITY
friend bool operator==(const iterator&, const iterator&);
_LIBCPP_FUNC_VIS iterator& __increment();
_LIBCPP_FUNC_VIS iterator& __decrement();
- path __elem_;
+ path __stashed_elem_;
const path* __path_ptr_;
- size_t __pos_;
+ path::__string_view __entry_;
+ unsigned char __state_;
};
inline _LIBCPP_INLINE_VISIBILITY
bool operator==(const path::iterator& __lhs, const path::iterator& __rhs) {
return __lhs.__path_ptr_ == __rhs.__path_ptr_ &&
- __lhs.__pos_ == __rhs.__pos_;
+ __lhs.__entry_.data() == __rhs.__entry_.data();
}
inline _LIBCPP_INLINE_VISIBILITY
@@ -1154,6 +1216,21 @@ private:
shared_ptr<_Storage> __paths_;
};
+template <class... _Args>
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+#ifndef _LIBCPP_NO_EXCEPTIONS
+void __throw_filesystem_error(_Args && ...__args)
+{
+ throw filesystem_error(std::forward<_Args>(__args)...);
+}
+#else
+void __throw_filesystem_error(_Args&&...)
+{
+ _VSTD::abort();
+}
+#endif
+
+
// operational functions
_LIBCPP_FUNC_VIS
@@ -1865,6 +1942,7 @@ public:
{ return __increment(&__ec); }
private:
+ inline _LIBCPP_INLINE_VISIBILITY
friend bool operator==(const directory_iterator& __lhs,
const directory_iterator& __rhs) _NOEXCEPT;
@@ -2014,6 +2092,7 @@ private:
_LIBCPP_FUNC_VIS
void __pop(error_code* __ec=nullptr);
+ inline _LIBCPP_INLINE_VISIBILITY
friend bool operator==(const recursive_directory_iterator&,
const recursive_directory_iterator&) _NOEXCEPT;
@@ -2023,9 +2102,9 @@ private:
}; // class recursive_directory_iterator
-_LIBCPP_INLINE_VISIBILITY
-inline bool operator==(const recursive_directory_iterator& __lhs,
- const recursive_directory_iterator& __rhs) _NOEXCEPT
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator==(const recursive_directory_iterator& __lhs,
+ const recursive_directory_iterator& __rhs) _NOEXCEPT
{
return __lhs.__imp_ == __rhs.__imp_;
}
diff --git a/include/experimental/memory_resource b/include/experimental/memory_resource
index 9b345210ee5e..1a2cb10bbec5 100644
--- a/include/experimental/memory_resource
+++ b/include/experimental/memory_resource
@@ -182,9 +182,9 @@ public:
_LIBCPP_INLINE_VISIBILITY
_ValueType* allocate(size_t __n) {
if (__n > max_size()) {
- __libcpp_throw(length_error(
+ __throw_length_error(
"std::experimental::pmr::polymorphic_allocator<T>::allocate(size_t n)"
- " 'n' exceeds maximum supported size"));
+ " 'n' exceeds maximum supported size");
}
return static_cast<_ValueType*>(
__res_->allocate(__n * sizeof(_ValueType), alignof(_ValueType))
@@ -383,9 +383,9 @@ protected:
virtual void * do_allocate(size_t __bytes, size_t)
{
if (__bytes > __max_size()) {
- __libcpp_throw(length_error(
+ __throw_length_error(
"std::experimental::pmr::resource_adaptor<T>::do_allocate(size_t bytes, size_t align)"
- " 'bytes' exceeds maximum supported size"));
+ " 'bytes' exceeds maximum supported size");
}
size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign;
return __alloc_.allocate(__s);
diff --git a/include/experimental/numeric b/include/experimental/numeric
new file mode 100644
index 000000000000..32b19a466358
--- /dev/null
+++ b/include/experimental/numeric
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+//===--------------------------- numeric ----------------------------------===//
+//
+// 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_EXPERIMENTAL_NUMERIC
+#define _LIBCPP_EXPERIMENTAL_NUMERIC
+/*
+ experimental/numeric synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v2 {
+
+ // 13.1.2, Greatest common divisor
+ template<class M, class N>
+ constexpr common_type_t<M,N> gcd(M m, N n);
+
+ // 13.1.3, Least common multiple
+ template<class M, class N>
+ constexpr common_type_t<M,N> lcm(M m, N n);
+
+} // namespace fundamentals_v2
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <numeric>
+#include <type_traits> // is_integral
+#include <limits> // numeric_limits
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 11
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
+
+template <typename _Tp, bool _IsSigned = is_signed<_Tp>::value> struct __abs;
+
+template <typename _Tp>
+struct __abs<_Tp, true> {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(_Tp __t) const noexcept { return __t >= 0 ? __t : -__t; }
+};
+
+template <typename _Tp>
+struct __abs<_Tp, false> {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(_Tp __t) const noexcept { return __t; }
+};
+
+
+template<class _Tp>
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+_Tp __gcd(_Tp __m, _Tp __n)
+{
+ static_assert((!is_signed<_Tp>::value), "" );
+ return __n == 0 ? __m : __gcd<_Tp>(__n, __m % __n);
+}
+
+
+template<class _Tp, class _Up>
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+common_type_t<_Tp,_Up>
+gcd(_Tp __m, _Up __n)
+{
+ static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to gcd must be integer types");
+ using _Rp = common_type_t<_Tp,_Up>;
+ using _Wp = make_unsigned_t<_Rp>;
+ return static_cast<_Rp>(__gcd(static_cast<_Wp>(__abs<_Tp>()(__m)),
+ static_cast<_Wp>(__abs<_Up>()(__n))));
+}
+
+template<class _Tp, class _Up>
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+common_type_t<_Tp,_Up>
+lcm(_Tp __m, _Up __n)
+{
+ static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to lcm must be integer types");
+ if (__m == 0 || __n == 0)
+ return 0;
+
+ using _Rp = common_type_t<_Tp,_Up>;
+ _Rp __val1 = __abs<_Tp>()(__m) / gcd(__m,__n);
+ _Up __val2 = __abs<_Up>()(__n);
+ _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
+ return __val1 * __val2;
+}
+
+_LIBCPP_END_NAMESPACE_LFTS_V2
+
+#endif /* _LIBCPP_STD_VER > 11 */
+#endif /* _LIBCPP_EXPERIMENTAL_NUMERIC */
diff --git a/include/experimental/optional b/include/experimental/optional
index 3912438ec104..8dcda652319b 100644
--- a/include/experimental/optional
+++ b/include/experimental/optional
@@ -8,8 +8,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef _LIBCPP_OPTIONAL
-#define _LIBCPP_OPTIONAL
+#ifndef _LIBCPP_EXPERIMENTAL_OPTIONAL
+#define _LIBCPP_EXPERIMENTAL_OPTIONAL
/*
optional synopsis
@@ -211,7 +211,7 @@ protected:
: __engaged_(__x.__engaged_)
{
if (__engaged_)
- ::new(_VSTD::addressof(__val_)) value_type(__x.__val_);
+ ::new((void*)_VSTD::addressof(__val_)) value_type(__x.__val_);
}
_LIBCPP_INLINE_VISIBILITY
@@ -220,7 +220,7 @@ protected:
: __engaged_(__x.__engaged_)
{
if (__engaged_)
- ::new(_VSTD::addressof(__val_)) value_type(_VSTD::move(__x.__val_));
+ ::new((void*)_VSTD::addressof(__val_)) value_type(_VSTD::move(__x.__val_));
}
_LIBCPP_INLINE_VISIBILITY
@@ -262,7 +262,7 @@ protected:
: __engaged_(__x.__engaged_)
{
if (__engaged_)
- ::new(_VSTD::addressof(__val_)) value_type(__x.__val_);
+ ::new((void*)_VSTD::addressof(__val_)) value_type(__x.__val_);
}
_LIBCPP_INLINE_VISIBILITY
@@ -271,7 +271,7 @@ protected:
: __engaged_(__x.__engaged_)
{
if (__engaged_)
- ::new(_VSTD::addressof(__val_)) value_type(_VSTD::move(__x.__val_));
+ ::new((void*)_VSTD::addressof(__val_)) value_type(_VSTD::move(__x.__val_));
}
_LIBCPP_INLINE_VISIBILITY
@@ -368,7 +368,7 @@ public:
if (this->__engaged_)
this->__val_.~value_type();
else
- ::new(_VSTD::addressof(this->__val_)) value_type(__opt.__val_);
+ ::new((void*)_VSTD::addressof(this->__val_)) value_type(__opt.__val_);
this->__engaged_ = __opt.__engaged_;
}
return *this;
@@ -390,7 +390,8 @@ public:
if (this->__engaged_)
this->__val_.~value_type();
else
- ::new(_VSTD::addressof(this->__val_)) value_type(_VSTD::move(__opt.__val_));
+ ::new((void*)_VSTD::addressof(this->__val_))
+ value_type(_VSTD::move(__opt.__val_));
this->__engaged_ = __opt.__engaged_;
}
return *this;
@@ -412,7 +413,7 @@ public:
this->__val_ = _VSTD::forward<_Up>(__v);
else
{
- ::new(_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Up>(__v));
+ ::new((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Up>(__v));
this->__engaged_ = true;
}
return *this;
@@ -429,7 +430,8 @@ public:
emplace(_Args&&... __args)
{
*this = nullopt;
- ::new(_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
+ ::new((void*)_VSTD::addressof(this->__val_))
+ value_type(_VSTD::forward<_Args>(__args)...);
this->__engaged_ = true;
}
@@ -444,7 +446,8 @@ public:
emplace(initializer_list<_Up> __il, _Args&&... __args)
{
*this = nullopt;
- ::new(_VSTD::addressof(this->__val_)) value_type(__il, _VSTD::forward<_Args>(__args)...);
+ ::new((void*)_VSTD::addressof(this->__val_))
+ value_type(__il, _VSTD::forward<_Args>(__args)...);
this->__engaged_ = true;
}
@@ -464,12 +467,14 @@ public:
{
if (this->__engaged_)
{
- ::new(_VSTD::addressof(__opt.__val_)) value_type(_VSTD::move(this->__val_));
+ ::new((void*)_VSTD::addressof(__opt.__val_))
+ value_type(_VSTD::move(this->__val_));
this->__val_.~value_type();
}
else
{
- ::new(_VSTD::addressof(this->__val_)) value_type(_VSTD::move(__opt.__val_));
+ ::new((void*)_VSTD::addressof(this->__val_))
+ value_type(_VSTD::move(__opt.__val_));
__opt.__val_.~value_type();
}
swap(this->__engaged_, __opt.__engaged_);
@@ -482,7 +487,11 @@ public:
operator->() const
{
_LIBCPP_ASSERT(this->__engaged_, "optional operator-> called for disengaged value");
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+ return __builtin_addressof(this->__val_);
+#else
return __operator_arrow(__has_operator_addressof<value_type>{});
+#endif
}
_LIBCPP_INLINE_VISIBILITY
@@ -513,15 +522,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
constexpr explicit operator bool() const noexcept {return this->__engaged_;}
+ _LIBCPP_NORETURN _LIBCPP_INLINE_VISIBILITY
+ constexpr void __throw_bad_optional_access() const
+ {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_optional_access();
+#else
+ _VSTD::abort();
+#endif
+ }
+
_LIBCPP_INLINE_VISIBILITY
constexpr value_type const& value() const
{
if (!this->__engaged_)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_optional_access();
-#else
- assert(!"bad optional access");
-#endif
+ __throw_bad_optional_access();
return this->__val_;
}
@@ -529,11 +544,7 @@ public:
value_type& value()
{
if (!this->__engaged_)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_optional_access();
-#else
- assert(!"bad optional access");
-#endif
+ __throw_bad_optional_access();
return this->__val_;
}
@@ -710,7 +721,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
constexpr
bool
-operator<=(nullopt_t, const optional<_Tp>& __x) noexcept
+operator<=(nullopt_t, const optional<_Tp>&) noexcept
{
return true;
}
@@ -728,7 +739,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
constexpr
bool
-operator>(nullopt_t, const optional<_Tp>& __x) noexcept
+operator>(nullopt_t, const optional<_Tp>&) noexcept
{
return false;
}
@@ -899,4 +910,4 @@ _LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER > 11
-#endif // _LIBCPP_OPTIONAL
+#endif // _LIBCPP_EXPERIMENTAL_OPTIONAL
diff --git a/include/experimental/propagate_const b/include/experimental/propagate_const
index f267ba275c2f..e7f7e9fc6831 100644
--- a/include/experimental/propagate_const
+++ b/include/experimental/propagate_const
@@ -123,8 +123,14 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS_V2
template <class _Tp>
class propagate_const;
-template <class _Up> _LIBCPP_CONSTEXPR const _Up& get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
-template <class _Up> _LIBCPP_CONSTEXPR _Up& get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
+
+template <class _Up>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+const _Up& get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
+
+template <class _Up>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_Up& get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
template <class _Tp>
class propagate_const
@@ -462,14 +468,12 @@ _LIBCPP_CONSTEXPR void swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& _
}
template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR const _Tp& get_underlying(const propagate_const<_Tp>& __pt) _NOEXCEPT
{
return __pt.__t_;
}
template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR _Tp& get_underlying(propagate_const<_Tp>& __pt) _NOEXCEPT
{
return __pt.__t_;
diff --git a/include/experimental/string_view b/include/experimental/string_view
index 0a7239b4c0bb..a62fe6e95a10 100644
--- a/include/experimental/string_view
+++ b/include/experimental/string_view
@@ -281,7 +281,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
const_reference at(size_type __pos) const
{
return __pos >= size()
- ? (__libcpp_throw(out_of_range("string_view::at")), __data[0])
+ ? (__throw_out_of_range("string_view::at"), __data[0])
: __data[__pos];
}
@@ -352,7 +352,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const
{
if ( __pos > size())
- __libcpp_throw(out_of_range("string_view::copy"));
+ __throw_out_of_range("string_view::copy");
size_type __rlen = _VSTD::min( __n, size() - __pos );
_VSTD::copy_n(begin() + __pos, __rlen, __s );
return __rlen;
@@ -362,11 +362,11 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
basic_string_view substr(size_type __pos = 0, size_type __n = npos) const
{
// if (__pos > size())
-// throw out_of_range("string_view::substr");
+// __throw_out_of_range("string_view::substr");
// size_type __rlen = _VSTD::min( __n, size() - __pos );
// return basic_string_view(data() + __pos, __rlen);
return __pos > size()
- ? (__libcpp_throw((out_of_range("string_view::substr"))), basic_string_view())
+ ? (__throw_out_of_range("string_view::substr"), basic_string_view())
: basic_string_view(data() + __pos, _VSTD::min(__n, size() - __pos));
}
diff --git a/include/experimental/type_traits b/include/experimental/type_traits
index ae49fc176c01..d6901d41a61e 100644
--- a/include/experimental/type_traits
+++ b/include/experimental/type_traits
@@ -172,6 +172,45 @@ inline namespace fundamentals_v1 {
template <class T>
using raw_invocation_type_t = typename raw_invocation_type<T>::type;
+ // 3.3.3, Logical operator traits
+ template<class... B> struct conjunction;
+ template<class... B> constexpr bool conjunction_v = conjunction<B...>::value;
+ template<class... B> struct disjunction;
+ template<class... B> constexpr bool disjunction_v = disjunction<B...>::value;
+ template<class B> struct negation;
+ template<class B> constexpr bool negation_v = negation<B>::value;
+
+ // 3.3.4, Detection idiom
+ template <class...> using void_t = void;
+
+ struct nonesuch {
+ nonesuch() = delete;
+ ~nonesuch() = delete;
+ nonesuch(nonesuch const&) = delete;
+ void operator=(nonesuch const&) = delete;
+ };
+
+ template <template<class...> class Op, class... Args>
+ using is_detected = see below;
+ template <template<class...> class Op, class... Args>
+ constexpr bool is_detected_v = is_detected<Op, Args...>::value;
+ template <template<class...> class Op, class... Args>
+ using detected_t = see below;
+ template <class Default, template<class...> class Op, class... Args>
+ using detected_or = see below;
+ template <class Default, template<class...> class Op, class... Args>
+ using detected_or_t = typename detected_or<Default, Op, Args...>::type;
+ template <class Expected, template<class...> class Op, class... Args>
+ using is_detected_exact = is_same<Expected, detected_t<Op, Args...>>;
+ template <class Expected, template<class...> class Op, class... Args>
+ constexpr bool is_detected_exact_v
+ = is_detected_exact<Expected, Op, Args...>::value;
+ template <class To, template<class...> class Op, class... Args>
+ using is_detected_convertible = is_convertible<detected_t<Op, Args...>, To>;
+ template <class To, template<class...> class Op, class... Args>
+ constexpr bool is_detected_convertible_v
+ = is_detected_convertible<To, Op, Args...>::value;
+
} // namespace fundamentals_v1
} // namespace experimental
} // namespace std
@@ -420,6 +459,70 @@ template <class _Tp>
using raw_invocation_type_t = typename raw_invocation_type<_Tp>::type;
*/
+// 3.3.3, Logical operator traits
+template <class...> using void_t = void;
+
+template <class... _Args>
+struct conjunction : _VSTD::__and_<_Args...> {};
+template <class... _Args>
+_LIBCPP_CONSTEXPR bool conjunction_v = conjunction<_Args...>::value;
+
+template <class... _Args>
+struct disjunction : _VSTD::__or_<_Args...> {};
+template <class... _Args>
+_LIBCPP_CONSTEXPR bool disjunction_v = disjunction<_Args...>::value;
+
+template <class _Tp>
+struct negation : _VSTD::__not_<_Tp> {};
+template<class _Tp>
+_LIBCPP_CONSTEXPR bool negation_v = negation<_Tp>::value;
+
+// 3.3.4, Detection idiom
+template <class...> using void_t = void;
+
+struct nonesuch {
+ nonesuch() = delete;
+ ~nonesuch() = delete;
+ nonesuch (nonesuch const&) = delete;
+ void operator=(nonesuch const&) = delete;
+ };
+
+template <class _Default, class _AlwaysVoid, template <class...> class _Op, class... _Args>
+struct _DETECTOR {
+ using value_t = false_type;
+ using type = _Default;
+ };
+
+template <class _Default, template <class...> class _Op, class... _Args>
+struct _DETECTOR<_Default, void_t<_Op<_Args...>>, _Op, _Args...> {
+ using value_t = true_type;
+ using type = _Op<_Args...>;
+ };
+
+
+template <template<class...> class _Op, class... _Args>
+ using is_detected = typename _DETECTOR<nonesuch, void, _Op, _Args...>::value_t;
+template <template<class...> class _Op, class... _Args>
+ using detected_t = typename _DETECTOR<nonesuch, void, _Op, _Args...>::type;
+template <template<class...> class _Op, class... _Args>
+ _LIBCPP_CONSTEXPR bool is_detected_v = is_detected<_Op, _Args...>::value;
+
+template <class Default, template<class...> class _Op, class... _Args>
+ using detected_or = _DETECTOR<Default, void, _Op, _Args...>;
+template <class Default, template<class...> class _Op, class... _Args>
+ using detected_or_t = typename detected_or<Default, _Op, _Args...>::type;
+
+template <class Expected, template<class...> class _Op, class... _Args>
+ using is_detected_exact = is_same<Expected, detected_t<_Op, _Args...>>;
+template <class Expected, template<class...> class _Op, class... _Args>
+ _LIBCPP_CONSTEXPR bool is_detected_exact_v = is_detected_exact<Expected, _Op, _Args...>::value;
+
+template <class To, template<class...> class _Op, class... _Args>
+ using is_detected_convertible = is_convertible<detected_t<_Op, _Args...>, To>;
+template <class To, template<class...> class _Op, class... _Args>
+ _LIBCPP_CONSTEXPR bool is_detected_convertible_v = is_detected_convertible<To, _Op, _Args...>::value;
+
+
_LIBCPP_END_NAMESPACE_LFTS
#endif /* _LIBCPP_STD_VER > 11 */
diff --git a/include/forward_list b/include/forward_list
index 18b300d84703..d70f7eddef6c 100644
--- a/include/forward_list
+++ b/include/forward_list
@@ -87,7 +87,7 @@ public:
reference front();
const_reference front() const;
- template <class... Args> void emplace_front(Args&&... args);
+ template <class... Args> reference emplace_front(Args&&... args);
void push_front(const value_type& v);
void push_front(value_type&& v);
@@ -531,7 +531,7 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- void __move_assign_alloc(__forward_list_base& __x, false_type) _NOEXCEPT
+ void __move_assign_alloc(__forward_list_base&, false_type) _NOEXCEPT
{}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(__forward_list_base& __x, true_type)
@@ -734,8 +734,11 @@ public:
bool empty() const _NOEXCEPT
{return base::__before_begin()->__next_ == nullptr;}
_LIBCPP_INLINE_VISIBILITY
- size_type max_size() const _NOEXCEPT
- {return numeric_limits<size_type>::max();}
+ size_type max_size() const _NOEXCEPT {
+ return std::min<size_type>(
+ __node_traits::max_size(base::__alloc()),
+ numeric_limits<difference_type>::max());
+ }
_LIBCPP_INLINE_VISIBILITY
reference front() {return base::__before_begin()->__next_->__value_;}
@@ -744,7 +747,7 @@ public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS
- template <class... _Args> void emplace_front(_Args&&... __args);
+ template <class... _Args> reference emplace_front(_Args&&... __args);
#endif
void push_front(value_type&& __v);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -873,8 +876,9 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n)
#if _LIBCPP_STD_VER > 11
template <class _Tp, class _Alloc>
-forward_list<_Tp, _Alloc>::forward_list(size_type __n, const allocator_type& __a)
- : base ( __a )
+forward_list<_Tp, _Alloc>::forward_list(size_type __n,
+ const allocator_type& __base_alloc)
+ : base ( __base_alloc )
{
if (__n > 0)
{
@@ -1099,7 +1103,7 @@ forward_list<_Tp, _Alloc>::assign(initializer_list<value_type> __il)
template <class _Tp, class _Alloc>
template <class... _Args>
-void
+typename forward_list<_Tp, _Alloc>::reference
forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
{
__node_allocator& __a = base::__alloc();
@@ -1109,6 +1113,7 @@ forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
_VSTD::forward<_Args>(__args)...);
__h->__next_ = base::__before_begin()->__next_;
base::__before_begin()->__next_ = __h.release();
+ return base::__before_begin()->__next_->__value_;
}
#endif // _LIBCPP_HAS_NO_VARIADICS
@@ -1421,7 +1426,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
- forward_list& __x,
+ forward_list& /*__other*/,
const_iterator __i)
{
const_iterator __lm1 = _VSTD::next(__i);
@@ -1436,7 +1441,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
- forward_list& __x,
+ forward_list& /*__other*/,
const_iterator __f, const_iterator __l)
{
if (__f != __l && __p != __f)
diff --git a/include/fstream b/include/fstream
index 3cb3b13bd10f..b8d18aadb1c9 100644
--- a/include/fstream
+++ b/include/fstream
@@ -618,10 +618,9 @@ basic_filebuf<_CharT, _Traits>::underflow()
size_t __nr = fread((void*)__extbufnext_, 1, __nmemb, __file_);
if (__nr != 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!__cv_)
- throw bad_cast();
-#endif
+ __throw_bad_cast();
+
__extbufend_ = __extbufnext_ + __nr;
char_type* __inext;
__r = __cv_->in(__st_, __extbuf_, __extbufend_, __extbufnext_,
@@ -700,10 +699,9 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c)
codecvt_base::result __r;
do
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!__cv_)
- throw bad_cast();
-#endif
+ __throw_bad_cast();
+
const char_type* __e;
__r = __cv_->out(__st_, this->pbase(), this->pptr(), __e,
__extbuf_, __extbuf_ + __ebs_, __extbe);
@@ -793,10 +791,9 @@ typename basic_filebuf<_CharT, _Traits>::pos_type
basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
ios_base::openmode)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!__cv_)
- throw bad_cast();
-#endif
+ __throw_bad_cast();
+
int __width = __cv_->encoding();
if (__file_ == 0 || (__width <= 0 && __off != 0) || sync())
return pos_type(off_type(-1));
@@ -816,7 +813,7 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
default:
return pos_type(off_type(-1));
}
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
if (fseek(__file_, __width > 0 ? __width * __off : 0, __whence))
return pos_type(off_type(-1));
pos_type __r = ftell(__file_);
@@ -835,7 +832,7 @@ basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)
{
if (__file_ == 0 || sync())
return pos_type(off_type(-1));
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
if (fseek(__file_, __sp, SEEK_SET))
return pos_type(off_type(-1));
#else
@@ -852,10 +849,9 @@ basic_filebuf<_CharT, _Traits>::sync()
{
if (__file_ == 0)
return 0;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!__cv_)
- throw bad_cast();
-#endif
+ __throw_bad_cast();
+
if (__cm_ & ios_base::out)
{
if (this->pptr() != this->pbase())
@@ -900,7 +896,7 @@ basic_filebuf<_CharT, _Traits>::sync()
}
}
}
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
if (fseek(__file_, -__c, SEEK_CUR))
return -1;
#else
diff --git a/include/functional b/include/functional
index 581f965b2b81..eb8609f1469b 100644
--- a/include/functional
+++ b/include/functional
@@ -212,6 +212,13 @@ template <class F> unspecified not_fn(F&& f); // C++17
template<class T> struct is_bind_expression;
template<class T> struct is_placeholder;
+ // See C++14 20.9.9, Function object binders
+template <class T> constexpr bool is_bind_expression_v
+ = is_bind_expression<T>::value; // C++17
+template <class T> constexpr int is_placeholder_v
+ = is_placeholder<T>::value; // C++17
+
+
template<class Fn, class... BoundArgs>
unspecified bind(Fn&&, BoundArgs&&...);
template<class R, class Fn, class... BoundArgs>
@@ -386,15 +393,15 @@ public:
template<class F>
function(F);
template<Allocator Alloc>
- function(allocator_arg_t, const Alloc&) noexcept;
+ function(allocator_arg_t, const Alloc&) noexcept; // removed in C++17
template<Allocator Alloc>
- function(allocator_arg_t, const Alloc&, nullptr_t) noexcept;
+ function(allocator_arg_t, const Alloc&, nullptr_t) noexcept; // removed in C++17
template<Allocator Alloc>
- function(allocator_arg_t, const Alloc&, const function&);
+ function(allocator_arg_t, const Alloc&, const function&); // removed in C++17
template<Allocator Alloc>
- function(allocator_arg_t, const Alloc&, function&&);
+ function(allocator_arg_t, const Alloc&, function&&); // removed in C++17
template<class F, Allocator Alloc>
- function(allocator_arg_t, const Alloc&, F);
+ function(allocator_arg_t, const Alloc&, F); // removed in C++17
function& operator=(const function&);
function& operator=(function&&) noexcept;
@@ -1382,6 +1389,16 @@ class _LIBCPP_EXCEPTION_ABI bad_function_call
{
};
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_function_call()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_function_call();
+#else
+ _VSTD::abort();
+#endif
+}
+
template<class _Fp> class _LIBCPP_TYPE_VIS_ONLY function; // undefined
namespace __function
@@ -1595,13 +1612,12 @@ public:
function(nullptr_t) _NOEXCEPT : __f_(0) {}
function(const function&);
function(function&&) _NOEXCEPT;
- template<class _Fp>
- function(_Fp, typename enable_if
- <
- __callable<_Fp>::value &&
- !is_same<_Fp, function>::value
- >::type* = 0);
+ template<class _Fp, class = typename enable_if<
+ __callable<_Fp>::value && !is_same<_Fp, function>::value
+ >::type>
+ function(_Fp);
+#if _LIBCPP_STD_VER <= 14
template<class _Alloc>
_LIBCPP_INLINE_VISIBILITY
function(allocator_arg_t, const _Alloc&) _NOEXCEPT : __f_(0) {}
@@ -1612,9 +1628,9 @@ public:
function(allocator_arg_t, const _Alloc&, const function&);
template<class _Alloc>
function(allocator_arg_t, const _Alloc&, function&&);
- template<class _Fp, class _Alloc>
- function(allocator_arg_t, const _Alloc& __a, _Fp __f,
- typename enable_if<__callable<_Fp>::value>::type* = 0);
+ template<class _Fp, class _Alloc, class = typename enable_if<__callable<_Fp>::value>::type>
+ function(allocator_arg_t, const _Alloc& __a, _Fp __f);
+#endif
function& operator=(const function&);
function& operator=(function&&) _NOEXCEPT;
@@ -1675,6 +1691,7 @@ function<_Rp(_ArgTypes...)>::function(const function& __f)
__f_ = __f.__f_->__clone();
}
+#if _LIBCPP_STD_VER <= 14
template<class _Rp, class ..._ArgTypes>
template <class _Alloc>
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
@@ -1690,6 +1707,7 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
else
__f_ = __f.__f_->__clone();
}
+#endif
template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>::function(function&& __f) _NOEXCEPT
@@ -1708,6 +1726,7 @@ function<_Rp(_ArgTypes...)>::function(function&& __f) _NOEXCEPT
}
}
+#if _LIBCPP_STD_VER <= 14
template<class _Rp, class ..._ArgTypes>
template <class _Alloc>
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
@@ -1726,15 +1745,11 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
__f.__f_ = 0;
}
}
+#endif
template<class _Rp, class ..._ArgTypes>
-template <class _Fp>
-function<_Rp(_ArgTypes...)>::function(_Fp __f,
- typename enable_if
- <
- __callable<_Fp>::value &&
- !is_same<_Fp, function>::value
- >::type*)
+template <class _Fp, class>
+function<_Rp(_ArgTypes...)>::function(_Fp __f)
: __f_(0)
{
if (__function::__not_null(__f))
@@ -1756,10 +1771,10 @@ function<_Rp(_ArgTypes...)>::function(_Fp __f,
}
}
+#if _LIBCPP_STD_VER <= 14
template<class _Rp, class ..._ArgTypes>
-template <class _Fp, class _Alloc>
-function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
- typename enable_if<__callable<_Fp>::value>::type*)
+template <class _Fp, class _Alloc, class>
+function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f)
: __f_(0)
{
typedef allocator_traits<_Alloc> __alloc_traits;
@@ -1782,6 +1797,7 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp _
}
}
}
+#endif
template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>&
@@ -1854,6 +1870,8 @@ template<class _Rp, class ..._ArgTypes>
void
function<_Rp(_ArgTypes...)>::swap(function& __f) _NOEXCEPT
{
+ if (_VSTD::addressof(__f) == this)
+ return;
if ((void *)__f_ == &__buf_ && (void *)__f.__f_ == &__f.__buf_)
{
typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
@@ -1891,10 +1909,8 @@ template<class _Rp, class ..._ArgTypes>
_Rp
function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0)
- throw bad_function_call();
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_bad_function_call();
return (*__f_)(_VSTD::forward<_ArgTypes>(__arg)...);
}
@@ -1971,10 +1987,20 @@ template<class _Tp> struct __is_bind_expression : public false_type {};
template<class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_bind_expression
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
+#endif
+
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
template<class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_placeholder
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value;
+#endif
+
namespace placeholders
{
@@ -2204,36 +2230,6 @@ private:
typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
public:
-#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
-
- _LIBCPP_INLINE_VISIBILITY
- __bind(const __bind& __b)
- : __f_(__b.__f_),
- __bound_args_(__b.__bound_args_) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __bind& operator=(const __bind& __b)
- {
- __f_ = __b.__f_;
- __bound_args_ = __b.__bound_args_;
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __bind(__bind&& __b)
- : __f_(_VSTD::move(__b.__f_)),
- __bound_args_(_VSTD::move(__b.__bound_args_)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __bind& operator=(__bind&& __b)
- {
- __f_ = _VSTD::move(__b.__f_);
- __bound_args_ = _VSTD::move(__b.__bound_args_);
- return *this;
- }
-
-#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
-
template <class _Gp, class ..._BA,
class = typename enable_if
<
@@ -2278,31 +2274,6 @@ class __bind_r
public:
typedef _Rp result_type;
-#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
-
- _LIBCPP_INLINE_VISIBILITY
- __bind_r(const __bind_r& __b)
- : base(_VSTD::forward<const base&>(__b)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __bind_r& operator=(const __bind_r& __b)
- {
- base::operator=(_VSTD::forward<const base&>(__b));
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __bind_r(__bind_r&& __b)
- : base(_VSTD::forward<base>(__b)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __bind_r& operator=(__bind_r&& __b)
- {
- base::operator=(_VSTD::forward<base>(__b));
- return *this;
- }
-
-#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
template <class _Gp, class ..._BA,
class = typename enable_if
@@ -2583,12 +2554,11 @@ struct _LIBCPP_TYPE_VIS_ONLY hash<long double>
};
#if _LIBCPP_STD_VER > 11
-template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY hash
+
+template <class _Tp, bool = is_enum<_Tp>::value>
+struct _LIBCPP_TYPE_VIS_ONLY __enum_hash
: public unary_function<_Tp, size_t>
{
- static_assert(is_enum<_Tp>::value, "This hash only works for enumeration types");
-
_LIBCPP_INLINE_VISIBILITY
size_t operator()(_Tp __v) const _NOEXCEPT
{
@@ -2596,11 +2566,24 @@ struct _LIBCPP_TYPE_VIS_ONLY hash
return hash<type>{}(static_cast<type>(__v));
}
};
+template <class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY __enum_hash<_Tp, false> {
+ __enum_hash() = delete;
+ __enum_hash(__enum_hash const&) = delete;
+ __enum_hash& operator=(__enum_hash const&) = delete;
+};
+
+template <class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY hash : public __enum_hash<_Tp>
+{
+};
#endif
#if _LIBCPP_STD_VER > 14
+#define __cpp_lib_invoke 201411
+
template <class _Fn, class ..._Args>
result_of_t<_Fn&&(_Args&&...)>
invoke(_Fn&& __f, _Args&&... __args)
@@ -2620,30 +2603,30 @@ public:
_LIBCPP_INLINE_VISIBILITY
auto operator()(_Args&& ...__args) &
noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
- -> decltype(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
- { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
+ -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
+ { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
template <class ..._Args>
_LIBCPP_INLINE_VISIBILITY
auto operator()(_Args&& ...__args) &&
noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
- -> decltype(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
- { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
+ -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
+ { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
template <class ..._Args>
_LIBCPP_INLINE_VISIBILITY
auto operator()(_Args&& ...__args) const&
noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
- -> decltype(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
- { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
+ -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
+ { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
template <class ..._Args>
_LIBCPP_INLINE_VISIBILITY
auto operator()(_Args&& ...__args) const&&
noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
- -> decltype(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
- { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
+ -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
+ { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
private:
template <class _RawFunc,
diff --git a/include/future b/include/future
index 936060e173b8..d1d42f6a7274 100644
--- a/include/future
+++ b/include/future
@@ -50,7 +50,7 @@ class future_error
{
public:
future_error(error_code ec); // exposition only
-
+ explicit future_error(future_errc); // C++17
const error_code& code() const noexcept;
const char* what() const noexcept;
};
@@ -505,20 +505,23 @@ class _LIBCPP_EXCEPTION_ABI future_error
error_code __ec_;
public:
future_error(error_code __ec);
-
+#if _LIBCPP_STD_VERS > 14
+ explicit future_error(future_errc _Ev) : logic_error(), __ec_(make_error_code(_Ev)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
const error_code& code() const _NOEXCEPT {return __ec_;}
virtual ~future_error() _NOEXCEPT;
};
-inline _LIBCPP_ALWAYS_INLINE
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
void __throw_future_error(future_errc _Ev)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw future_error(make_error_code(_Ev));
#else
- assert(!"future_error");
+ ((void)_Ev);
+ _VSTD::abort();
#endif
}
@@ -2372,7 +2375,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
shared_future() _NOEXCEPT : __state_(nullptr) {}
_LIBCPP_INLINE_VISIBILITY
- shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
+ shared_future(const shared_future& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
{if (__state_) __state_->__add_shared();}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
@@ -2383,7 +2386,7 @@ public:
{__rhs.__state_ = nullptr;}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~shared_future();
- shared_future& operator=(const shared_future& __rhs);
+ shared_future& operator=(const shared_future& __rhs) _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
@@ -2427,7 +2430,7 @@ shared_future<_Rp>::~shared_future()
template <class _Rp>
shared_future<_Rp>&
-shared_future<_Rp>::operator=(const shared_future& __rhs)
+shared_future<_Rp>::operator=(const shared_future& __rhs) _NOEXCEPT
{
if (__rhs.__state_)
__rhs.__state_->__add_shared();
diff --git a/include/inttypes.h b/include/inttypes.h
index 5c5618bef884..058f54b5161f 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -237,6 +237,13 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
#pragma GCC system_header
#endif
+/* C99 stdlib (e.g. glibc < 2.18) does not provide format macros needed
+ for C++11 unless __STDC_FORMAT_MACROS is defined
+*/
+#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
+# define __STDC_FORMAT_MACROS
+#endif
+
#include_next <inttypes.h>
#ifdef __cplusplus
diff --git a/include/iomanip b/include/iomanip
index 9efcbe03d1ae..a6bee736f45b 100644
--- a/include/iomanip
+++ b/include/iomanip
@@ -44,6 +44,7 @@ template <class charT, class traits, class Allocator>
*/
#include <__config>
+#include <__string>
#include <istream>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -567,19 +568,6 @@ __quoted_input ( basic_istream<_CharT, _Traits> &__is, _String & __string, _Char
}
-template <class _CharT, class _Iter, class _Traits=char_traits<_CharT> >
-struct __quoted_output_proxy
-{
- _Iter __first;
- _Iter __last;
- _CharT __delim;
- _CharT __escape;
-
- __quoted_output_proxy(_Iter __f, _Iter __l, _CharT __d, _CharT __e)
- : __first(__f), __last(__l), __delim(__d), __escape(__e) {}
- // This would be a nice place for a string_ref
-};
-
template <class _CharT, class _Traits, class _Iter>
basic_ostream<_CharT, _Traits>& operator<<(
basic_ostream<_CharT, _Traits>& __os,
@@ -666,6 +654,15 @@ quoted ( basic_string <_CharT, _Traits, _Allocator> &__s, _CharT __delim = _Char
{
return __quoted(__s, __delim, __escape);
}
+
+template <class _CharT, class _Traits>
+__quoted_output_proxy<_CharT, const _CharT *, _Traits>
+quoted (basic_string_view <_CharT, _Traits> __sv,
+ _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
+{
+ return __quoted_output_proxy<_CharT, const _CharT *, _Traits>
+ ( __sv.data(), __sv.data() + __sv.size(), __delim, __escape );
+}
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/ios b/include/ios
index cbea478a74a8..fb8f88dddab2 100644
--- a/include/ios
+++ b/include/ios
@@ -572,6 +572,13 @@ ios_base::exceptions(iostate __iostate)
clear(__rdstate_);
}
+#if defined(_LIBCPP_CXX03_LANG)
+struct _LIBCPP_TYPE_VIS_ONLY __cxx03_bool {
+ typedef void (__cxx03_bool::*__bool_type)();
+ void __true_value() {}
+};
+#endif
+
template <class _CharT, class _Traits>
class _LIBCPP_TYPE_VIS_ONLY basic_ios
: public ios_base
@@ -585,9 +592,19 @@ public:
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
+ // __true_value will generate undefined references when linking unless
+ // we give it internal linkage.
+
+#if defined(_LIBCPP_CXX03_LANG)
_LIBCPP_ALWAYS_INLINE
- _LIBCPP_EXPLICIT
- operator bool() const {return !fail();}
+ operator __cxx03_bool::__bool_type() const {
+ return !fail() ? &__cxx03_bool::__true_value : nullptr;
+ }
+#else
+ _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_EXPLICIT operator bool() const {return !fail();}
+#endif
+
_LIBCPP_ALWAYS_INLINE bool operator!() const {return fail();}
_LIBCPP_ALWAYS_INLINE iostate rdstate() const {return ios_base::rdstate();}
_LIBCPP_ALWAYS_INLINE void clear(iostate __state = goodbit) {ios_base::clear(__state);}
diff --git a/include/istream b/include/istream
index ee694003a3d8..04845a24341e 100644
--- a/include/istream
+++ b/include/istream
@@ -184,19 +184,26 @@ public:
typedef typename traits_type::off_type off_type;
// 27.7.1.1.1 Constructor/destructor:
- explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb) : __gc_(0)
+ { this->init(__sb); }
virtual ~basic_istream();
protected:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_INLINE_VISIBILITY
basic_istream(basic_istream&& __rhs);
#endif
// 27.7.1.1.2 Assign/swap:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_INLINE_VISIBILITY
basic_istream& operator=(basic_istream&& __rhs);
#endif
- void swap(basic_istream& __rhs);
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void swap(basic_istream& __rhs) {
+ _VSTD::swap(__gc_, __rhs.__gc_);
+ basic_ios<char_type, traits_type>::swap(__rhs);
+ }
#if _LIBCPP_STD_VER > 11
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
@@ -213,10 +220,19 @@ public:
class _LIBCPP_TYPE_VIS_ONLY sentry;
// 27.7.1.2 Formatted input:
- basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&));
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&))
+ { return __pf(*this); }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
basic_istream& operator>>(basic_ios<char_type, traits_type>&
- (*__pf)(basic_ios<char_type, traits_type>&));
- basic_istream& operator>>(ios_base& (*__pf)(ios_base&));
+ (*__pf)(basic_ios<char_type, traits_type>&))
+ { __pf(*this); return *this; }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& operator>>(ios_base& (*__pf)(ios_base&))
+ { __pf(*this); return *this; }
+
basic_istream& operator>>(basic_streambuf<char_type, traits_type>* __sb);
basic_istream& operator>>(bool& __n);
basic_istream& operator>>(short& __n);
@@ -236,13 +252,31 @@ public:
_LIBCPP_INLINE_VISIBILITY
streamsize gcount() const {return __gc_;}
int_type get();
- basic_istream& get(char_type& __c);
- basic_istream& get(char_type* __s, streamsize __n);
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& get(char_type& __c) {
+ int_type __ch = get();
+ if (__ch != traits_type::eof())
+ __c = traits_type::to_char_type(__ch);
+ return *this;
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& get(char_type* __s, streamsize __n)
+ { return get(__s, __n, this->widen('\n')); }
+
basic_istream& get(char_type* __s, streamsize __n, char_type __dlm);
- basic_istream& get(basic_streambuf<char_type, traits_type>& __sb);
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& get(basic_streambuf<char_type, traits_type>& __sb)
+ { return get(__sb, this->widen('\n')); }
+
basic_istream& get(basic_streambuf<char_type, traits_type>& __sb, char_type __dlm);
- basic_istream& getline(char_type* __s, streamsize __n);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& getline(char_type* __s, streamsize __n)
+ { return getline(__s, __n, this->widen('\n')); }
+
basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);
basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof());
@@ -303,18 +337,9 @@ basic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& _
__is.setstate(ios_base::failbit);
}
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_istream<_CharT, _Traits>::basic_istream(basic_streambuf<char_type, traits_type>* __sb)
- : __gc_(0)
-{
- this->init(__sb);
-}
-
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
: __gc_(__rhs.__gc_)
{
@@ -323,7 +348,6 @@ basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs)
{
@@ -339,15 +363,6 @@ basic_istream<_CharT, _Traits>::~basic_istream()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-basic_istream<_CharT, _Traits>::swap(basic_istream& __rhs)
-{
- _VSTD::swap(__gc_, __rhs.__gc_);
- basic_ios<char_type, traits_type>::swap(__rhs);
-}
-
-template <class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n)
{
@@ -724,33 +739,6 @@ basic_istream<_CharT, _Traits>::operator>>(int& __n)
return *this;
}
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::operator>>(basic_istream& (*__pf)(basic_istream&))
-{
- return __pf(*this);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::operator>>(basic_ios<char_type, traits_type>&
- (*__pf)(basic_ios<char_type, traits_type>&))
-{
- __pf(*this);
- return *this;
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::operator>>(ios_base& (*__pf)(ios_base&))
-{
- __pf(*this);
- return *this;
-}
-
template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
@@ -947,17 +935,6 @@ basic_istream<_CharT, _Traits>::get()
}
template<class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::get(char_type& __c)
-{
- int_type __ch = get();
- if (__ch != traits_type::eof())
- __c = traits_type::to_char_type(__ch);
- return *this;
-}
-
-template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __dlm)
{
@@ -1006,14 +983,6 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
}
template<class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n)
-{
- return get(__s, __n, this->widen('\n'));
-}
-
-template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __sb,
char_type __dlm)
@@ -1068,14 +1037,6 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
}
template<class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __sb)
-{
- return get(__sb, this->widen('\n'));
-}
-
-template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_type __dlm)
{
@@ -1129,14 +1090,6 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
}
template<class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n)
-{
- return getline(__s, __n, this->widen('\n'));
-}
-
-template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
{
@@ -1481,9 +1434,9 @@ ws(basic_istream<_CharT, _Traits>& __is)
template <class _CharT, class _Traits, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
-operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
+operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp&& __x)
{
- __is >> __x;
+ __is >> _VSTD::forward<_Tp>(__x);
return __is;
}
@@ -1503,41 +1456,38 @@ public:
typedef typename traits_type::off_type off_type;
// constructor/destructor
- explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb)
+ : basic_istream<_CharT, _Traits>(__sb)
+ {}
+
virtual ~basic_iostream();
protected:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_INLINE_VISIBILITY
basic_iostream(basic_iostream&& __rhs);
#endif
// assign/swap
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_INLINE_VISIBILITY
basic_iostream& operator=(basic_iostream&& __rhs);
#endif
- void swap(basic_iostream& __rhs);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void swap(basic_iostream& __rhs)
+ { basic_istream<char_type, traits_type>::swap(__rhs); }
public:
};
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_iostream<_CharT, _Traits>::basic_iostream(basic_streambuf<char_type, traits_type>* __sb)
- : basic_istream<_CharT, _Traits>(__sb)
-{
-}
-
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
{
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
basic_iostream<_CharT, _Traits>&
basic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs)
{
@@ -1552,14 +1502,6 @@ basic_iostream<_CharT, _Traits>::~basic_iostream()
{
}
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-basic_iostream<_CharT, _Traits>::swap(basic_iostream& __rhs)
-{
- basic_istream<char_type, traits_type>::swap(__rhs);
-}
-
template<class _CharT, class _Traits, class _Allocator>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is,
@@ -1705,7 +1647,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
{
basic_string<_CharT, _Traits> __str;
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
- streamsize __c = 0;
+ size_t __c = 0;
ios_base::iostate __err = ios_base::goodbit;
_CharT __zero = __ct.widen('0');
_CharT __one = __ct.widen('1');
@@ -1741,9 +1683,9 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
return __is;
}
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_istream<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_istream<wchar_t>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_iostream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/iterator b/include/iterator
index 0caabbb2ea1a..ba9a83b9e5e5 100644
--- a/include/iterator
+++ b/include/iterator
@@ -89,57 +89,60 @@ public:
typedef typename iterator_traits<Iterator>::reference reference;
typedef typename iterator_traits<Iterator>::pointer pointer;
- reverse_iterator();
- explicit reverse_iterator(Iterator x);
- template <class U> reverse_iterator(const reverse_iterator<U>& u);
- Iterator base() const;
- reference operator*() const;
- pointer operator->() const;
- reverse_iterator& operator++();
- reverse_iterator operator++(int);
- reverse_iterator& operator--();
- reverse_iterator operator--(int);
- reverse_iterator operator+ (difference_type n) const;
- reverse_iterator& operator+=(difference_type n);
- reverse_iterator operator- (difference_type n) const;
- reverse_iterator& operator-=(difference_type n);
- reference operator[](difference_type n) const;
+ constexpr reverse_iterator();
+ constexpr explicit reverse_iterator(Iterator x);
+ template <class U> constexpr reverse_iterator(const reverse_iterator<U>& u);
+ template <class U> constexpr reverse_iterator& operator=(const reverse_iterator<U>& u);
+ constexpr Iterator base() const;
+ constexpr reference operator*() const;
+ constexpr pointer operator->() const;
+ constexpr reverse_iterator& operator++();
+ constexpr reverse_iterator operator++(int);
+ constexpr reverse_iterator& operator--();
+ constexpr reverse_iterator operator--(int);
+ constexpr reverse_iterator operator+ (difference_type n) const;
+ constexpr reverse_iterator& operator+=(difference_type n);
+ constexpr reverse_iterator operator- (difference_type n) const;
+ constexpr reverse_iterator& operator-=(difference_type n);
+ constexpr reference operator[](difference_type n) const;
};
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator==(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator<(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator!=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator>(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator>=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator<=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-auto
+constexpr auto
operator-(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y)
--> decltype(__y.base() - __x.base());
+-> decltype(__y.base() - __x.base()); // constexpr in C++17
template <class Iterator>
-reverse_iterator<Iterator>
-operator+(typename reverse_iterator<Iterator>::difference_type n, const reverse_iterator<Iterator>& x);
+constexpr reverse_iterator<Iterator>
+operator+(typename reverse_iterator<Iterator>::difference_type n,
+ const reverse_iterator<Iterator>& x); // constexpr in C++17
-template <class Iterator> reverse_iterator<Iterator> make_reverse_iterator(Iterator i); // C++14
+template <class Iterator>
+constexpr reverse_iterator<Iterator> make_reverse_iterator(Iterator i); // C++14, constexpr in C++17
template <class Container>
class back_insert_iterator
@@ -216,61 +219,64 @@ public:
typedef typename iterator_traits<Iterator>::iterator_category iterator_category;
typedef value_type&& reference;
- move_iterator();
- explicit move_iterator(Iterator i);
- template <class U> move_iterator(const move_iterator<U>& u);
- template <class U> move_iterator& operator=(const move_iterator<U>& u);
- iterator_type base() const;
- reference operator*() const;
- pointer operator->() const;
- move_iterator& operator++();
- move_iterator operator++(int);
- move_iterator& operator--();
- move_iterator operator--(int);
- move_iterator operator+(difference_type n) const;
- move_iterator& operator+=(difference_type n);
- move_iterator operator-(difference_type n) const;
- move_iterator& operator-=(difference_type n);
- unspecified operator[](difference_type n) const;
+ constexpr move_iterator(); // all the constexprs are in C++17
+ constexpr explicit move_iterator(Iterator i);
+ template <class U>
+ constexpr move_iterator(const move_iterator<U>& u);
+ template <class U>
+ constexpr move_iterator& operator=(const move_iterator<U>& u);
+ constexpr iterator_type base() const;
+ constexpr reference operator*() const;
+ constexpr pointer operator->() const;
+ constexpr move_iterator& operator++();
+ constexpr move_iterator operator++(int);
+ constexpr move_iterator& operator--();
+ constexpr move_iterator operator--(int);
+ constexpr move_iterator operator+(difference_type n) const;
+ constexpr move_iterator& operator+=(difference_type n);
+ constexpr move_iterator operator-(difference_type n) const;
+ constexpr move_iterator& operator-=(difference_type n);
+ constexpr unspecified operator[](difference_type n) const;
private:
Iterator current; // exposition only
};
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator==(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator!=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator<(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator<=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator>(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator>=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-auto
+constexpr auto // constexpr in C++17
operator-(const move_iterator<Iterator1>& x,
const move_iterator<Iterator2>& y) -> decltype(x.base() - y.base());
template <class Iterator>
-move_iterator<Iterator> operator+(typename move_iterator<Iterator>::difference_type n,
- const move_iterator<Iterator>& x);
+constexpr move_iterator<Iterator> operator+( // constexpr in C++17
+ typename move_iterator<Iterator>::difference_type n,
+ const move_iterator<Iterator>& x);
-template <class Iterator>
-move_iterator<Iterator> make_move_iterator(const Iterator& i);
+template <class Iterator> // constexpr in C++17
+constexpr move_iterator<Iterator> make_move_iterator(const Iterator& i);
template <class T, class charT = char, class traits = char_traits<charT>, class Distance = ptrdiff_t>
@@ -508,8 +514,8 @@ struct __is_random_access_iterator : public __has_iterator_category_convertible_
template <class _Tp>
struct __is_exactly_input_iterator
: public integral_constant<bool,
- __has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value &&
- !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {};
+ __has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value &&
+ !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {};
template<class _Category, class _Tp, class _Distance = ptrdiff_t,
class _Pointer = _Tp*, class _Reference = _Tp&>
@@ -618,7 +624,7 @@ class _LIBCPP_TYPE_VIS_ONLY reverse_iterator
typename iterator_traits<_Iter>::reference>
{
private:
- mutable _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break
+ /*mutable*/ _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break
protected:
_Iter current;
public:
@@ -627,33 +633,45 @@ public:
typedef typename iterator_traits<_Iter>::reference reference;
typedef typename iterator_traits<_Iter>::pointer pointer;
- _LIBCPP_INLINE_VISIBILITY reverse_iterator() : current() {}
- _LIBCPP_INLINE_VISIBILITY explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
- template <class _Up> _LIBCPP_INLINE_VISIBILITY reverse_iterator(const reverse_iterator<_Up>& __u)
- : __t(__u.base()), current(__u.base()) {}
- _LIBCPP_INLINE_VISIBILITY _Iter base() const {return current;}
- _LIBCPP_INLINE_VISIBILITY reference operator*() const {_Iter __tmp = current; return *--__tmp;}
- _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return _VSTD::addressof(operator*());}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator++() {--current; return *this;}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator operator++(int)
- {reverse_iterator __tmp(*this); --current; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator--() {++current; return *this;}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator operator--(int)
- {reverse_iterator __tmp(*this); ++current; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator operator+ (difference_type __n) const
- {return reverse_iterator(current - __n);}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator+=(difference_type __n)
- {current -= __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator operator- (difference_type __n) const
- {return reverse_iterator(current + __n);}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator-=(difference_type __n)
- {current += __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const
- {return *(*this + __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator() : __t(), current() {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator(const reverse_iterator<_Up>& __u) : __t(__u.base()), current(__u.base()) {}
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator=(const reverse_iterator<_Up>& __u)
+ { __t = current = __u.base(); return *this; }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ _Iter base() const {return current;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator*() const {_Iter __tmp = current; return *--__tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ pointer operator->() const {return _VSTD::addressof(operator*());}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator++() {--current; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator++(int) {reverse_iterator __tmp(*this); --current; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator--() {++current; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator--(int) {reverse_iterator __tmp(*this); ++current; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator+ (difference_type __n) const {return reverse_iterator(current - __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator+=(difference_type __n) {current -= __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator- (difference_type __n) const {return reverse_iterator(current + __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator-=(difference_type __n) {current += __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator[](difference_type __n) const {return *(*this + __n);}
};
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -661,7 +679,7 @@ operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -669,7 +687,7 @@ operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& _
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -677,7 +695,7 @@ operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -685,7 +703,7 @@ operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& _
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -693,7 +711,7 @@ operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -702,7 +720,7 @@ operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
#ifndef _LIBCPP_CXX03_LANG
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
auto
operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-> decltype(__y.base() - __x.base())
@@ -720,7 +738,7 @@ operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& _
#endif
template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator<_Iter>
operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x)
{
@@ -729,7 +747,7 @@ operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_i
#if _LIBCPP_STD_VER > 11
template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator<_Iter> make_reverse_iterator(_Iter __i)
{
return reverse_iterator<_Iter>(__i);
@@ -889,9 +907,9 @@ private:
ostream_type* __out_stream_;
const char_type* __delim_;
public:
- _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s)
+ _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT
: __out_stream_(_VSTD::addressof(__s)), __delim_(0) {}
- _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter)
+ _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT
: __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {}
_LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_)
{
@@ -1040,37 +1058,40 @@ public:
typedef typename iterator_traits<iterator_type>::reference reference;
#endif
- _LIBCPP_INLINE_VISIBILITY move_iterator() : __i() {}
- _LIBCPP_INLINE_VISIBILITY explicit move_iterator(_Iter __x) : __i(__x) {}
- template <class _Up> _LIBCPP_INLINE_VISIBILITY move_iterator(const move_iterator<_Up>& __u)
- : __i(__u.base()) {}
- _LIBCPP_INLINE_VISIBILITY _Iter base() const {return __i;}
- _LIBCPP_INLINE_VISIBILITY reference operator*() const {
- return static_cast<reference>(*__i);
- }
- _LIBCPP_INLINE_VISIBILITY pointer operator->() const { return __i;}
- _LIBCPP_INLINE_VISIBILITY move_iterator& operator++() {++__i; return *this;}
- _LIBCPP_INLINE_VISIBILITY move_iterator operator++(int)
- {move_iterator __tmp(*this); ++__i; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY move_iterator& operator--() {--__i; return *this;}
- _LIBCPP_INLINE_VISIBILITY move_iterator operator--(int)
- {move_iterator __tmp(*this); --__i; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY move_iterator operator+ (difference_type __n) const
- {return move_iterator(__i + __n);}
- _LIBCPP_INLINE_VISIBILITY move_iterator& operator+=(difference_type __n)
- {__i += __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY move_iterator operator- (difference_type __n) const
- {return move_iterator(__i - __n);}
- _LIBCPP_INLINE_VISIBILITY move_iterator& operator-=(difference_type __n)
- {__i -= __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const
- {
- return static_cast<reference>(__i[__n]);
- }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator() : __i() {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ explicit move_iterator(_Iter __x) : __i(__x) {}
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator(const move_iterator<_Up>& __u) : __i(__u.base()) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _Iter base() const {return __i;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator*() const { return static_cast<reference>(*__i); }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ pointer operator->() const { return __i;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator++() {++__i; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator++(int) {move_iterator __tmp(*this); ++__i; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator--() {--__i; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator--(int) {move_iterator __tmp(*this); --__i; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator+ (difference_type __n) const {return move_iterator(__i + __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator+=(difference_type __n) {__i += __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator- (difference_type __n) const {return move_iterator(__i - __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator-=(difference_type __n) {__i -= __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator[](difference_type __n) const { return static_cast<reference>(__i[__n]); }
};
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -1078,7 +1099,7 @@ operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -1086,7 +1107,7 @@ operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -1094,7 +1115,7 @@ operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -1102,7 +1123,7 @@ operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -1110,7 +1131,7 @@ operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -1119,7 +1140,7 @@ operator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
#ifndef _LIBCPP_CXX03_LANG
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
auto
operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
-> decltype(__x.base() - __y.base())
@@ -1137,7 +1158,7 @@ operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
#endif
template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
move_iterator<_Iter>
operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x)
{
@@ -1145,7 +1166,7 @@ operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterato
}
template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
move_iterator<_Iter>
make_move_iterator(_Iter __i)
{
@@ -1159,56 +1180,58 @@ template <class _Iter> class __wrap_iter;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
#ifndef _LIBCPP_CXX03_LANG
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
auto
-operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
-> decltype(__x.base() - __y.base());
#else
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
typename __wrap_iter<_Iter1>::difference_type
-operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
#endif
template <class _Iter>
_LIBCPP_INLINE_VISIBILITY
__wrap_iter<_Iter>
-operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT;
+operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT_DEBUG;
template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY copy(_Ip, _Ip, _Op);
template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY copy_backward(_B1, _B1, _B2);
template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY move(_Ip, _Ip, _Op);
template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, _B1, _B2);
+#if _LIBCPP_DEBUG_LEVEL < 2
+
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
typename enable_if
@@ -1218,6 +1241,19 @@ typename enable_if
>::type
__unwrap_iter(__wrap_iter<_Tp*>);
+#else
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if
+<
+ is_trivially_copy_assignable<_Tp>::value,
+ __wrap_iter<_Tp*>
+>::type
+__unwrap_iter(__wrap_iter<_Tp*> __i);
+
+#endif
+
template <class _Iter>
class __wrap_iter
{
@@ -1231,7 +1267,7 @@ public:
private:
iterator_type __i;
public:
- _LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT_DEBUG
#if _LIBCPP_STD_VER > 11
: __i{}
#endif
@@ -1241,7 +1277,7 @@ public:
#endif
}
template <class _Up> _LIBCPP_INLINE_VISIBILITY __wrap_iter(const __wrap_iter<_Up>& __u,
- typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT
+ typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT_DEBUG
: __i(__u.base())
{
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1271,7 +1307,7 @@ public:
__get_db()->__erase_i(this);
}
#endif
- _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
@@ -1279,7 +1315,7 @@ public:
#endif
return *__i;
}
- _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
@@ -1287,7 +1323,7 @@ public:
#endif
return (pointer)_VSTD::addressof(*__i);
}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
@@ -1296,9 +1332,9 @@ public:
++__i;
return *this;
}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int) _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int) _NOEXCEPT_DEBUG
{__wrap_iter __tmp(*this); ++(*this); return __tmp;}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
@@ -1307,11 +1343,11 @@ public:
--__i;
return *this;
}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int) _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int) _NOEXCEPT_DEBUG
{__wrap_iter __tmp(*this); --(*this); return __tmp;}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const _NOEXCEPT_DEBUG
{__wrap_iter __w(*this); __w += __n; return __w;}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n) _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
@@ -1320,11 +1356,11 @@ public:
__i += __n;
return *this;
}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const _NOEXCEPT_DEBUG
{return *this + (-__n);}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n) _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n) _NOEXCEPT_DEBUG
{*this += -__n; return *this;}
- _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
@@ -1333,7 +1369,7 @@ public:
return __i[__n];
}
- _LIBCPP_INLINE_VISIBILITY iterator_type base() const _NOEXCEPT {return __i;}
+ _LIBCPP_INLINE_VISIBILITY iterator_type base() const _NOEXCEPT_DEBUG {return __i;}
private:
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1342,7 +1378,7 @@ private:
__get_db()->__insert_ic(this, __p);
}
#else
- _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT_DEBUG : __i(__x) {}
#endif
template <class _Up> friend class __wrap_iter;
@@ -1352,56 +1388,57 @@ private:
template <class _Iter1, class _Iter2>
friend
bool
- operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
friend
bool
- operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
friend
bool
- operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
friend
bool
- operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
friend
bool
- operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
friend
bool
- operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
#ifndef _LIBCPP_CXX03_LANG
template <class _Iter1, class _Iter2>
friend
auto
- operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+ operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
-> decltype(__x.base() - __y.base());
#else
template <class _Iter1, class _Iter2>
friend
typename __wrap_iter<_Iter1>::difference_type
- operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
#endif
template <class _Iter1>
friend
__wrap_iter<_Iter1>
- operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT;
+ operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT_DEBUG;
template <class _Ip, class _Op> friend _Op copy(_Ip, _Ip, _Op);
template <class _B1, class _B2> friend _B2 copy_backward(_B1, _B1, _B2);
template <class _Ip, class _Op> friend _Op move(_Ip, _Ip, _Op);
template <class _B1, class _B2> friend _B2 move_backward(_B1, _B1, _B2);
+#if _LIBCPP_DEBUG_LEVEL < 2
template <class _Tp>
friend
typename enable_if
@@ -1410,12 +1447,22 @@ private:
_Tp*
>::type
__unwrap_iter(__wrap_iter<_Tp*>);
+#else
+ template <class _Tp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ typename enable_if
+ <
+ is_trivially_copy_assignable<_Tp>::value,
+ __wrap_iter<_Tp*>
+ >::type
+ __unwrap_iter(__wrap_iter<_Tp*> __i);
+#endif
};
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
return __x.base() == __y.base();
}
@@ -1423,7 +1470,7 @@ operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
@@ -1435,7 +1482,7 @@ operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
return !(__x == __y);
}
@@ -1443,7 +1490,7 @@ operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
return __y < __x;
}
@@ -1451,7 +1498,7 @@ operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
return !(__x < __y);
}
@@ -1459,7 +1506,7 @@ operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
return !(__y < __x);
}
@@ -1467,7 +1514,7 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
template <class _Iter1>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG
{
return !(__x == __y);
}
@@ -1475,7 +1522,7 @@ operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX
template <class _Iter1>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG
{
return __y < __x;
}
@@ -1483,7 +1530,7 @@ operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXC
template <class _Iter1>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG
{
return !(__x < __y);
}
@@ -1491,7 +1538,7 @@ operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX
template <class _Iter1>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG
{
return !(__y < __x);
}
@@ -1500,7 +1547,7 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
auto
-operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
-> decltype(__x.base() - __y.base())
{
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1513,7 +1560,7 @@ operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
typename __wrap_iter<_Iter1>::difference_type
-operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
@@ -1527,7 +1574,7 @@ template <class _Iter>
inline _LIBCPP_INLINE_VISIBILITY
__wrap_iter<_Iter>
operator+(typename __wrap_iter<_Iter>::difference_type __n,
- __wrap_iter<_Iter> __x) _NOEXCEPT
+ __wrap_iter<_Iter> __x) _NOEXCEPT_DEBUG
{
__x += __n;
return __x;
@@ -1535,19 +1582,19 @@ operator+(typename __wrap_iter<_Iter>::difference_type __n,
template <class _Iter>
struct __libcpp_is_trivial_iterator
- : public _LIBCPP_BOOL_CONSTANT(is_pointer<_Iter>::value) {};
-
+ : public _LIBCPP_BOOL_CONSTANT(is_pointer<_Iter>::value) {};
+
template <class _Iter>
struct __libcpp_is_trivial_iterator<move_iterator<_Iter> >
- : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
+ : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
template <class _Iter>
struct __libcpp_is_trivial_iterator<reverse_iterator<_Iter> >
- : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
+ : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
template <class _Iter>
struct __libcpp_is_trivial_iterator<__wrap_iter<_Iter> >
- : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
+ : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
template <class _Tp, size_t _Np>
@@ -1566,7 +1613,7 @@ end(_Tp (&__array)[_Np])
return __array + _Np;
}
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+#if !defined(_LIBCPP_CXX03_LANG)
template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1689,7 +1736,7 @@ auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c))
#endif
-#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+#else // defined(_LIBCPP_CXX03_LANG)
template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1723,20 +1770,20 @@ end(const _Cp& __c)
return __c.end();
}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+#endif // !defined(_LIBCPP_CXX03_LANG)
#if _LIBCPP_STD_VER > 14
template <class _Cont>
constexpr auto size(const _Cont& __c) -> decltype(__c.size()) { return __c.size(); }
template <class _Tp, size_t _Sz>
-constexpr size_t size(const _Tp (&__array)[_Sz]) noexcept { return _Sz; }
+constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; }
template <class _Cont>
constexpr auto empty(const _Cont& __c) -> decltype(__c.empty()) { return __c.empty(); }
template <class _Tp, size_t _Sz>
-constexpr bool empty(const _Tp (&__array)[_Sz]) noexcept { return false; }
+constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; }
template <class _Ep>
constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }
diff --git a/include/limits b/include/limits
index 80a1be40fe47..4e67a7b63d56 100644
--- a/include/limits
+++ b/include/limits
@@ -182,7 +182,7 @@ protected:
static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
};
-template <class _Tp, int digits, bool is_signed>
+template <class _Tp, int digits, bool _IsSigned>
struct __libcpp_compute_min
{
static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << digits);
@@ -306,7 +306,7 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_signed = true;
static _LIBCPP_CONSTEXPR const int digits = __FLT_MANT_DIG__;
static _LIBCPP_CONSTEXPR const int digits10 = __FLT_DIG__;
- static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103)/100000;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l;
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __FLT_MIN__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __FLT_MAX__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
@@ -352,7 +352,7 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_signed = true;
static _LIBCPP_CONSTEXPR const int digits = __DBL_MANT_DIG__;
static _LIBCPP_CONSTEXPR const int digits10 = __DBL_DIG__;
- static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103)/100000;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l;
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __DBL_MIN__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __DBL_MAX__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
@@ -398,7 +398,7 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_signed = true;
static _LIBCPP_CONSTEXPR const int digits = __LDBL_MANT_DIG__;
static _LIBCPP_CONSTEXPR const int digits10 = __LDBL_DIG__;
- static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103)/100000;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l;
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __LDBL_MIN__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __LDBL_MAX__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
diff --git a/include/limits.h b/include/limits.h
new file mode 100644
index 000000000000..1867b1048574
--- /dev/null
+++ b/include/limits.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+//===--------------------------- limits.h ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_LIMITS_H
+#define _LIBCPP_LIMITS_H
+
+/*
+ limits.h synopsis
+
+Macros:
+
+ CHAR_BIT
+ SCHAR_MIN
+ SCHAR_MAX
+ UCHAR_MAX
+ CHAR_MIN
+ CHAR_MAX
+ MB_LEN_MAX
+ SHRT_MIN
+ SHRT_MAX
+ USHRT_MAX
+ INT_MIN
+ INT_MAX
+ UINT_MAX
+ LONG_MIN
+ LONG_MAX
+ ULONG_MAX
+ LLONG_MIN // C99
+ LLONG_MAX // C99
+ ULLONG_MAX // C99
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#ifndef __GNUC__
+#include_next <limits.h>
+#else
+// GCC header limits.h recursively includes itself through another header called
+// syslimits.h for some reason. This setup breaks down if we directly
+// #include_next GCC's limits.h (reasons not entirely clear to me). Therefore,
+// we manually re-create the necessary include sequence below:
+
+// Get the system limits.h defines (force recurse into the next level)
+#define _GCC_LIMITS_H_
+#define _GCC_NEXT_LIMITS_H
+#include_next <limits.h>
+
+// Get the ISO C defines
+#undef _GCC_LIMITS_H_
+#include_next <limits.h>
+#endif // __GNUC__
+
+#endif // _LIBCPP_LIMITS_H
diff --git a/include/list b/include/list
index cff0a853eff9..6b96fbfc57e0 100644
--- a/include/list
+++ b/include/list
@@ -93,10 +93,10 @@ public:
size_type max_size() const noexcept;
template <class... Args>
- void emplace_front(Args&&... args);
+ reference emplace_front(Args&&... args);
void pop_front();
template <class... Args>
- void emplace_back(Args&&... args);
+ reference emplace_back(Args&&... args);
void pop_back();
void push_front(const value_type& x);
void push_front(value_type&& x);
@@ -571,6 +571,10 @@ protected:
{return __size_alloc_.second();}
_LIBCPP_INLINE_VISIBILITY
+ size_type __node_alloc_max_size() const _NOEXCEPT {
+ return __node_alloc_traits::max_size(__node_alloc());
+ }
+ _LIBCPP_INLINE_VISIBILITY
static void __unlink_nodes(__link_pointer __f, __link_pointer __l) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
@@ -622,9 +626,9 @@ protected:
void swap(__list_imp& __c)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
+ _NOEXCEPT_DEBUG;
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value);
#endif
@@ -651,7 +655,7 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- void __copy_assign_alloc(const __list_imp& __c, false_type)
+ void __copy_assign_alloc(const __list_imp&, false_type)
{}
_LIBCPP_INLINE_VISIBILITY
@@ -662,9 +666,16 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- void __move_assign_alloc(__list_imp& __c, false_type)
+ void __move_assign_alloc(__list_imp&, false_type)
_NOEXCEPT
{}
+
+ _LIBCPP_INLINE_VISIBILITY
+ void __invalidate_all_iterators() {
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__invalidate_all(this);
+#endif
+ }
};
// Unlink nodes [__f, __l]
@@ -720,21 +731,7 @@ __list_imp<_Tp, _Alloc>::clear() _NOEXCEPT
__node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
__node_alloc_traits::deallocate(__na, __np, 1);
}
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
- {
- --__p;
- const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
- if (__i->__ptr_ != __l)
- {
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
-#endif
+ __invalidate_all_iterators();
}
}
@@ -742,9 +739,9 @@ template <class _Tp, class _Alloc>
void
__list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
+ _NOEXCEPT_DEBUG
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value)
#endif
{
@@ -904,7 +901,11 @@ public:
bool empty() const _NOEXCEPT {return base::empty();}
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
- {return numeric_limits<difference_type>::max();}
+ {
+ return std::min<size_type>(
+ base::__node_alloc_max_size(),
+ numeric_limits<difference_type >::max());
+ }
_LIBCPP_INLINE_VISIBILITY
iterator begin() _NOEXCEPT {return base::begin();}
@@ -968,9 +969,9 @@ public:
void push_back(value_type&& __x);
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
- void emplace_front(_Args&&... __args);
+ reference emplace_front(_Args&&... __args);
template <class... _Args>
- void emplace_back(_Args&&... __args);
+ reference emplace_back(_Args&&... __args);
template <class... _Args>
iterator emplace(const_iterator __p, _Args&&... __args);
#endif // _LIBCPP_HAS_NO_VARIADICS
@@ -994,9 +995,9 @@ public:
_LIBCPP_INLINE_VISIBILITY
void swap(list& __c)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
+ _NOEXCEPT_DEBUG
#else
- _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__node_alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<__node_allocator>::value)
#endif
{base::swap(__c);}
@@ -1353,6 +1354,9 @@ list<_Tp, _Alloc>::assign(_InpIter __f, _InpIter __l,
insert(__e, __f, __l);
else
erase(__i, __e);
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__invalidate_all(this);
+#endif
}
template <class _Tp, class _Alloc>
@@ -1367,6 +1371,9 @@ list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x)
insert(__e, __n, __x);
else
erase(__i, __e);
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__invalidate_all(this);
+#endif
}
template <class _Tp, class _Alloc>
@@ -1593,7 +1600,7 @@ list<_Tp, _Alloc>::push_back(value_type&& __x)
template <class _Tp, class _Alloc>
template <class... _Args>
-void
+typename list<_Tp, _Alloc>::reference
list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
{
__node_allocator& __na = base::__node_alloc();
@@ -1602,12 +1609,12 @@ list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
__link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link());
++base::__sz();
- __hold.release();
+ return __hold.release()->__value_;
}
template <class _Tp, class _Alloc>
template <class... _Args>
-void
+typename list<_Tp, _Alloc>::reference
list<_Tp, _Alloc>::emplace_back(_Args&&... __args)
{
__node_allocator& __na = base::__node_alloc();
@@ -1617,7 +1624,7 @@ list<_Tp, _Alloc>::emplace_back(_Args&&... __args)
__link_pointer __nl = __hold->__as_link();
__link_nodes_at_back(__nl, __nl);
++base::__sz();
- __hold.release();
+ return __hold.release()->__value_;
}
template <class _Tp, class _Alloc>
@@ -1751,15 +1758,15 @@ list<_Tp, _Alloc>::erase(const_iterator __p)
--base::__sz();
#if _LIBCPP_DEBUG_LEVEL >= 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
+ for (__i_node** __ip = __c->end_; __ip != __c->beg_; )
{
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
+ --__ip;
+ iterator* __i = static_cast<iterator*>((*__ip)->__i_);
if (__i->__ptr_ == __n)
{
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ (*__ip)->__c_ = nullptr;
+ if (--__c->end_ != __ip)
+ memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*));
}
}
__get_db()->unlock();
@@ -1782,6 +1789,9 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == this,
"list::erase(iterator, iterator) called with an iterator not"
" referring to this list");
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__l) == this,
+ "list::erase(iterator, iterator) called with an iterator not"
+ " referring to this list");
#endif
if (__f != __l)
{
@@ -1961,16 +1971,16 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__c_node* __cn2 = __db->__find_c(&__c);
- for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
+ for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
{
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
+ --__ip;
+ iterator* __i = static_cast<iterator*>((*__ip)->__i_);
if (__i->__ptr_ != __c.__end_as_link())
{
- __cn1->__add(*__p);
- (*__p)->__c_ = __cn1;
- if (--__cn2->end_ != __p)
- memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
+ __cn1->__add(*__ip);
+ (*__ip)->__c_ = __cn1;
+ if (--__cn2->end_ != __ip)
+ memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
}
}
__db->unlock();
@@ -2004,16 +2014,16 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__c_node* __cn2 = __db->__find_c(&__c);
- for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
+ for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
{
- --__p;
- iterator* __j = static_cast<iterator*>((*__p)->__i_);
+ --__ip;
+ iterator* __j = static_cast<iterator*>((*__ip)->__i_);
if (__j->__ptr_ == __f)
{
- __cn1->__add(*__p);
- (*__p)->__c_ = __cn1;
- if (--__cn2->end_ != __p)
- memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
+ __cn1->__add(*__ip);
+ (*__ip)->__c_ = __cn1;
+ if (--__cn2->end_ != __ip)
+ memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
}
}
__db->unlock();
@@ -2058,19 +2068,19 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__c_node* __cn2 = __db->__find_c(&__c);
- for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
+ for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
{
- --__p;
- iterator* __j = static_cast<iterator*>((*__p)->__i_);
+ --__ip;
+ iterator* __j = static_cast<iterator*>((*__ip)->__i_);
for (__link_pointer __k = __f.__ptr_;
__k != __l.__ptr_; __k = __k->__next_)
{
if (__j->__ptr_ == __k)
{
- __cn1->__add(*__p);
- (*__p)->__c_ = __cn1;
- if (--__cn2->end_ != __p)
- memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
+ __cn1->__add(*__ip);
+ (*__ip)->__c_ = __cn1;
+ if (--__cn2->end_ != __ip)
+ memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
}
}
}
@@ -2083,7 +2093,7 @@ template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::remove(const value_type& __x)
{
- list<_Tp, _Alloc> __deleted_nodes; // collect the nodes we're removing
+ list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing
for (const_iterator __i = begin(), __e = end(); __i != __e;)
{
if (*__i == __x)
@@ -2328,14 +2338,14 @@ list<_Tp, _Alloc>::__decrementable(const const_iterator* __i) const
template <class _Tp, class _Alloc>
bool
-list<_Tp, _Alloc>::__addable(const const_iterator* __i, ptrdiff_t __n) const
+list<_Tp, _Alloc>::__addable(const const_iterator*, ptrdiff_t) const
{
return false;
}
template <class _Tp, class _Alloc>
bool
-list<_Tp, _Alloc>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const
+list<_Tp, _Alloc>::__subscriptable(const const_iterator*, ptrdiff_t) const
{
return false;
}
diff --git a/include/locale b/include/locale
index 3d804e86f4d1..a567085f68f4 100644
--- a/include/locale
+++ b/include/locale
@@ -523,8 +523,8 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex
return 0;
}
-_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_get<char>)
-_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_get<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>)
+_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>)
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY num_get
@@ -779,6 +779,7 @@ long double __do_strtod<long double>(const char* __a, char** __p2) {
}
template <class _Tp>
+_LIBCPP_HIDDEN
_Tp
__num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err)
{
@@ -1042,8 +1043,8 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
return __b;
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_get<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_get<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>)
struct _LIBCPP_TYPE_VIS __num_put_base
{
@@ -1192,8 +1193,8 @@ __num_put<_CharT>::__widen_and_group_float(char* __nb, char* __np, char* __ne,
__op = __ob + (__np - __nb);
}
-_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_put<char>)
-_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_put<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>)
+_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY num_put
@@ -1621,8 +1622,8 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
return __pad_and_output(__s, __o, __op, __oe, __iob, __fl);
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_put<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_put<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>)
template <class _CharT, class _InputIterator>
_LIBCPP_HIDDEN
@@ -2291,8 +2292,8 @@ time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
return __b;
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>)
class _LIBCPP_TYPE_VIS __time_get
{
@@ -2374,8 +2375,8 @@ private:
virtual const string_type& __X() const {return this->__X_;}
};
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get_byname<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get_byname<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>)
class _LIBCPP_TYPE_VIS __time_put
{
@@ -2487,8 +2488,8 @@ time_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base&,
return _VSTD::copy(__nb, __ne, __s);
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY time_put_byname
@@ -2508,8 +2509,8 @@ protected:
~time_put_byname() {}
};
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put_byname<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put_byname<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>)
// money_base
@@ -2575,10 +2576,10 @@ template <class _CharT, bool _International>
const bool
moneypunct<_CharT, _International>::intl;
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<char, false>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<char, true>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<wchar_t, false>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<wchar_t, true>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>)
// moneypunct_byname
@@ -2632,10 +2633,10 @@ template<> void moneypunct_byname<char, true>::init(const char*);
template<> void moneypunct_byname<wchar_t, false>::init(const char*);
template<> void moneypunct_byname<wchar_t, true>::init(const char*);
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<char, false>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<char, true>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<wchar_t, false>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<wchar_t, true>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, false>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>)
// money_get
@@ -2691,8 +2692,8 @@ __money_get<_CharT>::__gather_info(bool __intl, const locale& __loc,
}
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_get<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_get<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>)
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY money_get
@@ -3074,8 +3075,8 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
return __b;
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_get<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_get<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>)
// money_put
@@ -3249,8 +3250,8 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
__mi = __mb;
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_put<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_put<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY money_put
@@ -3402,8 +3403,8 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
return __pad_and_output(__s, __mb, __mi, __me, __iob, __fl);
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_put<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_put<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>)
// messages
@@ -3512,8 +3513,8 @@ messages<_CharT>::do_close(catalog __c) const
#endif // _LIBCPP_HAS_CATOPEN
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>)
template <class _CharT>
class _LIBCPP_TYPE_VIS_ONLY messages_byname
@@ -3536,8 +3537,8 @@ protected:
~messages_byname() {}
};
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages_byname<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages_byname<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>)
template<class _Codecvt, class _Elem = wchar_t,
class _Wide_alloc = allocator<_Elem>,
@@ -3701,10 +3702,10 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
if (__r == codecvt_base::ok)
return __ws;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (__wide_err_string_.empty())
- throw range_error("wstring_convert: from_bytes error");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_range_error("wstring_convert: from_bytes error");
+
return __wide_err_string_;
}
@@ -3790,10 +3791,10 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
return __bs;
}
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (__byte_err_string_.empty())
- throw range_error("wstring_convert: to_bytes error");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_range_error("wstring_convert: to_bytes error");
+
return __byte_err_string_;
}
@@ -3932,7 +3933,8 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()
streamsize __nmemb = _VSTD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
static_cast<streamsize>(__extbufend_ - __extbufnext_));
codecvt_base::result __r;
- state_type __svs = __st_;
+ // FIXME: Do we ever need to restore the state here?
+ //state_type __svs = __st_;
streamsize __nr = __bufptr_->sgetn(const_cast<char*>(__extbufnext_), __nmemb);
if (__nr != 0)
{
diff --git a/include/locale.h b/include/locale.h
new file mode 100644
index 000000000000..cad7b8b53eb1
--- /dev/null
+++ b/include/locale.h
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+//===---------------------------- locale.h --------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_LOCALE_H
+#define _LIBCPP_LOCALE_H
+
+/*
+ locale.h synopsis
+
+Macros:
+
+ LC_ALL
+ LC_COLLATE
+ LC_CTYPE
+ LC_MONETARY
+ LC_NUMERIC
+ LC_TIME
+
+Types:
+
+ lconv
+
+Functions:
+
+ setlocale
+ localeconv
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <locale.h>
+
+#endif // _LIBCPP_LOCALE_H
diff --git a/include/math.h b/include/math.h
index 20205544d51d..fb0b6083010b 100644
--- a/include/math.h
+++ b/include/math.h
@@ -308,10 +308,6 @@ extern "C++" {
#include <type_traits>
-#ifdef _LIBCPP_MSVCRT
-#include "support/win32/math_win32.h"
-#endif
-
// signbit
#ifdef signbit
@@ -636,11 +632,9 @@ isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
#endif // isunordered
-#ifndef __sun__
-
// abs
-#if !defined(_AIX)
+#if !(defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY
float
abs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);}
@@ -652,11 +646,11 @@ abs(double __lcpp_x) _NOEXCEPT {return fabs(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY
long double
abs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);}
-#endif // !defined(_AIX)
+#endif // !(defined(_AIX) || defined(__sun__))
// acos
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float acos(float __lcpp_x) _NOEXCEPT {return acosf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);}
#endif
@@ -668,7 +662,7 @@ acos(_A1 __lcpp_x) _NOEXCEPT {return acos((double)__lcpp_x);}
// asin
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float asin(float __lcpp_x) _NOEXCEPT {return asinf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return asinl(__lcpp_x);}
#endif
@@ -680,7 +674,7 @@ asin(_A1 __lcpp_x) _NOEXCEPT {return asin((double)__lcpp_x);}
// atan
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float atan(float __lcpp_x) _NOEXCEPT {return atanf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return atanl(__lcpp_x);}
#endif
@@ -692,7 +686,7 @@ atan(_A1 __lcpp_x) _NOEXCEPT {return atan((double)__lcpp_x);}
// atan2
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT {return atan2f(__lcpp_y, __lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return atan2l(__lcpp_y, __lcpp_x);}
#endif
@@ -715,7 +709,7 @@ atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
// ceil
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float ceil(float __lcpp_x) _NOEXCEPT {return ceilf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ceill(__lcpp_x);}
#endif
@@ -727,7 +721,7 @@ ceil(_A1 __lcpp_x) _NOEXCEPT {return ceil((double)__lcpp_x);}
// cos
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float cos(float __lcpp_x) _NOEXCEPT {return cosf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return cosl(__lcpp_x);}
#endif
@@ -739,7 +733,7 @@ cos(_A1 __lcpp_x) _NOEXCEPT {return cos((double)__lcpp_x);}
// cosh
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float cosh(float __lcpp_x) _NOEXCEPT {return coshf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return coshl(__lcpp_x);}
#endif
@@ -751,7 +745,7 @@ cosh(_A1 __lcpp_x) _NOEXCEPT {return cosh((double)__lcpp_x);}
// exp
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float exp(float __lcpp_x) _NOEXCEPT {return expf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return expl(__lcpp_x);}
#endif
@@ -763,7 +757,7 @@ exp(_A1 __lcpp_x) _NOEXCEPT {return exp((double)__lcpp_x);}
// fabs
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float fabs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);}
#endif
@@ -775,7 +769,7 @@ fabs(_A1 __lcpp_x) _NOEXCEPT {return fabs((double)__lcpp_x);}
// floor
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float floor(float __lcpp_x) _NOEXCEPT {return floorf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return floorl(__lcpp_x);}
#endif
@@ -787,7 +781,7 @@ floor(_A1 __lcpp_x) _NOEXCEPT {return floor((double)__lcpp_x);}
// fmod
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmodf(__lcpp_x, __lcpp_y);}
inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmodl(__lcpp_x, __lcpp_y);}
#endif
@@ -810,7 +804,7 @@ fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
// frexp
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpf(__lcpp_x, __lcpp_e);}
inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpl(__lcpp_x, __lcpp_e);}
#endif
@@ -822,7 +816,7 @@ frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexp((double)__lcpp_x, __l
// ldexp
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpf(__lcpp_x, __lcpp_e);}
inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpl(__lcpp_x, __lcpp_e);}
#endif
@@ -834,7 +828,7 @@ ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexp((double)__lcpp_x, __lc
// log
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float log(float __lcpp_x) _NOEXCEPT {return logf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return logl(__lcpp_x);}
#endif
@@ -846,7 +840,7 @@ log(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);}
// log10
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float log10(float __lcpp_x) _NOEXCEPT {return log10f(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return log10l(__lcpp_x);}
#endif
@@ -858,14 +852,14 @@ log10(_A1 __lcpp_x) _NOEXCEPT {return log10((double)__lcpp_x);}
// modf
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return modff(__lcpp_x, __lcpp_y);}
inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return modfl(__lcpp_x, __lcpp_y);}
#endif
// pow
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return powf(__lcpp_x, __lcpp_y);}
inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return powl(__lcpp_x, __lcpp_y);}
#endif
@@ -888,7 +882,7 @@ pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
// sin
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float sin(float __lcpp_x) _NOEXCEPT {return sinf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return sinl(__lcpp_x);}
#endif
@@ -900,7 +894,7 @@ sin(_A1 __lcpp_x) _NOEXCEPT {return sin((double)__lcpp_x);}
// sinh
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float sinh(float __lcpp_x) _NOEXCEPT {return sinhf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return sinhl(__lcpp_x);}
#endif
@@ -912,21 +906,19 @@ sinh(_A1 __lcpp_x) _NOEXCEPT {return sinh((double)__lcpp_x);}
// sqrt
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return sqrtf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return sqrtl(__lcpp_x);}
#endif
-#endif // __sun__
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
sqrt(_A1 __lcpp_x) _NOEXCEPT {return sqrt((double)__lcpp_x);}
-#ifndef __sun__
// tan
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float tan(float __lcpp_x) _NOEXCEPT {return tanf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return tanl(__lcpp_x);}
#endif
@@ -938,7 +930,7 @@ tan(_A1 __lcpp_x) _NOEXCEPT {return tan((double)__lcpp_x);}
// tanh
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
+#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY float tanh(float __lcpp_x) _NOEXCEPT {return tanhf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return tanhl(__lcpp_x);}
#endif
@@ -1410,7 +1402,6 @@ typename std::enable_if<std::is_integral<_A1>::value, double>::type
trunc(_A1 __lcpp_x) _NOEXCEPT {return trunc((double)__lcpp_x);}
#endif // !_LIBCPP_MSVCRT
-#endif // __sun__
} // extern "C++"
diff --git a/include/memory b/include/memory
index 7a3281e17931..b4c2b35c0b73 100644
--- a/include/memory
+++ b/include/memory
@@ -164,6 +164,7 @@ template <class T> pair<T*,ptrdiff_t> get_temporary_buffer(ptrdiff_t n) noexcept
template <class T> void return_temporary_buffer(T* p) noexcept;
template <class T> T* addressof(T& r) noexcept;
+template <class T> T* addressof(const T&& r) noexcept = delete;
template <class InputIterator, class ForwardIterator>
ForwardIterator
@@ -180,6 +181,33 @@ template <class ForwardIterator, class Size, class T>
ForwardIterator
uninitialized_fill_n(ForwardIterator first, Size n, const T& x);
+template <class T>
+void destroy_at(T* location);
+
+template <class ForwardIterator>
+ void destroy(ForwardIterator first, ForwardIterator last);
+
+template <class ForwardIterator, class Size>
+ ForwardIterator destroy_n(ForwardIterator first, Size n);
+
+template <class InputIterator, class ForwardIterator>
+ ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result);
+
+template <class InputIterator, class Size, class ForwardIterator>
+ pair<InputIterator,ForwardIterator> uninitialized_move_n(InputIterator first, Size n, ForwardIterator result);
+
+template <class ForwardIterator>
+ void uninitialized_value_construct(ForwardIterator first, ForwardIterator last);
+
+template <class ForwardIterator, class Size>
+ ForwardIterator uninitialized_value_construct_n(ForwardIterator first, Size n);
+
+template <class ForwardIterator>
+ void uninitialized_default_construct(ForwardIterator first, ForwardIterator last);
+
+template <class ForwardIterator, class Size>
+ ForwardIterator uninitialized_default_construct_n(ForwardIterator first, Size n);
+
template <class Y> struct auto_ptr_ref {};
template<class X>
@@ -610,9 +638,6 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
#include <tuple>
#include <stdexcept>
#include <cstring>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
- #include <cassert>
-#endif
#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
# include <atomic>
@@ -639,7 +664,19 @@ _ValueType __libcpp_relaxed_load(_ValueType const* __value) {
#endif
}
-// addressof moved to <__functional_base>
+template <class _ValueType>
+inline _LIBCPP_ALWAYS_INLINE
+_ValueType __libcpp_acquire_load(_ValueType const* __value) {
+#if !defined(_LIBCPP_HAS_NO_THREADS) && \
+ defined(__ATOMIC_ACQUIRE) && \
+ (__has_builtin(__atomic_load_n) || _GNUC_VER >= 407)
+ return __atomic_load_n(__value, __ATOMIC_ACQUIRE);
+#else
+ return *__value;
+#endif
+}
+
+// addressof moved to <type_traits>
template <class _Tp> class allocator;
@@ -792,7 +829,7 @@ public:
template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
struct __pointer_traits_rebind
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Tp::template rebind<_Up> type;
#else
typedef typename _Tp::template rebind<_Up>::other type;
@@ -804,7 +841,7 @@ struct __pointer_traits_rebind
template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
@@ -822,7 +859,7 @@ struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false>
template <template <class> class _Sp, class _Tp, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp>::template rebind<_Up>::other type;
@@ -838,7 +875,7 @@ struct __pointer_traits_rebind<_Sp<_Tp>, _Up, false>
template <template <class, class> class _Sp, class _Tp, class _A0, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _A0>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _A0>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _A0>::template rebind<_Up>::other type;
@@ -855,7 +892,7 @@ template <template <class, class, class> class _Sp, class _Tp, class _A0,
class _A1, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _A0, _A1>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _A0, _A1>::template rebind<_Up>::other type;
@@ -873,7 +910,7 @@ template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
class _A1, class _A2, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _A0, _A1, _A2>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _A0, _A1, _A2>::template rebind<_Up>::other type;
@@ -896,12 +933,12 @@ struct _LIBCPP_TYPE_VIS_ONLY pointer_traits
typedef typename __pointer_traits_element_type<pointer>::type element_type;
typedef typename __pointer_traits_difference_type<pointer>::type difference_type;
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
#else
template <class _Up> struct rebind
{typedef typename __pointer_traits_rebind<pointer, _Up>::type other;};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
private:
struct __nat {};
@@ -919,7 +956,7 @@ struct _LIBCPP_TYPE_VIS_ONLY pointer_traits<_Tp*>
typedef _Tp element_type;
typedef ptrdiff_t difference_type;
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Up> using rebind = _Up*;
#else
template <class _Up> struct rebind {typedef _Up* other;};
@@ -936,7 +973,7 @@ public:
template <class _From, class _To>
struct __rebind_pointer {
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_From>::template rebind<_To> type;
#else
typedef typename pointer_traits<_From>::template rebind<_To>::other type;
@@ -1000,7 +1037,7 @@ struct __const_pointer
template <class _Tp, class _Ptr, class _Alloc>
struct __const_pointer<_Tp, _Ptr, _Alloc, false>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_Ptr>::template rebind<const _Tp> type;
#else
typedef typename pointer_traits<_Ptr>::template rebind<const _Tp>::other type;
@@ -1027,7 +1064,7 @@ struct __void_pointer
template <class _Ptr, class _Alloc>
struct __void_pointer<_Ptr, _Alloc, false>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_Ptr>::template rebind<void> type;
#else
typedef typename pointer_traits<_Ptr>::template rebind<void>::other type;
@@ -1054,7 +1091,7 @@ struct __const_void_pointer
template <class _Ptr, class _Alloc>
struct __const_void_pointer<_Ptr, _Alloc, false>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_Ptr>::template rebind<const void> type;
#else
typedef typename pointer_traits<_Ptr>::template rebind<const void>::other type;
@@ -1285,7 +1322,7 @@ struct __allocator_traits_rebind<_Alloc<_Tp, _A0, _A1, _A2>, _Up, false>
#endif // _LIBCPP_HAS_NO_VARIADICS
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#ifndef _LIBCPP_CXX03_LANG
template <class _Alloc, class _SizeType, class _ConstVoidPtr>
auto
@@ -1308,7 +1345,7 @@ struct __has_allocate_hint
{
};
-#else // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#else // _LIBCPP_CXX03_LANG
template <class _Alloc, class _SizeType, class _ConstVoidPtr>
struct __has_allocate_hint
@@ -1316,9 +1353,9 @@ struct __has_allocate_hint
{
};
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif // _LIBCPP_CXX03_LANG
-#if !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#if !defined(_LIBCPP_CXX03_LANG)
template <class _Alloc, class _Tp, class ..._Args>
decltype(_VSTD::declval<_Alloc>().construct(_VSTD::declval<_Tp*>(),
@@ -1399,7 +1436,7 @@ struct __has_select_on_container_copy_construction
{
};
-#else // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#else // _LIBCPP_CXX03_LANG
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -1437,7 +1474,7 @@ struct __has_select_on_container_copy_construction
{
};
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif // _LIBCPP_CXX03_LANG
template <class _Alloc, class _Ptr, bool = __has_difference_type<_Alloc>::value>
struct __alloc_traits_difference_type
@@ -1474,16 +1511,16 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
typedef typename __is_always_equal<allocator_type>::type
is_always_equal;
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp> using rebind_alloc =
typename __allocator_traits_rebind<allocator_type, _Tp>::type;
template <class _Tp> using rebind_traits = allocator_traits<rebind_alloc<_Tp>>;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _Tp> struct rebind_alloc
{typedef typename __allocator_traits_rebind<allocator_type, _Tp>::type other;};
template <class _Tp> struct rebind_traits
{typedef allocator_traits<typename rebind_alloc<_Tp>::other> other;};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
static pointer allocate(allocator_type& __a, size_type __n)
@@ -1568,7 +1605,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
is_trivially_move_constructible<_Tp>::value,
void
>::type
- __construct_forward(allocator_type& __a, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
+ __construct_forward(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
{
ptrdiff_t _Np = __end1 - __begin1;
if (_Np > 0)
@@ -1598,7 +1635,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
is_trivially_move_constructible<_Tp>::value,
void
>::type
- __construct_range_forward(allocator_type& __a, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
+ __construct_range_forward(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
{
typedef typename remove_const<_Tp>::type _Vp;
ptrdiff_t _Np = __end1 - __begin1;
@@ -1632,7 +1669,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
is_trivially_move_constructible<_Tp>::value,
void
>::type
- __construct_backward(allocator_type& __a, _Tp* __begin1, _Tp* __end1, _Tp*& __end2)
+ __construct_backward(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __end2)
{
ptrdiff_t _Np = __end1 - __begin1;
__end2 -= _Np;
@@ -1695,7 +1732,7 @@ private:
template <class _Traits, class _Tp>
struct __rebind_alloc_helper
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Traits::template rebind_alloc<_Tp> type;
#else
typedef typename _Traits::template rebind_alloc<_Tp>::other type;
@@ -1730,8 +1767,8 @@ public:
_LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator<void>::const_pointer = 0)
{
if (__n > max_size())
- __libcpp_throw(length_error("allocator<T>::allocate(size_t n)"
- " 'n' exceeds maximum supported size"));
+ __throw_length_error("allocator<T>::allocate(size_t n)"
+ " 'n' exceeds maximum supported size");
return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp)));
}
_LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT
@@ -1826,8 +1863,8 @@ public:
_LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator<void>::const_pointer = 0)
{
if (__n > max_size())
- __libcpp_throw(length_error("allocator<const T>::allocate(size_t n)"
- " 'n' exceeds maximum supported size"));
+ __throw_length_error("allocator<const T>::allocate(size_t n)"
+ " 'n' exceeds maximum supported size");
return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp)));
}
_LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT
@@ -2068,49 +2105,11 @@ public:
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
: __first_(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
-#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
- is_nothrow_copy_constructible<_T2>::value)
- : __first_(__p.first()),
- __second_(__p.second()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
- is_nothrow_copy_assignable<_T2>::value)
- {
- __first_ = __p.first();
- __second_ = __p.second();
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : __first_(_VSTD::forward<_T1>(__p.first())),
- __second_(_VSTD::forward<_T2>(__p.second())) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
- is_nothrow_move_assignable<_T2>::value)
- {
- __first_ = _VSTD::forward<_T1>(__p.first());
- __second_ = _VSTD::forward<_T2>(__p.second());
- return *this;
- }
-
-#endif // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
+ __libcpp_compressed_pair_imp(piecewise_construct_t,
tuple<_Args1...> __first_args,
tuple<_Args2...> __second_args,
__tuple_indices<_I1...>,
@@ -2161,47 +2160,11 @@ public:
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
: _T1(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
-#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
- is_nothrow_copy_constructible<_T2>::value)
- : _T1(__p.first()), __second_(__p.second()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
- is_nothrow_copy_assignable<_T2>::value)
- {
- _T1::operator=(__p.first());
- __second_ = __p.second();
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : _T1(_VSTD::move(__p.first())), __second_(_VSTD::forward<_T2>(__p.second())) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
- is_nothrow_move_assignable<_T2>::value)
- {
- _T1::operator=(_VSTD::move(__p.first()));
- __second_ = _VSTD::forward<_T2>(__p.second());
- return *this;
- }
-
-#endif // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
+ __libcpp_compressed_pair_imp(piecewise_construct_t,
tuple<_Args1...> __first_args,
tuple<_Args2...> __second_args,
__tuple_indices<_I1...>,
@@ -2253,47 +2216,11 @@ public:
is_nothrow_move_constructible<_T2>::value)
: _T2(_VSTD::forward<_T2_param>(__t2)), __first_(_VSTD::forward<_T1_param>(__t1)) {}
-#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
- is_nothrow_copy_constructible<_T2>::value)
- : _T2(__p.second()), __first_(__p.first()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
- is_nothrow_copy_assignable<_T2>::value)
- {
- _T2::operator=(__p.second());
- __first_ = __p.first();
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : _T2(_VSTD::forward<_T2>(__p.second())), __first_(_VSTD::move(__p.first())) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
- is_nothrow_move_assignable<_T2>::value)
- {
- _T2::operator=(_VSTD::forward<_T2>(__p.second()));
- __first_ = _VSTD::move(__p.first());
- return *this;
- }
-
-#endif // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
+ __libcpp_compressed_pair_imp(piecewise_construct_t,
tuple<_Args1...> __first_args,
tuple<_Args2...> __second_args,
__tuple_indices<_I1...>,
@@ -2343,47 +2270,11 @@ public:
_LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
: _T1(_VSTD::forward<_T1_param>(__t1)), _T2(_VSTD::forward<_T2_param>(__t2)) {}
-#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
- is_nothrow_copy_constructible<_T2>::value)
- : _T1(__p.first()), _T2(__p.second()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
- is_nothrow_copy_assignable<_T2>::value)
- {
- _T1::operator=(__p.first());
- _T2::operator=(__p.second());
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : _T1(_VSTD::move(__p.first())), _T2(_VSTD::move(__p.second())) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
- is_nothrow_move_assignable<_T2>::value)
- {
- _T1::operator=(_VSTD::move(__p.first()));
- _T2::operator=(_VSTD::move(__p.second()));
- return *this;
- }
-
-#endif // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
+ __libcpp_compressed_pair_imp(piecewise_construct_t,
tuple<_Args1...> __first_args,
tuple<_Args2...> __second_args,
__tuple_indices<_I1...>,
@@ -2430,40 +2321,6 @@ public:
_LIBCPP_INLINE_VISIBILITY __compressed_pair(_T1_param __t1, _T2_param __t2)
: base(_VSTD::forward<_T1_param>(__t1), _VSTD::forward<_T2_param>(__t2)) {}
-#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
- _LIBCPP_INLINE_VISIBILITY
- __compressed_pair(const __compressed_pair& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
- is_nothrow_copy_constructible<_T2>::value)
- : base(__p) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __compressed_pair& operator=(const __compressed_pair& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
- is_nothrow_copy_assignable<_T2>::value)
- {
- base::operator=(__p);
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __compressed_pair(__compressed_pair&& __p)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : base(_VSTD::move(__p)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __compressed_pair& operator=(__compressed_pair&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
- is_nothrow_move_assignable<_T2>::value)
- {
- base::operator=(_VSTD::move(__p));
- return *this;
- }
-
-#endif // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args1, class... _Args2>
@@ -2526,7 +2383,7 @@ struct __same_or_less_cv_qualified<_Ptr1, _Ptr2, false>
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY default_delete
{
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
#else
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
@@ -2546,7 +2403,7 @@ template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY default_delete<_Tp[]>
{
public:
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
#else
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
@@ -3488,6 +3345,17 @@ struct __scalar_hash<_Tp, 4>
}
};
+_LIBCPP_INLINE_VISIBILITY
+inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT {
+ struct _PairT {
+ size_t first;
+ size_t second;
+ };
+ typedef __scalar_hash<_PairT> _HashT;
+ const _PairT __p = {__lhs, __rhs};
+ return _HashT()(__p);
+}
+
template<class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY hash<_Tp*>
: public unary_function<_Tp*, size_t>
@@ -3671,6 +3539,148 @@ uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)
return __f;
}
+#if _LIBCPP_STD_VER > 14
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+void destroy_at(_Tp* __loc) {
+ _LIBCPP_ASSERT(__loc, "null pointer given to destroy_at");
+ __loc->~_Tp();
+}
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+void destroy(_ForwardIterator __first, _ForwardIterator __last) {
+ for (; __first != __last; ++__first)
+ _VSTD::destroy_at(_VSTD::addressof(*__first));
+}
+
+template <class _ForwardIterator, class _Size>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {
+ for (; __n > 0; (void)++__first, --__n)
+ _VSTD::destroy_at(_VSTD::addressof(*__first));
+ return __first;
+}
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator __last) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __idx != __last; ++__idx)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+template <class _ForwardIterator, class _Size>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __n > 0; (void)++__idx, --__n)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt;
+ return __idx;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __last) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __idx != __last; ++__idx)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt();
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+template <class _ForwardIterator, class _Size>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __n > 0; (void)++__idx, --__n)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt();
+ return __idx;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+
+template <class _InputIt, class _ForwardIt>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIt uninitialized_move(_InputIt __first, _InputIt __last, _ForwardIt __first_res) {
+ using _Vt = typename iterator_traits<_ForwardIt>::value_type;
+ auto __idx = __first_res;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __first != __last; (void)++__idx, ++__first)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt(std::move(*__first));
+ return __idx;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first_res, __idx);
+ throw;
+ }
+#endif
+}
+
+template <class _InputIt, class _Size, class _ForwardIt>
+inline _LIBCPP_INLINE_VISIBILITY
+pair<_InputIt, _ForwardIt>
+uninitialized_move_n(_InputIt __first, _Size __n, _ForwardIt __first_res) {
+ using _Vt = typename iterator_traits<_ForwardIt>::value_type;
+ auto __idx = __first_res;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __n > 0; ++__idx, (void)++__first, --__n)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt(std::move(*__first));
+ return {__first, __idx};
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first_res, __idx);
+ throw;
+ }
+#endif
+}
+
+
+#endif // _LIBCPP_STD_VER > 14
+
class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
: public std::exception
{
@@ -3679,6 +3689,16 @@ public:
virtual const char* what() const _NOEXCEPT;
};
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_weak_ptr()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_weak_ptr();
+#else
+ _VSTD::abort();
+#endif
+}
+
template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY weak_ptr;
class _LIBCPP_TYPE_VIS __shared_count
@@ -5335,11 +5355,7 @@ shared_ptr<_Tp>::shared_ptr(const weak_ptr<_Yp>& __r,
__cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_)
{
if (__cntrl_ == 0)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_weak_ptr();
-#else
- assert(!"bad_weak_ptr");
-#endif
+ __throw_bad_weak_ptr();
}
template<class _Tp>
diff --git a/include/module.modulemap b/include/module.modulemap
index 3fb7428411df..95610bfb735e 100644
--- a/include/module.modulemap
+++ b/include/module.modulemap
@@ -1,13 +1,224 @@
+// define the module for __config outside of the top level 'std' module
+// since __config may be included from C headers which may create an
+// include cycle.
+module std_config [system] [extern_c] {
+ header "__config"
+}
+
module std [system] {
+ export std_config
// FIXME: The standard does not require that each of these submodules
// re-exports its imported modules. We should provide an alternative form of
// export that issues a warning if a name from the submodule is used, and
// use that to provide a 'strict mode' for libc++.
+
+ // Deprecated C-compatibility headers. These can all be included from within
+ // an 'extern "C"' context.
+ module depr [extern_c] {
+ // <assert.h> provided by C library.
+ module ctype_h {
+ header "ctype.h"
+ export *
+ }
+ module errno_h {
+ header "errno.h"
+ export *
+ }
+ // <fenv.h> provided by C library.
+ // <float.h> provided by compiler or C library.
+ module inttypes_h {
+ header "inttypes.h"
+ export stdint_h
+ export *
+ }
+ // <iso646.h> provided by compiler.
+ // <limits.h> provided by compiler or C library.
+ module locale_h {
+ header "locale.h"
+ export *
+ }
+ module math_h {
+ header "math.h"
+ export *
+ }
+ module setjmp_h {
+ header "setjmp.h"
+ export *
+ }
+ // FIXME: <stdalign.h> is missing.
+ // <signal.h> provided by C library.
+ // <stdarg.h> provided by compiler.
+ // <stdbool.h> provided by compiler.
+ module stddef_h {
+ // <stddef.h>'s __need_* macros require textual inclusion.
+ textual header "stddef.h"
+ }
+ module stdint_h {
+ header "stdint.h"
+ export *
+ // FIXME: This module only exists on OS X and for some reason the
+ // wildcard above doesn't export it.
+ export Darwin.C.stdint
+ }
+ module stdio_h {
+ // <stdio.h>'s __need_* macros require textual inclusion.
+ textual header "stdio.h"
+ export *
+ export Darwin.C.stdio
+ }
+ module stdlib_h {
+ // <stdlib.h>'s __need_* macros require textual inclusion.
+ textual header "stdlib.h"
+ export *
+ }
+ module string_h {
+ header "string.h"
+ export *
+ }
+ // FIXME: <uchar.h> is missing.
+ // <time.h> provided by C library.
+ module wchar_h {
+ // <wchar.h>'s __need_* macros require textual inclusion.
+ textual header "wchar.h"
+ export *
+ }
+ module wctype_h {
+ header "wctype.h"
+ export *
+ }
+ }
+
+ // <complex.h> and <tgmath.h> are not C headers in any real sense, do not
+ // allow their use in extern "C" contexts.
+ module complex_h {
+ header "complex.h"
+ export ccomplex
+ export *
+ }
+ module tgmath_h {
+ header "tgmath.h"
+ export ccomplex
+ export cmath
+ export *
+ }
+
+ // C compatibility headers.
+ module compat {
+ module cassert {
+ // <cassert>'s use of NDEBUG requires textual inclusion.
+ textual header "cassert"
+ }
+ module ccomplex {
+ header "ccomplex"
+ export complex
+ export *
+ }
+ module cctype {
+ header "cctype"
+ export *
+ }
+ module cerrno {
+ header "cerrno"
+ export *
+ }
+ module cfenv {
+ header "cfenv"
+ export *
+ }
+ module cfloat {
+ header "cfloat"
+ export *
+ }
+ module cinttypes {
+ header "cinttypes"
+ export cstdint
+ export *
+ }
+ module ciso646 {
+ header "ciso646"
+ export *
+ }
+ module climits {
+ header "climits"
+ export *
+ }
+ module clocale {
+ header "clocale"
+ export *
+ }
+ module cmath {
+ header "cmath"
+ export *
+ }
+ module csetjmp {
+ header "csetjmp"
+ export *
+ }
+ module csignal {
+ header "csignal"
+ export *
+ }
+ // FIXME: <cstdalign> is missing.
+ module cstdarg {
+ header "cstdarg"
+ export *
+ }
+ module cstdbool {
+ header "cstdbool"
+ export *
+ }
+ module cstddef {
+ header "cstddef"
+ export *
+ }
+ module cstdint {
+ header "cstdint"
+ export depr.stdint_h
+ export *
+ }
+ module cstdio {
+ header "cstdio"
+ export *
+ }
+ module cstdlib {
+ header "cstdlib"
+ export *
+ }
+ module cstring {
+ header "cstring"
+ export *
+ }
+ module ctgmath {
+ header "ctgmath"
+ export ccomplex
+ export cmath
+ export *
+ }
+ module ctime {
+ header "ctime"
+ export *
+ }
+ // FIXME: <cuchar> is missing.
+ module cwchar {
+ header "cwchar"
+ export depr.stdio_h
+ export *
+ }
+ module cwctype {
+ header "cwctype"
+ export *
+ }
+ }
+
module algorithm {
header "algorithm"
export initializer_list
export *
}
+ module any {
+ header "any"
+ export *
+ }
module array {
header "array"
export initializer_list
@@ -16,7 +227,6 @@ module std [system] {
module atomic {
header "atomic"
export *
- requires cplusplus11
}
module bitset {
header "bitset"
@@ -25,118 +235,10 @@ module std [system] {
export *
}
// No submodule for cassert. It fundamentally needs repeated, textual inclusion.
- module ccomplex {
- header "ccomplex"
- export complex
- export *
- }
- module cctype {
- header "cctype"
- export *
- }
- module cerrno {
- header "cerrno"
-/*
- export_macros ECONNREFUSED, EIO, ENODEV, ENOTEMPTY, ERANGE,
- E2BIG, ECONNRESET, EISCONN, ENOENT, ENOTRECOVERABLE, EROFS,
- EACCES, EDEADLK, EISDIR, ENOEXEC, ENOTSOCK, ESPIPE,
- EADDRINUSE, EDESTADDRREQ, ELOOP, ENOLCK, ENOTSUP, ESRCH,
- EADDRNOTAVAIL, EDOM, EMFILE, ENOLINK, ENOTTY, ETIME,
- EAFNOSUPPORT, EEXIST, EMLINK, ENOMEM, ENXIO, ETIMEDOUT,
- EAGAIN, EFAULT, EMSGSIZE, ENOMSG, EOPNOTSUPP, ETXTBSY,
- EALREADY, EFBIG, ENAMETOOLONG, ENOPROTOOPT, EOVERFLOW, EWOULDBLOCK,
- EBADF, EHOSTUNREACH, ENETDOWN, ENOSPC, EOWNERDEAD, EXDEV,
- EBADMSG, EIDRM, ENETRESET, ENOSR, EPERM, errno,
- EBUSY, EILSEQ, ENETUNREACH, ENOSTR, EPIPE,
- ECANCELED, EINPROGRESS, ENFILE, ENOSYS, EPROTO,
- ECHILD, EINTR, ENOBUFS, ENOTCONN, EPROTONOSUPPORT,
- ECONNABORTED, EINVAL, ENODATA, ENOTDIR, EPROTOTYPE
-*/
- export *
- }
- module cfenv {
- header "cfenv"
-/*
- export_macros FE_ALL_EXCEPT, FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW,
- FE_UNDERFLOW, FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD,
- FE_DFL_ENV
-*/
- export *
- }
- module cfloat {
- header "cfloat"
-/*
- export_macros FLT_EVAL_METHOD, FLT_RADIX, FLT_ROUNDS,
- FLT_DIG, FLT_EPSILON, FLT_MANT_DIG,
- FLT_MAX, FLT_MAX_10_EXP, FLT_MAX_EXP,
- FLT_MIN, FLT_MIN_10_EXP, FLT_MIN_EXP,
- DBL_DIG, DBL_EPSILON, DBL_MANT_DIG,
- DBL_MAX, DBL_MAX_10_EXP, DBL_MAX_EXP,
- DBL_MIN, DBL_MIN_10_EXP, DBL_MIN_EXP,
- LDBL_DIG, LDBL_EPSILON, LDBL_MANT_DIG,
- LDBL_MAX, LDBL_MAX_10_EXP, LDBL_MAX_EXP,
- LDBL_MIN, LDBL_MIN_10_EXP, LDBL_MIN_EXP
-*/
- export *
- }
module chrono {
header "chrono"
export *
}
- module cinttypes {
- header "cinttypes"
- export cstdint
-/*
- export_macros
- PRId8, PRId16, PRId32, PRId64, PRIdFAST8, PRIdFAST16, PRIdFAST32, PRIdFAST64, PRIdLEAST8, PRIdLEAST16, PRIdLEAST32, PRIdLEAST64, PRIdMAX, PRIdPTR,
- PRIi8, PRIi16, PRIi32, PRIi64, PRIiFAST8, PRIiFAST16, PRIiFAST32, PRIiFAST64, PRIiLEAST8, PRIiLEAST16, PRIiLEAST32, PRIiLEAST64, PRIiMAX, PRIiPTR,
- PRIo8, PRIo16, PRIo32, PRIo64, PRIoFAST8, PRIoFAST16, PRIoFAST32, PRIoFAST64, PRIoLEAST8, PRIoLEAST16, PRIoLEAST32, PRIoLEAST64, PRIoMAX, PRIoPTR,
- PRIu8, PRIu16, PRIu32, PRIu64, PRIuFAST8, PRIuFAST16, PRIuFAST32, PRIuFAST64, PRIuLEAST8, PRIuLEAST16, PRIuLEAST32, PRIuLEAST64, PRIuMAX, PRIuPTR,
- PRIx8, PRIx16, PRIx32, PRIx64, PRIxFAST8, PRIxFAST16, PRIxFAST32, PRIxFAST64, PRIxLEAST8, PRIxLEAST16, PRIxLEAST32, PRIxLEAST64, PRIxMAX, PRIxPTR,
- PRIX8, PRIX16, PRIX32, PRIX64, PRIXFAST8, PRIXFAST16, PRIXFAST32, PRIXFAST64, PRIXLEAST8, PRIXLEAST16, PRIXLEAST32, PRIXLEAST64, PRIXMAX, PRIXPTR,
- SCNd8, SCNd16, SCNd32, SCNd64, SCNdFAST8, SCNdFAST16, SCNdFAST32, SCNdFAST64, SCNdLEAST8, SCNdLEAST16, SCNdLEAST32, SCNdLEAST64, SCNdMAX, SCNdPTR,
- SCNi8, SCNi16, SCNi32, SCNi64, SCNiFAST8, SCNiFAST16, SCNiFAST32, SCNiFAST64, SCNiLEAST8, SCNiLEAST16, SCNiLEAST32, SCNiLEAST64, SCNiMAX, SCNiPTR,
- SCNo8, SCNo16, SCNo32, SCNo64, SCNoFAST8, SCNoFAST16, SCNoFAST32, SCNoFAST64, SCNoLEAST8, SCNoLEAST16, SCNoLEAST32, SCNoLEAST64, SCNoMAX, SCNoPTR,
- SCNu8, SCNu16, SCNu32, SCNu64, SCNuFAST8, SCNuFAST16, SCNuFAST32, SCNuFAST64, SCNuLEAST8, SCNuLEAST16, SCNuLEAST32, SCNuLEAST64, SCNuMAX, SCNuPTR,
- SCNx8, SCNx16, SCNx32, SCNx64, SCNxFAST8, SCNxFAST16, SCNxFAST32, SCNxFAST64, SCNxLEAST8, SCNxLEAST16, SCNxLEAST32, SCNxLEAST64, SCNxMAX, SCNxPTR,
- SCNX8, SCNX16, SCNX32, SCNX64, SCNXFAST8, SCNXFAST16, SCNXFAST32, SCNXFAST64, SCNXLEAST8, SCNXLEAST16, SCNXLEAST32, SCNXLEAST64, SCNXMAX, SCNXPTR
-*/
- export *
- }
- module ciso646 {
- header "ciso646"
- export *
- }
- module climits {
- header "climits"
-/*
- export_macros CHAR_BIT, CHAR_MIN, CHAR_MAX,
- SCHAR_MIN, SCHAR_MAX, UCHAR_MAX,
- SHRT_MIN, SHRT_MAX, USHRT_MAX,
- INT_MIN, INT_MAX, UINT_MAX,
- LONG_MIN, LONG_MAX, ULONG_MAX,
- LLONG_MIN, LLONG_MAX, ULLONG_MAX,
- MB_LEN_MAX
-*/
- export *
- }
- module clocale {
- header "clocale"
-/*
- export_macros LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME, NULL
-*/
- export *
- }
- module cmath {
- header "cmath"
-/*
- export_macros FP_FAST_FMA, FP_FAST_FMAF, FP_FAST_FMAL, FP_ILOGBO, FP_ILOGBNAN,
- FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO,
- HUGE_VAL, HUGE_VALF, HUGE_VALL, INFINITY, NAN,
- MATH_ERRNO, MATH_ERREXCEPT, math_errhandling
-*/
- export *
- }
module codecvt {
header "codecvt"
export *
@@ -149,108 +251,6 @@ module std [system] {
header "condition_variable"
export *
}
- module csetjmp {
- header "csetjmp"
-/*
- export_macros setjmp
-*/
- export *
- }
- module csignal {
- header "csignal"
-/*
- export_macros SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM,
- SIG_DFL, SIG_IGN, SIG_ERR
-*/
- export *
- }
- module cstdarg {
- header "cstdarg"
-/*
- export_macros va_arg, va_start, va_end, va_copy
-*/
- export *
- }
- module cstdbool {
- header "cstdbool"
-/*
- export_macros __bool_true_false_are_defined
-*/
- export *
- }
- module cstddef {
- header "cstddef"
-/*
- export_macros NULL, offsetof
-*/
- export *
- }
- module cstdint {
- header "cstdint"
-/*
- export_macros
- INT_8_MIN, INT_8_MAX, UINT_8_MAX, INT_16_MIN, INT_16_MAX, UINT_16_MAX,
- INT_32_MIN, INT_32_MAX, UINT_32_MAX, INT_64_MIN, INT_64_MAX, UINT_64_MAX,
- INT_FAST8_MIN, INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX, UINT_FAST16_MAX,
- INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX, INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX,
- INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX, INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX,
- INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
- INT_MAX_MIN, INT_MAX_MAX, UINT_MAX_MAX, INT_PTR_MIN, INT_PTR_MAX, UINT_PTR_MAX,
- PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX,
- SIZE_MAX
-*/
- export *
- }
- module cstdio {
- header "cstdio"
-/*
- export_macros BUFSIZ, EOF, FILENAME_MAX, FOPEN_MAX, L_tmpnam, NULL,
- SEEK_CUR, SEEK_END, SEEK_SET, TMP_MAX, _IOFBF, _IOLBF,
- stdin, stdout, stderr
-*/
- export *
- }
- module cstdlib {
- header "cstdlib"
-/*
- export_macros RAND_MAX
-*/
- export *
- }
- module cstring {
- header "cstring"
-/*
- export_macros NULL
-*/
- export *
- }
- module ctgmath {
- header "ctgmath"
- export ccomplex
- export cmath
- export *
- }
- module ctime {
- header "ctime"
-/*
- export_macros NULL, CLOCKS_PER_SEC
-*/
- export *
- }
- module cwchar {
- header "cwchar"
-/*
- export_macros NULL, WCHAR_MAX, WCHAR_MIN, WEOF
-*/
- export *
- }
- module cwctype {
- header "cwctype"
-/*
- export_macros WEOF
-*/
- export *
- }
module deque {
header "deque"
export initializer_list
@@ -345,6 +345,10 @@ module std [system] {
header "numeric"
export *
}
+ module optional {
+ header "optional"
+ export *
+ }
module ostream {
header "ostream"
// FIXME: should re-export ios, streambuf?
@@ -399,11 +403,19 @@ module std [system] {
module string {
header "string"
export initializer_list
+ export string_view
+ export __string
+ export *
+ }
+ module string_view {
+ header "string_view"
+ export initializer_list
+ export __string
export *
}
module strstream {
header "strstream"
- requires !cplusplus11
+ export *
}
module system_error {
header "system_error"
@@ -449,17 +461,16 @@ module std [system] {
export initializer_list
export *
}
+ module variant {
+ header "variant"
+ export *
+ }
module vector {
header "vector"
export initializer_list
export *
}
- // FIXME: We don't have modules for the <foo.h> headers, because they might
- // be included from the C library's headers, and that would create a #include
- // cycle. For the same reason, we don't have a module for __config.
- //module __config { header "__config" export * }
-
// FIXME: These should be private.
module __bit_reference { header "__bit_reference" export * }
module __debug { header "__debug" export * }
@@ -470,8 +481,127 @@ module std [system] {
module __split_buffer { header "__split_buffer" export * }
module __sso_allocator { header "__sso_allocator" export * }
module __std_stream { header "__std_stream" export * }
+ module __string { header "__string" export * }
module __tree { header "__tree" export * }
module __tuple { header "__tuple" export * }
module __undef_min_max { header "__undef_min_max" export * }
module __undef___deallocate { header "__undef___deallocate" export * }
+
+ module experimental {
+ requires cplusplus11
+
+ module algorithm {
+ header "experimental/algorithm"
+ export *
+ }
+ module any {
+ header "experimental/any"
+ export *
+ }
+ module chrono {
+ header "experimental/chrono"
+ export *
+ }
+ module deque {
+ header "experimental/deque"
+ export *
+ }
+ module dynarray {
+ header "experimental/dynarray"
+ export *
+ }
+ module filesystem {
+ header "experimental/filesystem"
+ export *
+ }
+ module forward_list {
+ header "experimental/forward_list"
+ export *
+ }
+ module functional {
+ header "experimental/functional"
+ export *
+ }
+ module iterator {
+ header "experimental/iterator"
+ export *
+ }
+ module list {
+ header "experimental/list"
+ export *
+ }
+ module map {
+ header "experimental/map"
+ export *
+ }
+ module memory_resource {
+ header "experimental/memory_resource"
+ export *
+ }
+ module numeric {
+ header "experimental/numeric"
+ export *
+ }
+ module optional {
+ header "experimental/optional"
+ export *
+ }
+ module propagate_const {
+ header "experimental/propagate_const"
+ export *
+ }
+ module ratio {
+ header "experimental/ratio"
+ export *
+ }
+ module regex {
+ header "experimental/regex"
+ export *
+ }
+ module set {
+ header "experimental/set"
+ export *
+ }
+ module string {
+ header "experimental/string"
+ export *
+ }
+ module string_view {
+ header "experimental/string_view"
+ export *
+ }
+ module system_error {
+ header "experimental/system_error"
+ export *
+ }
+ module tuple {
+ header "experimental/tuple"
+ export *
+ }
+ module type_traits {
+ header "experimental/type_traits"
+ export *
+ }
+ module unordered_map {
+ header "experimental/unordered_map"
+ export *
+ }
+ module unordered_set {
+ header "experimental/unordered_set"
+ export *
+ }
+ module utility {
+ header "experimental/utility"
+ export *
+ }
+ module vector {
+ header "experimental/vector"
+ export *
+ }
+ // FIXME these should be private
+ module __memory {
+ header "experimental/__memory"
+ export *
+ }
+ } // end experimental
}
diff --git a/include/mutex b/include/mutex
index c047cf943e8c..79befbeb56fe 100644
--- a/include/mutex
+++ b/include/mutex
@@ -574,7 +574,7 @@ inline _LIBCPP_INLINE_VISIBILITY
void
call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
{
- if (__libcpp_relaxed_load(&__flag.__state_) != ~0ul)
+ if (__libcpp_acquire_load(&__flag.__state_) != ~0ul)
{
typedef tuple<_Callable&&, _Args&&...> _Gp;
_Gp __f(_VSTD::forward<_Callable>(__func), _VSTD::forward<_Args>(__args)...);
@@ -590,7 +590,7 @@ inline _LIBCPP_INLINE_VISIBILITY
void
call_once(once_flag& __flag, _Callable& __func)
{
- if (__libcpp_relaxed_load(&__flag.__state_) != ~0ul)
+ if (__libcpp_acquire_load(&__flag.__state_) != ~0ul)
{
__call_once_param<_Callable> __p(__func);
__call_once(__flag.__state_, &__p, &__call_once_proxy<_Callable>);
diff --git a/include/new b/include/new
index d2b2ae648b48..6b432f231bf6 100644
--- a/include/new
+++ b/include/new
@@ -27,18 +27,19 @@ public:
virtual const char* what() const noexcept;
};
-class bad_array_length : public bad_alloc // C++14
+class bad_array_length : public bad_alloc // FIXME: Not part of C++
{
public:
bad_array_length() noexcept;
};
-class bad_array_new_length : public bad_alloc
+class bad_array_new_length : public bad_alloc // C++14
{
public:
bad_array_new_length() noexcept;
};
+enum class align_val_t : size_t {}; // C++17
struct nothrow_t {};
extern const nothrow_t nothrow;
typedef void (*new_handler)();
@@ -48,16 +49,34 @@ new_handler get_new_handler() noexcept;
} // std
void* operator new(std::size_t size); // replaceable
+void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17
void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable
+void* operator new(std::size_t size, std::align_val_t alignment,
+ const std::nothrow_t&) noexcept; // replaceable, C++17
void operator delete(void* ptr) noexcept; // replaceable
void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14
+void operator delete(void* ptr, std::align_val_t alignment) noexcept; // replaceable, C++17
+void operator delete(void* ptr, std::size_t size,
+ std::align_val_t alignment) noexcept; // replaceable, C++17
void operator delete(void* ptr, const std::nothrow_t&) noexcept; // replaceable
+void operator delete(void* ptr, std:align_val_t alignment,
+ const std::nothrow_t&) noexcept; // replaceable, C++17
void* operator new[](std::size_t size); // replaceable
+void* operator new[](std::size_t size,
+ std::align_val_t alignment) noexcept; // replaceable, C++17
void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable
+void* operator new[](std::size_t size, std::align_val_t alignment,
+ const std::nothrow_t&) noexcept; // replaceable, C++17
void operator delete[](void* ptr) noexcept; // replaceable
void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14
+void operator delete[](void* ptr,
+ std::align_val_t alignment) noexcept; // replaceable, C++17
+void operator delete[](void* ptr, std::size_t size,
+ std::align_val_t alignment) noexcept; // replaceable, C++17
void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // replaceable
+void operator delete[](void* ptr, std::align_val_t alignment,
+ const std::nothrow_t&) noexcept; // replaceable, C++17
void* operator new (std::size_t size, void* ptr) noexcept;
void* operator new[](std::size_t size, void* ptr) noexcept;
@@ -69,6 +88,9 @@ void operator delete[](void* ptr, void*) noexcept;
#include <__config>
#include <exception>
#include <cstddef>
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
#include <__undef___deallocate>
@@ -76,6 +98,16 @@ void operator delete[](void* ptr, void*) noexcept;
#pragma GCC system_header
#endif
+#if !(defined(_LIBCPP_BUILDING_NEW) || _LIBCPP_STD_VER >= 14 || \
+ (defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309))
+# define _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+#endif
+
+#if !(defined(_LIBCPP_BUILDING_NEW) || _LIBCPP_STD_VER > 14 || \
+ (defined(__cpp_aligned_new) && __cpp_aligned_new >= 201606))
+# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+#endif
+
namespace std // purposefully not using versioning namespace
{
@@ -97,6 +129,8 @@ public:
virtual const char* what() const _NOEXCEPT;
};
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec
+
#if defined(_LIBCPP_BUILDING_NEW) || (_LIBCPP_STD_VER > 11)
class _LIBCPP_EXCEPTION_ABI bad_array_length
@@ -112,7 +146,13 @@ public:
#endif // defined(_LIBCPP_BUILDING_NEW) || (_LIBCPP_STD_VER > 11)
-_LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec
+#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+#ifndef _LIBCPP_CXX03_LANG
+enum class _LIBCPP_ENUM_VIS align_val_t : size_t { };
+#else
+enum align_val_t { __zero = 0, __max = (size_t)-1 };
+#endif
+#endif
struct _LIBCPP_TYPE_VIS nothrow_t {};
extern _LIBCPP_FUNC_VIS const nothrow_t nothrow;
@@ -122,36 +162,44 @@ _LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;
} // std
-#if defined(_WIN32) && !defined(cxx_EXPORTS)
-# define _LIBCPP_NEW_DELETE_VIS _LIBCPP_FUNC_VIS_ONLY
+#if !__has_feature(cxx_noexcept)
+#define _THROW_BAD_ALLOC throw(std::bad_alloc)
#else
-# define _LIBCPP_NEW_DELETE_VIS _LIBCPP_FUNC_VIS
+#define _THROW_BAD_ALLOC
#endif
-_LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz)
-#if !__has_feature(cxx_noexcept)
- throw(std::bad_alloc)
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
#endif
-;
-_LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
-_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p) _NOEXCEPT;
-_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
-#if defined(_LIBCPP_BUILDING_NEW) || _LIBCPP_STD_VER >= 14 || \
- (defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309)
-_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
+
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
#endif
-_LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz)
-#if !__has_feature(cxx_noexcept)
- throw(std::bad_alloc)
+#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+#endif
+
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
#endif
-;
-_LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
-_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p) _NOEXCEPT;
-_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
-#if defined(_LIBCPP_BUILDING_NEW) || _LIBCPP_STD_VER >= 14 || \
- (defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309)
-_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
#endif
inline _LIBCPP_INLINE_VISIBILITY void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;}
@@ -177,6 +225,18 @@ inline _LIBCPP_INLINE_VISIBILITY void __deallocate(void *__ptr) {
#endif
}
+#ifdef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_array_length()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_array_length();
+#else
+ _VSTD::abort();
+#endif
+}
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_NEW
diff --git a/include/numeric b/include/numeric
index 21c3781ab6a4..e00580854d41 100644
--- a/include/numeric
+++ b/include/numeric
@@ -53,6 +53,12 @@ template <class InputIterator, class OutputIterator, class BinaryOperation>
template <class ForwardIterator, class T>
void iota(ForwardIterator first, ForwardIterator last, T value);
+template <class M, class N>
+ constexpr common_type_t<M,N> gcd(M m, N n); // C++17
+
+template <class M, class N>
+ constexpr common_type_t<M,N> lcm(M m, N n); // C++17
+
} // std
*/
@@ -192,6 +198,66 @@ iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value_)
*__first = __value_;
}
+
+#if _LIBCPP_STD_VER > 14
+template <typename _Tp, bool _IsSigned = is_signed<_Tp>::value> struct __abs;
+
+template <typename _Tp>
+struct __abs<_Tp, true> {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(_Tp __t) const noexcept { return __t >= 0 ? __t : -__t; }
+};
+
+template <typename _Tp>
+struct __abs<_Tp, false> {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ _Tp operator()(_Tp __t) const noexcept { return __t; }
+};
+
+
+template<class _Tp>
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+_Tp __gcd(_Tp __m, _Tp __n)
+{
+ static_assert((!is_signed<_Tp>::value), "" );
+ return __n == 0 ? __m : __gcd<_Tp>(__n, __m % __n);
+}
+
+
+template<class _Tp, class _Up>
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+common_type_t<_Tp,_Up>
+gcd(_Tp __m, _Up __n)
+{
+ static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to gcd must be integer types");
+ static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to gcd cannot be bool" );
+ static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to gcd cannot be bool" );
+ using _Rp = common_type_t<_Tp,_Up>;
+ using _Wp = make_unsigned_t<_Rp>;
+ return static_cast<_Rp>(__gcd(static_cast<_Wp>(__abs<_Tp>()(__m)),
+ static_cast<_Wp>(__abs<_Up>()(__n))));
+}
+
+template<class _Tp, class _Up>
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+common_type_t<_Tp,_Up>
+lcm(_Tp __m, _Up __n)
+{
+ static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to lcm must be integer types");
+ static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to lcm cannot be bool" );
+ static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to lcm cannot be bool" );
+ if (__m == 0 || __n == 0)
+ return 0;
+
+ using _Rp = common_type_t<_Tp,_Up>;
+ _Rp __val1 = __abs<_Tp>()(__m) / gcd(__m,__n);
+ _Up __val2 = __abs<_Up>()(__n);
+ _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
+ return __val1 * __val2;
+}
+
+#endif /* _LIBCPP_STD_VER > 14 */
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_NUMERIC
diff --git a/include/optional b/include/optional
new file mode 100644
index 000000000000..b950efd0bda7
--- /dev/null
+++ b/include/optional
@@ -0,0 +1,1314 @@
+// -*- C++ -*-
+//===-------------------------- optional ----------------------------------===//
+//
+// 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_OPTIONAL
+#define _LIBCPP_OPTIONAL
+
+/*
+ optional synopsis
+
+// C++1z
+
+namespace std {
+ // 20.6.3, optional for object types
+ template <class T> class optional;
+
+ // 20.6.4, no-value state indicator
+ struct nullopt_t{see below };
+ constexpr nullopt_t nullopt(unspecified );
+
+ // 20.6.5, class bad_optional_access
+ class bad_optional_access;
+
+ // 20.6.6, relational operators
+ template <class T>
+ constexpr bool operator==(const optional<T>&, const optional<T>&);
+ template <class T>
+ constexpr bool operator!=(const optional<T>&, const optional<T>&);
+ template <class T>
+ constexpr bool operator<(const optional<T>&, const optional<T>&);
+ template <class T>
+ constexpr bool operator>(const optional<T>&, const optional<T>&);
+ template <class T>
+ constexpr bool operator<=(const optional<T>&, const optional<T>&);
+ template <class T>
+ constexpr bool operator>=(const optional<T>&, const optional<T>&);
+ template <class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept;
+ template <class T> constexpr bool operator!=(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator!=(nullopt_t, const optional<T>&) noexcept;
+ template <class T> constexpr bool operator<(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator<(nullopt_t, const optional<T>&) noexcept;
+ template <class T> constexpr bool operator<=(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator<=(nullopt_t, const optional<T>&) noexcept;
+ template <class T> constexpr bool operator>(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator>(nullopt_t, const optional<T>&) noexcept;
+ template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator>=(nullopt_t, const optional<T>&) noexcept;
+
+ // 20.6.8, comparison with T
+ template <class T> constexpr bool operator==(const optional<T>&, const T&);
+ template <class T> constexpr bool operator==(const T&, const optional<T>&);
+ template <class T> constexpr bool operator!=(const optional<T>&, const T&);
+ template <class T> constexpr bool operator!=(const T&, const optional<T>&);
+ template <class T> constexpr bool operator<(const optional<T>&, const T&);
+ template <class T> constexpr bool operator<(const T&, const optional<T>&);
+ template <class T> constexpr bool operator<=(const optional<T>&, const T&);
+ template <class T> constexpr bool operator<=(const T&, const optional<T>&);
+ template <class T> constexpr bool operator>(const optional<T>&, const T&);
+ template <class T> constexpr bool operator>(const T&, const optional<T>&);
+ template <class T> constexpr bool operator>=(const optional<T>&, const T&);
+ template <class T> constexpr bool operator>=(const T&, const optional<T>&);
+
+ // 20.6.9, specialized algorithms
+ template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below );
+ template <class T> constexpr optional<see below > make_optional(T&&);
+ template <class T, class... Args>
+ constexpr optional<T> make_optional(Args&&... args);
+ template <class T, class U, class... Args>
+ constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args);
+
+ // 20.6.10, hash support
+ template <class T> struct hash;
+ template <class T> struct hash<optional<T>>;
+
+ template <class T> class optional {
+ public:
+ using value_type = T;
+
+ // 20.6.3.1, constructors
+ constexpr optional() noexcept;
+ constexpr optional(nullopt_t) noexcept;
+ optional(const optional &);
+ optional(optional &&) noexcept(see below );
+ template <class... Args> constexpr explicit optional(in_place_t, Args &&...);
+ template <class U, class... Args>
+ constexpr explicit optional(in_place_t, initializer_list<U>, Args &&...);
+ template <class U = T>
+ constexpr EXPLICIT optional(U &&);
+ template <class U>
+ constexpr EXPLICIT optional(const optional<U> &);
+ template <class U>
+ constexpr EXPLICIT optional(optional<U> &&);
+
+ // 20.6.3.2, destructor
+ ~optional();
+
+ // 20.6.3.3, assignment
+ optional &operator=(nullopt_t) noexcept;
+ optional &operator=(const optional &);
+ optional &operator=(optional &&) noexcept(see below );
+ template <class U = T> optional &operator=(U &&);
+ template <class U> optional &operator=(const optional<U> &);
+ template <class U> optional &operator=(optional<U> &&);
+ template <class... Args> void emplace(Args &&...);
+ template <class U, class... Args>
+ void emplace(initializer_list<U>, Args &&...);
+
+ // 20.6.3.4, swap
+ void swap(optional &) noexcept(see below );
+
+ // 20.6.3.5, observers
+ constexpr T const *operator->() const;
+ constexpr T *operator->();
+ constexpr T const &operator*() const &;
+ constexpr T &operator*() &;
+ constexpr T &&operator*() &&;
+ constexpr const T &&operator*() const &&;
+ constexpr explicit operator bool() const noexcept;
+ constexpr bool has_value() const noexcept;
+ constexpr T const &value() const &;
+ constexpr T &value() &;
+ constexpr T &&value() &&;
+ constexpr const T &&value() const &&;
+ template <class U> constexpr T value_or(U &&) const &;
+ template <class U> constexpr T value_or(U &&) &&;
+
+ // 20.6.3.6, modifiers
+ void reset() noexcept;
+
+ private:
+ T *val; // exposition only
+ };
+} // namespace std
+
+*/
+
+#include <__config>
+#include <__debug>
+#include <__functional_base>
+#include <__undef_min_max>
+#include <functional>
+#include <initializer_list>
+#include <new>
+#include <stdexcept>
+#include <type_traits>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+namespace std // purposefully not using versioning namespace
+{
+
+class _LIBCPP_EXCEPTION_ABI bad_optional_access
+ : public logic_error
+{
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ bad_optional_access() : logic_error("bad optional access") {}
+
+ // Get the key function ~bad_optional_access() into the dylib
+ virtual ~bad_optional_access() _NOEXCEPT;
+};
+
+} // std
+
+#if _LIBCPP_STD_VER > 14
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_NORETURN
+inline _LIBCPP_INLINE_VISIBILITY
+void __throw_bad_optional_access() {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_optional_access();
+#else
+ _VSTD::abort();
+#endif
+}
+
+struct nullopt_t
+{
+ struct __secret_tag { _LIBCPP_INLINE_VISIBILITY explicit __secret_tag() = default; };
+ _LIBCPP_INLINE_VISIBILITY constexpr explicit nullopt_t(__secret_tag, __secret_tag) noexcept {}
+};
+
+/* inline */ constexpr nullopt_t nullopt{nullopt_t::__secret_tag{}, nullopt_t::__secret_tag{}};
+
+template <class _Tp, bool = is_trivially_destructible<_Tp>::value>
+struct __optional_destruct_base;
+
+template <class _Tp>
+struct __optional_destruct_base<_Tp, false>
+{
+ typedef _Tp value_type;
+ static_assert(is_object_v<value_type>,
+ "instantiation of optional with a non-object type is undefined behavior");
+ union
+ {
+ char __null_state_;
+ value_type __val_;
+ };
+ bool __engaged_;
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~__optional_destruct_base()
+ {
+ if (__engaged_)
+ __val_.~value_type();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr __optional_destruct_base() noexcept
+ : __null_state_(),
+ __engaged_(false) {}
+
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit __optional_destruct_base(in_place_t, _Args&&... __args)
+ : __val_(_VSTD::forward<_Args>(__args)...),
+ __engaged_(true) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ void reset() noexcept
+ {
+ if (__engaged_)
+ {
+ __val_.~value_type();
+ __engaged_ = false;
+ }
+ }
+};
+
+template <class _Tp>
+struct __optional_destruct_base<_Tp, true>
+{
+ typedef _Tp value_type;
+ static_assert(is_object_v<value_type>,
+ "instantiation of optional with a non-object type is undefined behavior");
+ union
+ {
+ char __null_state_;
+ value_type __val_;
+ };
+ bool __engaged_;
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr __optional_destruct_base() noexcept
+ : __null_state_(),
+ __engaged_(false) {}
+
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit __optional_destruct_base(in_place_t, _Args&&... __args)
+ : __val_(_VSTD::forward<_Args>(__args)...),
+ __engaged_(true) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ void reset() noexcept
+ {
+ if (__engaged_)
+ {
+ __engaged_ = false;
+ }
+ }
+};
+
+template <class _Tp, bool = is_reference<_Tp>::value>
+struct __optional_storage_base : __optional_destruct_base<_Tp>
+{
+ using __base = __optional_destruct_base<_Tp>;
+ using value_type = _Tp;
+ using __base::__base;
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr bool has_value() const noexcept
+ {
+ return this->__engaged_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type& __get() & noexcept
+ {
+ return this->__val_;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr const value_type& __get() const& noexcept
+ {
+ return this->__val_;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type&& __get() && noexcept
+ {
+ return _VSTD::move(this->__val_);
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr const value_type&& __get() const&& noexcept
+ {
+ return _VSTD::move(this->__val_);
+ }
+
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ void __construct(_Args&&... __args)
+ {
+ _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
+ ::new((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
+ this->__engaged_ = true;
+ }
+
+ template <class _That>
+ _LIBCPP_INLINE_VISIBILITY
+ void __construct_from(_That&& __opt)
+ {
+ if (__opt.has_value())
+ __construct(_VSTD::forward<_That>(__opt).__get());
+ }
+
+ template <class _That>
+ _LIBCPP_INLINE_VISIBILITY
+ void __assign_from(_That&& __opt)
+ {
+ if (this->__engaged_ == __opt.has_value())
+ {
+ if (this->__engaged_)
+ this->__val_ = _VSTD::forward<_That>(__opt).__get();
+ }
+ else
+ {
+ if (this->__engaged_)
+ this->reset();
+ else
+ __construct(_VSTD::forward<_That>(__opt).__get());
+ }
+ }
+};
+
+// optional<T&> is currently required ill-formed, however it may to be in the
+// future. For this reason it has already been implemented to ensure we can
+// make the change in an ABI compatible manner.
+template <class _Tp>
+struct __optional_storage_base<_Tp, true>
+{
+ using value_type = _Tp;
+ using __raw_type = remove_reference_t<_Tp>;
+ __raw_type* __value_;
+
+ template <class _Up>
+ static constexpr bool __can_bind_reference() {
+ using _RawUp = typename remove_reference<_Up>::type;
+ using _UpPtr = _RawUp*;
+ using _RawTp = typename remove_reference<_Tp>::type;
+ using _TpPtr = _RawTp*;
+ using _CheckLValueArg = integral_constant<bool,
+ (is_lvalue_reference<_Up>::value && is_convertible<_UpPtr, _TpPtr>::value)
+ || is_same<_RawUp, reference_wrapper<_RawTp>>::value
+ || is_same<_RawUp, reference_wrapper<typename remove_const<_RawTp>::type>>::value
+ >;
+ return (is_lvalue_reference<_Tp>::value && _CheckLValueArg::value)
+ || (is_rvalue_reference<_Tp>::value && !is_lvalue_reference<_Up>::value &&
+ is_convertible<_UpPtr, _TpPtr>::value);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr __optional_storage_base() noexcept
+ : __value_(nullptr) {}
+
+ template <class _UArg>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit __optional_storage_base(in_place_t, _UArg&& __uarg)
+ : __value_(_VSTD::addressof(__uarg))
+ {
+ static_assert(__can_bind_reference<_UArg>(),
+ "Attempted to construct a reference element in tuple from a "
+ "possible temporary");
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void reset() noexcept { __value_ = nullptr; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr bool has_value() const noexcept
+ { return __value_ != nullptr; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type& __get() const& noexcept
+ { return *__value_; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type&& __get() const&& noexcept
+ { return _VSTD::forward<value_type>(*__value_); }
+
+ template <class _UArg>
+ _LIBCPP_INLINE_VISIBILITY
+ void __construct(_UArg&& __val)
+ {
+ _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
+ static_assert(__can_bind_reference<_UArg>(),
+ "Attempted to construct a reference element in tuple from a "
+ "possible temporary");
+ __value_ = _VSTD::addressof(__val);
+ }
+
+ template <class _That>
+ _LIBCPP_INLINE_VISIBILITY
+ void __construct_from(_That&& __opt)
+ {
+ if (__opt.has_value())
+ __construct(_VSTD::forward<_That>(__opt).__get());
+ }
+
+ template <class _That>
+ _LIBCPP_INLINE_VISIBILITY
+ void __assign_from(_That&& __opt)
+ {
+ if (has_value() == __opt.has_value())
+ {
+ if (has_value())
+ *__value_ = _VSTD::forward<_That>(__opt).__get();
+ }
+ else
+ {
+ if (has_value())
+ reset();
+ else
+ __construct(_VSTD::forward<_That>(__opt).__get());
+ }
+ }
+};
+
+template <class _Tp, bool = is_trivially_copyable<_Tp>::value>
+struct __optional_storage;
+
+template <class _Tp>
+struct __optional_storage<_Tp, true> : __optional_storage_base<_Tp>
+{
+ using __optional_storage_base<_Tp>::__optional_storage_base;
+};
+
+template <class _Tp>
+struct __optional_storage<_Tp, false> : __optional_storage_base<_Tp>
+{
+ using value_type = _Tp;
+ using __optional_storage_base<_Tp>::__optional_storage_base;
+
+ _LIBCPP_INLINE_VISIBILITY
+ __optional_storage() = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ __optional_storage(const __optional_storage& __opt)
+ {
+ this->__construct_from(__opt);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __optional_storage(__optional_storage&& __opt)
+ noexcept(is_nothrow_move_constructible_v<value_type>)
+ {
+ this->__construct_from(_VSTD::move(__opt));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __optional_storage& operator=(const __optional_storage& __opt)
+ {
+ this->__assign_from(__opt);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __optional_storage& operator=(__optional_storage&& __opt)
+ noexcept(is_nothrow_move_assignable_v<value_type> &&
+ is_nothrow_move_constructible_v<value_type>)
+ {
+ this->__assign_from(_VSTD::move(__opt));
+ return *this;
+ }
+};
+
+template <class _Tp>
+using __optional_sfinae_ctor_base_t = __sfinae_ctor_base<
+ is_copy_constructible<_Tp>::value,
+ is_move_constructible<_Tp>::value
+>;
+
+template <class _Tp>
+using __optional_sfinae_assign_base_t = __sfinae_assign_base<
+ (is_copy_constructible<_Tp>::value && is_copy_assignable<_Tp>::value),
+ (is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value)
+>;
+
+template <class _Tp>
+class optional
+ : private __optional_storage<_Tp>
+ , private __optional_sfinae_ctor_base_t<_Tp>
+ , private __optional_sfinae_assign_base_t<_Tp>
+{
+ using __base = __optional_storage<_Tp>;
+public:
+ using value_type = _Tp;
+
+private:
+ // Disable the reference extension using this static assert.
+ static_assert(!is_same_v<value_type, in_place_t>,
+ "instantiation of optional with in_place_t is ill-formed");
+ static_assert(!is_same_v<__uncvref_t<value_type>, nullopt_t>,
+ "instantiation of optional with nullopt_t is ill-formed");
+ static_assert(!is_reference_v<value_type>,
+ "instantiation of optional with a reference type is ill-formed");
+ static_assert(is_destructible_v<value_type>,
+ "instantiation of optional with a non-destructible type is ill-formed");
+
+ // LWG2756: conditionally explicit conversion from _Up
+ struct _CheckOptionalArgsConstructor {
+ template <class _Up>
+ static constexpr bool __enable_implicit() {
+ return is_constructible_v<_Tp, _Up&&> &&
+ is_convertible_v<_Up&&, _Tp>;
+ }
+
+ template <class _Up>
+ static constexpr bool __enable_explicit() {
+ return is_constructible_v<_Tp, _Up&&> &&
+ !is_convertible_v<_Up&&, _Tp>;
+ }
+ };
+ template <class _Up>
+ using _CheckOptionalArgsCtor = conditional_t<
+ !is_same_v<in_place_t, _Up> &&
+ !is_same_v<decay_t<_Up>, optional>,
+ _CheckOptionalArgsConstructor,
+ __check_tuple_constructor_fail
+ >;
+ template <class _QualUp>
+ struct _CheckOptionalLikeConstructor {
+ template <class _Up, class _Opt = optional<_Up>>
+ using __check_constructible_from_opt = __lazy_or<
+ is_constructible<_Tp, _Opt&>,
+ is_constructible<_Tp, _Opt const&>,
+ is_constructible<_Tp, _Opt&&>,
+ is_constructible<_Tp, _Opt const&&>,
+ is_convertible<_Opt&, _Tp>,
+ is_convertible<_Opt const&, _Tp>,
+ is_convertible<_Opt&&, _Tp>,
+ is_convertible<_Opt const&&, _Tp>
+ >;
+ template <class _Up, class _Opt = optional<_Up>>
+ using __check_assignable_from_opt = __lazy_or<
+ is_assignable<_Tp&, _Opt&>,
+ is_assignable<_Tp&, _Opt const&>,
+ is_assignable<_Tp&, _Opt&&>,
+ is_assignable<_Tp&, _Opt const&&>
+ >;
+ template <class _Up, class _QUp = _QualUp>
+ static constexpr bool __enable_implicit() {
+ return is_convertible<_QUp, _Tp>::value &&
+ !__check_constructible_from_opt<_Up>::value;
+ }
+ template <class _Up, class _QUp = _QualUp>
+ static constexpr bool __enable_explicit() {
+ return !is_convertible<_QUp, _Tp>::value &&
+ !__check_constructible_from_opt<_Up>::value;
+ }
+ template <class _Up, class _QUp = _QualUp>
+ static constexpr bool __enable_assign() {
+ // Construction and assignability of _Qup to _Tp has already been
+ // checked.
+ return !__check_constructible_from_opt<_Up>::value &&
+ !__check_assignable_from_opt<_Up>::value;
+ }
+ };
+
+ template <class _Up, class _QualUp>
+ using _CheckOptionalLikeCtor = conditional_t<
+ __lazy_and<
+ __lazy_not<is_same<_Up, _Tp>>,
+ is_constructible<_Tp, _QualUp>
+ >::value,
+ _CheckOptionalLikeConstructor<_QualUp>,
+ __check_tuple_constructor_fail
+ >;
+ template <class _Up, class _QualUp>
+ using _CheckOptionalLikeAssign = conditional_t<
+ __lazy_and<
+ __lazy_not<is_same<_Up, _Tp>>,
+ is_constructible<_Tp, _QualUp>,
+ is_assignable<_Tp&, _QualUp>
+ >::value,
+ _CheckOptionalLikeConstructor<_QualUp>,
+ __check_tuple_constructor_fail
+ >;
+public:
+
+ _LIBCPP_INLINE_VISIBILITY constexpr optional() noexcept {}
+ _LIBCPP_INLINE_VISIBILITY optional(const optional&) = default;
+ _LIBCPP_INLINE_VISIBILITY optional(optional&&) = default;
+ _LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {}
+
+ template <class... _Args, class = enable_if_t<
+ is_constructible_v<value_type, _Args...>>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit optional(in_place_t, _Args&&... __args)
+ : __base(in_place, _VSTD::forward<_Args>(__args)...) {}
+
+ template <class _Up, class... _Args, class = enable_if_t<
+ is_constructible_v<value_type, initializer_list<_Up>&, _Args...>>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args)
+ : __base(in_place, __il, _VSTD::forward<_Args>(__args)...) {}
+
+ template <class _Up = value_type, enable_if_t<
+ _CheckOptionalArgsCtor<_Up>::template __enable_implicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr optional(_Up&& __v)
+ : __base(in_place, _VSTD::forward<_Up>(__v)) {}
+
+ template <class _Up, enable_if_t<
+ _CheckOptionalArgsCtor<_Up>::template __enable_explicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit optional(_Up&& __v)
+ : __base(in_place, _VSTD::forward<_Up>(__v)) {}
+
+ // LWG2756: conditionally explicit conversion from const optional<_Up>&
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ optional(const optional<_Up>& __v)
+ {
+ this->__construct_from(__v);
+ }
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ explicit optional(const optional<_Up>& __v)
+ {
+ this->__construct_from(__v);
+ }
+
+ // LWG2756: conditionally explicit conversion from optional<_Up>&&
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_implicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ optional(optional<_Up>&& __v)
+ {
+ this->__construct_from(_VSTD::move(__v));
+ }
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_explicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ explicit optional(optional<_Up>&& __v)
+ {
+ this->__construct_from(_VSTD::move(__v));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ optional& operator=(nullopt_t) noexcept
+ {
+ reset();
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY optional& operator=(const optional&) = default;
+ _LIBCPP_INLINE_VISIBILITY optional& operator=(optional&&) = default;
+
+ // LWG2756
+ template <class _Up = value_type,
+ class = enable_if_t
+ <__lazy_and<
+ integral_constant<bool,
+ !is_same_v<decay_t<_Up>, optional> &&
+ !(is_same_v<_Up, value_type> && is_scalar_v<value_type>)
+ >,
+ is_constructible<value_type, _Up>,
+ is_assignable<value_type&, _Up>
+ >::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ optional&
+ operator=(_Up&& __v)
+ {
+ if (this->has_value())
+ this->__get() = _VSTD::forward<_Up>(__v);
+ else
+ this->__construct(_VSTD::forward<_Up>(__v));
+ return *this;
+ }
+
+ // LWG2756
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeAssign<_Up, _Up const&>::template __enable_assign<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ optional&
+ operator=(const optional<_Up>& __v)
+ {
+ this->__assign_from(__v);
+ return *this;
+ }
+
+ // LWG2756
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_assign<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ optional&
+ operator=(optional<_Up>&& __v)
+ {
+ this->__assign_from(_VSTD::move(__v));
+ return *this;
+ }
+
+ template <class... _Args,
+ class = enable_if_t
+ <
+ is_constructible_v<value_type, _Args...>
+ >
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ void
+ emplace(_Args&&... __args)
+ {
+ reset();
+ this->__construct(_VSTD::forward<_Args>(__args)...);
+ }
+
+ template <class _Up, class... _Args,
+ class = enable_if_t
+ <
+ is_constructible_v<value_type, initializer_list<_Up>&, _Args...>
+ >
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ void
+ emplace(initializer_list<_Up> __il, _Args&&... __args)
+ {
+ reset();
+ this->__construct(__il, _VSTD::forward<_Args>(__args)...);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(optional& __opt)
+ noexcept(is_nothrow_move_constructible_v<value_type> &&
+ is_nothrow_swappable_v<value_type>)
+ {
+ if (this->has_value() == __opt.has_value())
+ {
+ using _VSTD::swap;
+ if (this->has_value())
+ swap(this->__get(), __opt.__get());
+ }
+ else
+ {
+ if (this->has_value())
+ {
+ __opt.__construct(_VSTD::move(this->__get()));
+ reset();
+ }
+ else
+ {
+ this->__construct(_VSTD::move(__opt.__get()));
+ __opt.reset();
+ }
+ }
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ add_pointer_t<value_type const>
+ operator->() const
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator-> called for disengaged value");
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+ return _VSTD::addressof(this->__get());
+#else
+ return __operator_arrow(__has_operator_addressof<value_type>{}, this->__get());
+#endif
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ add_pointer_t<value_type>
+ operator->()
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator-> called for disengaged value");
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+ return _VSTD::addressof(this->__get());
+#else
+ return __operator_arrow(__has_operator_addressof<value_type>{}, this->__get());
+#endif
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ const value_type&
+ operator*() const&
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ return this->__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ value_type&
+ operator*() &
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ return this->__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ value_type&&
+ operator*() &&
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ return _VSTD::move(this->__get());
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ const value_type&&
+ operator*() const&&
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ return _VSTD::move(this->__get());
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit operator bool() const noexcept { return has_value(); }
+
+ using __base::has_value;
+ using __base::__get;
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type const& value() const&
+ {
+ if (!this->has_value())
+ __throw_bad_optional_access();
+ return this->__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type& value() &
+ {
+ if (!this->has_value())
+ __throw_bad_optional_access();
+ return this->__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type&& value() &&
+ {
+ if (!this->has_value())
+ __throw_bad_optional_access();
+ return _VSTD::move(this->__get());
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type const&& value() const&&
+ {
+ if (!this->has_value())
+ __throw_bad_optional_access();
+ return _VSTD::move(this->__get());
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type value_or(_Up&& __v) const&
+ {
+ static_assert(is_copy_constructible_v<value_type>,
+ "optional<T>::value_or: T must be copy constructible");
+ static_assert(is_convertible_v<_Up, value_type>,
+ "optional<T>::value_or: U must be convertible to T");
+ return this->has_value() ? this->__get() :
+ static_cast<value_type>(_VSTD::forward<_Up>(__v));
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ value_type value_or(_Up&& __v) &&
+ {
+ static_assert(is_move_constructible_v<value_type>,
+ "optional<T>::value_or: T must be move constructible");
+ static_assert(is_convertible_v<_Up, value_type>,
+ "optional<T>::value_or: U must be convertible to T");
+ return this->has_value() ? _VSTD::move(this->__get()) :
+ static_cast<value_type>(_VSTD::forward<_Up>(__v));
+ }
+
+ using __base::reset;
+
+private:
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ static _Up*
+ __operator_arrow(true_type, _Up& __x)
+ {
+ return _VSTD::addressof(__x);
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ static constexpr _Up*
+ __operator_arrow(false_type, _Up& __x)
+ {
+ return &__x;
+ }
+};
+
+// Comparisons between optionals
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator==(const optional<_Tp>& __x, const optional<_Tp>& __y)
+{
+ if (static_cast<bool>(__x) != static_cast<bool>(__y))
+ return false;
+ if (!static_cast<bool>(__x))
+ return true;
+ return *__x == *__y;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator!=(const optional<_Tp>& __x, const optional<_Tp>& __y)
+{
+ if (static_cast<bool>(__x) != static_cast<bool>(__y))
+ return true;
+ if (!static_cast<bool>(__x))
+ return false;
+ return *__x != *__y;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator<(const optional<_Tp>& __x, const optional<_Tp>& __y)
+{
+ if (!static_cast<bool>(__y))
+ return false;
+ if (!static_cast<bool>(__x))
+ return true;
+ return *__x < *__y;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator>(const optional<_Tp>& __x, const optional<_Tp>& __y)
+{
+ if (!static_cast<bool>(__x))
+ return false;
+ if (!static_cast<bool>(__y))
+ return true;
+ return *__x > *__y;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator<=(const optional<_Tp>& __x, const optional<_Tp>& __y)
+{
+ if (!static_cast<bool>(__x))
+ return true;
+ if (!static_cast<bool>(__y))
+ return false;
+ return *__x <= *__y;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator>=(const optional<_Tp>& __x, const optional<_Tp>& __y)
+{
+ if (!static_cast<bool>(__y))
+ return true;
+ if (!static_cast<bool>(__x))
+ return false;
+ return *__x >= *__y;
+}
+
+// Comparisons with nullopt
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator==(const optional<_Tp>& __x, nullopt_t) noexcept
+{
+ return !static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator==(nullopt_t, const optional<_Tp>& __x) noexcept
+{
+ return !static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator!=(const optional<_Tp>& __x, nullopt_t) noexcept
+{
+ return static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator!=(nullopt_t, const optional<_Tp>& __x) noexcept
+{
+ return static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator<(const optional<_Tp>&, nullopt_t) noexcept
+{
+ return false;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator<(nullopt_t, const optional<_Tp>& __x) noexcept
+{
+ return static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator<=(const optional<_Tp>& __x, nullopt_t) noexcept
+{
+ return !static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator<=(nullopt_t, const optional<_Tp>&) noexcept
+{
+ return true;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator>(const optional<_Tp>& __x, nullopt_t) noexcept
+{
+ return static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator>(nullopt_t, const optional<_Tp>&) noexcept
+{
+ return false;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator>=(const optional<_Tp>&, nullopt_t) noexcept
+{
+ return true;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator>=(nullopt_t, const optional<_Tp>& __x) noexcept
+{
+ return !static_cast<bool>(__x);
+}
+
+// Comparisons with T
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator==(const optional<_Tp>& __x, const _Tp& __v)
+{
+ return static_cast<bool>(__x) ? *__x == __v : false;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator==(const _Tp& __v, const optional<_Tp>& __x)
+{
+ return static_cast<bool>(__x) ? __v == *__x : false;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator!=(const optional<_Tp>& __x, const _Tp& __v)
+{
+ return static_cast<bool>(__x) ? *__x != __v : true;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator!=(const _Tp& __v, const optional<_Tp>& __x)
+{
+ return static_cast<bool>(__x) ? __v != *__x : true;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator<(const optional<_Tp>& __x, const _Tp& __v)
+{
+ return static_cast<bool>(__x) ? *__x < __v : true;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator<(const _Tp& __v, const optional<_Tp>& __x)
+{
+ return static_cast<bool>(__x) ? __v < *__x : false;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator<=(const optional<_Tp>& __x, const _Tp& __v)
+{
+ return static_cast<bool>(__x) ? *__x <= __v : true;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator<=(const _Tp& __v, const optional<_Tp>& __x)
+{
+ return static_cast<bool>(__x) ? __v <= *__x : false;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator>(const optional<_Tp>& __x, const _Tp& __v)
+{
+ return static_cast<bool>(__x) ? *__x > __v : false;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator>(const _Tp& __v, const optional<_Tp>& __x)
+{
+ return static_cast<bool>(__x) ? __v > *__x : true;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator>=(const optional<_Tp>& __x, const _Tp& __v)
+{
+ return static_cast<bool>(__x) ? *__x >= __v : false;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
+ _VSTD::declval<const _Tp&>()), bool>,
+ bool
+>
+operator>=(const _Tp& __v, const optional<_Tp>& __x)
+{
+ return static_cast<bool>(__x) ? __v >= *__x : true;
+}
+
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+enable_if_t<
+ is_move_constructible_v<_Tp> && is_swappable_v<_Tp>,
+ void
+>
+swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y)))
+{
+ __x.swap(__y);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+optional<decay_t<_Tp>> make_optional(_Tp&& __v)
+{
+ return optional<decay_t<_Tp>>(_VSTD::forward<_Tp>(__v));
+}
+
+template <class _Tp, class... _Args>
+_LIBCPP_INLINE_VISIBILITY constexpr
+optional<_Tp> make_optional(_Args&&... __args)
+{
+ return optional<_Tp>(in_place, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _Tp, class _Up, class... _Args>
+_LIBCPP_INLINE_VISIBILITY constexpr
+optional<_Tp> make_optional(initializer_list<_Up> __il, _Args&&... __args)
+{
+ return optional<_Tp>(in_place, __il, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY hash<optional<_Tp> >
+{
+ typedef optional<_Tp> argument_type;
+ typedef size_t result_type;
+
+ _LIBCPP_INLINE_VISIBILITY
+ result_type operator()(const argument_type& __opt) const _NOEXCEPT
+ {
+ return static_cast<bool>(__opt) ? hash<_Tp>()(*__opt) : 0;
+ }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 14
+
+#endif // _LIBCPP_OPTIONAL
diff --git a/include/ostream b/include/ostream
index f55fd40856ec..cf2051433a61 100644
--- a/include/ostream
+++ b/include/ostream
@@ -160,20 +160,24 @@ public:
typedef typename traits_type::off_type off_type;
// 27.7.2.2 Constructor/destructor:
- explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb)
+ { this->init(__sb); }
virtual ~basic_ostream();
protected:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_INLINE_VISIBILITY
basic_ostream(basic_ostream&& __rhs);
#endif
// 27.7.2.3 Assign/swap
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_INLINE_VISIBILITY
basic_ostream& operator=(basic_ostream&& __rhs);
#endif
- void swap(basic_ostream& __rhs);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void swap(basic_ostream& __rhs)
+ { basic_ios<char_type, traits_type>::swap(__rhs); }
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
basic_ostream (const basic_ostream& __rhs) = delete;
@@ -188,10 +192,19 @@ public:
class _LIBCPP_TYPE_VIS_ONLY sentry;
// 27.7.2.6 Formatted output:
- basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&));
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&))
+ { return __pf(*this); }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
basic_ostream& operator<<(basic_ios<char_type, traits_type>&
- (*__pf)(basic_ios<char_type,traits_type>&));
- basic_ostream& operator<<(ios_base& (*__pf)(ios_base&));
+ (*__pf)(basic_ios<char_type,traits_type>&))
+ { __pf(*this); return *this; }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_ostream& operator<<(ios_base& (*__pf)(ios_base&))
+ { __pf(*this); return *this; }
+
basic_ostream& operator<<(bool __n);
basic_ostream& operator<<(short __n);
basic_ostream& operator<<(unsigned short __n);
@@ -213,8 +226,11 @@ public:
basic_ostream& flush();
// 27.7.2.5 seeks:
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
pos_type tellp();
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
basic_ostream& seekp(pos_type __pos);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
basic_ostream& seekp(off_type __off, ios_base::seekdir __dir);
protected:
@@ -274,24 +290,15 @@ basic_ostream<_CharT, _Traits>::sentry::~sentry()
}
}
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_ostream<_CharT, _Traits>::basic_ostream(basic_streambuf<char_type, traits_type>* __sb)
-{
- this->init(__sb);
-}
-
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>::basic_ostream(basic_ostream&& __rhs)
{
this->move(__rhs);
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator=(basic_ostream&& __rhs)
{
@@ -307,41 +314,6 @@ basic_ostream<_CharT, _Traits>::~basic_ostream()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-basic_ostream<_CharT, _Traits>::swap(basic_ostream& __rhs)
-{
- basic_ios<char_type, traits_type>::swap(__rhs);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_ostream<_CharT, _Traits>&
-basic_ostream<_CharT, _Traits>::operator<<(basic_ostream& (*__pf)(basic_ostream&))
-{
- return __pf(*this);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_ostream<_CharT, _Traits>&
-basic_ostream<_CharT, _Traits>::operator<<(basic_ios<char_type, traits_type>&
- (*__pf)(basic_ios<char_type,traits_type>&))
-{
- __pf(*this);
- return *this;
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_ostream<_CharT, _Traits>&
-basic_ostream<_CharT, _Traits>::operator<<(ios_base& (*__pf)(ios_base&))
-{
- __pf(*this);
- return *this;
-}
-
-template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_type>* __sb)
{
@@ -989,7 +961,6 @@ basic_ostream<_CharT, _Traits>::flush()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
typename basic_ostream<_CharT, _Traits>::pos_type
basic_ostream<_CharT, _Traits>::tellp()
{
@@ -999,7 +970,6 @@ basic_ostream<_CharT, _Traits>::tellp()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
{
@@ -1013,7 +983,6 @@ basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)
{
@@ -1080,6 +1049,14 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
return _VSTD::__put_character_sequence(__os, __str.data(), __str.size());
}
+template<class _CharT, class _Traits>
+basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os,
+ const basic_string_view<_CharT, _Traits> __sv)
+{
+ return _VSTD::__put_character_sequence(__os, __sv.data(), __sv.size());
+}
+
template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
@@ -1105,8 +1082,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
}
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ostream<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ostream<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/queue b/include/queue
index c657b52f8038..01247a29da2b 100644
--- a/include/queue
+++ b/include/queue
@@ -63,7 +63,7 @@ public:
void push(const value_type& v);
void push(value_type&& v);
- template <class... Args> void emplace(Args&&... args);
+ template <class... Args> reference emplace(Args&&... args);
void pop();
void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>)
@@ -292,8 +292,8 @@ public:
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- void emplace(_Args&&... __args)
- {c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+ reference emplace(_Args&&... __args)
+ { return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
diff --git a/include/random b/include/random
index 794bf7b3fd15..4e11f9e70771 100644
--- a/include/random
+++ b/include/random
@@ -2817,6 +2817,7 @@ class _LIBCPP_TYPE_VIS_ONLY discard_block_engine
static_assert( 0 < __r, "discard_block_engine invalid parameters");
static_assert(__r <= __p, "discard_block_engine invalid parameters");
+ static_assert(__r <= INT_MAX, "discard_block_engine invalid parameters");
public:
// types
typedef typename _Engine::result_type result_type;
@@ -2918,7 +2919,7 @@ template<class _Engine, size_t __p, size_t __r>
typename discard_block_engine<_Engine, __p, __r>::result_type
discard_block_engine<_Engine, __p, __r>::operator()()
{
- if (__n_ >= __r)
+ if (__n_ >= static_cast<int>(__r))
{
__e_.discard(__p - __r);
__n_ = 0;
diff --git a/include/ratio b/include/ratio
index 8f708ce478d3..08eb774df665 100644
--- a/include/ratio
+++ b/include/ratio
@@ -300,18 +300,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_multiply
= typename __ratio_multiply<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_multiply
: public __ratio_multiply<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_divide
@@ -327,18 +327,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_divide
= typename __ratio_divide<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_divide
: public __ratio_divide<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_add
@@ -362,18 +362,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_add
= typename __ratio_add<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_add
: public __ratio_add<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_subtract
@@ -397,18 +397,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_subtract
= typename __ratio_subtract<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_subtract
: public __ratio_subtract<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
// ratio_equal
diff --git a/include/regex b/include/regex
index 1139d8fb2a90..5a6c7fbb8e0a 100644
--- a/include/regex
+++ b/include/regex
@@ -127,6 +127,8 @@ class basic_regex
public:
// types:
typedef charT value_type;
+ typedef traits traits_type;
+ typedef typename traits::string_type string_type;
typedef regex_constants::syntax_option_type flag_type;
typedef typename traits::locale_type locale_type;
@@ -145,7 +147,7 @@ public:
// construct/copy/destroy:
basic_regex();
explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
- basic_regex(const charT* p, size_t len, flag_type f);
+ basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
basic_regex(const basic_regex&);
basic_regex(basic_regex&&) noexcept;
template <class ST, class SA>
@@ -762,7 +764,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#include <memory>
#include <vector>
#include <deque>
-#include <cassert>
#include <__undef_min_max>
@@ -864,7 +865,8 @@ enum match_flag_type
format_sed = 1 << 8,
format_no_copy = 1 << 9,
format_first_only = 1 << 10,
- __no_update_pos = 1 << 11
+ __no_update_pos = 1 << 11,
+ __full_match = 1 << 12
};
inline _LIBCPP_INLINE_VISIBILITY
@@ -957,13 +959,13 @@ public:
};
template <regex_constants::error_type _Ev>
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
void __throw_regex_error()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw regex_error(_Ev);
#else
- assert(!"regex_error");
+ _VSTD::abort();
#endif
}
@@ -2475,6 +2477,8 @@ class _LIBCPP_TYPE_VIS_ONLY basic_regex
public:
// types:
typedef _CharT value_type;
+ typedef _Traits traits_type;
+ typedef typename _Traits::string_type string_type;
typedef regex_constants::syntax_option_type flag_type;
typedef typename _Traits::locale_type locale_type;
@@ -2515,7 +2519,7 @@ public:
__end_(0)
{__parse(__p, __p + __traits_.length(__p));}
_LIBCPP_INLINE_VISIBILITY
- basic_regex(const value_type* __p, size_t __len, flag_type __f)
+ basic_regex(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
__end_(0)
{__parse(__p, __p + __len);}
@@ -2981,10 +2985,12 @@ __lookahead<_CharT, _Traits>::__exec(__state& __s) const
{
match_results<const _CharT*> __m;
__m.__init(1 + __exp_.mark_count(), __s.__current_, __s.__last_);
- bool __matched = __exp_.__match_at_start_ecma(__s.__current_, __s.__last_,
- __m,
- __s.__flags_ | regex_constants::match_continuous,
- __s.__at_first_ && __s.__current_ == __s.__first_);
+ bool __matched = __exp_.__match_at_start_ecma(
+ __s.__current_, __s.__last_,
+ __m,
+ (__s.__flags_ | regex_constants::match_continuous) &
+ ~regex_constants::__full_match,
+ __s.__at_first_ && __s.__current_ == __s.__first_);
if (__matched != __invert_)
{
__s.__do_ = __state::__accept_but_not_consume;
@@ -4308,7 +4314,8 @@ basic_regex<_CharT, _Traits>::__parse_decimal_escape(_ForwardIterator __first,
else if ('1' <= *__first && *__first <= '9')
{
unsigned __v = *__first - '0';
- for (++__first; '0' <= *__first && *__first <= '9'; ++__first)
+ for (++__first;
+ __first != __last && '0' <= *__first && *__first <= '9'; ++__first)
__v = 10 * __v + *__first - '0';
if (__v > mark_count())
__throw_regex_error<regex_constants::error_backref>();
@@ -5552,6 +5559,18 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
switch (__s.__do_)
{
case __state::__end_state:
+ if ((__flags & regex_constants::match_not_null) &&
+ __s.__current_ == __first)
+ {
+ __states.pop_back();
+ break;
+ }
+ if ((__flags & regex_constants::__full_match) &&
+ __s.__current_ != __last)
+ {
+ __states.pop_back();
+ break;
+ }
__m.__matches_[0].first = __first;
__m.__matches_[0].second = _VSTD::next(__first, __s.__current_ - __first);
__m.__matches_[0].matched = true;
@@ -5615,6 +5634,18 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
switch (__s.__do_)
{
case __state::__end_state:
+ if ((__flags & regex_constants::match_not_null) &&
+ __s.__current_ == __first)
+ {
+ __states.pop_back();
+ break;
+ }
+ if ((__flags & regex_constants::__full_match) &&
+ __s.__current_ != __last)
+ {
+ __states.pop_back();
+ break;
+ }
if (!__matched || __highest_j < __s.__current_ - __s.__first_)
__highest_j = __s.__current_ - __s.__first_;
__matched = true;
@@ -5700,6 +5731,18 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
switch (__s.__do_)
{
case __state::__end_state:
+ if ((__flags & regex_constants::match_not_null) &&
+ __s.__current_ == __first)
+ {
+ __states.pop_back();
+ break;
+ }
+ if ((__flags & regex_constants::__full_match) &&
+ __s.__current_ != __last)
+ {
+ __states.pop_back();
+ break;
+ }
if (!__matched || __highest_j < __s.__current_ - __s.__first_)
{
__highest_j = __s.__current_ - __s.__first_;
@@ -5930,8 +5973,10 @@ regex_match(_BidirectionalIterator __first, _BidirectionalIterator __last,
const basic_regex<_CharT, _Traits>& __e,
regex_constants::match_flag_type __flags = regex_constants::match_default)
{
- bool __r = _VSTD::regex_search(__first, __last, __m, __e,
- __flags | regex_constants::match_continuous);
+ bool __r = _VSTD::regex_search(
+ __first, __last, __m, __e,
+ __flags | regex_constants::match_continuous |
+ regex_constants::__full_match);
if (__r)
{
__r = !__m.suffix().matched;
@@ -6142,7 +6187,7 @@ private:
_Position __position_;
const value_type* __result_;
value_type __suffix_;
- ptrdiff_t _N_;
+ ptrdiff_t __n_;
vector<int> __subs_;
public:
@@ -6225,10 +6270,10 @@ public:
private:
void __init(_BidirectionalIterator __a, _BidirectionalIterator __b);
void __establish_result () {
- if (__subs_[_N_] == -1)
+ if (__subs_[__n_] == -1)
__result_ = &__position_->prefix();
else
- __result_ = &(*__position_)[__subs_[_N_]];
+ __result_ = &(*__position_)[__subs_[__n_]];
}
};
@@ -6237,7 +6282,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
regex_token_iterator()
: __result_(nullptr),
__suffix_(),
- _N_(0)
+ __n_(0)
{
}
@@ -6248,7 +6293,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
{
if (__position_ != _Position())
__establish_result ();
- else if (__subs_[_N_] == -1)
+ else if (__subs_[__n_] == -1)
{
__suffix_.matched = true;
__suffix_.first = __a;
@@ -6265,7 +6310,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
const regex_type& __re, int __submatch,
regex_constants::match_flag_type __m)
: __position_(__a, __b, __re, __m),
- _N_(0),
+ __n_(0),
__subs_(1, __submatch)
{
__init(__a, __b);
@@ -6277,7 +6322,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
const regex_type& __re, const vector<int>& __submatches,
regex_constants::match_flag_type __m)
: __position_(__a, __b, __re, __m),
- _N_(0),
+ __n_(0),
__subs_(__submatches)
{
__init(__a, __b);
@@ -6292,7 +6337,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
initializer_list<int> __submatches,
regex_constants::match_flag_type __m)
: __position_(__a, __b, __re, __m),
- _N_(0),
+ __n_(0),
__subs_(__submatches)
{
__init(__a, __b);
@@ -6308,7 +6353,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
const int (&__submatches)[_Np],
regex_constants::match_flag_type __m)
: __position_(__a, __b, __re, __m),
- _N_(0),
+ __n_(0),
__subs_(__submatches, __submatches + _Np)
{
__init(__a, __b);
@@ -6320,7 +6365,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
: __position_(__x.__position_),
__result_(__x.__result_),
__suffix_(__x.__suffix_),
- _N_(__x._N_),
+ __n_(__x.__n_),
__subs_(__x.__subs_)
{
if (__x.__result_ == &__x.__suffix_)
@@ -6342,7 +6387,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
else
__result_ = __x.__result_;
__suffix_ = __x.__suffix_;
- _N_ = __x._N_;
+ __n_ = __x.__n_;
__subs_ = __x.__subs_;
if ( __result_ != nullptr && __result_ != &__suffix_ )
@@ -6365,7 +6410,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
return false;
if (__result_ == &__suffix_ || __x.__result_ == &__x.__suffix_)
return false;
- return __position_ == __x.__position_ && _N_ == __x._N_ &&
+ return __position_ == __x.__position_ && __n_ == __x.__n_ &&
__subs_ == __x.__subs_;
}
@@ -6376,14 +6421,14 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
_Position __prev = __position_;
if (__result_ == &__suffix_)
__result_ = nullptr;
- else if (_N_ + 1 < __subs_.size())
+ else if (static_cast<size_t>(__n_ + 1) < __subs_.size())
{
- ++_N_;
+ ++__n_;
__establish_result();
}
else
{
- _N_ = 0;
+ __n_ = 0;
++__position_;
if (__position_ != _Position())
__establish_result();
diff --git a/include/scoped_allocator b/include/scoped_allocator
index 9436dac9c199..605f70b472f1 100644
--- a/include/scoped_allocator
+++ b/include/scoped_allocator
@@ -115,7 +115,7 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
_LIBCPP_BEGIN_NAMESPACE_STD
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
+#if !defined(_LIBCPP_CXX03_LANG)
// scoped_allocator_adaptor
@@ -498,8 +498,58 @@ public:
template <class _Tp, class... _Args>
_LIBCPP_INLINE_VISIBILITY
void construct(_Tp* __p, _Args&& ...__args)
- {__construct(__uses_alloc_ctor<_Tp, inner_allocator_type, _Args...>(),
+ {__construct(__uses_alloc_ctor<_Tp, inner_allocator_type&, _Args...>(),
__p, _VSTD::forward<_Args>(__args)...);}
+
+ template <class _T1, class _T2, class... _Args1, class... _Args2>
+ void construct(pair<_T1, _T2>* __p, piecewise_construct_t,
+ tuple<_Args1...> __x, tuple<_Args2...> __y)
+ {
+ typedef __outermost<outer_allocator_type> _OM;
+ allocator_traits<typename _OM::type>::construct(
+ _OM()(outer_allocator()), __p, piecewise_construct
+ , __transform_tuple(
+ typename __uses_alloc_ctor<
+ _T1, inner_allocator_type&, _Args1...
+ >::type()
+ , _VSTD::move(__x)
+ , typename __make_tuple_indices<sizeof...(_Args1)>::type{}
+ )
+ , __transform_tuple(
+ typename __uses_alloc_ctor<
+ _T2, inner_allocator_type&, _Args2...
+ >::type()
+ , _VSTD::move(__y)
+ , typename __make_tuple_indices<sizeof...(_Args2)>::type{}
+ )
+ );
+ }
+
+ template <class _T1, class _T2>
+ void construct(pair<_T1, _T2>* __p)
+ { construct(__p, piecewise_construct, tuple<>{}, tuple<>{}); }
+
+ template <class _T1, class _T2, class _Up, class _Vp>
+ void construct(pair<_T1, _T2>* __p, _Up&& __x, _Vp&& __y) {
+ construct(__p, piecewise_construct,
+ _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x)),
+ _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__y)));
+ }
+
+ template <class _T1, class _T2, class _Up, class _Vp>
+ void construct(pair<_T1, _T2>* __p, const pair<_Up, _Vp>& __x) {
+ construct(__p, piecewise_construct,
+ _VSTD::forward_as_tuple(__x.first),
+ _VSTD::forward_as_tuple(__x.second));
+ }
+
+ template <class _T1, class _T2, class _Up, class _Vp>
+ void construct(pair<_T1, _T2>* __p, pair<_Up, _Vp>&& __x) {
+ construct(__p, piecewise_construct,
+ _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x.first)),
+ _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__x.second)));
+ }
+
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
void destroy(_Tp* __p)
@@ -515,6 +565,7 @@ public:
private:
+
template <class _OuterA2,
class = typename enable_if<
is_constructible<outer_allocator_type, _OuterA2>::value
@@ -545,9 +596,7 @@ private:
allocator_traits<typename _OM::type>::construct
(
_OM()(outer_allocator()),
- __p,
- allocator_arg,
- inner_allocator(),
+ __p, allocator_arg, inner_allocator(),
_VSTD::forward<_Args>(__args)...
);
}
@@ -566,6 +615,36 @@ private:
);
}
+ template <class ..._Args, size_t ..._Idx>
+ _LIBCPP_INLINE_VISIBILITY
+ tuple<_Args&&...>
+ __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t,
+ __tuple_indices<_Idx...>)
+ {
+ return _VSTD::forward_as_tuple(_VSTD::get<_Idx>(_VSTD::move(__t))...);
+ }
+
+ template <class ..._Args, size_t ..._Idx>
+ _LIBCPP_INLINE_VISIBILITY
+ tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>
+ __transform_tuple(integral_constant<int, 1>, tuple<_Args...> && __t,
+ __tuple_indices<_Idx...>)
+ {
+ using _Tup = tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>;
+ return _Tup(allocator_arg, inner_allocator(),
+ _VSTD::get<_Idx>(_VSTD::move(__t))...);
+ }
+
+ template <class ..._Args, size_t ..._Idx>
+ _LIBCPP_INLINE_VISIBILITY
+ tuple<_Args&&..., inner_allocator_type&>
+ __transform_tuple(integral_constant<int, 2>, tuple<_Args...> && __t,
+ __tuple_indices<_Idx...>)
+ {
+ using _Tup = tuple<_Args&&..., inner_allocator_type&>;
+ return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., inner_allocator());
+ }
+
template <class...> friend class __scoped_allocator_storage;
};
@@ -597,7 +676,7 @@ operator!=(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
return !(__a == __b);
}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
+#endif // !defined(_LIBCPP_CXX03_LANG)
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/set b/include/set
index ac69e085241f..8e4c2ae6a604 100644
--- a/include/set
+++ b/include/set
@@ -672,7 +672,7 @@ public:
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
- count(const _K2& __k) {return __tree_.__count_unique(__k);}
+ count(const _K2& __k) const {return __tree_.__count_unique(__k);}
#endif
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -1023,7 +1023,7 @@ public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, value_type&& __v)
- {return __tree_.__insert_multi(_VSTD::move(__v));}
+ {return __tree_.__insert_multi(__p, _VSTD::move(__v));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
diff --git a/include/sstream b/include/sstream
index 27ae78f9d45f..18bccf6ac6c7 100644
--- a/include/sstream
+++ b/include/sstream
@@ -207,7 +207,9 @@ private:
public:
// 27.8.1.1 Constructors:
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_stringbuf(ios_base::openmode __wch = ios_base::in | ios_base::out);
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_stringbuf(const string_type& __s,
ios_base::openmode __wch = ios_base::in | ios_base::out);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -231,12 +233,12 @@ protected:
virtual int_type overflow (int_type __c = traits_type::eof());
virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
ios_base::openmode __wch = ios_base::in | ios_base::out);
+ inline _LIBCPP_INLINE_VISIBILITY
virtual pos_type seekpos(pos_type __sp,
ios_base::openmode __wch = ios_base::in | ios_base::out);
};
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode __wch)
: __hm_(0),
__mode_(__wch)
@@ -245,7 +247,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type& __s,
ios_base::openmode __wch)
: __hm_(0),
@@ -607,7 +608,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
typename basic_stringbuf<_CharT, _Traits, _Allocator>::pos_type
basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
ios_base::openmode __wch)
@@ -636,25 +636,31 @@ private:
public:
// 27.8.2.1 Constructors:
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_istringstream(ios_base::openmode __wch = ios_base::in);
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_istringstream(const string_type& __s,
ios_base::openmode __wch = ios_base::in);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ inline _LIBCPP_INLINE_VISIBILITY
basic_istringstream(basic_istringstream&& __rhs);
// 27.8.2.2 Assign and swap:
basic_istringstream& operator=(basic_istringstream&& __rhs);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ inline _LIBCPP_INLINE_VISIBILITY
void swap(basic_istringstream& __rhs);
// 27.8.2.3 Members:
+ inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
+ inline _LIBCPP_INLINE_VISIBILITY
string_type str() const;
+ inline _LIBCPP_INLINE_VISIBILITY
void str(const string_type& __s);
};
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(ios_base::openmode __wch)
: basic_istream<_CharT, _Traits>(&__sb_),
__sb_(__wch | ios_base::in)
@@ -662,7 +668,6 @@ basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(ios_base::
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const string_type& __s,
ios_base::openmode __wch)
: basic_istream<_CharT, _Traits>(&__sb_),
@@ -673,7 +678,6 @@ basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const stri
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs)
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -693,9 +697,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream&
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rhs)
+void basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rhs)
{
basic_istream<char_type, traits_type>::swap(__rhs);
__sb_.swap(__rhs.__sb_);
@@ -711,7 +713,6 @@ swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<_CharT, _Traits, _Allocator>*
basic_istringstream<_CharT, _Traits, _Allocator>::rdbuf() const
{
@@ -719,7 +720,6 @@ basic_istringstream<_CharT, _Traits, _Allocator>::rdbuf() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>
basic_istringstream<_CharT, _Traits, _Allocator>::str() const
{
@@ -727,9 +727,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::str() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
+void basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
__sb_.str(__s);
}
@@ -755,25 +753,31 @@ private:
public:
// 27.8.2.1 Constructors:
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_ostringstream(ios_base::openmode __wch = ios_base::out);
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_ostringstream(const string_type& __s,
ios_base::openmode __wch = ios_base::out);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ inline _LIBCPP_INLINE_VISIBILITY
basic_ostringstream(basic_ostringstream&& __rhs);
// 27.8.2.2 Assign and swap:
basic_ostringstream& operator=(basic_ostringstream&& __rhs);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ inline _LIBCPP_INLINE_VISIBILITY
void swap(basic_ostringstream& __rhs);
// 27.8.2.3 Members:
+ inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
+ inline _LIBCPP_INLINE_VISIBILITY
string_type str() const;
+ inline _LIBCPP_INLINE_VISIBILITY
void str(const string_type& __s);
};
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(ios_base::openmode __wch)
: basic_ostream<_CharT, _Traits>(&__sb_),
__sb_(__wch | ios_base::out)
@@ -781,7 +785,6 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(ios_base::
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const string_type& __s,
ios_base::openmode __wch)
: basic_ostream<_CharT, _Traits>(&__sb_),
@@ -792,7 +795,6 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const stri
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs)
: basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -812,7 +814,6 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream&
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
void
basic_ostringstream<_CharT, _Traits, _Allocator>::swap(basic_ostringstream& __rhs)
{
@@ -830,7 +831,6 @@ swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<_CharT, _Traits, _Allocator>*
basic_ostringstream<_CharT, _Traits, _Allocator>::rdbuf() const
{
@@ -838,7 +838,6 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::rdbuf() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>
basic_ostringstream<_CharT, _Traits, _Allocator>::str() const
{
@@ -846,7 +845,6 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::str() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
void
basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
@@ -874,25 +872,31 @@ private:
public:
// 27.8.2.1 Constructors:
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_stringstream(ios_base::openmode __wch = ios_base::in | ios_base::out);
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_stringstream(const string_type& __s,
ios_base::openmode __wch = ios_base::in | ios_base::out);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ inline _LIBCPP_INLINE_VISIBILITY
basic_stringstream(basic_stringstream&& __rhs);
// 27.8.2.2 Assign and swap:
basic_stringstream& operator=(basic_stringstream&& __rhs);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ inline _LIBCPP_INLINE_VISIBILITY
void swap(basic_stringstream& __rhs);
// 27.8.2.3 Members:
+ inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
+ inline _LIBCPP_INLINE_VISIBILITY
string_type str() const;
+ inline _LIBCPP_INLINE_VISIBILITY
void str(const string_type& __s);
};
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(ios_base::openmode __wch)
: basic_iostream<_CharT, _Traits>(&__sb_),
__sb_(__wch)
@@ -900,7 +904,6 @@ basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(ios_base::op
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string_type& __s,
ios_base::openmode __wch)
: basic_iostream<_CharT, _Traits>(&__sb_),
@@ -911,7 +914,6 @@ basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs)
: basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -931,7 +933,6 @@ basic_stringstream<_CharT, _Traits, _Allocator>::operator=(basic_stringstream&&
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
void
basic_stringstream<_CharT, _Traits, _Allocator>::swap(basic_stringstream& __rhs)
{
@@ -949,7 +950,6 @@ swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<_CharT, _Traits, _Allocator>*
basic_stringstream<_CharT, _Traits, _Allocator>::rdbuf() const
{
@@ -957,7 +957,6 @@ basic_stringstream<_CharT, _Traits, _Allocator>::rdbuf() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>
basic_stringstream<_CharT, _Traits, _Allocator>::str() const
{
@@ -965,7 +964,6 @@ basic_stringstream<_CharT, _Traits, _Allocator>::str() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
void
basic_stringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
diff --git a/include/stack b/include/stack
index 48b3b0d16ec2..ee3fac8c4548 100644
--- a/include/stack
+++ b/include/stack
@@ -55,7 +55,7 @@ public:
void push(const value_type& x);
void push(value_type&& x);
- template <class... Args> void emplace(Args&&... args);
+ template <class... Args> reference emplace(Args&&... args);
void pop();
void swap(stack& c) noexcept(is_nothrow_swappable_v<Container>)
@@ -199,8 +199,8 @@ public:
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- void emplace(_Args&&... __args)
- {c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+ reference emplace(_Args&&... __args)
+ { return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
diff --git a/include/stdexcept b/include/stdexcept
index 4218b1398d85..d501d0916085 100644
--- a/include/stdexcept
+++ b/include/stdexcept
@@ -45,22 +45,31 @@ public:
#include <__config>
#include <exception>
#include <iosfwd> // for string forward decl
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
-#ifndef _LIBCPP___REFSTRING
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_HIDDEN __libcpp_refstring {
-#ifdef __clang__
- const char *__imp_ __attribute__((__unused__)); // only clang emits a warning
-#else
- const char *__imp_;
-#endif
+
+class _LIBCPP_HIDDEN __libcpp_refstring
+{
+ const char* __imp_;
+
+ bool __uses_refcount() const;
+public:
+ explicit __libcpp_refstring(const char* msg);
+ __libcpp_refstring(const __libcpp_refstring& s) _NOEXCEPT;
+ __libcpp_refstring& operator=(const __libcpp_refstring& s) _NOEXCEPT;
+ ~__libcpp_refstring();
+
+ const char* c_str() const _NOEXCEPT {return __imp_;}
};
+
_LIBCPP_END_NAMESPACE_STD
-#endif
namespace std // purposefully not using versioning namespace
{
@@ -171,4 +180,99 @@ public:
} // std
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// in the dylib
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_logic_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw logic_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_domain_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw domain_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_invalid_argument(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw invalid_argument(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_length_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw length_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_out_of_range(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw out_of_range(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_range_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw range_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_overflow_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw overflow_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_underflow_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw underflow_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
#endif // _LIBCPP_STDEXCEPT
diff --git a/include/stdint.h b/include/stdint.h
new file mode 100644
index 000000000000..468f6cd97c23
--- /dev/null
+++ b/include/stdint.h
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+//===---------------------------- stdint.h --------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_STDINT_H
+#define _LIBCPP_STDINT_H
+
+/*
+ stdint.h synopsis
+
+Macros:
+
+ INT8_MIN
+ INT16_MIN
+ INT32_MIN
+ INT64_MIN
+
+ INT8_MAX
+ INT16_MAX
+ INT32_MAX
+ INT64_MAX
+
+ UINT8_MAX
+ UINT16_MAX
+ UINT32_MAX
+ UINT64_MAX
+
+ INT_LEAST8_MIN
+ INT_LEAST16_MIN
+ INT_LEAST32_MIN
+ INT_LEAST64_MIN
+
+ INT_LEAST8_MAX
+ INT_LEAST16_MAX
+ INT_LEAST32_MAX
+ INT_LEAST64_MAX
+
+ UINT_LEAST8_MAX
+ UINT_LEAST16_MAX
+ UINT_LEAST32_MAX
+ UINT_LEAST64_MAX
+
+ INT_FAST8_MIN
+ INT_FAST16_MIN
+ INT_FAST32_MIN
+ INT_FAST64_MIN
+
+ INT_FAST8_MAX
+ INT_FAST16_MAX
+ INT_FAST32_MAX
+ INT_FAST64_MAX
+
+ UINT_FAST8_MAX
+ UINT_FAST16_MAX
+ UINT_FAST32_MAX
+ UINT_FAST64_MAX
+
+ INTPTR_MIN
+ INTPTR_MAX
+ UINTPTR_MAX
+
+ INTMAX_MIN
+ INTMAX_MAX
+
+ UINTMAX_MAX
+
+ PTRDIFF_MIN
+ PTRDIFF_MAX
+
+ SIG_ATOMIC_MIN
+ SIG_ATOMIC_MAX
+
+ SIZE_MAX
+
+ WCHAR_MIN
+ WCHAR_MAX
+
+ WINT_MIN
+ WINT_MAX
+
+ INT8_C(value)
+ INT16_C(value)
+ INT32_C(value)
+ INT64_C(value)
+
+ UINT8_C(value)
+ UINT16_C(value)
+ UINT32_C(value)
+ UINT64_C(value)
+
+ INTMAX_C(value)
+ UINTMAX_C(value)
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+/* C99 stdlib (e.g. glibc < 2.18) does not provide macros needed
+ for C++11 unless __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS
+ are defined
+*/
+#if defined(__cplusplus) && !defined(__STDC_LIMIT_MACROS)
+# define __STDC_LIMIT_MACROS
+#endif
+#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS)
+# define __STDC_CONSTANT_MACROS
+#endif
+
+#include_next <stdint.h>
+
+#endif // _LIBCPP_STDINT_H
diff --git a/include/streambuf b/include/streambuf
index 7544aaf179bd..6c478384d769 100644
--- a/include/streambuf
+++ b/include/streambuf
@@ -132,32 +132,96 @@ public:
virtual ~basic_streambuf();
// 27.6.2.2.1 locales:
- locale pubimbue(const locale& __loc);
- locale getloc() const;
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ locale pubimbue(const locale& __loc) {
+ imbue(__loc);
+ locale __r = __loc_;
+ __loc_ = __loc;
+ return __r;
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ locale getloc() const { return __loc_; }
// 27.6.2.2.2 buffer and positioning:
- basic_streambuf* pubsetbuf(char_type* __s, streamsize __n);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_streambuf* pubsetbuf(char_type* __s, streamsize __n)
+ { return setbuf(__s, __n); }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
pos_type pubseekoff(off_type __off, ios_base::seekdir __way,
- ios_base::openmode __which = ios_base::in | ios_base::out);
+ ios_base::openmode __which = ios_base::in | ios_base::out)
+ { return seekoff(__off, __way, __which); }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
pos_type pubseekpos(pos_type __sp,
- ios_base::openmode __which = ios_base::in | ios_base::out);
- int pubsync();
+ ios_base::openmode __which = ios_base::in | ios_base::out)
+ { return seekpos(__sp, __which); }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int pubsync() { return sync(); }
// Get and put areas:
// 27.6.2.2.3 Get area:
- streamsize in_avail();
- int_type snextc();
- int_type sbumpc();
- int_type sgetc();
- streamsize sgetn(char_type* __s, streamsize __n);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ streamsize in_avail() {
+ if (__ninp_ < __einp_)
+ return static_cast<streamsize>(__einp_ - __ninp_);
+ return showmanyc();
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type snextc() {
+ if (sbumpc() == traits_type::eof())
+ return traits_type::eof();
+ return sgetc();
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type sbumpc() {
+ if (__ninp_ == __einp_)
+ return uflow();
+ return traits_type::to_int_type(*__ninp_++);
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type sgetc() {
+ if (__ninp_ == __einp_)
+ return underflow();
+ return traits_type::to_int_type(*__ninp_);
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ streamsize sgetn(char_type* __s, streamsize __n)
+ { return xsgetn(__s, __n); }
// 27.6.2.2.4 Putback:
- int_type sputbackc(char_type __c);
- int_type sungetc();
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type sputbackc(char_type __c) {
+ if (__binp_ == __ninp_ || !traits_type::eq(__c, __ninp_[-1]))
+ return pbackfail(traits_type::to_int_type(__c));
+ return traits_type::to_int_type(*--__ninp_);
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type sungetc() {
+ if (__binp_ == __ninp_)
+ return pbackfail();
+ return traits_type::to_int_type(*--__ninp_);
+ }
// 27.6.2.2.5 Put area:
- int_type sputc(char_type __c);
- streamsize sputn(const char_type* __s, streamsize __n);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type sputc(char_type __c) {
+ if (__nout_ == __eout_)
+ return overflow(traits_type::to_int_type(__c));
+ *__nout_++ = __c;
+ return traits_type::to_int_type(__c);
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ streamsize sputn(const char_type* __s, streamsize __n)
+ { return xsputn(__s, __n); }
protected:
basic_streambuf();
@@ -169,15 +233,30 @@ protected:
_LIBCPP_ALWAYS_INLINE char_type* eback() const {return __binp_;}
_LIBCPP_ALWAYS_INLINE char_type* gptr() const {return __ninp_;}
_LIBCPP_ALWAYS_INLINE char_type* egptr() const {return __einp_;}
- void gbump(int __n);
- void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend);
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void gbump(int __n) { __ninp_ += __n; }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) {
+ __binp_ = __gbeg;
+ __ninp_ = __gnext;
+ __einp_ = __gend;
+ }
// 27.6.2.3.3 Put area:
_LIBCPP_ALWAYS_INLINE char_type* pbase() const {return __bout_;}
_LIBCPP_ALWAYS_INLINE char_type* pptr() const {return __nout_;}
_LIBCPP_ALWAYS_INLINE char_type* epptr() const {return __eout_;}
- void pbump(int __n);
- void setp(char_type* __pbeg, char_type* __pend);
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void pbump(int __n) { __nout_ += __n; }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void setp(char_type* __pbeg, char_type* __pend) {
+ __bout_ = __nout_ = __pbeg;
+ __eout_ = __pend;
+ }
// 27.6.2.4 virtual functions:
// 27.6.2.4.1 Locales:
@@ -220,147 +299,6 @@ basic_streambuf<_CharT, _Traits>::~basic_streambuf()
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-locale
-basic_streambuf<_CharT, _Traits>::pubimbue(const locale& __loc)
-{
- imbue(__loc);
- locale __r = __loc_;
- __loc_ = __loc;
- return __r;
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-locale
-basic_streambuf<_CharT, _Traits>::getloc() const
-{
- return __loc_;
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-basic_streambuf<_CharT, _Traits>*
-basic_streambuf<_CharT, _Traits>::pubsetbuf(char_type* __s, streamsize __n)
-{
- return setbuf(__s, __n);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-typename basic_streambuf<_CharT, _Traits>::pos_type
-basic_streambuf<_CharT, _Traits>::pubseekoff(off_type __off,
- ios_base::seekdir __way,
- ios_base::openmode __which)
-{
- return seekoff(__off, __way, __which);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-typename basic_streambuf<_CharT, _Traits>::pos_type
-basic_streambuf<_CharT, _Traits>::pubseekpos(pos_type __sp,
- ios_base::openmode __which)
-{
- return seekpos(__sp, __which);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-int
-basic_streambuf<_CharT, _Traits>::pubsync()
-{
- return sync();
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-streamsize
-basic_streambuf<_CharT, _Traits>::in_avail()
-{
- if (__ninp_ < __einp_)
- return static_cast<streamsize>(__einp_ - __ninp_);
- return showmanyc();
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::snextc()
-{
- if (sbumpc() == traits_type::eof())
- return traits_type::eof();
- return sgetc();
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::sbumpc()
-{
- if (__ninp_ == __einp_)
- return uflow();
- return traits_type::to_int_type(*__ninp_++);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::sgetc()
-{
- if (__ninp_ == __einp_)
- return underflow();
- return traits_type::to_int_type(*__ninp_);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-streamsize
-basic_streambuf<_CharT, _Traits>::sgetn(char_type* __s, streamsize __n)
-{
- return xsgetn(__s, __n);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::sputbackc(char_type __c)
-{
- if (__binp_ == __ninp_ || !traits_type::eq(__c, __ninp_[-1]))
- return pbackfail(traits_type::to_int_type(__c));
- return traits_type::to_int_type(*--__ninp_);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::sungetc()
-{
- if (__binp_ == __ninp_)
- return pbackfail();
- return traits_type::to_int_type(*--__ninp_);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::sputc(char_type __c)
-{
- if (__nout_ == __eout_)
- return overflow(traits_type::to_int_type(__c));
- *__nout_++ = __c;
- return traits_type::to_int_type(__c);
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-streamsize
-basic_streambuf<_CharT, _Traits>::sputn(const char_type* __s, streamsize __n)
-{
- return xsputn(__s, __n);
-}
-
-template <class _CharT, class _Traits>
basic_streambuf<_CharT, _Traits>::basic_streambuf()
: __binp_(0),
__ninp_(0),
@@ -411,42 +349,6 @@ basic_streambuf<_CharT, _Traits>::swap(basic_streambuf& __sb)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-basic_streambuf<_CharT, _Traits>::gbump(int __n)
-{
- __ninp_ += __n;
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-basic_streambuf<_CharT, _Traits>::setg(char_type* __gbeg, char_type* __gnext,
- char_type* __gend)
-{
- __binp_ = __gbeg;
- __ninp_ = __gnext;
- __einp_ = __gend;
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-basic_streambuf<_CharT, _Traits>::pbump(int __n)
-{
- __nout_ += __n;
-}
-
-template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-basic_streambuf<_CharT, _Traits>::setp(char_type* __pbeg, char_type* __pend)
-{
- __bout_ = __nout_ = __pbeg;
- __eout_ = __pend;
-}
-
-template <class _CharT, class _Traits>
void
basic_streambuf<_CharT, _Traits>::imbue(const locale&)
{
@@ -574,11 +476,11 @@ basic_streambuf<_CharT, _Traits>::overflow(int_type)
return traits_type::eof();
}
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_streambuf<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_streambuf<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ios<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ios<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>)
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/string b/include/string
index 786735f970f8..98f538c38a0e 100644
--- a/include/string
+++ b/include/string
@@ -101,7 +101,10 @@ public:
basic_string(const basic_string& str, size_type pos,
const allocator_type& a = allocator_type());
basic_string(const basic_string& str, size_type pos, size_type n,
- const Allocator& a = Allocator());
+ const Allocator& a = Allocator());
+ template<class T>
+ basic_string(const T& t, size_type pos, size_type n, const Allocator& a = Allocator()); // C++17
+ explicit basic_string(const basic_string_view<charT, traits> sv, const Allocator& a = Allocator());
basic_string(const value_type* s, const allocator_type& a = allocator_type());
basic_string(const value_type* s, size_type n, const allocator_type& a = allocator_type());
basic_string(size_type n, value_type c, const allocator_type& a = allocator_type());
@@ -114,7 +117,10 @@ public:
~basic_string();
+ operator basic_string_view<charT, traits>() const noexcept;
+
basic_string& operator=(const basic_string& str);
+ basic_string& operator=(basic_string_view<charT, traits> sv);
basic_string& operator=(basic_string&& str)
noexcept(
allocator_type::propagate_on_container_move_assignment::value ||
@@ -158,12 +164,16 @@ public:
reference at(size_type n);
basic_string& operator+=(const basic_string& str);
+ basic_string& operator+=(basic_string_view<charT, traits> sv);
basic_string& operator+=(const value_type* s);
basic_string& operator+=(value_type c);
basic_string& operator+=(initializer_list<value_type>);
basic_string& append(const basic_string& str);
+ basic_string& append(basic_string_view<charT, traits> sv);
basic_string& append(const basic_string& str, size_type pos, size_type n=npos); //C++14
+ template <class T>
+ basic_string& append(const T& t, size_type pos, size_type n=npos); // C++17
basic_string& append(const value_type* s, size_type n);
basic_string& append(const value_type* s);
basic_string& append(size_type n, value_type c);
@@ -179,8 +189,11 @@ public:
const_reference back() const;
basic_string& assign(const basic_string& str);
+ basic_string& assign(basic_string_view<charT, traits> sv);
basic_string& assign(basic_string&& str);
basic_string& assign(const basic_string& str, size_type pos, size_type n=npos); // C++14
+ template <class T>
+ basic_string& assign(const T& t, size_type pos, size_type n=npos); // C++17
basic_string& assign(const value_type* s, size_type n);
basic_string& assign(const value_type* s);
basic_string& assign(size_type n, value_type c);
@@ -189,8 +202,11 @@ public:
basic_string& assign(initializer_list<value_type>);
basic_string& insert(size_type pos1, const basic_string& str);
+ basic_string& insert(size_type pos1, basic_string_view<charT, traits> sv);
basic_string& insert(size_type pos1, const basic_string& str,
size_type pos2, size_type n);
+ template <class T>
+ basic_string& insert(size_type pos1, const T& t, size_type pos2, size_type n); // C++17
basic_string& insert(size_type pos, const value_type* s, size_type n=npos); //C++14
basic_string& insert(size_type pos, const value_type* s);
basic_string& insert(size_type pos, size_type n, value_type c);
@@ -205,12 +221,17 @@ public:
iterator erase(const_iterator first, const_iterator last);
basic_string& replace(size_type pos1, size_type n1, const basic_string& str);
+ basic_string& replace(size_type pos1, size_type n1, basic_string_view<charT, traits> sv);
basic_string& replace(size_type pos1, size_type n1, const basic_string& str,
size_type pos2, size_type n2=npos); // C++14
+ template <class T>
+ basic_string& replace(size_type pos1, size_type n1, const T& t,
+ size_type pos2, size_type n); // C++17
basic_string& replace(size_type pos, size_type n1, const value_type* s, size_type n2);
basic_string& replace(size_type pos, size_type n1, const value_type* s);
basic_string& replace(size_type pos, size_type n1, size_type n2, value_type c);
basic_string& replace(const_iterator i1, const_iterator i2, const basic_string& str);
+ basic_string& replace(const_iterator i1, const_iterator i2, basic_string_view<charT, traits> sv);
basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s, size_type n);
basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s);
basic_string& replace(const_iterator i1, const_iterator i2, size_type n, value_type c);
@@ -232,39 +253,50 @@ public:
allocator_type get_allocator() const noexcept;
size_type find(const basic_string& str, size_type pos = 0) const noexcept;
+ size_type find(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type find(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find(const value_type* s, size_type pos = 0) const noexcept;
size_type find(value_type c, size_type pos = 0) const noexcept;
size_type rfind(const basic_string& str, size_type pos = npos) const noexcept;
+ size_type ffind(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept;
size_type rfind(const value_type* s, size_type pos = npos) const noexcept;
size_type rfind(value_type c, size_type pos = npos) const noexcept;
size_type find_first_of(const basic_string& str, size_type pos = 0) const noexcept;
+ size_type find_first_of(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type find_first_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_first_of(const value_type* s, size_type pos = 0) const noexcept;
size_type find_first_of(value_type c, size_type pos = 0) const noexcept;
size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept;
+ size_type find_last_of(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept;
size_type find_last_of(value_type c, size_type pos = npos) const noexcept;
size_type find_first_not_of(const basic_string& str, size_type pos = 0) const noexcept;
+ size_type find_first_not_of(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type find_first_not_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_first_not_of(const value_type* s, size_type pos = 0) const noexcept;
size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept;
size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept;
+ size_type find_last_not_of(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept;
size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept;
int compare(const basic_string& str) const noexcept;
+ int compare(basic_string_view<charT, traits> sv) const noexcept;
int compare(size_type pos1, size_type n1, const basic_string& str) const;
+ int compare(size_type pos1, size_type n1, basic_string_view<charT, traits> sv) const;
int compare(size_type pos1, size_type n1, const basic_string& str,
size_type pos2, size_type n2=npos) const; // C++14
+ template <class T>
+ int compare(size_type pos1, size_type n1, const T& t,
+ size_type pos2, size_type n2=npos) const; // C++17
int compare(const value_type* s) const noexcept;
int compare(size_type pos1, size_type n1, const value_type* s) const;
int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const;
@@ -435,6 +467,7 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
*/
#include <__config>
+#include <string_view>
#include <iosfwd>
#include <cstring>
#include <cstdio> // For EOF.
@@ -450,9 +483,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
#include <cstdint>
#endif
-#if defined(_LIBCPP_NO_EXCEPTIONS)
-#include <cassert>
-#endif
#include <__undef_min_max>
@@ -501,647 +531,6 @@ inline _LIBCPP_INLINE_VISIBILITY
bool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y)
{return streamoff(__x) != streamoff(__y);}
-// char_traits
-
-template <class _CharT>
-struct _LIBCPP_TYPE_VIS_ONLY char_traits
-{
- typedef _CharT char_type;
- typedef int int_type;
- typedef streamoff off_type;
- typedef streampos pos_type;
- typedef mbstate_t state_type;
-
- static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
- {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 < __c2;}
-
- static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static size_t length(const char_type* __s);
- _LIBCPP_INLINE_VISIBILITY
- static const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
- static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* assign(char_type* __s, size_t __n, char_type __a);
-
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
- {return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
- {return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
- {return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
- {return int_type(EOF);}
-};
-
-template <class _CharT>
-int
-char_traits<_CharT>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
-{
- for (; __n; --__n, ++__s1, ++__s2)
- {
- if (lt(*__s1, *__s2))
- return -1;
- if (lt(*__s2, *__s1))
- return 1;
- }
- return 0;
-}
-
-template <class _CharT>
-inline
-size_t
-char_traits<_CharT>::length(const char_type* __s)
-{
- size_t __len = 0;
- for (; !eq(*__s, char_type(0)); ++__s)
- ++__len;
- return __len;
-}
-
-template <class _CharT>
-inline
-const _CharT*
-char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a)
-{
- for (; __n; --__n)
- {
- if (eq(*__s, __a))
- return __s;
- ++__s;
- }
- return 0;
-}
-
-template <class _CharT>
-_CharT*
-char_traits<_CharT>::move(char_type* __s1, const char_type* __s2, size_t __n)
-{
- char_type* __r = __s1;
- if (__s1 < __s2)
- {
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- }
- else if (__s2 < __s1)
- {
- __s1 += __n;
- __s2 += __n;
- for (; __n; --__n)
- assign(*--__s1, *--__s2);
- }
- return __r;
-}
-
-template <class _CharT>
-inline
-_CharT*
-char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n)
-{
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
- char_type* __r = __s1;
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- return __r;
-}
-
-template <class _CharT>
-inline
-_CharT*
-char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
-{
- char_type* __r = __s;
- for (; __n; --__n, ++__s)
- assign(*__s, __a);
- return __r;
-}
-
-// char_traits<char>
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY char_traits<char>
-{
- typedef char char_type;
- typedef int int_type;
- typedef streamoff off_type;
- typedef streampos pos_type;
- typedef mbstate_t state_type;
-
- static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
- {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
- {return (unsigned char)__c1 < (unsigned char)__c2;}
-
- static inline int compare(const char_type* __s1, const char_type* __s2, size_t __n)
- {return __n == 0 ? 0 : memcmp(__s1, __s2, __n);}
- static inline size_t length(const char_type* __s) {return strlen(__s);}
- static inline const char_type* find(const char_type* __s, size_t __n, const char_type& __a)
- {return __n == 0 ? NULL : (const char_type*) memchr(__s, to_int_type(__a), __n);}
- static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n)
- {return __n == 0 ? __s1 : (char_type*) memmove(__s1, __s2, __n);}
- static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n)
- {
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
- return __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);
- }
- static inline char_type* assign(char_type* __s, size_t __n, char_type __a)
- {return __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);}
-
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
- {return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
- {return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
- {return int_type((unsigned char)__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
- {return int_type(EOF);}
-};
-
-// char_traits<wchar_t>
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY char_traits<wchar_t>
-{
- typedef wchar_t char_type;
- typedef wint_t int_type;
- typedef streamoff off_type;
- typedef streampos pos_type;
- typedef mbstate_t state_type;
-
- static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
- {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 < __c2;}
-
- static inline int compare(const char_type* __s1, const char_type* __s2, size_t __n)
- {return __n == 0 ? 0 : wmemcmp(__s1, __s2, __n);}
- static inline size_t length(const char_type* __s)
- {return wcslen(__s);}
- static inline const char_type* find(const char_type* __s, size_t __n, const char_type& __a)
- {return __n == 0 ? NULL : (const char_type*)wmemchr(__s, __a, __n);}
- static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n)
- {return __n == 0 ? __s1 : (char_type*)wmemmove(__s1, __s2, __n);}
- static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n)
- {
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
- return __n == 0 ? __s1 : (char_type*)wmemcpy(__s1, __s2, __n);
- }
- static inline char_type* assign(char_type* __s, size_t __n, char_type __a)
- {return __n == 0 ? __s : (char_type*)wmemset(__s, __a, __n);}
-
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
- {return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
- {return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
- {return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
- {return int_type(WEOF);}
-};
-
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY char_traits<char16_t>
-{
- typedef char16_t char_type;
- typedef uint_least16_t int_type;
- typedef streamoff off_type;
- typedef u16streampos pos_type;
- typedef mbstate_t state_type;
-
- static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
- {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 < __c2;}
-
- _LIBCPP_INLINE_VISIBILITY
- static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static size_t length(const char_type* __s);
- _LIBCPP_INLINE_VISIBILITY
- static const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* assign(char_type* __s, size_t __n, char_type __a);
-
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
- {return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
- {return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
- {return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
- {return int_type(0xFFFF);}
-};
-
-inline
-int
-char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
-{
- for (; __n; --__n, ++__s1, ++__s2)
- {
- if (lt(*__s1, *__s2))
- return -1;
- if (lt(*__s2, *__s1))
- return 1;
- }
- return 0;
-}
-
-inline
-size_t
-char_traits<char16_t>::length(const char_type* __s)
-{
- size_t __len = 0;
- for (; !eq(*__s, char_type(0)); ++__s)
- ++__len;
- return __len;
-}
-
-inline
-const char16_t*
-char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& __a)
-{
- for (; __n; --__n)
- {
- if (eq(*__s, __a))
- return __s;
- ++__s;
- }
- return 0;
-}
-
-inline
-char16_t*
-char_traits<char16_t>::move(char_type* __s1, const char_type* __s2, size_t __n)
-{
- char_type* __r = __s1;
- if (__s1 < __s2)
- {
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- }
- else if (__s2 < __s1)
- {
- __s1 += __n;
- __s2 += __n;
- for (; __n; --__n)
- assign(*--__s1, *--__s2);
- }
- return __r;
-}
-
-inline
-char16_t*
-char_traits<char16_t>::copy(char_type* __s1, const char_type* __s2, size_t __n)
-{
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
- char_type* __r = __s1;
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- return __r;
-}
-
-inline
-char16_t*
-char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a)
-{
- char_type* __r = __s;
- for (; __n; --__n, ++__s)
- assign(*__s, __a);
- return __r;
-}
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY char_traits<char32_t>
-{
- typedef char32_t char_type;
- typedef uint_least32_t int_type;
- typedef streamoff off_type;
- typedef u32streampos pos_type;
- typedef mbstate_t state_type;
-
- static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
- {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 < __c2;}
-
- _LIBCPP_INLINE_VISIBILITY
- static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static size_t length(const char_type* __s);
- _LIBCPP_INLINE_VISIBILITY
- static const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* assign(char_type* __s, size_t __n, char_type __a);
-
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
- {return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
- {return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
- {return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
- {return int_type(0xFFFFFFFF);}
-};
-
-inline
-int
-char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
-{
- for (; __n; --__n, ++__s1, ++__s2)
- {
- if (lt(*__s1, *__s2))
- return -1;
- if (lt(*__s2, *__s1))
- return 1;
- }
- return 0;
-}
-
-inline
-size_t
-char_traits<char32_t>::length(const char_type* __s)
-{
- size_t __len = 0;
- for (; !eq(*__s, char_type(0)); ++__s)
- ++__len;
- return __len;
-}
-
-inline
-const char32_t*
-char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& __a)
-{
- for (; __n; --__n)
- {
- if (eq(*__s, __a))
- return __s;
- ++__s;
- }
- return 0;
-}
-
-inline
-char32_t*
-char_traits<char32_t>::move(char_type* __s1, const char_type* __s2, size_t __n)
-{
- char_type* __r = __s1;
- if (__s1 < __s2)
- {
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- }
- else if (__s2 < __s1)
- {
- __s1 += __n;
- __s2 += __n;
- for (; __n; --__n)
- assign(*--__s1, *--__s2);
- }
- return __r;
-}
-
-inline
-char32_t*
-char_traits<char32_t>::copy(char_type* __s1, const char_type* __s2, size_t __n)
-{
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
- char_type* __r = __s1;
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- return __r;
-}
-
-inline
-char32_t*
-char_traits<char32_t>::assign(char_type* __s, size_t __n, char_type __a)
-{
- char_type* __r = __s;
- for (; __n; --__n, ++__s)
- assign(*__s, __a);
- return __r;
-}
-
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
-
-// helper fns for basic_string
-
-// __str_find
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find(const _CharT *__p, _SizeT __sz,
- _CharT __c, _SizeT __pos) _NOEXCEPT
-{
- if (__pos >= __sz)
- return __npos;
- const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);
- if (__r == 0)
- return __npos;
- return static_cast<_SizeT>(__r - __p);
-}
-
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
-{
- if (__pos > __sz || __sz - __pos < __n)
- return __npos;
- if (__n == 0)
- return __pos;
- const _CharT* __r =
- _VSTD::__search(__p + __pos, __p + __sz,
- __s, __s + __n, _Traits::eq,
- random_access_iterator_tag(), random_access_iterator_tag()).first;
- if (__r == __p + __sz)
- return __npos;
- return static_cast<_SizeT>(__r - __p);
-}
-
-
-// __str_rfind
-
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_rfind(const _CharT *__p, _SizeT __sz,
- _CharT __c, _SizeT __pos) _NOEXCEPT
-{
- if (__sz < 1)
- return __npos;
- if (__pos < __sz)
- ++__pos;
- else
- __pos = __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __p;)
- {
- if (_Traits::eq(*--__ps, __c))
- return static_cast<_SizeT>(__ps - __p);
- }
- return __npos;
-}
-
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_rfind(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
-{
- __pos = _VSTD::min(__pos, __sz);
- if (__n < __sz - __pos)
- __pos += __n;
- else
- __pos = __sz;
- const _CharT* __r = _VSTD::__find_end(
- __p, __p + __pos, __s, __s + __n, _Traits::eq,
- random_access_iterator_tag(), random_access_iterator_tag());
- if (__n > 0 && __r == __p + __pos)
- return __npos;
- return static_cast<_SizeT>(__r - __p);
-}
-
-// __str_find_first_of
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_first_of(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
-{
- if (__pos >= __sz || __n == 0)
- return __npos;
- const _CharT* __r = _VSTD::__find_first_of_ce
- (__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq );
- if (__r == __p + __sz)
- return __npos;
- return static_cast<_SizeT>(__r - __p);
-}
-
-
-// __str_find_last_of
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_last_of(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
- {
- if (__n != 0)
- {
- if (__pos < __sz)
- ++__pos;
- else
- __pos = __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __p;)
- {
- const _CharT* __r = _Traits::find(__s, __n, *--__ps);
- if (__r)
- return static_cast<_SizeT>(__ps - __p);
- }
- }
- return __npos;
-}
-
-
-// __str_find_first_not_of
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
-{
- if (__pos < __sz)
- {
- const _CharT* __pe = __p + __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
- if (_Traits::find(__s, __n, *__ps) == 0)
- return static_cast<_SizeT>(__ps - __p);
- }
- return __npos;
-}
-
-
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
- _CharT __c, _SizeT __pos) _NOEXCEPT
-{
- if (__pos < __sz)
- {
- const _CharT* __pe = __p + __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
- if (!_Traits::eq(*__ps, __c))
- return static_cast<_SizeT>(__ps - __p);
- }
- return __npos;
-}
-
-
-// __str_find_last_not_of
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
-{
- if (__pos < __sz)
- ++__pos;
- else
- __pos = __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __p;)
- if (_Traits::find(__s, __n, *--__ps) == 0)
- return static_cast<_SizeT>(__ps - __p);
- return __npos;
-}
-
-
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
- _CharT __c, _SizeT __pos) _NOEXCEPT
-{
- if (__pos < __sz)
- ++__pos;
- else
- __pos = __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __p;)
- if (!_Traits::eq(*--__ps, __c))
- return static_cast<_SizeT>(__ps - __p);
- return __npos;
-}
-
-template<class _Ptr>
-size_t _LIBCPP_INLINE_VISIBILITY __do_string_hash(_Ptr __p, _Ptr __e)
-{
- typedef typename iterator_traits<_Ptr>::value_type value_type;
- return __murmur2_or_cityhash<size_t>()(__p, (__e-__p)*sizeof(value_type));
-}
-
// basic_string
template<class _CharT, class _Traits, class _Allocator>
@@ -1169,37 +558,29 @@ template <bool>
class _LIBCPP_TYPE_VIS_ONLY __basic_string_common
{
protected:
- void __throw_length_error() const;
- void __throw_out_of_range() const;
+ _LIBCPP_NORETURN void __throw_length_error() const;
+ _LIBCPP_NORETURN void __throw_out_of_range() const;
};
template <bool __b>
void
__basic_string_common<__b>::__throw_length_error() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw length_error("basic_string");
-#else
- assert(!"basic_string length_error");
-#endif
+ _VSTD::__throw_length_error("basic_string");
}
template <bool __b>
void
__basic_string_common<__b>::__throw_out_of_range() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("basic_string");
-#else
- assert(!"basic_string out_of_range");
-#endif
+ _VSTD::__throw_out_of_range("basic_string");
}
#ifdef _LIBCPP_MSVC
#pragma warning( push )
#pragma warning( disable: 4231 )
#endif // _LIBCPP_MSVC
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS __basic_string_common<true>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __basic_string_common<true>)
#ifdef _LIBCPP_MSVC
#pragma warning( pop )
#endif // _LIBCPP_MSVC
@@ -1228,6 +609,11 @@ template <class _Iter>
struct __libcpp_string_gets_noexcept_iterator
: public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value || __libcpp_string_gets_noexcept_iterator_impl<_Iter>::value) {};
+template <class _CharT, class _Traits, class _Tp>
+struct __can_be_converted_to_string_view : public _LIBCPP_BOOL_CONSTANT(
+ ( is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value &&
+ !is_convertible<const _Tp&, const _CharT*>::value)) {};
+
#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
template <class _CharT, size_t = sizeof(_CharT)>
@@ -1249,6 +635,7 @@ class _LIBCPP_TYPE_VIS_ONLY basic_string
{
public:
typedef basic_string __self;
+ typedef basic_string_view<_CharT, _Traits> __self_view;
typedef _Traits traits_type;
typedef typename traits_type::char_type value_type;
typedef _Allocator allocator_type;
@@ -1404,6 +791,14 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_string(const basic_string& __str, size_type __pos,
const allocator_type& __a = allocator_type());
+ template<class _Tp>
+ basic_string(const _Tp& __t, size_type __pos, size_type __n,
+ const allocator_type& __a = allocator_type(),
+ typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type* = 0);
+ _LIBCPP_INLINE_VISIBILITY explicit
+ basic_string(__self_view __sv);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string(__self_view __sv, const allocator_type& __a);
template<class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
basic_string(_InputIterator __first, _InputIterator __last);
@@ -1417,9 +812,14 @@ public:
basic_string(initializer_list<value_type> __il, const allocator_type& __a);
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- ~basic_string();
+ inline ~basic_string();
+
+ _LIBCPP_INLINE_VISIBILITY
+ operator __self_view() const _NOEXCEPT { return __self_view(data(), size()); }
basic_string& operator=(const basic_string& __str);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string& operator=(__self_view __sv) {return assign(__sv);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
basic_string& operator=(basic_string&& __str)
@@ -1503,14 +903,15 @@ public:
void clear() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT {return size() == 0;}
- _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __pos) const;
- _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __pos);
+ _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __pos) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __pos) _NOEXCEPT;
const_reference at(size_type __n) const;
reference at(size_type __n);
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const basic_string& __str) {return append(__str);}
- _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const value_type* __s) {return append(__s);}
+ _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(__self_view __sv) {return append(__sv);}
+ _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const value_type* __s) {return append(__s);}
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c) {push_back(__c); return *this;}
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(initializer_list<value_type> __il) {return append(__il);}
@@ -1518,10 +919,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_string& append(const basic_string& __str);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string& append(__self_view __sv) { return append(__sv.data(), __sv.size()); }
basic_string& append(const basic_string& __str, size_type __pos, size_type __n=npos);
+ template <class _Tp>
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string&
+ >::type
+ append(const _Tp& __t, size_type __pos, size_type __n=npos);
basic_string& append(const value_type* __s, size_type __n);
basic_string& append(const value_type* __s);
basic_string& append(size_type __n, value_type __c);
+ template <class _ForwardIterator>
+ inline basic_string& __append_forward_unsafe(_ForwardIterator, _ForwardIterator);
template<class _InputIterator>
typename enable_if
<
@@ -1529,7 +941,12 @@ public:
|| !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
basic_string&
>::type
- append(_InputIterator __first, _InputIterator __last);
+ _LIBCPP_INLINE_VISIBILITY
+ append(_InputIterator __first, _InputIterator __last) {
+ const basic_string __temp (__first, __last, __alloc());
+ append(__temp.data(), __temp.size());
+ return *this;
+ }
template<class _ForwardIterator>
typename enable_if
<
@@ -1537,7 +954,11 @@ public:
&& __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
basic_string&
>::type
- append(_ForwardIterator __first, _ForwardIterator __last);
+ _LIBCPP_INLINE_VISIBILITY
+ append(_ForwardIterator __first, _ForwardIterator __last) {
+ return __append_forward_unsafe(__first, __last);
+ }
+
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
@@ -1552,6 +973,8 @@ public:
_LIBCPP_INLINE_VISIBILITY const_reference back() const;
_LIBCPP_INLINE_VISIBILITY
+ basic_string& assign(__self_view __sv) { return assign(__sv.data(), __sv.size()); }
+ _LIBCPP_INLINE_VISIBILITY
basic_string& assign(const basic_string& __str) { return *this = __str; }
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
@@ -1560,6 +983,13 @@ public:
{*this = _VSTD::move(str); return *this;}
#endif
basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);
+ template <class _Tp>
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string&
+ >::type
+ assign(const _Tp & __t, size_type pos, size_type n=npos);
basic_string& assign(const value_type* __s, size_type __n);
basic_string& assign(const value_type* __s);
basic_string& assign(size_type __n, value_type __c);
@@ -1586,6 +1016,15 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_string& insert(size_type __pos1, const basic_string& __str);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string& insert(size_type __pos1, __self_view __sv) { return insert(__pos1, __sv.data(), __sv.size()); }
+ template <class _Tp>
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string&
+ >::type
+ insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n=npos);
basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n=npos);
basic_string& insert(size_type __pos, const value_type* __s, size_type __n);
basic_string& insert(size_type __pos, const value_type* __s);
@@ -1623,13 +1062,24 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string& replace(size_type __pos1, size_type __n1, __self_view __sv) { return replace(__pos1, __n1, __sv.data(), __sv.size()); }
basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos);
+ template <class _Tp>
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string&
+ >::type
+ replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos);
basic_string& replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2);
basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);
basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
_LIBCPP_INLINE_VISIBILITY
basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str);
_LIBCPP_INLINE_VISIBILITY
+ basic_string& replace(const_iterator __i1, const_iterator __i2, __self_view __sv) { return replace(__i1 - begin(), __i2 - __i1, __sv); }
+ _LIBCPP_INLINE_VISIBILITY
basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n);
_LIBCPP_INLINE_VISIBILITY
basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s);
@@ -1655,9 +1105,9 @@ public:
_LIBCPP_INLINE_VISIBILITY
void swap(basic_string& __str)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
+ _NOEXCEPT_DEBUG;
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value);
#endif
@@ -1675,6 +1125,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type find(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
@@ -1682,6 +1134,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
@@ -1689,6 +1143,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
@@ -1697,6 +1153,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
@@ -1705,6 +1163,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
@@ -1713,6 +1173,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
@@ -1722,8 +1184,20 @@ public:
_LIBCPP_INLINE_VISIBILITY
int compare(const basic_string& __str) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
+ int compare(__self_view __sv) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, __self_view __sv) const;
+ _LIBCPP_INLINE_VISIBILITY
int compare(size_type __pos1, size_type __n1, const basic_string& __str) const;
int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos) const;
+ template <class _Tp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ int
+ >::type
+ compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos) const;
int compare(const value_type* __s) const _NOEXCEPT;
int compare(size_type __pos1, size_type __n1, const value_type* __s) const;
int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;
@@ -1847,11 +1321,15 @@ private:
__align_it<sizeof(value_type) < __alignment ?
__alignment/sizeof(value_type) : 1 > (__s+1)) - 1;}
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
void __init(const value_type* __s, size_type __sz, size_type __reserve);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
void __init(const value_type* __s, size_type __sz);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
void __init(size_type __n, value_type __c);
template <class _InputIterator>
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
typename enable_if
<
__is_exactly_input_iterator<_InputIterator>::value,
@@ -1860,6 +1338,7 @@ private:
__init(_InputIterator __first, _InputIterator __last);
template <class _ForwardIterator>
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
typename enable_if
<
__is_forward_iterator<_ForwardIterator>::value,
@@ -2008,8 +1487,9 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __
}
template <class _CharT, class _Traits, class _Allocator>
-void
-basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve)
+void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s,
+ size_type __sz,
+ size_type __reserve)
{
if (__reserve > max_size())
this->__throw_length_error();
@@ -2243,6 +1723,41 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
}
template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+basic_string<_CharT, _Traits, _Allocator>::basic_string(
+ const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a,
+ typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type *)
+ : __r_(__a)
+{
+ __self_view __sv = __self_view(__t).substr(__pos, __n);
+ __init(__sv.data(), __sv.size());
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__insert_c(this);
+#endif
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv)
+{
+ __init(__sv.data(), __sv.size());
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__insert_c(this);
+#endif
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv, const allocator_type& __a)
+ : __r_(__a)
+{
+ __init(__sv.data(), __sv.size());
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__insert_c(this);
+#endif
+}
+
+template <class _CharT, class _Traits, class _Allocator>
template <class _InputIterator>
typename enable_if
<
@@ -2550,7 +2065,7 @@ typename enable_if
>::type
basic_string<_CharT, _Traits, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
{
- basic_string __temp(__first, __last, __alloc());
+ const basic_string __temp(__first, __last, __alloc());
assign(__temp.data(), __temp.size());
return *this;
}
@@ -2593,6 +2108,23 @@ basic_string<_CharT, _Traits, _Allocator>::assign(const basic_string& __str, siz
}
template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+typename enable_if
+<
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string<_CharT, _Traits, _Allocator>&
+>::type
+basic_string<_CharT, _Traits, _Allocator>::assign(const _Tp & __t, size_type __pos, size_type __n)
+{
+ __self_view __sv = __t;
+ size_type __sz = __sv.size();
+ if (__pos > __sz)
+ this->__throw_out_of_range();
+ return assign(__sv.data() + __pos, _VSTD::min(__n, __sz - __pos));
+}
+
+
+template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s)
{
@@ -2681,43 +2213,46 @@ basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
traits_type::assign(*++__p, value_type());
}
-template <class _CharT, class _Traits, class _Allocator>
-template<class _InputIterator>
-typename enable_if
-<
- __is_exactly_input_iterator<_InputIterator>::value
- || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->::type
-basic_string<_CharT, _Traits, _Allocator>::append(_InputIterator __first, _InputIterator __last)
+template <class _Tp>
+bool __ptr_in_range (const _Tp* __p, const _Tp* __first, const _Tp* __last)
{
- basic_string __temp (__first, __last, __alloc());
- append(__temp.data(), __temp.size());
- return *this;
+ return __first <= __p && __p < __last;
+}
+
+template <class _Tp1, class _Tp2>
+bool __ptr_in_range (const _Tp1*, const _Tp2*, const _Tp2*)
+{
+ return false;
}
template <class _CharT, class _Traits, class _Allocator>
template<class _ForwardIterator>
-typename enable_if
-<
- __is_forward_iterator<_ForwardIterator>::value
- && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->::type
-basic_string<_CharT, _Traits, _Allocator>::append(_ForwardIterator __first, _ForwardIterator __last)
+basic_string<_CharT, _Traits, _Allocator>&
+basic_string<_CharT, _Traits, _Allocator>::__append_forward_unsafe(
+ _ForwardIterator __first, _ForwardIterator __last)
{
+ static_assert(__is_forward_iterator<_ForwardIterator>::value,
+ "function requires a ForwardIterator");
size_type __sz = size();
size_type __cap = capacity();
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n)
{
- if (__cap - __sz < __n)
- __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);
- pointer __p = __get_pointer() + __sz;
- for (; __first != __last; ++__p, ++__first)
- traits_type::assign(*__p, *__first);
- traits_type::assign(*__p, value_type());
- __set_size(__sz + __n);
+ if ( __ptr_in_range(&*__first, data(), data() + size()))
+ {
+ const basic_string __temp (__first, __last, __alloc());
+ append(__temp.data(), __temp.size());
+ }
+ else
+ {
+ if (__cap - __sz < __n)
+ __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);
+ pointer __p = __get_pointer() + __sz;
+ for (; __first != __last; ++__p, ++__first)
+ traits_type::assign(*__p, *__first);
+ traits_type::assign(*__p, value_type());
+ __set_size(__sz + __n);
+ }
}
return *this;
}
@@ -2741,6 +2276,22 @@ basic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str, siz
}
template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string<_CharT, _Traits, _Allocator>&
+ >::type
+basic_string<_CharT, _Traits, _Allocator>::append(const _Tp & __t, size_type __pos, size_type __n)
+{
+ __self_view __sv = __t;
+ size_type __sz = __sv.size();
+ if (__pos > __sz)
+ this->__throw_out_of_range();
+ return append(__sv.data() + __pos, _VSTD::min(__n, __sz - __pos));
+}
+
+template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s)
{
@@ -2828,7 +2379,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIt
"string::insert(iterator, range) called with an iterator not"
" referring to this string");
#endif
- basic_string __temp(__first, __last, __alloc());
+ const basic_string __temp(__first, __last, __alloc());
return insert(__pos, __temp.data(), __temp.data() + __temp.size());
}
@@ -2848,11 +2399,17 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _Forward
" referring to this string");
#endif
size_type __ip = static_cast<size_type>(__pos - begin());
- size_type __sz = size();
- size_type __cap = capacity();
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n)
{
+ if ( __ptr_in_range(&*__first, data(), data() + size()))
+ {
+ const basic_string __temp(__first, __last, __alloc());
+ return insert(__pos, __temp.data(), __temp.data() + __temp.size());
+ }
+
+ size_type __sz = size();
+ size_type __cap = capacity();
value_type* __p;
if (__cap - __sz >= __n)
{
@@ -2895,6 +2452,23 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const basic_
}
template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+typename enable_if
+<
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string<_CharT, _Traits, _Allocator>&
+>::type
+basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const _Tp& __t,
+ size_type __pos2, size_type __n)
+{
+ __self_view __sv = __t;
+ size_type __str_sz = __sv.size();
+ if (__pos2 > __str_sz)
+ this->__throw_out_of_range();
+ return insert(__pos1, __sv.data() + __pos2, _VSTD::min(__n, __str_sz - __pos2));
+}
+
+template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s)
{
@@ -3040,7 +2614,7 @@ typename enable_if
basic_string<_CharT, _Traits, _Allocator>::replace(const_iterator __i1, const_iterator __i2,
_InputIterator __j1, _InputIterator __j2)
{
- basic_string __temp(__j1, __j2, __alloc());
+ const basic_string __temp(__j1, __j2, __alloc());
return this->replace(__i1, __i2, __temp);
}
@@ -3064,6 +2638,23 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type _
}
template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+typename enable_if
+<
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string<_CharT, _Traits, _Allocator>&
+>::type
+basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type __n1, const _Tp& __t,
+ size_type __pos2, size_type __n2)
+{
+ __self_view __sv = __t;
+ size_type __str_sz = __sv.size();
+ if (__pos2 > __str_sz)
+ this->__throw_out_of_range();
+ return replace(__pos1, __n1, __sv.data() + __pos2, _VSTD::min(__n2, __str_sz - __pos2));
+}
+
+template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, const value_type* __s)
{
@@ -3311,7 +2902,7 @@ basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __res_arg)
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::const_reference
-basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) const
+basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__pos <= size(), "string index out of bounds");
return *(data() + __pos);
@@ -3320,7 +2911,7 @@ basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) const
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::reference
-basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos)
+basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) _NOEXCEPT
{
_LIBCPP_ASSERT(__pos <= size(), "string index out of bounds");
return *(__get_pointer() + __pos);
@@ -3405,9 +2996,9 @@ inline _LIBCPP_INLINE_VISIBILITY
void
basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
+ _NOEXCEPT_DEBUG
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value)
#endif
{
@@ -3418,6 +3009,10 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
__get_db()->__invalidate_all(&__str);
__get_db()->swap(this, &__str);
#endif
+ _LIBCPP_ASSERT(
+ __alloc_traits::propagate_on_container_swap::value ||
+ __alloc_traits::is_always_equal::value ||
+ __alloc() == __str.__alloc(), "swapping non-equal allocators");
_VSTD::swap(__r_.first(), __str.__r_.first());
__swap_allocator(__alloc(), __str.__alloc());
}
@@ -3440,7 +3035,7 @@ basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find(): received nullptr");
- return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ return __str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3450,18 +3045,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ return __str_find<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::find(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find(): received nullptr");
- return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ return __str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3470,7 +3075,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ return __str_find<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3483,7 +3088,7 @@ basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::rfind(): received nullptr");
- return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ return __str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3493,18 +3098,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ return __str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::rfind(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::rfind(): received nullptr");
- return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ return __str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3513,7 +3128,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ return __str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3526,7 +3141,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s,
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_first_of(): received nullptr");
- return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3536,18 +3151,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::find_first_of(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_first_of(): received nullptr");
- return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3569,7 +3194,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s,
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_last_of(): received nullptr");
- return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3579,18 +3204,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::find_last_of(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_last_of(): received nullptr");
- return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3612,7 +3247,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* _
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_first_not_of(): received nullptr");
- return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3622,18 +3257,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_first_not_of(): received nullptr");
- return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3643,7 +3288,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3656,7 +3301,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_last_not_of(): received nullptr");
- return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3666,18 +3311,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_last_not_of(): received nullptr");
- return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3687,7 +3342,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3696,11 +3351,11 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(value_type __c,
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
int
-basic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) const _NOEXCEPT
+basic_string<_CharT, _Traits, _Allocator>::compare(__self_view __sv) const _NOEXCEPT
{
size_t __lhs_sz = size();
- size_t __rhs_sz = __str.size();
- int __result = traits_type::compare(data(), __str.data(),
+ size_t __rhs_sz = __sv.size();
+ int __result = traits_type::compare(data(), __sv.data(),
_VSTD::min(__lhs_sz, __rhs_sz));
if (__result != 0)
return __result;
@@ -3714,6 +3369,47 @@ basic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) co
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
int
+basic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) const _NOEXCEPT
+{
+ return compare(__self_view(__str));
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+int
+basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
+ size_type __n1,
+ const value_type* __s,
+ size_type __n2) const
+{
+ _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::compare(): received nullptr");
+ size_type __sz = size();
+ if (__pos1 > __sz || __n2 == npos)
+ this->__throw_out_of_range();
+ size_type __rlen = _VSTD::min(__n1, __sz - __pos1);
+ int __r = traits_type::compare(data() + __pos1, __s, _VSTD::min(__rlen, __n2));
+ if (__r == 0)
+ {
+ if (__rlen < __n2)
+ __r = -1;
+ else if (__rlen > __n2)
+ __r = 1;
+ }
+ return __r;
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+int
+basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
+ size_type __n1,
+ __self_view __sv) const
+{
+ return compare(__pos1, __n1, __sv.data(), __sv.size());
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+int
basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
size_type __n1,
const basic_string& __str) const
@@ -3722,6 +3418,23 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
}
template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+typename enable_if
+<
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ int
+>::type
+basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
+ size_type __n1,
+ const _Tp& __t,
+ size_type __pos2,
+ size_type __n2) const
+{
+ __self_view __sv = __t;
+ return __self_view(*this).substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
+}
+
+template <class _CharT, class _Traits, class _Allocator>
int
basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
size_type __n1,
@@ -3729,11 +3442,7 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
size_type __pos2,
size_type __n2) const
{
- size_type __sz = __str.size();
- if (__pos2 > __sz)
- this->__throw_out_of_range();
- return compare(__pos1, __n1, __str.data() + __pos2, _VSTD::min(__n2,
- __sz - __pos2));
+ return compare(__pos1, __n1, __self_view(__str), __pos2, __n2);
}
template <class _CharT, class _Traits, class _Allocator>
@@ -3754,29 +3463,6 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
return compare(__pos1, __n1, __s, traits_type::length(__s));
}
-template <class _CharT, class _Traits, class _Allocator>
-int
-basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
- size_type __n1,
- const value_type* __s,
- size_type __n2) const
-{
- _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::compare(): received nullptr");
- size_type __sz = size();
- if (__pos1 > __sz || __n2 == npos)
- this->__throw_out_of_range();
- size_type __rlen = _VSTD::min(__n1, __sz - __pos1);
- int __r = traits_type::compare(data() + __pos1, __s, _VSTD::min(__rlen, __n2));
- if (__r == 0)
- {
- if (__rlen < __n2)
- __r = -1;
- else if (__rlen > __n2)
- __r = 1;
- }
- return __r;
-}
-
// __invariants
template<class _CharT, class _Traits, class _Allocator>
@@ -3854,8 +3540,6 @@ operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
return __lhs.compare(0, _String::npos, __rhs, __rhs_len) == 0;
}
-// operator!=
-
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -4307,8 +3991,8 @@ inline namespace literals
}
#endif
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_string<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_string<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<wchar_t>)
_LIBCPP_EXTERN_TEMPLATE(string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&))
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/string_view b/include/string_view
new file mode 100644
index 000000000000..e66ac40d3e2f
--- /dev/null
+++ b/include/string_view
@@ -0,0 +1,754 @@
+// -*- C++ -*-
+//===------------------------ string_view ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_STRING_VIEW
+#define _LIBCPP_STRING_VIEW
+
+/*
+string_view synopsis
+
+namespace std {
+
+ // 7.2, Class template basic_string_view
+ template<class charT, class traits = char_traits<charT>>
+ class basic_string_view;
+
+ // 7.9, basic_string_view non-member comparison functions
+ template<class charT, class traits>
+ constexpr bool operator==(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator!=(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator< (basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator> (basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator<=(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator>=(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ // see below, sufficient additional overloads of comparison functions
+
+ // 7.10, Inserters and extractors
+ template<class charT, class traits>
+ basic_ostream<charT, traits>&
+ operator<<(basic_ostream<charT, traits>& os,
+ basic_string_view<charT, traits> str);
+
+ // basic_string_view typedef names
+ typedef basic_string_view<char> string_view;
+ typedef basic_string_view<char16_t> u16string_view;
+ typedef basic_string_view<char32_t> u32string_view;
+ typedef basic_string_view<wchar_t> wstring_view;
+
+ template<class charT, class traits = char_traits<charT>>
+ class basic_string_view {
+ public:
+ // types
+ typedef traits traits_type;
+ typedef charT value_type;
+ typedef charT* pointer;
+ typedef const charT* const_pointer;
+ typedef charT& reference;
+ typedef const charT& const_reference;
+ typedef implementation-defined const_iterator;
+ typedef const_iterator iterator;
+ typedef reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef const_reverse_iterator reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ static constexpr size_type npos = size_type(-1);
+
+ // 7.3, basic_string_view constructors and assignment operators
+ constexpr basic_string_view() noexcept;
+ constexpr basic_string_view(const basic_string_view&) noexcept = default;
+ basic_string_view& operator=(const basic_string_view&) noexcept = default;
+ template<class Allocator>
+ constexpr basic_string_view(const charT* str);
+ constexpr basic_string_view(const charT* str, size_type len);
+
+ // 7.4, basic_string_view iterator support
+ constexpr const_iterator begin() const noexcept;
+ constexpr const_iterator end() const noexcept;
+ constexpr const_iterator cbegin() const noexcept;
+ constexpr const_iterator cend() const noexcept;
+ const_reverse_iterator rbegin() const noexcept;
+ const_reverse_iterator rend() const noexcept;
+ const_reverse_iterator crbegin() const noexcept;
+ const_reverse_iterator crend() const noexcept;
+
+ // 7.5, basic_string_view capacity
+ constexpr size_type size() const noexcept;
+ constexpr size_type length() const noexcept;
+ constexpr size_type max_size() const noexcept;
+ constexpr bool empty() const noexcept;
+
+ // 7.6, basic_string_view element access
+ constexpr const_reference operator[](size_type pos) const;
+ constexpr const_reference at(size_type pos) const;
+ constexpr const_reference front() const;
+ constexpr const_reference back() const;
+ constexpr const_pointer data() const noexcept;
+
+ // 7.7, basic_string_view modifiers
+ constexpr void clear() noexcept;
+ constexpr void remove_prefix(size_type n);
+ constexpr void remove_suffix(size_type n);
+ constexpr void swap(basic_string_view& s) noexcept;
+
+ size_type copy(charT* s, size_type n, size_type pos = 0) const;
+
+ constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
+ constexpr int compare(basic_string_view s) const noexcept;
+ constexpr int compare(size_type pos1, size_type n1, basic_string_view s) const;
+ constexpr int compare(size_type pos1, size_type n1,
+ basic_string_view s, size_type pos2, size_type n2) const;
+ constexpr int compare(const charT* s) const;
+ constexpr int compare(size_type pos1, size_type n1, const charT* s) const;
+ constexpr int compare(size_type pos1, size_type n1,
+ const charT* s, size_type n2) const;
+ constexpr size_type find(basic_string_view s, size_type pos = 0) const noexcept;
+ constexpr size_type find(charT c, size_type pos = 0) const noexcept;
+ constexpr size_type find(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find(const charT* s, size_type pos = 0) const;
+ constexpr size_type rfind(basic_string_view s, size_type pos = npos) const noexcept;
+ constexpr size_type rfind(charT c, size_type pos = npos) const noexcept;
+ constexpr size_type rfind(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type rfind(const charT* s, size_type pos = npos) const;
+ constexpr size_type find_first_of(basic_string_view s, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_of(charT c, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_first_of(const charT* s, size_type pos = 0) const;
+ constexpr size_type find_last_of(basic_string_view s, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_of(charT c, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_last_of(const charT* s, size_type pos = npos) const;
+ constexpr size_type find_first_not_of(basic_string_view s, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_not_of(charT c, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const;
+ constexpr size_type find_last_not_of(basic_string_view s, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_not_of(charT c, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const;
+
+ private:
+ const_pointer data_; // exposition only
+ size_type size_; // exposition only
+ };
+
+ // 7.11, Hash support
+ template <class T> struct hash;
+ template <> struct hash<string_view>;
+ template <> struct hash<u16string_view>;
+ template <> struct hash<u32string_view>;
+ template <> struct hash<wstring_view>;
+
+} // namespace std
+
+
+*/
+
+#include <__config>
+
+#include <__string>
+#include <algorithm>
+#include <iterator>
+#include <limits>
+#include <stdexcept>
+#include <__debug>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template<class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TYPE_VIS_ONLY basic_string_view {
+public:
+ // types
+ typedef _Traits traits_type;
+ typedef _CharT value_type;
+ typedef const _CharT* pointer;
+ typedef const _CharT* const_pointer;
+ typedef const _CharT& reference;
+ typedef const _CharT& const_reference;
+ typedef const_pointer const_iterator; // See [string.view.iterators]
+ typedef const_iterator iterator;
+ typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef const_reverse_iterator reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1);
+
+ // [string.view.cons], construct/copy
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view() _NOEXCEPT : __data (nullptr), __size(0) {}
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view(const basic_string_view&) _NOEXCEPT = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string_view& operator=(const basic_string_view&) _NOEXCEPT = default;
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view(const _CharT* __s, size_type __len)
+ : __data(__s), __size(__len)
+ {
+// #if _LIBCPP_STD_VER > 11
+// _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr");
+// #endif
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view(const _CharT* __s)
+ : __data(__s), __size(_Traits::length(__s)) {}
+
+ // [string.view.iterators], iterators
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator begin() const _NOEXCEPT { return cbegin(); }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator end() const _NOEXCEPT { return cend(); }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator cbegin() const _NOEXCEPT { return __data; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator cend() const _NOEXCEPT { return __data + __size; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(cbegin()); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator crbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator crend() const _NOEXCEPT { return const_reverse_iterator(cbegin()); }
+
+ // [string.view.capacity], capacity
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ size_type size() const _NOEXCEPT { return __size; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ size_type length() const _NOEXCEPT { return __size; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ size_type max_size() const _NOEXCEPT { return numeric_limits<size_type>::max(); }
+
+ _LIBCPP_CONSTEXPR bool _LIBCPP_INLINE_VISIBILITY
+ empty() const _NOEXCEPT { return __size == 0; }
+
+ // [string.view.access], element access
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference operator[](size_type __pos) const _NOEXCEPT { return __data[__pos]; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference at(size_type __pos) const
+ {
+ return __pos >= size()
+ ? (__throw_out_of_range("string_view::at"), __data[0])
+ : __data[__pos];
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference front() const
+ {
+ return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data[0];
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference back() const
+ {
+ return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data[__size-1];
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_pointer data() const _NOEXCEPT { return __data; }
+
+ // [string.view.modifiers], modifiers:
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void clear() _NOEXCEPT
+ {
+ __data = nullptr;
+ __size = 0;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void remove_prefix(size_type __n) _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__n <= size(), "remove_prefix() can't remove more than size()");
+ __data += __n;
+ __size -= __n;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void remove_suffix(size_type __n) _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__n <= size(), "remove_suffix() can't remove more than size()");
+ __size -= __n;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void swap(basic_string_view& __other) _NOEXCEPT
+ {
+ const value_type *__p = __data;
+ __data = __other.__data;
+ __other.__data = __p;
+
+ size_type __sz = __size;
+ __size = __other.__size;
+ __other.__size = __sz;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const
+ {
+ if (__pos > size())
+ __throw_out_of_range("string_view::copy");
+ size_type __rlen = _VSTD::min(__n, size() - __pos);
+ _Traits::copy(__s, data() + __pos, __rlen);
+ return __rlen;
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view substr(size_type __pos = 0, size_type __n = npos) const
+ {
+ return __pos > size()
+ ? (__throw_out_of_range("string_view::substr"), basic_string_view())
+ : basic_string_view(data() + __pos, _VSTD::min(__n, size() - __pos));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 int compare(basic_string_view __sv) const _NOEXCEPT
+ {
+ size_type __rlen = _VSTD::min( size(), __sv.size());
+ int __retval = _Traits::compare(data(), __sv.data(), __rlen);
+ if ( __retval == 0 ) // first __rlen chars matched
+ __retval = size() == __sv.size() ? 0 : ( size() < __sv.size() ? -1 : 1 );
+ return __retval;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, basic_string_view __sv) const
+ {
+ return substr(__pos1, __n1).compare(__sv);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare( size_type __pos1, size_type __n1,
+ basic_string_view _sv, size_type __pos2, size_type __n2) const
+ {
+ return substr(__pos1, __n1).compare(_sv.substr(__pos2, __n2));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(const _CharT* __s) const _NOEXCEPT
+ {
+ return compare(basic_string_view(__s));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, const _CharT* __s) const
+ {
+ return substr(__pos1, __n1).compare(basic_string_view(__s));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) const
+ {
+ return substr(__pos1, __n1).compare(basic_string_view(__s, __n2));
+ }
+
+ // find
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
+ return __str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(_CharT __c, size_type __pos = 0) const _NOEXCEPT
+ {
+ return __str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");
+ return __str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(const _CharT* __s, size_type __pos = 0) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find(): received nullptr");
+ return __str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // rfind
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
+ return __str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(_CharT __c, size_type __pos = npos) const _NOEXCEPT
+ {
+ return __str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");
+ return __str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(const _CharT* __s, size_type __pos=npos) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::rfind(): received nullptr");
+ return __str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_first_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_of(): received nullptr");
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(_CharT __c, size_type __pos = 0) const _NOEXCEPT
+ { return find(__c, __pos); }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(const _CharT* __s, size_type __pos=0) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_of(): received nullptr");
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_last_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_of(): received nullptr");
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(_CharT __c, size_type __pos = npos) const _NOEXCEPT
+ { return rfind(__c, __pos); }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(const _CharT* __s, size_type __pos=npos) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_of(): received nullptr");
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_first_not_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(basic_string_view __s, size_type __pos=0) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_not_of(): received nullptr");
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(_CharT __c, size_type __pos=0) const _NOEXCEPT
+ {
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_not_of(): received nullptr");
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_last_not_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_not_of(): received nullptr");
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(_CharT __c, size_type __pos=npos) const _NOEXCEPT
+ {
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_not_of(): received nullptr");
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+private:
+ const value_type* __data;
+ size_type __size;
+};
+
+
+// [string.view.comparison]
+// operator ==
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator==(basic_string_view<_CharT, _Traits> __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size()) return false;
+ return __lhs.compare(__rhs) == 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator==(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size()) return false;
+ return __lhs.compare(__rhs) == 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator==(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size()) return false;
+ return __lhs.compare(__rhs) == 0;
+}
+
+
+// operator !=
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator!=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size())
+ return true;
+ return __lhs.compare(__rhs) != 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator!=(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size())
+ return true;
+ return __lhs.compare(__rhs) != 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator!=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size())
+ return true;
+ return __lhs.compare(__rhs) != 0;
+}
+
+
+// operator <
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) < 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) < 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) < 0;
+}
+
+
+// operator >
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator> (basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) > 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator>(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) > 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator>(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) > 0;
+}
+
+
+// operator <=
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) <= 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<=(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) <= 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) <= 0;
+}
+
+
+// operator >=
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator>=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) >= 0;
+}
+
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator>=(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) >= 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator>=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) >= 0;
+}
+
+typedef basic_string_view<char> string_view;
+typedef basic_string_view<char16_t> u16string_view;
+typedef basic_string_view<char32_t> u32string_view;
+typedef basic_string_view<wchar_t> wstring_view;
+
+// [string.view.hash]
+template<class _CharT, class _Traits>
+struct _LIBCPP_TYPE_VIS_ONLY hash<basic_string_view<_CharT, _Traits> >
+ : public unary_function<basic_string_view<_CharT, _Traits>, size_t>
+{
+ size_t operator()(const basic_string_view<_CharT, _Traits> __val) const _NOEXCEPT;
+};
+
+template<class _CharT, class _Traits>
+size_t
+hash<basic_string_view<_CharT, _Traits> >::operator()(
+ const basic_string_view<_CharT, _Traits> __val) const _NOEXCEPT
+{
+ return __do_string_hash(__val.data(), __val.data() + __val.size());
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STRING_VIEW
diff --git a/include/support/android/locale_bionic.h b/include/support/android/locale_bionic.h
index 1365563ee481..482e23433585 100644
--- a/include/support/android/locale_bionic.h
+++ b/include/support/android/locale_bionic.h
@@ -11,7 +11,7 @@
#ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
#define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
-#if defined(__ANDROID__)
+#if defined(__BIONIC__)
#ifdef __cplusplus
extern "C" {
@@ -27,5 +27,5 @@ extern "C" {
#include <support/xlocale/__posix_l_fallback.h>
#include <support/xlocale/__strtonum_fallback.h>
-#endif // defined(__ANDROID__)
+#endif // defined(__BIONIC__)
#endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
diff --git a/include/support/win32/locale_win32.h b/include/support/win32/locale_win32.h
index 7f3710ecc188..0f5527e570ab 100644
--- a/include/support/win32/locale_win32.h
+++ b/include/support/win32/locale_win32.h
@@ -17,7 +17,6 @@ extern "C" unsigned short __declspec(dllimport) _ctype[];
#include "support/win32/support.h"
#include "support/win32/locale_mgmt_win32.h"
#include <stdio.h>
-#include <memory>
lconv *localeconv_l( locale_t loc );
size_t mbrlen_l( const char *__restrict s, size_t n,
@@ -34,21 +33,19 @@ size_t wcsnrtombs_l( char *__restrict dst, const wchar_t **__restrict src,
size_t nwc, size_t len, mbstate_t *__restrict ps, locale_t loc);
wint_t btowc_l( int c, locale_t loc );
int wctob_l( wint_t c, locale_t loc );
-typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
-typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
inline _LIBCPP_ALWAYS_INLINE
decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l )
{
- __locale_raii __current( uselocale(__l), uselocale );
- return MB_CUR_MAX;
+ return ___mb_cur_max_l_func(__l);
}
// the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+
#define mbtowc_l _mbtowc_l
#define strtoll_l _strtoi64_l
#define strtoull_l _strtoui64_l
-// FIXME: current msvcrt does not know about long double
-#define strtold_l _strtod_l
+#define strtof_l _strtof_l
+#define strtod_l _strtod_l
+#define strtold_l _strtold_l
inline _LIBCPP_INLINE_VISIBILITY
int
diff --git a/include/support/win32/math_win32.h b/include/support/win32/math_win32.h
deleted file mode 100644
index 0d6b422a165c..000000000000
--- a/include/support/win32/math_win32.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// -*- C++ -*-
-//===---------------------- support/win32/math_win32.h --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H
-#define _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H
-
-#if !defined(_LIBCPP_MSVCRT)
-#error "This header complements Microsoft's C Runtime library, and should not be included otherwise."
-#else
-
-#include <math.h>
-#include <float.h> // _FPCLASS_PN etc.
-#include <crtversion.h>
-
-#if ((_VC_CRT_MAJOR_VERSION-0) < 12)
-// Necessary?
-typedef float float_t;
-typedef double double_t;
-
-_LIBCPP_ALWAYS_INLINE bool isfinite( double num )
-{
- return _finite(num) != 0;
-}
-_LIBCPP_ALWAYS_INLINE bool isinf( double num )
-{
- return !isfinite(num) && !_isnan(num);
-}
-_LIBCPP_ALWAYS_INLINE bool isnan( double num )
-{
- return _isnan(num) != 0;
-}
-_LIBCPP_ALWAYS_INLINE bool isnormal( double num )
-{
- int class_ = _fpclass(num);
- return class_ == _FPCLASS_NN || class_ == _FPCLASS_PN;
-}
-
-_LIBCPP_ALWAYS_INLINE bool isgreater( double x, double y )
-{
- if(_fpclass(x) == _FPCLASS_SNAN || _fpclass(y) == _FPCLASS_SNAN) return false;
- else return x > y;
-}
-
-_LIBCPP_ALWAYS_INLINE bool isgreaterequal( double x, double y )
-{
- if(_fpclass(x) == _FPCLASS_SNAN || _fpclass(y) == _FPCLASS_SNAN) return false;
- else return x >= y;
-}
-
-_LIBCPP_ALWAYS_INLINE bool isless( double x, double y )
-{
- if(_fpclass(x) == _FPCLASS_SNAN || _fpclass(y) == _FPCLASS_SNAN) return false;
- else return x < y;
-}
-
-_LIBCPP_ALWAYS_INLINE bool islessequal( double x, double y )
-{
- if(::_fpclass(x) == _FPCLASS_SNAN || ::_fpclass(y) == _FPCLASS_SNAN) return false;
- else return x <= y;
-}
-
-_LIBCPP_ALWAYS_INLINE bool islessgreater( double x, double y )
-{
- if(::_fpclass(x) == _FPCLASS_SNAN || ::_fpclass(y) == _FPCLASS_SNAN) return false;
- else return x < y || x > y;
-}
-
-_LIBCPP_ALWAYS_INLINE bool isunordered( double x, double y )
-{
- return isnan(x) || isnan(y);
-}
-_LIBCPP_ALWAYS_INLINE bool signbit( double num )
-{
- switch(_fpclass(num))
- {
- case _FPCLASS_SNAN:
- case _FPCLASS_QNAN:
- case _FPCLASS_NINF:
- case _FPCLASS_NN:
- case _FPCLASS_ND:
- case _FPCLASS_NZ:
- return true;
- case _FPCLASS_PZ:
- case _FPCLASS_PD:
- case _FPCLASS_PN:
- case _FPCLASS_PINF:
- return false;
- }
- return false;
-}
-_LIBCPP_ALWAYS_INLINE float copysignf( float x, float y )
-{
- return (signbit (x) != signbit (y) ? - x : x);
-}
-_LIBCPP_ALWAYS_INLINE double copysign( double x, double y )
-{
- return ::_copysign(x,y);
-}
-_LIBCPP_ALWAYS_INLINE double copysignl( long double x, long double y )
-{
- return ::_copysignl(x,y);
-}
-_LIBCPP_ALWAYS_INLINE int fpclassify( double num )
-{
- return _fpclass(num);
-}
-#endif
-#endif // _LIBCPP_MSVCRT
-
-#endif // _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H
diff --git a/include/support/win32/support.h b/include/support/win32/support.h
index 5765babcd13b..6a5763b5e49b 100644
--- a/include/support/win32/support.h
+++ b/include/support/win32/support.h
@@ -22,7 +22,7 @@
#include <intrin.h>
#endif
#if defined(_LIBCPP_MSVCRT)
-#include <xlocinfo.h>
+#include <crtversion.h>
#endif
#define swprintf _snwprintf
#define vswprintf _vsnwprintf
@@ -44,26 +44,8 @@ size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
}
#endif // __MINGW32__
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_VC_CRT_MAJOR_VERSION) && _VC_CRT_MAJOR_VERSION < 14
#define snprintf _snprintf
-#define atoll _atoi64
-#define strtoll _strtoi64
-#define strtoull _strtoui64
-#define wcstoll _wcstoi64
-#define wcstoull _wcstoui64
-_LIBCPP_ALWAYS_INLINE float strtof(const char *nptr, char **endptr)
-{
- return _Stof(nptr, endptr, 0);
-}
-_LIBCPP_ALWAYS_INLINE double strtod(const char *nptr, char **endptr)
-{
- return _Stod(nptr, endptr, 0);
-}
-_LIBCPP_ALWAYS_INLINE long double strtold(const char *nptr, char **endptr)
-{
- return _Stold(nptr, endptr, 0);
-}
-
#define _Exit _exit
#endif
diff --git a/include/support/xlocale/__posix_l_fallback.h b/include/support/xlocale/__posix_l_fallback.h
index 8bf9567ffc25..c893a67313cc 100644
--- a/include/support/xlocale/__posix_l_fallback.h
+++ b/include/support/xlocale/__posix_l_fallback.h
@@ -124,11 +124,11 @@ inline _LIBCPP_ALWAYS_INLINE int tolower_l(int c, locale_t) {
return ::tolower(c);
}
-inline _LIBCPP_ALWAYS_INLINE int towupper_l(int c, locale_t) {
+inline _LIBCPP_ALWAYS_INLINE wint_t towupper_l(wint_t c, locale_t) {
return ::towupper(c);
}
-inline _LIBCPP_ALWAYS_INLINE int towlower_l(int c, locale_t) {
+inline _LIBCPP_ALWAYS_INLINE wint_t towlower_l(wint_t c, locale_t) {
return ::towlower(c);
}
diff --git a/include/system_error b/include/system_error
index 134bb3274031..c7e73d4ab82b 100644
--- a/include/system_error
+++ b/include/system_error
@@ -46,6 +46,12 @@ template <class T> struct is_error_code_enum
template <class T> struct is_error_condition_enum
: public false_type {};
+template <class _Tp>
+constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; // C++17
+
+template <class _Tp>
+constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value; // C++17
+
class error_code
{
public:
@@ -213,6 +219,7 @@ bool operator!=(const error_condition& lhs, const error_code& rhs) noexcept;
bool operator!=(const error_condition& lhs, const error_condition& rhs) noexcept;
template <> struct hash<std::error_code>;
+template <> struct hash<std::error_condition>;
} // std
@@ -236,12 +243,22 @@ template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum
: public false_type {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value;
+#endif
+
// is_error_condition_enum
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_error_condition_enum
: public false_type {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value;
+#endif
+
// Some error codes are not present on all platforms, so we provide equivalents
// for them:
@@ -613,6 +630,17 @@ struct _LIBCPP_TYPE_VIS_ONLY hash<error_code>
}
};
+template <>
+struct _LIBCPP_TYPE_VIS_ONLY hash<error_condition>
+ : public unary_function<error_condition, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(const error_condition& __ec) const _NOEXCEPT
+ {
+ return static_cast<size_t>(__ec.value());
+ }
+};
+
// system_error
class _LIBCPP_TYPE_VIS system_error
@@ -635,7 +663,8 @@ private:
static string __init(const error_code&, string);
};
-_LIBCPP_FUNC_VIS void __throw_system_error(int ev, const char* what_arg);
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS
+void __throw_system_error(int ev, const char* what_arg);
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/thread b/include/thread
index 022021c5adde..7fe4c77e1b10 100644
--- a/include/thread
+++ b/include/thread
@@ -99,6 +99,7 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
#include <tuple>
#endif
#include <__threading_support>
+#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -136,7 +137,7 @@ public:
template <class _Tp>
class __thread_specific_ptr
{
- __libcpp_tl_key __key_;
+ __libcpp_tls_key __key_;
// Only __thread_local_data() may construct a __thread_specific_ptr
// and only with _Tp == __thread_struct.
@@ -154,13 +155,12 @@ public:
~__thread_specific_ptr();
_LIBCPP_INLINE_VISIBILITY
- pointer get() const {return static_cast<_Tp*>(__libcpp_tl_get(__key_));}
+ pointer get() const {return static_cast<_Tp*>(__libcpp_tls_get(__key_));}
_LIBCPP_INLINE_VISIBILITY
pointer operator*() const {return *get();}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const {return get();}
- pointer release();
- void reset(pointer __p = nullptr);
+ void set_pointer(pointer __p);
};
template <class _Tp>
@@ -173,7 +173,7 @@ __thread_specific_ptr<_Tp>::__at_thread_exit(void* __p)
template <class _Tp>
__thread_specific_ptr<_Tp>::__thread_specific_ptr()
{
- int __ec = __libcpp_tl_create(
+ int __ec = __libcpp_tls_create(
&__key_,
&__thread_specific_ptr::__at_thread_exit);
if (__ec)
@@ -191,21 +191,12 @@ __thread_specific_ptr<_Tp>::~__thread_specific_ptr()
}
template <class _Tp>
-typename __thread_specific_ptr<_Tp>::pointer
-__thread_specific_ptr<_Tp>::release()
-{
- pointer __p = get();
- __libcpp_tl_set(__key_, nullptr);
- return __p;
-}
-
-template <class _Tp>
void
-__thread_specific_ptr<_Tp>::reset(pointer __p)
+__thread_specific_ptr<_Tp>::set_pointer(pointer __p)
{
- pointer __p_old = get();
- __libcpp_tl_set(__key_, __p);
- delete __p_old;
+ _LIBCPP_ASSERT(get() == nullptr,
+ "Attempting to overwrite thread local data");
+ __libcpp_tls_set(__key_, __p);
}
class _LIBCPP_TYPE_VIS thread;
@@ -351,7 +342,7 @@ void* __thread_proxy(void* __vp)
{
// _Fp = std::tuple< unique_ptr<__thread_struct>, Functor, Args...>
std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
- __thread_local_data().reset(_VSTD::get<0>(*__p).release());
+ __thread_local_data().set_pointer(_VSTD::get<0>(*__p).release());
typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 2>::type _Index;
__thread_execute(*__p, _Index());
return nullptr;
@@ -392,7 +383,7 @@ template <class _Fp>
void* __thread_proxy_cxx03(void* __vp)
{
std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
- __thread_local_data().reset(__p->__tsp_.release());
+ __thread_local_data().set_pointer(__p->__tsp_.release());
(__p->__fn_)();
return nullptr;
}
diff --git a/include/tuple b/include/tuple
index 744a3ff032d0..553d8e546f89 100644
--- a/include/tuple
+++ b/include/tuple
@@ -84,7 +84,7 @@ template <class T, class Tuple>
constexpr T make_from_tuple(Tuple&& t); // C++17
// 20.4.1.4, tuple helper classes:
-template <class T> class tuple_size; // undefined
+template <class T> class tuple_size;
template <class... T> class tuple_size<tuple<T...>>;
template <class T>
constexpr size_t tuple_size_v = tuple_size<T>::value; // C++17
@@ -150,27 +150,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_VARIADICS
-// tuple_size
-
-template <class ..._Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_size<tuple<_Tp...> >
- : public integral_constant<size_t, sizeof...(_Tp)>
-{
-};
-
-// tuple_element
-
-template <size_t _Ip, class ..._Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, tuple<_Tp...> >
-{
-public:
- typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
-};
-
-#if _LIBCPP_STD_VER > 11
-template <size_t _Ip, class ..._Tp>
-using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type;
-#endif
// __tuple_leaf
@@ -192,6 +171,20 @@ class __tuple_leaf
{
_Hp value;
+ template <class _Tp>
+ static constexpr bool __can_bind_reference() {
+ using _RawTp = typename remove_reference<_Tp>::type;
+ using _RawHp = typename remove_reference<_Hp>::type;
+ using _CheckLValueArg = integral_constant<bool,
+ is_lvalue_reference<_Tp>::value
+ || is_same<_RawTp, reference_wrapper<_RawHp>>::value
+ || is_same<_RawTp, reference_wrapper<typename remove_const<_RawHp>::type>>::value
+ >;
+ return !is_reference<_Hp>::value
+ || (is_lvalue_reference<_Hp>::value && _CheckLValueArg::value)
+ || (is_rvalue_reference<_Hp>::value && !is_lvalue_reference<_Tp>::value);
+ }
+
__tuple_leaf& operator=(const __tuple_leaf&);
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
@@ -231,59 +224,29 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
: value(_VSTD::forward<_Tp>(__t))
- {static_assert(!is_reference<_Hp>::value ||
- (is_lvalue_reference<_Hp>::value &&
- (is_lvalue_reference<_Tp>::value ||
- is_same<typename remove_reference<_Tp>::type,
- reference_wrapper<
- typename remove_reference<_Hp>::type
- >
- >::value)) ||
- (is_rvalue_reference<_Hp>::value &&
- !is_lvalue_reference<_Tp>::value),
+ {static_assert(__can_bind_reference<_Tp>(),
"Attempted to construct a reference element in a tuple with an rvalue");}
template <class _Tp, class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
: value(_VSTD::forward<_Tp>(__t))
- {static_assert(!is_lvalue_reference<_Hp>::value ||
- (is_lvalue_reference<_Hp>::value &&
- (is_lvalue_reference<_Tp>::value ||
- is_same<typename remove_reference<_Tp>::type,
- reference_wrapper<
- typename remove_reference<_Hp>::type
- >
- >::value)),
+ {static_assert(__can_bind_reference<_Tp>(),
"Attempted to construct a reference element in a tuple with an rvalue");}
template <class _Tp, class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
: value(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t))
- {static_assert(!is_lvalue_reference<_Hp>::value ||
- (is_lvalue_reference<_Hp>::value &&
- (is_lvalue_reference<_Tp>::value ||
- is_same<typename remove_reference<_Tp>::type,
- reference_wrapper<
- typename remove_reference<_Hp>::type
- >
- >::value)),
- "Attempted to construct a reference element in a tuple with an rvalue");}
+ {static_assert(!is_reference<_Hp>::value,
+ "Attempted to uses-allocator construct a reference element in a tuple");}
template <class _Tp, class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
: value(_VSTD::forward<_Tp>(__t), __a)
- {static_assert(!is_lvalue_reference<_Hp>::value ||
- (is_lvalue_reference<_Hp>::value &&
- (is_lvalue_reference<_Tp>::value ||
- is_same<typename remove_reference<_Tp>::type,
- reference_wrapper<
- typename remove_reference<_Hp>::type
- >
- >::value)),
- "Attempted to construct a reference element in a tuple with an rvalue");}
+ {static_assert(!is_reference<_Hp>::value,
+ "Attempted to uses-allocator construct a reference element in a tuple");}
__tuple_leaf(const __tuple_leaf& __t) = default;
__tuple_leaf(__tuple_leaf&& __t) = default;
@@ -505,27 +468,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
}
};
-template <bool _IsTuple, class _SizeTrait, size_t _Expected>
-struct __tuple_like_with_size_imp : false_type {};
-
-template <class _SizeTrait, size_t _Expected>
-struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected>
- : integral_constant<bool, _SizeTrait::value == _Expected> {};
-template <class _Tuple, size_t _ExpectedSize,
- class _RawTuple = typename __uncvref<_Tuple>::type>
-using __tuple_like_with_size = __tuple_like_with_size_imp<
- __tuple_like<_RawTuple>::value,
- tuple_size<_RawTuple>, _ExpectedSize
- >;
-
-
-struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail {
- template <class ...>
- static constexpr bool __enable_explicit() { return false; }
- template <class ...>
- static constexpr bool __enable_implicit() { return false; }
-};
template <class ..._Tp>
class _LIBCPP_TYPE_VIS_ONLY tuple
@@ -534,6 +477,12 @@ class _LIBCPP_TYPE_VIS_ONLY tuple
base base_;
+#if defined(_LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION)
+ static constexpr bool _EnableImplicitReducedArityExtension = true;
+#else
+ static constexpr bool _EnableImplicitReducedArityExtension = false;
+#endif
+
template <class ..._Args>
struct _PackExpandsToThisTuple : false_type {};
@@ -548,6 +497,11 @@ class _LIBCPP_TYPE_VIS_ONLY tuple
struct _CheckArgsConstructor<true, _Dummy>
{
template <class ..._Args>
+ static constexpr bool __enable_default() {
+ return __all<is_default_constructible<_Args>::value...>::value;
+ }
+
+ template <class ..._Args>
static constexpr bool __enable_explicit() {
return
__tuple_constructible<
@@ -657,12 +611,15 @@ class _LIBCPP_TYPE_VIS_ONLY tuple
public:
template <bool _Dummy = true, class = typename enable_if<
- __all<__dependent_type<is_default_constructible<_Tp>, _Dummy>::value...>::value
+ _CheckArgsConstructor<_Dummy>::template __enable_default<_Tp...>()
>::type>
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR tuple()
_NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
+ tuple(tuple const&) = default;
+ tuple(tuple&&) = default;
+
template <class _AllocArgT, class _Alloc, bool _Dummy = true, class = typename enable_if<
__lazy_and<
is_same<allocator_arg_t, _AllocArgT>,
@@ -752,11 +709,17 @@ public:
) {}
template <class ..._Up,
+ bool _PackIsTuple = _PackExpandsToThisTuple<_Up...>::value,
typename enable_if
<
_CheckArgsConstructor<
- sizeof...(_Up) <= sizeof...(_Tp)
- && !_PackExpandsToThisTuple<_Up...>::value
+ sizeof...(_Up) == sizeof...(_Tp)
+ && !_PackIsTuple
+ >::template __enable_implicit<_Up...>() ||
+ _CheckArgsConstructor<
+ _EnableImplicitReducedArityExtension
+ && sizeof...(_Up) < sizeof...(_Tp)
+ && !_PackIsTuple
>::template __enable_implicit<_Up...>(),
bool
>::type = false
@@ -784,7 +747,12 @@ public:
_CheckArgsConstructor<
sizeof...(_Up) <= sizeof...(_Tp)
&& !_PackExpandsToThisTuple<_Up...>::value
- >::template __enable_explicit<_Up...>(),
+ >::template __enable_explicit<_Up...>() ||
+ _CheckArgsConstructor<
+ !_EnableImplicitReducedArityExtension
+ && sizeof...(_Up) < sizeof...(_Tp)
+ && !_PackExpandsToThisTuple<_Up...>()
+ >::template __enable_implicit<_Up...>(),
bool
>::type = false
>
@@ -901,6 +869,25 @@ public:
tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
: base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
+ using _CanCopyAssign = __all<is_copy_assignable<_Tp>::value...>;
+ using _CanMoveAssign = __all<is_move_assignable<_Tp>::value...>;
+
+ _LIBCPP_INLINE_VISIBILITY
+ tuple& operator=(typename conditional<_CanCopyAssign::value, tuple, __nat>::type const& __t)
+ _NOEXCEPT_((__all<is_nothrow_copy_assignable<_Tp>::value...>::value))
+ {
+ base_.operator=(__t.base_);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ tuple& operator=(typename conditional<_CanMoveAssign::value, tuple, __nat>::type&& __t)
+ _NOEXCEPT_((__all<is_nothrow_move_assignable<_Tp>::value...>::value))
+ {
+ base_.operator=(static_cast<base&&>(__t.base_));
+ return *this;
+ }
+
template <class _Tuple,
class = typename enable_if
<
@@ -1356,6 +1343,9 @@ template <class ..._Tp, class _Alloc>
struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<tuple<_Tp...>, _Alloc>
: true_type {};
+#endif // _LIBCPP_HAS_NO_VARIADICS
+
+#ifndef _LIBCPP_CXX03_LANG
template <class _T1, class _T2>
template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1366,8 +1356,7 @@ pair<_T1, _T2>::pair(piecewise_construct_t,
second(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...)
{
}
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 14
template <class _Tp>
diff --git a/include/type_traits b/include/type_traits
index 821a73c764dd..e2b537799dcc 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -425,7 +425,7 @@ template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp
#endif
// addressof
-#if __has_builtin(__builtin_addressof)
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
template <class _Tp>
inline _LIBCPP_CONSTEXPR_AFTER_CXX14
@@ -443,10 +443,11 @@ inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
_Tp*
addressof(_Tp& __x) _NOEXCEPT
{
- return (_Tp*)&reinterpret_cast<const volatile char&>(__x);
+ return reinterpret_cast<_Tp *>(
+ const_cast<char *>(&reinterpret_cast<const volatile char &>(__x)));
}
-#endif // __has_builtin(__builtin_addressof)
+#endif // _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
// Objective-C++ Automatic Reference Counting uses qualified pointers
@@ -488,6 +489,10 @@ addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
}
#endif
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_DELETED_FUNCTIONS)
+template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete;
+#endif
+
struct __two {char __lx[2];};
// helper class:
@@ -520,7 +525,7 @@ using bool_constant = integral_constant<bool, __b>;
typedef _LIBCPP_BOOL_CONSTANT(true) true_type;
typedef _LIBCPP_BOOL_CONSTANT(false) false_type;
-#if !defined(_LIBCPP_HAS_NO_VARIADICS)
+#if !defined(_LIBCPP_CXX03_LANG)
// __lazy_and
@@ -595,7 +600,7 @@ struct __or_<_B0, _B1, _B2, _Bn...>
template<class _Tp>
struct __not_ : conditional<_Tp::value, false_type, true_type>::type {};
-#endif // !defined(_LIBCPP_HAS_NO_VARIADICS)
+#endif // !defined(_LIBCPP_CXX03_LANG)
// is_const
@@ -1122,6 +1127,11 @@ struct __unconstref {
typedef typename remove_const<typename remove_reference<_Tp>::type>::type type;
};
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp>
+using __uncvref_t = typename __uncvref<_Tp>::type;
+#endif
+
// __is_same_uncvref
template <class _Tp, class _Up>
@@ -1670,10 +1680,10 @@ _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x400);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x800);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1000);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2000);
-// MSDN says that MSVC does not support alignment beyond 8192 (=0x2000)
-#if !defined(_LIBCPP_MSVC)
+// PE/COFF does not support alignment beyond 8192 (=0x2000)
+#if !defined(_WIN32)
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4000);
-#endif // !_LIBCPP_MSVC
+#endif // !_WIN32
#undef _CREATE_ALIGNED_STORAGE_SPECIALIZATION
@@ -1987,10 +1997,10 @@ struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp>
// bullet 3 - sizeof...(Tp) == 2
template <class _Tp, class _Up, class = void>
-struct __common_type2 {};
+struct __common_type2_imp {};
template <class _Tp, class _Up>
-struct __common_type2<_Tp, _Up,
+struct __common_type2_imp<_Tp, _Up,
typename __void_t<decltype(
true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>()
)>::type>
@@ -2000,6 +2010,16 @@ struct __common_type2<_Tp, _Up,
)>::type type;
};
+template <class _Tp, class _Up,
+ class _DTp = typename decay<_Tp>::type,
+ class _DUp = typename decay<_Up>::type>
+using __common_type2 =
+ typename conditional<
+ is_same<_Tp, _DTp>::value && is_same<_Up, _DUp>::value,
+ __common_type2_imp<_Tp, _Up>,
+ common_type<_DTp, _DUp>
+ >::type;
+
template <class _Tp, class _Up>
struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up>
: __common_type2<_Tp, _Up> {};
@@ -2011,13 +2031,21 @@ template <class ...Tp> struct __common_types;
template <class, class = void>
struct __common_type_impl {};
+template <class _Tp, class _Up>
+struct __common_type_impl<
+ __common_types<_Tp, _Up>,
+ typename __void_t<typename common_type<_Tp, _Up>::type>::type>
+{
+ typedef typename common_type<_Tp, _Up>::type type;
+};
+
template <class _Tp, class _Up, class ..._Vp>
struct __common_type_impl<__common_types<_Tp, _Up, _Vp...>,
typename __void_t<typename common_type<_Tp, _Up>::type>::type>
+ : __common_type_impl<
+ __common_types<typename common_type<_Tp, _Up>::type, _Vp...> >
{
- typedef typename common_type<
- typename common_type<_Tp, _Up>::type, _Vp...
- >::type type;
+
};
template <class _Tp, class _Up, class ..._Vp>
@@ -2036,26 +2064,15 @@ template<typename, typename _Tp> struct __select_2nd { typedef _Tp type; };
template <class _Tp, class _Arg>
typename __select_2nd<decltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>())), true_type>::type
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-__is_assignable_test(_Tp&&, _Arg&&);
-#else
-__is_assignable_test(_Tp, _Arg&);
-#endif
+__is_assignable_test(int);
+
+template <class, class>
+false_type __is_assignable_test(...);
-template <class _Arg>
-false_type
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-__is_assignable_test(__any, _Arg&&);
-#else
-__is_assignable_test(__any, _Arg&);
-#endif
template <class _Tp, class _Arg, bool = is_void<_Tp>::value || is_void<_Arg>::value>
struct __is_assignable_imp
- : public common_type
- <
- decltype(_VSTD::__is_assignable_test(declval<_Tp>(), declval<_Arg>()))
- >::type {};
+ : public decltype((_VSTD::__is_assignable_test<_Tp, _Arg>(0))) {};
template <class _Tp, class _Arg>
struct __is_assignable_imp<_Tp, _Arg, true>
@@ -2088,7 +2105,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_assignable_v
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_move_assignable
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
: public is_assignable<typename add_lvalue_reference<_Tp>::type,
- const typename add_rvalue_reference<_Tp>::type> {};
+ typename add_rvalue_reference<_Tp>::type> {};
#else
: public is_copy_assignable<_Tp> {};
#endif
@@ -2166,7 +2183,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_destructible_v
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
typename remove_reference<_Tp>::type&&
move(_Tp&& __t) _NOEXCEPT
{
@@ -2175,7 +2192,7 @@ move(_Tp&& __t) _NOEXCEPT
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
_Tp&&
forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT
{
@@ -2183,12 +2200,12 @@ forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
_Tp&&
forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT
{
static_assert(!is_lvalue_reference<_Tp>::value,
- "Can not forward an rvalue as an lvalue.");
+ "can not forward an rvalue as an lvalue");
return static_cast<_Tp&&>(__t);
}
@@ -2900,135 +2917,132 @@ namespace __is_construct
struct __nat {};
}
-#if __has_feature(is_constructible)
+#if !defined(_LIBCPP_CXX03_LANG) && (!__has_feature(is_constructible) || \
+ defined(_LIBCPP_TESTING_FALLBACK_IS_CONSTRUCTIBLE))
-template <class _Tp, class ..._Args>
-struct _LIBCPP_TYPE_VIS_ONLY is_constructible
- : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
- {};
-
-#else
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
-// main is_constructible test
-
-template <class _Tp, class ..._Args>
-typename __select_2nd<decltype(_VSTD::move(_Tp(_VSTD::declval<_Args>()...))), true_type>::type
-__is_constructible_test(_Tp&&, _Args&& ...);
-
-template <class ..._Args>
-false_type
-__is_constructible_test(__any, _Args&& ...);
-
-template <bool, class _Tp, class... _Args>
-struct __libcpp_is_constructible // false, _Tp is not a scalar
- : public common_type
- <
- decltype(__is_constructible_test(declval<_Tp>(), declval<_Args>()...))
- >::type
- {};
+template <class _Tp, class... _Args>
+struct __libcpp_is_constructible;
+
+template <class _To, class _From>
+struct __is_invalid_base_to_derived_cast {
+ static_assert(is_reference<_To>::value, "Wrong specialization");
+ using _RawFrom = __uncvref_t<_From>;
+ using _RawTo = __uncvref_t<_To>;
+ static const bool value = __lazy_and<
+ __lazy_not<is_same<_RawFrom, _RawTo>>,
+ is_base_of<_RawFrom, _RawTo>,
+ __lazy_not<__libcpp_is_constructible<_RawTo, _From>>
+ >::value;
+};
+
+template <class _To, class _From>
+struct __is_invalid_lvalue_to_rvalue_cast : false_type {
+ static_assert(is_reference<_To>::value, "Wrong specialization");
+};
+
+template <class _ToRef, class _FromRef>
+struct __is_invalid_lvalue_to_rvalue_cast<_ToRef&&, _FromRef&> {
+ using _RawFrom = __uncvref_t<_FromRef>;
+ using _RawTo = __uncvref_t<_ToRef>;
+ static const bool value = __lazy_and<
+ __lazy_not<is_function<_RawTo>>,
+ __lazy_or<
+ is_same<_RawFrom, _RawTo>,
+ is_base_of<_RawTo, _RawFrom>>
+ >::value;
+};
+
+struct __is_constructible_helper
+{
+ template <class _To>
+ static void __eat(_To);
+
+ // This overload is needed to work around a Clang bug that disallows
+ // static_cast<T&&>(e) for non-reference-compatible types.
+ // Example: static_cast<int&&>(declval<double>());
+ // NOTE: The static_cast implementation below is required to support
+ // classes with explicit conversion operators.
+ template <class _To, class _From,
+ class = decltype(__eat<_To>(_VSTD::declval<_From>()))>
+ static true_type __test_cast(int);
+
+ template <class _To, class _From,
+ class = decltype(static_cast<_To>(_VSTD::declval<_From>()))>
+ static integral_constant<bool,
+ !__is_invalid_base_to_derived_cast<_To, _From>::value &&
+ !__is_invalid_lvalue_to_rvalue_cast<_To, _From>::value
+ > __test_cast(long);
-// function types are not constructible
+ template <class, class>
+ static false_type __test_cast(...);
-template <class _Rp, class... _A1, class... _A2>
-struct __libcpp_is_constructible<false, _Rp(_A1...), _A2...>
- : public false_type
- {};
+ template <class _Tp, class ..._Args,
+ class = decltype(_Tp(_VSTD::declval<_Args>()...))>
+ static true_type __test_nary(int);
+ template <class _Tp, class...>
+ static false_type __test_nary(...);
-// handle scalars and reference types
+ template <class _Tp, class _A0, class = decltype(::new _Tp(_VSTD::declval<_A0>()))>
+ static is_destructible<_Tp> __test_unary(int);
+ template <class, class>
+ static false_type __test_unary(...);
+};
-// Scalars are default constructible, references are not
+template <class _Tp, bool = is_void<_Tp>::value>
+struct __is_default_constructible
+ : decltype(__is_constructible_helper::__test_nary<_Tp>(0))
+{};
template <class _Tp>
-struct __libcpp_is_constructible<true, _Tp>
- : public is_scalar<_Tp>
- {};
-
-// Scalars and references are constructible from one arg if that arg is
-// implicitly convertible to the scalar or reference.
+struct __is_default_constructible<_Tp, true> : false_type {};
template <class _Tp>
-struct __is_constructible_ref
-{
- true_type static __lxx(_Tp);
- false_type static __lxx(...);
-};
-
-template <class _Tp, class _A0>
-struct __libcpp_is_constructible<true, _Tp, _A0>
- : public common_type
- <
- decltype(__is_constructible_ref<_Tp>::__lxx(declval<_A0>()))
- >::type
- {};
-
-// Scalars and references are not constructible from multiple args.
+struct __is_default_constructible<_Tp[], false> : false_type {};
-template <class _Tp, class _A0, class ..._Args>
-struct __libcpp_is_constructible<true, _Tp, _A0, _Args...>
- : public false_type
- {};
-
-// Treat scalars and reference types separately
-
-template <bool, class _Tp, class... _Args>
-struct __is_constructible_void_check
- : public __libcpp_is_constructible<is_scalar<_Tp>::value || is_reference<_Tp>::value,
- _Tp, _Args...>
- {};
-
-// If any of T or Args is void, is_constructible should be false
+template <class _Tp, size_t _Nx>
+struct __is_default_constructible<_Tp[_Nx], false>
+ : __is_default_constructible<typename remove_all_extents<_Tp>::type> {};
template <class _Tp, class... _Args>
-struct __is_constructible_void_check<true, _Tp, _Args...>
- : public false_type
- {};
-
-template <class ..._Args> struct __contains_void;
-
-template <> struct __contains_void<> : false_type {};
-
-template <class _A0, class ..._Args>
-struct __contains_void<_A0, _Args...>
+struct __libcpp_is_constructible
{
- static const bool value = is_void<_A0>::value ||
- __contains_void<_Args...>::value;
+ static_assert(sizeof...(_Args) > 1, "Wrong specialization");
+ typedef decltype(__is_constructible_helper::__test_nary<_Tp, _Args...>(0))
+ type;
};
-// is_constructible entry point
-
-template <class _Tp, class... _Args>
-struct _LIBCPP_TYPE_VIS_ONLY is_constructible
- : public __is_constructible_void_check<__contains_void<_Tp, _Args...>::value
- || is_abstract<_Tp>::value,
- _Tp, _Args...>
- {};
-
-// Array types are default constructible if their element type
-// is default constructible
+template <class _Tp>
+struct __libcpp_is_constructible<_Tp> : __is_default_constructible<_Tp> {};
-template <class _Ap, size_t _Np>
-struct __libcpp_is_constructible<false, _Ap[_Np]>
- : public is_constructible<typename remove_all_extents<_Ap>::type>
- {};
+template <class _Tp, class _A0>
+struct __libcpp_is_constructible<_Tp, _A0>
+ : public decltype(__is_constructible_helper::__test_unary<_Tp, _A0>(0))
+{};
-// Otherwise array types are not constructible by this syntax
+template <class _Tp, class _A0>
+struct __libcpp_is_constructible<_Tp&, _A0>
+ : public decltype(__is_constructible_helper::
+ __test_cast<_Tp&, _A0>(0))
+{};
-template <class _Ap, size_t _Np, class ..._Args>
-struct __libcpp_is_constructible<false, _Ap[_Np], _Args...>
- : public false_type
- {};
+template <class _Tp, class _A0>
+struct __libcpp_is_constructible<_Tp&&, _A0>
+ : public decltype(__is_constructible_helper::
+ __test_cast<_Tp&&, _A0>(0))
+{};
-// Incomplete array types are not constructible
+#endif
-template <class _Ap, class ..._Args>
-struct __libcpp_is_constructible<false, _Ap[], _Args...>
- : public false_type
+#if __has_feature(is_constructible)
+template <class _Tp, class ..._Args>
+struct _LIBCPP_TYPE_VIS_ONLY is_constructible
+ : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
{};
-
-#else // _LIBCPP_HAS_NO_VARIADICS
-
+#elif !defined(_LIBCPP_CXX03_LANG)
+template <class _Tp, class... _Args>
+struct _LIBCPP_TYPE_VIS_ONLY is_constructible
+ : public __libcpp_is_constructible<_Tp, _Args...>::type {};
+#else
// template <class T> struct is_constructible0;
// main is_constructible0 test
@@ -3201,8 +3215,8 @@ struct __is_constructible2_imp<false, _Ap[], _A0, _A1>
: public false_type
{};
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // __has_feature(is_constructible)
+#endif // __has_feature(is_constructible)
+
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
template <class _Tp, class ..._Args> _LIBCPP_CONSTEXPR bool is_constructible_v
@@ -4406,7 +4420,7 @@ template <class _Tp> struct __is_nothrow_swappable;
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#ifndef _LIBCPP_CXX03_LANG
typename enable_if
<
is_move_constructible<_Tp>::value &&
@@ -4614,7 +4628,7 @@ inline _LIBCPP_INLINE_VISIBILITY
typename __sfinae_underlying_type<_Tp>::__promoted_type
__convert_to_integral(_Tp __val) { return __val; }
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
struct __has_operator_addressof_member_imp
@@ -4646,9 +4660,11 @@ struct __has_operator_addressof
|| __has_operator_addressof_free_imp<_Tp>::value>
{};
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 14
+
+#define __cpp_lib_void_t 201411
template <class...> using void_t = void;
# ifndef _LIBCPP_HAS_NO_VARIADICS
diff --git a/include/typeinfo b/include/typeinfo
index 14ef77b31c3f..9b14cb36048e 100644
--- a/include/typeinfo
+++ b/include/typeinfo
@@ -61,6 +61,9 @@ public:
#include <exception>
#include <cstddef>
#include <cstdint>
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -73,6 +76,7 @@ class _LIBCPP_EXCEPTION_ABI type_info
{
type_info& operator=(const type_info&);
type_info(const type_info&);
+
protected:
#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
const char* __type_name;
@@ -113,7 +117,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_t hash_code() const _NOEXCEPT
#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
- {return *reinterpret_cast<const size_t*>(&__type_name);}
+ {return reinterpret_cast<size_t>(__type_name);}
#else
{if (!(__type_name & _LIBCPP_NONUNIQUE_RTTI_BIT)) return __type_name;
const char *__ptr = name();
@@ -165,4 +169,16 @@ public:
} // std
+_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_cast()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_cast();
+#else
+ _VSTD::abort();
+#endif
+}
+_LIBCPP_END_NAMESPACE_STD
+
#endif // __LIBCPP_TYPEINFO
diff --git a/include/unordered_map b/include/unordered_map
index 8d7edaf509c8..dc8db8085197 100644
--- a/include/unordered_map
+++ b/include/unordered_map
@@ -922,6 +922,8 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__p);
#endif
return insert(__x).first;
}
@@ -946,6 +948,8 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__p);
#endif
return __table_.__insert_unique(_VSTD::move(__x)).first;
}
@@ -965,6 +969,8 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::insert(const_iterator, value_type&&) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__p);
#endif
return insert(_VSTD::forward<_Pp>(__x)).first;
}
@@ -982,6 +988,8 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::emplace_hint(const_iterator, args...) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__p);
#endif
return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;
}
@@ -1012,11 +1020,13 @@ public:
iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
"unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__h);
#endif
- return try_emplace(__k, _VSTD::forward<_Args>(__args)...).first;
+ return try_emplace(__k, _VSTD::forward<_Args>(__args)...).first;
}
template <class... _Args>
@@ -1024,9 +1034,11 @@ public:
iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
"unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__h);
#endif
return try_emplace(_VSTD::move(__k), _VSTD::forward<_Args>(__args)...).first;
}
@@ -1057,15 +1069,17 @@ public:
template <class _Vp>
_LIBCPP_INLINE_VISIBILITY
- iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v)
+ iterator insert_or_assign(const_iterator, const key_type& __k, _Vp&& __v)
{
+ // FIXME: Add debug mode checking for the iterator input
return insert_or_assign(__k, _VSTD::forward<_Vp>(__v)).first;
}
template <class _Vp>
_LIBCPP_INLINE_VISIBILITY
- iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v)
+ iterator insert_or_assign(const_iterator, key_type&& __k, _Vp&& __v)
{
+ // FIXME: Add debug mode checking for the iterator input
return insert_or_assign(_VSTD::move(__k), _VSTD::forward<_Vp>(__v)).first;
}
#endif
@@ -1085,7 +1099,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void swap(unordered_map& __u)
_NOEXCEPT_(__is_nothrow_swappable<__table>::value)
- {__table_.swap(__u.__table_);}
+ { __table_.swap(__u.__table_);}
_LIBCPP_INLINE_VISIBILITY
hasher hash_function() const
diff --git a/include/utility b/include/utility
index 7b978ad30969..364221433a8a 100644
--- a/include/utility
+++ b/include/utility
@@ -171,6 +171,25 @@ template<class... T>
template<class T, class U=T>
T exchange(T& obj, U&& new_value);
+
+// 20.2.7, in-place construction // C++17
+struct in_place_t {
+ explicit in_place_t() = default;
+};
+inline constexpr in_place_t in_place{};
+template <class T>
+ struct in_place_type_t {
+ explicit in_place_type_t() = default;
+ };
+template <class T>
+ inline constexpr in_place_type_t<T> in_place_type{};
+template <size_t I>
+ struct in_place_index_t {
+ explicit in_place_index_t() = default;
+ };
+template <size_t I>
+ inline constexpr in_place_index_t<I> in_place_index{};
+
} // std
*/
@@ -179,6 +198,7 @@ template<class T, class U=T>
#include <__tuple>
#include <type_traits>
#include <initializer_list>
+#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -276,8 +296,20 @@ extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_
constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
#endif
+#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+struct __non_trivially_copyable_base {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ __non_trivially_copyable_base() _NOEXCEPT {}
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ __non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {}
+};
+#endif
+
template <class _T1, class _T2>
struct _LIBCPP_TYPE_VIS_ONLY pair
+#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+: private __non_trivially_copyable_base
+#endif
{
typedef _T1 first_type;
typedef _T2 second_type;
@@ -285,56 +317,179 @@ struct _LIBCPP_TYPE_VIS_ONLY pair
_T1 first;
_T2 second;
-#ifndef _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
- template <bool _Dummy = true, class = typename enable_if<
- __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&
- __dependent_type<is_default_constructible<_T2>, _Dummy>::value
- >::type>
+#if !defined(_LIBCPP_CXX03_LANG)
+ pair(pair const&) = default;
+ pair(pair&&) = default;
+#else
+ // Use the implicitly declared copy constructor in C++03
#endif
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR pair() : first(), second() {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(const _T1& __x, const _T2& __y)
- : first(__x), second(__y) {}
-
- template<class _U1, class _U2>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(const pair<_U1, _U2>& __p
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
- ,typename enable_if<is_convertible<const _U1&, _T1>::value &&
- is_convertible<const _U2&, _T2>::value>::type* = 0
-#endif
- )
- : first(__p.first), second(__p.second) {}
+#ifdef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ pair() : first(), second() {}
-#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
_LIBCPP_INLINE_VISIBILITY
- pair(const pair& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
- is_nothrow_copy_constructible<second_type>::value)
- : first(__p.first),
- second(__p.second)
- {
- }
+ pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {}
-# ifndef _LIBCPP_CXX03_LANG
+ template <class _U1, class _U2>
_LIBCPP_INLINE_VISIBILITY
- pair(pair&& __p) _NOEXCEPT_(is_nothrow_move_constructible<first_type>::value &&
- is_nothrow_move_constructible<second_type>::value)
- : first(_VSTD::forward<first_type>(__p.first)),
- second(_VSTD::forward<second_type>(__p.second))
- {
+ pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ pair& operator=(pair const& __p) {
+ first = __p.first;
+ second = __p.second;
+ return *this;
}
-# endif
-#elif !defined(_LIBCPP_CXX03_LANG)
- pair(pair const&) = default;
- pair(pair&&) = default;
#else
- // Use the implicitly declared copy constructor in C++03
-#endif
+ template <bool _Val>
+ using _EnableB = typename enable_if<_Val, bool>::type;
+
+ struct _CheckArgs {
+ template <class _U1, class _U2>
+ static constexpr bool __enable_default() {
+ return is_default_constructible<_U1>::value
+ && is_default_constructible<_U2>::value;
+ }
+
+ template <class _U1, class _U2>
+ static constexpr bool __enable_explicit() {
+ return is_constructible<first_type, _U1>::value
+ && is_constructible<second_type, _U2>::value
+ && (!is_convertible<_U1, first_type>::value
+ || !is_convertible<_U2, second_type>::value);
+ }
+
+ template <class _U1, class _U2>
+ static constexpr bool __enable_implicit() {
+ return is_constructible<first_type, _U1>::value
+ && is_constructible<second_type, _U2>::value
+ && is_convertible<_U1, first_type>::value
+ && is_convertible<_U2, second_type>::value;
+ }
+ };
+
+ template <bool _MaybeEnable>
+ using _CheckArgsDep = typename conditional<
+ _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type;
+
+ struct _CheckTupleLikeConstructor {
+ template <class _Tuple>
+ static constexpr bool __enable_implicit() {
+ return __tuple_convertible<_Tuple, pair>::value;
+ }
+
+ template <class _Tuple>
+ static constexpr bool __enable_explicit() {
+ return __tuple_constructible<_Tuple, pair>::value
+ && !__tuple_convertible<_Tuple, pair>::value;
+ }
+
+ template <class _Tuple>
+ static constexpr bool __enable_assign() {
+ return __tuple_assignable<_Tuple, pair>::value;
+ }
+ };
+
+ template <class _Tuple>
+ using _CheckTLC = typename conditional<
+ __tuple_like_with_size<_Tuple, 2>::value
+ && !is_same<typename decay<_Tuple>::type, pair>::value,
+ _CheckTupleLikeConstructor,
+ __check_tuple_constructor_fail
+ >::type;
+
+ template<bool _Dummy = true, _EnableB<
+ _CheckArgsDep<_Dummy>::template __enable_default<_T1, _T2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ pair() : first(), second() {}
+
+ template <bool _Dummy = true, _EnableB<
+ _CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(_T1 const& __t1, _T2 const& __t2)
+ : first(__t1), second(__t2) {}
+
+ template<bool _Dummy = true, _EnableB<
+ _CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(_T1 const& __t1, _T2 const& __t2)
+ : first(__t1), second(__t2) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_explicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(_U1&& __u1, _U2&& __u2)
+ : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_implicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(_U1&& __u1, _U2&& __u2)
+ : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(pair<_U1, _U2> const& __p)
+ : first(__p.first), second(__p.second) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(pair<_U1, _U2> const& __p)
+ : first(__p.first), second(__p.second) {}
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_explicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(pair<_U1, _U2>&&__p)
+ : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_implicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(pair<_U1, _U2>&& __p)
+ : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
+
+ template<class _Tuple, _EnableB<
+ _CheckTLC<_Tuple>::template __enable_explicit<_Tuple>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(_Tuple&& __p)
+ : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
+ second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
+
+ template<class _Tuple, _EnableB<
+ _CheckTLC<_Tuple>::template __enable_implicit<_Tuple>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(_Tuple&& __p)
+ : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
+ second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
+
+ template <class... _Args1, class... _Args2>
_LIBCPP_INLINE_VISIBILITY
- pair& operator=(const pair& __p)
+ pair(piecewise_construct_t __pc,
+ tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)
+ : pair(__pc, __first_args, __second_args,
+ typename __make_tuple_indices<sizeof...(_Args1)>::type(),
+ typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ pair& operator=(typename conditional<
+ is_copy_assignable<first_type>::value &&
+ is_copy_assignable<second_type>::value,
+ pair, __nat>::type const& __p)
_NOEXCEPT_(is_nothrow_copy_assignable<first_type>::value &&
is_nothrow_copy_assignable<second_type>::value)
{
@@ -343,75 +498,30 @@ struct _LIBCPP_TYPE_VIS_ONLY pair
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- template <class _U1, class _U2,
- class = typename enable_if<is_convertible<_U1, first_type>::value &&
- is_convertible<_U2, second_type>::value>::type>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(_U1&& __u1, _U2&& __u2)
- : first(_VSTD::forward<_U1>(__u1)),
- second(_VSTD::forward<_U2>(__u2))
- {}
-
- template<class _U1, class _U2>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(pair<_U1, _U2>&& __p,
- typename enable_if<is_convertible<_U1, _T1>::value &&
- is_convertible<_U2, _T2>::value>::type* = 0)
- : first(_VSTD::forward<_U1>(__p.first)),
- second(_VSTD::forward<_U2>(__p.second)) {}
-
_LIBCPP_INLINE_VISIBILITY
- pair&
- operator=(pair&& __p) _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
- is_nothrow_move_assignable<second_type>::value)
+ pair& operator=(typename conditional<
+ is_move_assignable<first_type>::value &&
+ is_move_assignable<second_type>::value,
+ pair, __nat>::type&& __p)
+ _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
+ is_nothrow_move_assignable<second_type>::value)
{
first = _VSTD::forward<first_type>(__p.first);
second = _VSTD::forward<second_type>(__p.second);
return *this;
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
- template<class _Tuple,
- class = typename enable_if<__tuple_convertible<_Tuple, pair>::value>::type>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(_Tuple&& __p)
- : first(_VSTD::forward<typename tuple_element<0,
- typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<0>(__p))),
- second(_VSTD::forward<typename tuple_element<1,
- typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<1>(__p)))
- {}
-
-
-
- template <class... _Args1, class... _Args2>
- _LIBCPP_INLINE_VISIBILITY
- pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
- tuple<_Args2...> __second_args)
- : pair(__pc, __first_args, __second_args,
- typename __make_tuple_indices<sizeof...(_Args1)>::type(),
- typename __make_tuple_indices<sizeof...(_Args2) >::type())
- {}
-
- template <class _Tuple,
- class = typename enable_if<__tuple_assignable<_Tuple, pair>::value>::type>
- _LIBCPP_INLINE_VISIBILITY
- pair&
- operator=(_Tuple&& __p)
- {
- typedef typename __make_tuple_types<_Tuple>::type _TupleRef;
- typedef typename tuple_element<0, _TupleRef>::type _U0;
- typedef typename tuple_element<1, _TupleRef>::type _U1;
- first = _VSTD::forward<_U0>(_VSTD::get<0>(__p));
- second = _VSTD::forward<_U1>(_VSTD::get<1>(__p));
- return *this;
- }
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
+ template <class _Tuple, _EnableB<
+ _CheckTLC<_Tuple>::template __enable_assign<_Tuple>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY
+ pair& operator=(_Tuple&& __p) {
+ first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p));
+ second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p));
+ return *this;
+ }
+#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
void
swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
@@ -423,13 +533,13 @@ struct _LIBCPP_TYPE_VIS_ONLY pair
}
private:
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
pair(piecewise_construct_t,
tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
__tuple_indices<_I1...>, __tuple_indices<_I2...>);
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif
};
template <class _T1, class _T2>
@@ -782,6 +892,44 @@ _T1 exchange(_T1& __obj, _T2 && __new_value)
}
#endif // _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER > 14
+
+struct _LIBCPP_TYPE_VIS in_place_t {
+ explicit in_place_t() = default;
+};
+#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
+inline
+#endif
+constexpr in_place_t in_place{};
+
+template <class _Tp>
+struct _LIBCPP_TYPE_VIS in_place_type_t {
+ explicit in_place_type_t() = default;
+};
+template <class _Tp>
+#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
+inline
+#endif
+constexpr in_place_type_t<_Tp> in_place_type{};
+
+template <size_t _Idx>
+struct _LIBCPP_TYPE_VIS in_place_index_t {
+ explicit in_place_index_t() = default;
+};
+template <size_t _Idx>
+#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
+inline
+#endif
+constexpr in_place_index_t<_Idx> in_place_index{};
+
+template <class _Tp> struct __is_inplace_type_imp : false_type {};
+template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
+
+template <class _Tp>
+using __is_inplace_type = __is_inplace_type_imp<__uncvref_t<_Tp>>;
+
+#endif // _LIBCPP_STD_VER > 14
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_UTILITY
diff --git a/include/valarray b/include/valarray
index bde644e8719b..2325c54f7c6d 100644
--- a/include/valarray
+++ b/include/valarray
@@ -802,8 +802,8 @@ public:
// construct/destroy:
_LIBCPP_INLINE_VISIBILITY
valarray() : __begin_(0), __end_(0) {}
- _LIBCPP_INLINE_VISIBILITY
- inline explicit valarray(size_t __n);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ explicit valarray(size_t __n);
_LIBCPP_INLINE_VISIBILITY
valarray(const value_type& __x, size_t __n);
valarray(const value_type* __p, size_t __n);
@@ -819,7 +819,7 @@ public:
valarray(const gslice_array<value_type>& __ga);
valarray(const mask_array<value_type>& __ma);
valarray(const indirect_array<value_type>& __ia);
- inline _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
~valarray();
// assignment:
diff --git a/include/variant b/include/variant
new file mode 100644
index 000000000000..fcbad951f7d9
--- /dev/null
+++ b/include/variant
@@ -0,0 +1,1568 @@
+// -*- C++ -*-
+//===------------------------------ variant -------------------------------===//
+//
+// 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_VARIANT
+#define _LIBCPP_VARIANT
+
+/*
+ variant synopsis
+
+namespace std {
+
+ // 20.7.2, class template variant
+ template <class... Types>
+ class variant {
+ public:
+
+ // 20.7.2.1, constructors
+ constexpr variant() noexcept(see below);
+ variant(const variant&);
+ variant(variant&&) noexcept(see below);
+
+ template <class T> constexpr variant(T&&) noexcept(see below);
+
+ template <class T, class... Args>
+ constexpr explicit variant(in_place_type_t<T>, Args&&...);
+
+ template <class T, class U, class... Args>
+ constexpr explicit variant(
+ in_place_type_t<T>, initializer_list<U>, Args&&...);
+
+ template <size_t I, class... Args>
+ constexpr explicit variant(in_place_index_t<I>, Args&&...);
+
+ template <size_t I, class U, class... Args>
+ constexpr explicit variant(
+ in_place_index_t<I>, initializer_list<U>, Args&&...);
+
+ // 20.7.2.2, destructor
+ ~variant();
+
+ // 20.7.2.3, assignment
+ variant& operator=(const variant&);
+ variant& operator=(variant&&) noexcept(see below);
+
+ template <class T> variant& operator=(T&&) noexcept(see below);
+
+ // 20.7.2.4, modifiers
+ template <class T, class... Args>
+ void emplace(Args&&...);
+
+ template <class T, class U, class... Args>
+ void emplace(initializer_list<U>, Args&&...);
+
+ template <size_t I, class... Args>
+ void emplace(Args&&...);
+
+ template <size_t I, class U, class... Args>
+ void emplace(initializer_list<U>, Args&&...);
+
+ // 20.7.2.5, value status
+ constexpr bool valueless_by_exception() const noexcept;
+ constexpr size_t index() const noexcept;
+
+ // 20.7.2.6, swap
+ void swap(variant&) noexcept(see below);
+ };
+
+ // 20.7.3, variant helper classes
+ template <class T> struct variant_size; // undefined
+
+ template <class T>
+ constexpr size_t variant_size_v = variant_size<T>::value;
+
+ template <class T> struct variant_size<const T>;
+ template <class T> struct variant_size<volatile T>;
+ template <class T> struct variant_size<const volatile T>;
+
+ template <class... Types>
+ struct variant_size<variant<Types...>>;
+
+ template <size_t I, class T> struct variant_alternative; // undefined
+
+ template <size_t I, class T>
+ using variant_alternative_t = typename variant_alternative<I, T>::type;
+
+ template <size_t I, class T> struct variant_alternative<I, const T>;
+ template <size_t I, class T> struct variant_alternative<I, volatile T>;
+ template <size_t I, class T> struct variant_alternative<I, const volatile T>;
+
+ template <size_t I, class... Types>
+ struct variant_alternative<I, variant<Types...>>;
+
+ constexpr size_t variant_npos = -1;
+
+ // 20.7.4, value access
+ template <class T, class... Types>
+ constexpr bool holds_alternative(const variant<Types...>&) noexcept;
+
+ template <size_t I, class... Types>
+ constexpr variant_alternative_t<I, variant<Types...>>&
+ get(variant<Types...>&);
+
+ template <size_t I, class... Types>
+ constexpr variant_alternative_t<I, variant<Types...>>&&
+ get(variant<Types...>&&);
+
+ template <size_t I, class... Types>
+ constexpr variant_alternative_t<I, variant<Types...>> const&
+ get(const variant<Types...>&);
+
+ template <size_t I, class... Types>
+ constexpr variant_alternative_t<I, variant<Types...>> const&&
+ get(const variant<Types...>&&);
+
+ template <class T, class... Types>
+ constexpr T& get(variant<Types...>&);
+
+ template <class T, class... Types>
+ constexpr T&& get(variant<Types...>&&);
+
+ template <class T, class... Types>
+ constexpr const T& get(const variant<Types...>&);
+
+ template <class T, class... Types>
+ constexpr const T&& get(const variant<Types...>&&);
+
+ template <size_t I, class... Types>
+ constexpr add_pointer_t<variant_alternative_t<I, variant<Types...>>>
+ get_if(variant<Types...>*) noexcept;
+
+ template <size_t I, class... Types>
+ constexpr add_pointer_t<const variant_alternative_t<I, variant<Types...>>>
+ get_if(const variant<Types...>*) noexcept;
+
+ template <class T, class... Types>
+ constexpr add_pointer_t<T>
+ get_if(variant<Types...>*) noexcept;
+
+ template <class T, class... Types>
+ constexpr add_pointer_t<const T>
+ get_if(const variant<Types...>*) noexcept;
+
+ // 20.7.5, relational operators
+ template <class... Types>
+ constexpr bool operator==(const variant<Types...>&, const variant<Types...>&);
+
+ template <class... Types>
+ constexpr bool operator!=(const variant<Types...>&, const variant<Types...>&);
+
+ template <class... Types>
+ constexpr bool operator<(const variant<Types...>&, const variant<Types...>&);
+
+ template <class... Types>
+ constexpr bool operator>(const variant<Types...>&, const variant<Types...>&);
+
+ template <class... Types>
+ constexpr bool operator<=(const variant<Types...>&, const variant<Types...>&);
+
+ template <class... Types>
+ constexpr bool operator>=(const variant<Types...>&, const variant<Types...>&);
+
+ // 20.7.6, visitation
+ template <class Visitor, class... Variants>
+ constexpr see below visit(Visitor&&, Variants&&...);
+
+ // 20.7.7, class monostate
+ struct monostate;
+
+ // 20.7.8, monostate relational operators
+ constexpr bool operator<(monostate, monostate) noexcept;
+ constexpr bool operator>(monostate, monostate) noexcept;
+ constexpr bool operator<=(monostate, monostate) noexcept;
+ constexpr bool operator>=(monostate, monostate) noexcept;
+ constexpr bool operator==(monostate, monostate) noexcept;
+ constexpr bool operator!=(monostate, monostate) noexcept;
+
+ // 20.7.9, specialized algorithms
+ template <class... Types>
+ void swap(variant<Types...>&, variant<Types...>&) noexcept(see below);
+
+ // 20.7.10, class bad_variant_access
+ class bad_variant_access;
+
+ // 20.7.11, hash support
+ template <class T> struct hash;
+ template <class... Types> struct hash<variant<Types...>>;
+ template <> struct hash<monostate>;
+
+} // namespace std
+
+*/
+
+#include <__config>
+#include <__tuple>
+#include <array>
+#include <exception>
+#include <functional>
+#include <initializer_list>
+#include <new>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+namespace std { // explicitly not using versioning namespace
+
+class _LIBCPP_EXCEPTION_ABI bad_variant_access : public exception {
+public:
+ virtual const char* what() const _NOEXCEPT;
+};
+
+} // namespace std
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+_LIBCPP_NORETURN
+inline _LIBCPP_INLINE_VISIBILITY
+void __throw_bad_variant_access() {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_variant_access();
+#else
+ _VSTD::abort();
+#endif
+}
+
+template <class... _Types>
+class _LIBCPP_TYPE_VIS_ONLY variant;
+
+template <class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY variant_size;
+
+template <class _Tp>
+constexpr size_t variant_size_v = variant_size<_Tp>::value;
+
+template <class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY variant_size<const _Tp> : variant_size<_Tp> {};
+
+template <class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY variant_size<volatile _Tp> : variant_size<_Tp> {};
+
+template <class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY variant_size<const volatile _Tp>
+ : variant_size<_Tp> {};
+
+template <class... _Types>
+struct _LIBCPP_TYPE_VIS_ONLY variant_size<variant<_Types...>>
+ : integral_constant<size_t, sizeof...(_Types)> {};
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY variant_alternative;
+
+template <size_t _Ip, class _Tp>
+using variant_alternative_t = typename variant_alternative<_Ip, _Tp>::type;
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY variant_alternative<_Ip, const _Tp>
+ : add_const<variant_alternative_t<_Ip, _Tp>> {};
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY variant_alternative<_Ip, volatile _Tp>
+ : add_volatile<variant_alternative_t<_Ip, _Tp>> {};
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY variant_alternative<_Ip, const volatile _Tp>
+ : add_cv<variant_alternative_t<_Ip, _Tp>> {};
+
+template <size_t _Ip, class... _Types>
+struct _LIBCPP_TYPE_VIS_ONLY variant_alternative<_Ip, variant<_Types...>> {
+ static_assert(_Ip < sizeof...(_Types));
+ using type = __type_pack_element<_Ip, _Types...>;
+};
+
+constexpr size_t variant_npos = static_cast<size_t>(-1);
+constexpr unsigned int __variant_npos = static_cast<unsigned int>(-1);
+
+namespace __find_detail {
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr size_t __find_index() {
+ constexpr bool __matches[] = {is_same_v<_Tp, _Types>...};
+ size_t __result = __not_found;
+ for (size_t __i = 0; __i < sizeof...(_Types); ++__i) {
+ if (__matches[__i]) {
+ if (__result != __not_found) {
+ return __ambiguous;
+ }
+ __result = __i;
+ }
+ }
+ return __result;
+}
+
+template <size_t _Index>
+struct __find_unambiguous_index_sfinae_impl
+ : integral_constant<size_t, _Index> {};
+
+template <>
+struct __find_unambiguous_index_sfinae_impl<__not_found> {};
+
+template <>
+struct __find_unambiguous_index_sfinae_impl<__ambiguous> {};
+
+template <class _Tp, class... _Types>
+struct __find_unambiguous_index_sfinae
+ : __find_unambiguous_index_sfinae_impl<__find_index<_Tp, _Types...>()> {};
+
+} // namespace __find_detail
+
+namespace __variant_detail {
+
+struct __valueless_t {};
+
+enum class _Trait { _TriviallyAvailable, _Available, _Unavailable };
+
+template <typename _Tp,
+ template <typename> class _IsTriviallyAvailable,
+ template <typename> class _IsAvailable>
+constexpr _Trait __trait =
+ _IsTriviallyAvailable<_Tp>::value
+ ? _Trait::_TriviallyAvailable
+ : _IsAvailable<_Tp>::value ? _Trait::_Available : _Trait::_Unavailable;
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _Trait __common_trait(initializer_list<_Trait> __traits) {
+ _Trait __result = _Trait::_TriviallyAvailable;
+ for (_Trait __t : __traits) {
+ if (static_cast<int>(__t) > static_cast<int>(__result)) {
+ __result = __t;
+ }
+ }
+ return __result;
+}
+
+template <typename... _Types>
+struct __traits {
+ static constexpr _Trait __copy_constructible_trait =
+ __common_trait({__trait<_Types,
+ is_trivially_copy_constructible,
+ is_copy_constructible>...});
+
+ static constexpr _Trait __move_constructible_trait =
+ __common_trait({__trait<_Types,
+ is_trivially_move_constructible,
+ is_move_constructible>...});
+
+ static constexpr _Trait __copy_assignable_trait = __common_trait(
+ {__copy_constructible_trait,
+ __move_constructible_trait,
+ __trait<_Types, is_trivially_copy_assignable, is_copy_assignable>...});
+
+ static constexpr _Trait __move_assignable_trait = __common_trait(
+ {__move_constructible_trait,
+ __trait<_Types, is_trivially_move_assignable, is_move_assignable>...});
+
+ static constexpr _Trait __destructible_trait = __common_trait(
+ {__trait<_Types, is_trivially_destructible, is_destructible>...});
+};
+
+namespace __access {
+
+struct __union {
+ template <class _Vp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __get_alt(_Vp&& __v, in_place_index_t<0>) {
+ return _VSTD::forward<_Vp>(__v).__head;
+ }
+
+ template <class _Vp, size_t _Ip>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __get_alt(_Vp&& __v, in_place_index_t<_Ip>) {
+ return __get_alt(_VSTD::forward<_Vp>(__v).__tail, in_place_index<_Ip - 1>);
+ }
+};
+
+struct __base {
+ template <size_t _Ip, class _Vp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __get_alt(_Vp&& __v) {
+ return __union::__get_alt(_VSTD::forward<_Vp>(__v).__data,
+ in_place_index<_Ip>);
+ }
+};
+
+struct __variant {
+ template <size_t _Ip, class _Vp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __get_alt(_Vp&& __v) {
+ return __base::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v).__impl);
+ }
+};
+
+} // namespace __access
+
+namespace __visitation {
+
+struct __base {
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto)
+ __visit_alt_at(size_t __index, _Visitor&& __visitor, _Vs&&... __vs) {
+ constexpr auto __fdiagonal =
+ __make_fdiagonal<_Visitor&&,
+ decltype(_VSTD::forward<_Vs>(__vs).__as_base())...>();
+ return __fdiagonal[__index](_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs).__as_base()...);
+ }
+
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto) __visit_alt(_Visitor&& __visitor,
+ _Vs&&... __vs) {
+ constexpr auto __fmatrix =
+ __make_fmatrix<_Visitor&&,
+ decltype(_VSTD::forward<_Vs>(__vs).__as_base())...>();
+ const size_t __indices[] = {__vs.index()...};
+ return __at(__fmatrix, __indices)(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs).__as_base()...);
+ }
+
+private:
+ template <class _Tp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr const _Tp& __at_impl(const _Tp& __elem, const size_t*) {
+ return __elem;
+ }
+
+ template <class _Tp, size_t _Np>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __at_impl(const array<_Tp, _Np>& __elems,
+ const size_t* __index) {
+ return __at_impl(__elems[*__index], __index + 1);
+ }
+
+ template <class _Tp, size_t _Np, size_t _Ip>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __at(const array<_Tp, _Np>& __elems,
+ const size_t (&__indices)[_Ip]) {
+ return __at_impl(__elems, begin(__indices));
+ }
+
+ template <class _Fp, class... _Fs>
+ static constexpr void __std_visit_visitor_return_type_check() {
+ static_assert(
+ __all<is_same_v<_Fp, _Fs>...>::value,
+ "`std::visit` requires the visitor to have a single return type.");
+ }
+
+ template <class... _Fs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_farray(_Fs&&... __fs) {
+ __std_visit_visitor_return_type_check<decay_t<_Fs>...>();
+ using __result = array<common_type_t<decay_t<_Fs>...>, sizeof...(_Fs)>;
+ return __result{{_VSTD::forward<_Fs>(__fs)...}};
+ }
+
+ template <class _Fp, class... _Vs, size_t... _Is>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_dispatch(index_sequence<_Is...>) {
+ struct __dispatcher {
+ static constexpr decltype(auto) __dispatch(_Fp __f, _Vs... __vs) {
+ return __invoke_constexpr(
+ static_cast<_Fp>(__f),
+ __access::__base::__get_alt<_Is>(static_cast<_Vs>(__vs))...);
+ }
+ };
+ return _VSTD::addressof(__dispatcher::__dispatch);
+ }
+
+ template <size_t _Ip, class _Fp, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fdiagonal_impl() {
+ return __make_dispatch<_Fp, _Vs...>(
+ index_sequence<(__identity<_Vs>{}, _Ip)...>{});
+ }
+
+ template <class _Fp, class... _Vs, size_t... _Is>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fdiagonal_impl(index_sequence<_Is...>) {
+ return __base::__make_farray(__make_fdiagonal_impl<_Is, _Fp, _Vs...>()...);
+ }
+
+ template <class _Fp, class _Vp, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fdiagonal() {
+ constexpr size_t _Np = decay_t<_Vp>::__size();
+ static_assert(__all<(_Np == decay_t<_Vs>::__size())...>::value);
+ return __make_fdiagonal_impl<_Fp, _Vp, _Vs...>(make_index_sequence<_Np>{});
+ }
+
+ template <class _Fp, class... _Vs, size_t... _Is>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fmatrix_impl(index_sequence<_Is...> __is) {
+ return __make_dispatch<_Fp, _Vs...>(__is);
+ }
+
+ template <class _Fp, class... _Vs, size_t... _Is, size_t... _Js, class... _Ls>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fmatrix_impl(index_sequence<_Is...>,
+ index_sequence<_Js...>,
+ _Ls... __ls) {
+ return __base::__make_farray(__make_fmatrix_impl<_Fp, _Vs...>(
+ index_sequence<_Is..., _Js>{}, __ls...)...);
+ }
+
+ template <class _Fp, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fmatrix() {
+ return __make_fmatrix_impl<_Fp, _Vs...>(
+ index_sequence<>{}, make_index_sequence<decay_t<_Vs>::__size()>{}...);
+ }
+};
+
+struct __variant {
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto)
+ __visit_alt_at(size_t __index, _Visitor&& __visitor, _Vs&&... __vs) {
+ return __base::__visit_alt_at(__index,
+ _VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs).__impl...);
+ }
+
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto) __visit_alt(_Visitor&& __visitor,
+ _Vs&&... __vs) {
+ return __base::__visit_alt(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs).__impl...);
+ }
+
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto)
+ __visit_value_at(size_t __index, _Visitor&& __visitor, _Vs&&... __vs) {
+ return __visit_alt_at(
+ __index,
+ __make_value_visitor(_VSTD::forward<_Visitor>(__visitor)),
+ _VSTD::forward<_Vs>(__vs)...);
+ }
+
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto) __visit_value(_Visitor&& __visitor,
+ _Vs&&... __vs) {
+ return __visit_alt(
+ __make_value_visitor(_VSTD::forward<_Visitor>(__visitor)),
+ _VSTD::forward<_Vs>(__vs)...);
+ }
+
+private:
+ template <class _Visitor, class... _Values>
+ static constexpr void __std_visit_exhaustive_visitor_check() {
+ static_assert(is_callable_v<_Visitor(_Values...)>,
+ "`std::visit` requires the visitor to be exhaustive.");
+ }
+
+ template <class _Visitor>
+ struct __value_visitor {
+ template <class... _Alts>
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr decltype(auto) operator()(_Alts&&... __alts) const {
+ __std_visit_exhaustive_visitor_check<
+ _Visitor,
+ decltype(_VSTD::forward<_Alts>(__alts).__value)...>();
+ return __invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Alts>(__alts).__value...);
+ }
+ _Visitor&& __visitor;
+ };
+
+ template <class _Visitor>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_value_visitor(_Visitor&& __visitor) {
+ return __value_visitor<_Visitor>{_VSTD::forward<_Visitor>(__visitor)};
+ }
+};
+
+} // namespace __visitation
+
+template <size_t _Index, class _Tp>
+struct _LIBCPP_TYPE_VIS_ONLY __alt {
+ using __value_type = _Tp;
+
+ template <class... _Args>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr __alt(in_place_t, _Args&&... __args)
+ : __value(_VSTD::forward<_Args>(__args)...) {}
+
+ __value_type __value;
+};
+
+template <_Trait _DestructibleTrait, size_t _Index, class... _Types>
+union _LIBCPP_TYPE_VIS_ONLY __union;
+
+template <_Trait _DestructibleTrait, size_t _Index>
+union _LIBCPP_TYPE_VIS_ONLY __union<_DestructibleTrait, _Index> {};
+
+#define _LIBCPP_VARIANT_UNION(destructible_trait, destructor) \
+ template <size_t _Index, class _Tp, class... _Types> \
+ union _LIBCPP_TYPE_VIS_ONLY __union<destructible_trait, \
+ _Index, \
+ _Tp, \
+ _Types...> { \
+ public: \
+ inline _LIBCPP_INLINE_VISIBILITY \
+ explicit constexpr __union(__valueless_t) noexcept : __dummy{} {} \
+ \
+ template <class... _Args> \
+ inline _LIBCPP_INLINE_VISIBILITY \
+ explicit constexpr __union(in_place_index_t<0>, _Args&&... __args) \
+ : __head(in_place, _VSTD::forward<_Args>(__args)...) {} \
+ \
+ template <size_t _Ip, class... _Args> \
+ inline _LIBCPP_INLINE_VISIBILITY \
+ explicit constexpr __union(in_place_index_t<_Ip>, _Args&&... __args) \
+ : __tail(in_place_index<_Ip - 1>, _VSTD::forward<_Args>(__args)...) {} \
+ \
+ __union(const __union&) = default; \
+ __union(__union&&) = default; \
+ \
+ destructor \
+ \
+ __union& operator=(const __union&) = default; \
+ __union& operator=(__union&&) = default; \
+ \
+ private: \
+ char __dummy; \
+ __alt<_Index, _Tp> __head; \
+ __union<destructible_trait, _Index + 1, _Types...> __tail; \
+ \
+ friend struct __access::__union; \
+ }
+
+_LIBCPP_VARIANT_UNION(_Trait::_TriviallyAvailable, ~__union() = default;);
+_LIBCPP_VARIANT_UNION(_Trait::_Available, ~__union() {});
+_LIBCPP_VARIANT_UNION(_Trait::_Unavailable, ~__union() = delete;);
+
+#undef _LIBCPP_VARIANT_UNION
+
+template <_Trait _DestructibleTrait, class... _Types>
+class _LIBCPP_TYPE_VIS_ONLY __base {
+public:
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr __base(__valueless_t tag) noexcept
+ : __data(tag), __index(__variant_npos) {}
+
+ template <size_t _Ip, class... _Args>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr __base(in_place_index_t<_Ip>, _Args&&... __args)
+ :
+ __data(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...),
+ __index(_Ip) {}
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr bool valueless_by_exception() const noexcept {
+ return index() == variant_npos;
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr size_t index() const noexcept {
+ return __index == __variant_npos ? variant_npos : __index;
+ }
+
+protected:
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr auto&& __as_base() & { return *this; }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr auto&& __as_base() && { return _VSTD::move(*this); }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr auto&& __as_base() const & { return *this; }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr auto&& __as_base() const && { return _VSTD::move(*this); }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr size_t __size() { return sizeof...(_Types); }
+
+ __union<_DestructibleTrait, 0, _Types...> __data;
+ unsigned int __index;
+
+ friend struct __access::__base;
+ friend struct __visitation::__base;
+};
+
+template <class _Traits, _Trait = _Traits::__destructible_trait>
+class _LIBCPP_TYPE_VIS_ONLY __destructor;
+
+#define _LIBCPP_VARIANT_DESTRUCTOR(destructible_trait, destructor, destroy) \
+ template <class... _Types> \
+ class _LIBCPP_TYPE_VIS_ONLY __destructor<__traits<_Types...>, \
+ destructible_trait> \
+ : public __base<destructible_trait, _Types...> { \
+ using __base_type = __base<destructible_trait, _Types...>; \
+ \
+ public: \
+ using __base_type::__base_type; \
+ using __base_type::operator=; \
+ \
+ __destructor(const __destructor&) = default; \
+ __destructor(__destructor&&) = default; \
+ destructor \
+ __destructor& operator=(const __destructor&) = default; \
+ __destructor& operator=(__destructor&&) = default; \
+ \
+ protected: \
+ inline _LIBCPP_INLINE_VISIBILITY \
+ destroy \
+ }
+
+_LIBCPP_VARIANT_DESTRUCTOR(
+ _Trait::_TriviallyAvailable,
+ ~__destructor() = default;,
+ void __destroy() noexcept { this->__index = __variant_npos; });
+
+_LIBCPP_VARIANT_DESTRUCTOR(
+ _Trait::_Available,
+ ~__destructor() { __destroy(); },
+ void __destroy() noexcept {
+ if (!this->valueless_by_exception()) {
+ __visitation::__base::__visit_alt(
+ [](auto& __alt) noexcept {
+ using __alt_type = decay_t<decltype(__alt)>;
+ __alt.~__alt_type();
+ },
+ *this);
+ }
+ this->__index = __variant_npos;
+ });
+
+_LIBCPP_VARIANT_DESTRUCTOR(
+ _Trait::_Unavailable,
+ ~__destructor() = delete;,
+ void __destroy() noexcept = delete;);
+
+#undef _LIBCPP_VARIANT_DESTRUCTOR
+
+template <class _Traits>
+class _LIBCPP_TYPE_VIS_ONLY __constructor : public __destructor<_Traits> {
+ using __base_type = __destructor<_Traits>;
+
+public:
+ using __base_type::__base_type;
+ using __base_type::operator=;
+
+protected:
+ template <size_t _Ip, class _Tp, class... _Args>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static void __construct_alt(__alt<_Ip, _Tp>& __a, _Args&&... __args) {
+ ::new (_VSTD::addressof(__a))
+ __alt<_Ip, _Tp>(in_place, _VSTD::forward<_Args>(__args)...);
+ }
+
+ template <class _Rhs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static void __generic_construct(__constructor& __lhs, _Rhs&& __rhs) {
+ __lhs.__destroy();
+ if (!__rhs.valueless_by_exception()) {
+ __visitation::__base::__visit_alt_at(
+ __rhs.index(),
+ [](auto& __lhs_alt, auto&& __rhs_alt) {
+ __construct_alt(
+ __lhs_alt,
+ _VSTD::forward<decltype(__rhs_alt)>(__rhs_alt).__value);
+ },
+ __lhs, _VSTD::forward<_Rhs>(__rhs));
+ __lhs.__index = __rhs.index();
+ }
+ }
+};
+
+template <class _Traits, _Trait = _Traits::__move_constructible_trait>
+class _LIBCPP_TYPE_VIS_ONLY __move_constructor;
+
+#define _LIBCPP_VARIANT_MOVE_CONSTRUCTOR(move_constructible_trait, \
+ move_constructor) \
+ template <class... _Types> \
+ class _LIBCPP_TYPE_VIS_ONLY __move_constructor<__traits<_Types...>, \
+ move_constructible_trait> \
+ : public __constructor<__traits<_Types...>> { \
+ using __base_type = __constructor<__traits<_Types...>>; \
+ \
+ public: \
+ using __base_type::__base_type; \
+ using __base_type::operator=; \
+ \
+ __move_constructor(const __move_constructor&) = default; \
+ move_constructor \
+ ~__move_constructor() = default; \
+ __move_constructor& operator=(const __move_constructor&) = default; \
+ __move_constructor& operator=(__move_constructor&&) = default; \
+ }
+
+_LIBCPP_VARIANT_MOVE_CONSTRUCTOR(
+ _Trait::_TriviallyAvailable,
+ __move_constructor(__move_constructor&& __that) = default;);
+
+_LIBCPP_VARIANT_MOVE_CONSTRUCTOR(
+ _Trait::_Available,
+ __move_constructor(__move_constructor&& __that) noexcept(
+ __all<is_nothrow_move_constructible_v<_Types>...>::value)
+ : __move_constructor(__valueless_t{}) {
+ this->__generic_construct(*this, _VSTD::move(__that));
+ });
+
+_LIBCPP_VARIANT_MOVE_CONSTRUCTOR(
+ _Trait::_Unavailable,
+ __move_constructor(__move_constructor&&) = delete;);
+
+#undef _LIBCPP_VARIANT_MOVE_CONSTRUCTOR
+
+template <class _Traits, _Trait = _Traits::__copy_constructible_trait>
+class _LIBCPP_TYPE_VIS_ONLY __copy_constructor;
+
+#define _LIBCPP_VARIANT_COPY_CONSTRUCTOR(copy_constructible_trait, \
+ copy_constructor) \
+ template <class... _Types> \
+ class _LIBCPP_TYPE_VIS_ONLY __copy_constructor<__traits<_Types...>, \
+ copy_constructible_trait> \
+ : public __move_constructor<__traits<_Types...>> { \
+ using __base_type = __move_constructor<__traits<_Types...>>; \
+ \
+ public: \
+ using __base_type::__base_type; \
+ using __base_type::operator=; \
+ \
+ copy_constructor \
+ __copy_constructor(__copy_constructor&&) = default; \
+ ~__copy_constructor() = default; \
+ __copy_constructor& operator=(const __copy_constructor&) = default; \
+ __copy_constructor& operator=(__copy_constructor&&) = default; \
+ }
+
+_LIBCPP_VARIANT_COPY_CONSTRUCTOR(
+ _Trait::_TriviallyAvailable,
+ __copy_constructor(const __copy_constructor& __that) = default;);
+
+_LIBCPP_VARIANT_COPY_CONSTRUCTOR(
+ _Trait::_Available,
+ __copy_constructor(const __copy_constructor& __that)
+ : __copy_constructor(__valueless_t{}) {
+ this->__generic_construct(*this, __that);
+ });
+
+_LIBCPP_VARIANT_COPY_CONSTRUCTOR(
+ _Trait::_Unavailable,
+ __copy_constructor(const __copy_constructor&) = delete;);
+
+#undef _LIBCPP_VARIANT_COPY_CONSTRUCTOR
+
+template <class _Traits>
+class _LIBCPP_TYPE_VIS_ONLY __assignment : public __copy_constructor<_Traits> {
+ using __base_type = __copy_constructor<_Traits>;
+
+public:
+ using __base_type::__base_type;
+ using __base_type::operator=;
+
+ template <size_t _Ip, class... _Args>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __emplace(_Args&&... __args) {
+ this->__destroy();
+ this->__construct_alt(__access::__base::__get_alt<_Ip>(*this),
+ _VSTD::forward<_Args>(__args)...);
+ this->__index = _Ip;
+ }
+
+protected:
+ template <bool _CopyAssign, size_t _Ip, class _Tp, class _Arg>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __assign_alt(__alt<_Ip, _Tp>& __a,
+ _Arg&& __arg,
+ bool_constant<_CopyAssign> __tag) {
+ if (this->index() == _Ip) {
+ __a.__value = _VSTD::forward<_Arg>(__arg);
+ } else {
+ struct {
+ void operator()(true_type) const {
+ __this->__emplace<_Ip>(_Tp(_VSTD::forward<_Arg>(__arg)));
+ }
+ void operator()(false_type) const {
+ __this->__emplace<_Ip>(_VSTD::forward<_Arg>(__arg));
+ }
+ __assignment* __this;
+ _Arg&& __arg;
+ } __impl{this, _VSTD::forward<_Arg>(__arg)};
+ __impl(__tag);
+ }
+ }
+
+ template <class _That>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __generic_assign(_That&& __that) {
+ if (this->valueless_by_exception() && __that.valueless_by_exception()) {
+ // do nothing.
+ } else if (__that.valueless_by_exception()) {
+ this->__destroy();
+ } else {
+ __visitation::__base::__visit_alt_at(
+ __that.index(),
+ [this](auto& __this_alt, auto&& __that_alt) {
+ this->__assign_alt(
+ __this_alt,
+ _VSTD::forward<decltype(__that_alt)>(__that_alt).__value,
+ is_lvalue_reference<_That>{});
+ },
+ *this, _VSTD::forward<_That>(__that));
+ }
+ }
+};
+
+template <class _Traits, _Trait = _Traits::__move_assignable_trait>
+class _LIBCPP_TYPE_VIS_ONLY __move_assignment;
+
+#define _LIBCPP_VARIANT_MOVE_ASSIGNMENT(move_assignable_trait, \
+ move_assignment) \
+ template <class... _Types> \
+ class _LIBCPP_TYPE_VIS_ONLY __move_assignment<__traits<_Types...>, \
+ move_assignable_trait> \
+ : public __assignment<__traits<_Types...>> { \
+ using __base_type = __assignment<__traits<_Types...>>; \
+ \
+ public: \
+ using __base_type::__base_type; \
+ using __base_type::operator=; \
+ \
+ __move_assignment(const __move_assignment&) = default; \
+ __move_assignment(__move_assignment&&) = default; \
+ ~__move_assignment() = default; \
+ __move_assignment& operator=(const __move_assignment&) = default; \
+ move_assignment \
+ }
+
+_LIBCPP_VARIANT_MOVE_ASSIGNMENT(
+ _Trait::_TriviallyAvailable,
+ __move_assignment& operator=(__move_assignment&& __that) = default;);
+
+_LIBCPP_VARIANT_MOVE_ASSIGNMENT(
+ _Trait::_Available,
+ __move_assignment& operator=(__move_assignment&& __that) noexcept(
+ __all<(is_nothrow_move_constructible_v<_Types> &&
+ is_nothrow_move_assignable_v<_Types>)...>::value) {
+ this->__generic_assign(_VSTD::move(__that));
+ return *this;
+ });
+
+_LIBCPP_VARIANT_MOVE_ASSIGNMENT(
+ _Trait::_Unavailable,
+ __move_assignment& operator=(__move_assignment&&) = delete;);
+
+#undef _LIBCPP_VARIANT_MOVE_ASSIGNMENT
+
+template <class _Traits, _Trait = _Traits::__copy_assignable_trait>
+class _LIBCPP_TYPE_VIS_ONLY __copy_assignment;
+
+#define _LIBCPP_VARIANT_COPY_ASSIGNMENT(copy_assignable_trait, \
+ copy_assignment) \
+ template <class... _Types> \
+ class _LIBCPP_TYPE_VIS_ONLY __copy_assignment<__traits<_Types...>, \
+ copy_assignable_trait> \
+ : public __move_assignment<__traits<_Types...>> { \
+ using __base_type = __move_assignment<__traits<_Types...>>; \
+ \
+ public: \
+ using __base_type::__base_type; \
+ using __base_type::operator=; \
+ \
+ __copy_assignment(const __copy_assignment&) = default; \
+ __copy_assignment(__copy_assignment&&) = default; \
+ ~__copy_assignment() = default; \
+ copy_assignment \
+ __copy_assignment& operator=(__copy_assignment&&) = default; \
+ }
+
+_LIBCPP_VARIANT_COPY_ASSIGNMENT(
+ _Trait::_TriviallyAvailable,
+ __copy_assignment& operator=(const __copy_assignment& __that) = default;);
+
+_LIBCPP_VARIANT_COPY_ASSIGNMENT(
+ _Trait::_Available,
+ __copy_assignment& operator=(const __copy_assignment& __that) {
+ this->__generic_assign(__that);
+ return *this;
+ });
+
+_LIBCPP_VARIANT_COPY_ASSIGNMENT(
+ _Trait::_Unavailable,
+ __copy_assignment& operator=(const __copy_assignment&) = delete;);
+
+#undef _LIBCPP_VARIANT_COPY_ASSIGNMENT
+
+template <class... _Types>
+class _LIBCPP_TYPE_VIS_ONLY __impl
+ : public __copy_assignment<__traits<_Types...>> {
+ using __base_type = __copy_assignment<__traits<_Types...>>;
+
+public:
+ using __base_type::__base_type;
+ using __base_type::operator=;
+
+ template <size_t _Ip, class _Arg>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __assign(_Arg&& __arg) {
+ this->__assign_alt(__access::__base::__get_alt<_Ip>(*this),
+ _VSTD::forward<_Arg>(__arg),
+ false_type{});
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __swap(__impl& __that) {
+ if (this->valueless_by_exception() && __that.valueless_by_exception()) {
+ // do nothing.
+ } else if (this->index() == __that.index()) {
+ __visitation::__base::__visit_alt_at(
+ this->index(),
+ [](auto& __this_alt, auto& __that_alt) {
+ using _VSTD::swap;
+ swap(__this_alt.__value, __that_alt.__value);
+ },
+ *this,
+ __that);
+ } else {
+ __impl* __lhs = this;
+ __impl* __rhs = _VSTD::addressof(__that);
+ if (__lhs->__move_nothrow() && !__rhs->__move_nothrow()) {
+ _VSTD::swap(__lhs, __rhs);
+ }
+ __impl __tmp(_VSTD::move(*__rhs));
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ // EXTENSION: When the move construction of `__lhs` into `__rhs` throws
+ // and `__tmp` is nothrow move constructible then we move `__tmp` back
+ // into `__rhs` and provide the strong exception safety guarentee.
+ try {
+ this->__generic_construct(*__rhs, _VSTD::move(*__lhs));
+ } catch (...) {
+ if (__tmp.__move_nothrow()) {
+ this->__generic_construct(*__rhs, _VSTD::move(__tmp));
+ }
+ throw;
+ }
+#else
+ this->__generic_construct(*__rhs, _VSTD::move(*__lhs));
+#endif
+ this->__generic_construct(*__lhs, _VSTD::move(__tmp));
+ }
+ }
+
+private:
+ inline _LIBCPP_INLINE_VISIBILITY
+ bool __move_nothrow() const {
+ constexpr bool __results[] = {is_nothrow_move_constructible_v<_Types>...};
+ return this->valueless_by_exception() || __results[this->index()];
+ }
+};
+
+template <class... _Types>
+struct __overload;
+
+template <>
+struct __overload<> { void operator()() const; };
+
+template <class _Tp, class... _Types>
+struct __overload<_Tp, _Types...> : __overload<_Types...> {
+ using __overload<_Types...>::operator();
+ __identity<_Tp> operator()(_Tp) const;
+};
+
+template <class _Tp, class... _Types>
+using __best_match_t = typename result_of_t<__overload<_Types...>(_Tp&&)>::type;
+
+} // __variant_detail
+
+template <class... _Types>
+class _LIBCPP_TYPE_VIS_ONLY variant
+ : private __sfinae_ctor_base<
+ __all<is_copy_constructible_v<_Types>...>::value,
+ __all<is_move_constructible_v<_Types>...>::value>,
+ private __sfinae_assign_base<
+ __all<(is_copy_constructible_v<_Types> &&
+ is_move_constructible_v<_Types> &&
+ is_copy_assignable_v<_Types>)...>::value,
+ __all<(is_move_constructible_v<_Types> &&
+ is_move_assignable_v<_Types>)...>::value> {
+ static_assert(0 < sizeof...(_Types),
+ "variant must consist of at least one alternative.");
+
+ static_assert(__all<!is_array_v<_Types>...>::value,
+ "variant can not have an array type as an alternative.");
+
+ static_assert(__all<!is_reference_v<_Types>...>::value,
+ "variant can not have a reference type as an alternative.");
+
+ static_assert(__all<!is_void_v<_Types>...>::value,
+ "variant can not have a void type as an alternative.");
+
+ using __first_type = variant_alternative_t<0, variant>;
+
+public:
+ template <bool _Dummy = true,
+ enable_if_t<__dependent_type<is_default_constructible<__first_type>,
+ _Dummy>::value,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr variant() noexcept(is_nothrow_default_constructible_v<__first_type>)
+ : __impl(in_place_index<0>) {}
+
+ variant(const variant&) = default;
+ variant(variant&&) = default;
+
+ template <
+ class _Arg,
+ enable_if_t<!is_same_v<decay_t<_Arg>, variant>, int> = 0,
+ class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_constructible_v<_Tp, _Arg>, int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr variant(_Arg&& __arg) noexcept(
+ is_nothrow_constructible_v<_Tp, _Arg>)
+ : __impl(in_place_index<_Ip>, _VSTD::forward<_Arg>(__arg)) {}
+
+ template <size_t _Ip, class... _Args,
+ enable_if_t<(_Ip < sizeof...(_Types)), int> = 0,
+ class _Tp = variant_alternative_t<_Ip, variant<_Types...>>,
+ enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr variant(
+ in_place_index_t<_Ip>,
+ _Args&&... __args) noexcept(is_nothrow_constructible_v<_Tp, _Args...>)
+ : __impl(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {}
+
+ template <
+ size_t _Ip,
+ class _Up,
+ class... _Args,
+ enable_if_t<(_Ip < sizeof...(_Types)), int> = 0,
+ class _Tp = variant_alternative_t<_Ip, variant<_Types...>>,
+ enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr variant(
+ in_place_index_t<_Ip>,
+ initializer_list<_Up> __il,
+ _Args&&... __args) noexcept(
+ is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, _Args...>)
+ : __impl(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {}
+
+ template <
+ class _Tp,
+ class... _Args,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr variant(in_place_type_t<_Tp>, _Args&&... __args) noexcept(
+ is_nothrow_constructible_v<_Tp, _Args...>)
+ : __impl(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {}
+
+ template <
+ class _Tp,
+ class _Up,
+ class... _Args,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr variant(
+ in_place_type_t<_Tp>,
+ initializer_list<_Up> __il,
+ _Args&&... __args) noexcept(
+ is_nothrow_constructible_v<_Tp, initializer_list< _Up>&, _Args...>)
+ : __impl(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {}
+
+ ~variant() = default;
+
+ variant& operator=(const variant&) = default;
+ variant& operator=(variant&&) = default;
+
+ template <
+ class _Arg,
+ enable_if_t<!is_same_v<decay_t<_Arg>, variant>, int> = 0,
+ class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_assignable_v<_Tp&, _Arg> && is_constructible_v<_Tp, _Arg>,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ variant& operator=(_Arg&& __arg) noexcept(
+ is_nothrow_assignable_v<_Tp&, _Arg> &&
+ is_nothrow_constructible_v<_Tp, _Arg>) {
+ __impl.template __assign<_Ip>(_VSTD::forward<_Arg>(__arg));
+ return *this;
+ }
+
+ template <
+ size_t _Ip,
+ class... _Args,
+ enable_if_t<(_Ip < sizeof...(_Types)), int> = 0,
+ class _Tp = variant_alternative_t<_Ip, variant<_Types...>>,
+ enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void emplace(_Args&&... __args) {
+ __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
+ }
+
+ template <
+ size_t _Ip,
+ class _Up,
+ class... _Args,
+ enable_if_t<(_Ip < sizeof...(_Types)), int> = 0,
+ class _Tp = variant_alternative_t<_Ip, variant<_Types...>>,
+ enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void emplace(initializer_list<_Up> __il, _Args&&... __args) {
+ __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
+ }
+
+ template <
+ class _Tp,
+ class... _Args,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void emplace(_Args&&... __args) {
+ __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
+ }
+
+ template <
+ class _Tp,
+ class _Up,
+ class... _Args,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void emplace(initializer_list<_Up> __il, _Args&&... __args) {
+ __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr bool valueless_by_exception() const noexcept {
+ return __impl.valueless_by_exception();
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr size_t index() const noexcept { return __impl.index(); }
+
+ template <
+ bool _Dummy = true,
+ enable_if_t<
+ __all<(
+ __dependent_type<is_move_constructible<_Types>, _Dummy>::value &&
+ __dependent_type<is_swappable<_Types>, _Dummy>::value)...>::value,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void swap(variant& __that) noexcept(
+ __all<(is_nothrow_move_constructible_v<_Types> &&
+ is_nothrow_swappable_v<_Types>)...>::value) {
+ __impl.__swap(__that.__impl);
+ }
+
+private:
+ __variant_detail::__impl<_Types...> __impl;
+
+ friend struct __variant_detail::__access::__variant;
+ friend struct __variant_detail::__visitation::__variant;
+};
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool __holds_alternative(const variant<_Types...>& __v) noexcept {
+ return __v.index() == _Ip;
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {
+ return __holds_alternative<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <size_t _Ip, class _Vp>
+inline _LIBCPP_INLINE_VISIBILITY
+static constexpr auto&& __generic_get(_Vp&& __v) {
+ using __variant_detail::__access::__variant;
+ if (!__holds_alternative<_Ip>(__v)) {
+ __throw_bad_variant_access();
+ }
+ return __variant::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v)).__value;
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr variant_alternative_t<_Ip, variant<_Types...>>& get(
+ variant<_Types...>& __v) {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get<_Ip>(__v);
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr variant_alternative_t<_Ip, variant<_Types...>>&& get(
+ variant<_Types...>&& __v) {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get<_Ip>(_VSTD::move(__v));
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr const variant_alternative_t<_Ip, variant<_Types...>>& get(
+ const variant<_Types...>& __v) {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get<_Ip>(__v);
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr const variant_alternative_t<_Ip, variant<_Types...>>&& get(
+ const variant<_Types...>&& __v) {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get<_Ip>(_VSTD::move(__v));
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _Tp& get(variant<_Types...>& __v) {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _Tp&& get(variant<_Types...>&& __v) {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get<__find_exactly_one_t<_Tp, _Types...>::value>(
+ _VSTD::move(__v));
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr const _Tp& get(const variant<_Types...>& __v) {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr const _Tp&& get(const variant<_Types...>&& __v) {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get<__find_exactly_one_t<_Tp, _Types...>::value>(
+ _VSTD::move(__v));
+}
+
+template <size_t _Ip, class _Vp>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr auto* __generic_get_if(_Vp* __v) noexcept {
+ using __variant_detail::__access::__variant;
+ return __v && __holds_alternative<_Ip>(*__v)
+ ? _VSTD::addressof(__variant::__get_alt<_Ip>(*__v).__value)
+ : nullptr;
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr add_pointer_t<variant_alternative_t<_Ip, variant<_Types...>>>
+get_if(variant<_Types...>* __v) noexcept {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get_if<_Ip>(__v);
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr add_pointer_t<const variant_alternative_t<_Ip, variant<_Types...>>>
+get_if(const variant<_Types...>* __v) noexcept {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get_if<_Ip>(__v);
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr add_pointer_t<_Tp>
+get_if(variant<_Types...>* __v) noexcept {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get_if<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr add_pointer_t<const _Tp>
+get_if(const variant<_Types...>* __v) noexcept {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get_if<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator==(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__lhs.index() != __rhs.index()) return false;
+ if (__lhs.valueless_by_exception()) return true;
+ return __variant::__visit_value_at(__lhs.index(), equal_to<>{}, __lhs, __rhs);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator!=(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__lhs.index() != __rhs.index()) return true;
+ if (__lhs.valueless_by_exception()) return false;
+ return __variant::__visit_value_at(
+ __lhs.index(), not_equal_to<>{}, __lhs, __rhs);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator<(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__rhs.valueless_by_exception()) return false;
+ if (__lhs.valueless_by_exception()) return true;
+ if (__lhs.index() < __rhs.index()) return true;
+ if (__lhs.index() > __rhs.index()) return false;
+ return __variant::__visit_value_at(__lhs.index(), less<>{}, __lhs, __rhs);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator>(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__lhs.valueless_by_exception()) return false;
+ if (__rhs.valueless_by_exception()) return true;
+ if (__lhs.index() > __rhs.index()) return true;
+ if (__lhs.index() < __rhs.index()) return false;
+ return __variant::__visit_value_at(__lhs.index(), greater<>{}, __lhs, __rhs);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator<=(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__lhs.valueless_by_exception()) return true;
+ if (__rhs.valueless_by_exception()) return false;
+ if (__lhs.index() < __rhs.index()) return true;
+ if (__lhs.index() > __rhs.index()) return false;
+ return __variant::__visit_value_at(
+ __lhs.index(), less_equal<>{}, __lhs, __rhs);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator>=(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__rhs.valueless_by_exception()) return true;
+ if (__lhs.valueless_by_exception()) return false;
+ if (__lhs.index() > __rhs.index()) return true;
+ if (__lhs.index() < __rhs.index()) return false;
+ return __variant::__visit_value_at(
+ __lhs.index(), greater_equal<>{}, __lhs, __rhs);
+}
+
+template <class _Visitor, class... _Vs>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
+ using __variant_detail::__visitation::__variant;
+ bool __results[] = {__vs.valueless_by_exception()...};
+ for (bool __result : __results) {
+ if (__result) {
+ __throw_bad_variant_access();
+ }
+ }
+ return __variant::__visit_value(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs)...);
+}
+
+struct _LIBCPP_TYPE_VIS_ONLY monostate {};
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator<(monostate, monostate) noexcept { return false; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator>(monostate, monostate) noexcept { return false; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator<=(monostate, monostate) noexcept { return true; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator>=(monostate, monostate) noexcept { return true; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator==(monostate, monostate) noexcept { return true; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator!=(monostate, monostate) noexcept { return false; }
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+auto swap(variant<_Types...>& __lhs,
+ variant<_Types...>& __rhs) noexcept(noexcept(__lhs.swap(__rhs)))
+ -> decltype(__lhs.swap(__rhs)) {
+ __lhs.swap(__rhs);
+}
+
+template <class... _Types>
+struct _LIBCPP_TYPE_VIS_ONLY hash<variant<_Types...>> {
+ using argument_type = variant<_Types...>;
+ using result_type = size_t;
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ result_type operator()(const argument_type& __v) const {
+ using __variant_detail::__visitation::__variant;
+ size_t __res =
+ __v.valueless_by_exception()
+ ? 299792458 // Random value chosen by the universe upon creation
+ : __variant::__visit_alt(
+ [](const auto& __alt) {
+ using __alt_type = decay_t<decltype(__alt)>;
+ using __value_type = typename __alt_type::__value_type;
+ return hash<__value_type>{}(__alt.__value);
+ },
+ __v);
+ return __hash_combine(__res, hash<size_t>{}(__v.index()));
+ }
+};
+
+template <>
+struct _LIBCPP_TYPE_VIS_ONLY hash<monostate> {
+ using argument_type = monostate;
+ using result_type = size_t;
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ result_type operator()(const argument_type&) const {
+ return 66740831; // return a fundamentally attractive random value.
+ }
+};
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_VARIANT
diff --git a/include/vector b/include/vector
index 021bbfb6643e..0e014d4bed13 100644
--- a/include/vector
+++ b/include/vector
@@ -99,7 +99,7 @@ public:
void push_back(const value_type& x);
void push_back(value_type&& x);
template <class... Args>
- void emplace_back(Args&&... args);
+ reference emplace_back(Args&&... args);
void pop_back();
template <class... Args> iterator emplace(const_iterator position, Args&&... args);
@@ -218,7 +218,7 @@ public:
const_reference back() const;
void push_back(const value_type& x);
- template <class... Args> void emplace_back(Args&&... args); // C++14
+ template <class... Args> reference emplace_back(Args&&... args); // C++14
void pop_back();
template <class... Args> iterator emplace(const_iterator position, Args&&... args); // C++14
@@ -290,37 +290,29 @@ class __vector_base_common
{
protected:
_LIBCPP_ALWAYS_INLINE __vector_base_common() {}
- void __throw_length_error() const;
- void __throw_out_of_range() const;
+ _LIBCPP_NORETURN void __throw_length_error() const;
+ _LIBCPP_NORETURN void __throw_out_of_range() const;
};
template <bool __b>
void
__vector_base_common<__b>::__throw_length_error() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw length_error("vector");
-#else
- assert(!"vector length_error");
-#endif
+ _VSTD::__throw_length_error("vector");
}
template <bool __b>
void
__vector_base_common<__b>::__throw_out_of_range() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("vector");
-#else
- assert(!"vector out_of_range");
-#endif
+ _VSTD::__throw_out_of_range("vector");
}
#ifdef _LIBCPP_MSVC
#pragma warning( push )
#pragma warning( disable: 4231 )
#endif // _LIBCPP_MSVC
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS __vector_base_common<true>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __vector_base_common<true>)
#ifdef _LIBCPP_MSVC
#pragma warning( pop )
#endif // _LIBCPP_MSVC
@@ -687,7 +679,7 @@ public:
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- void emplace_back(_Args&&... __args);
+ reference emplace_back(_Args&&... __args);
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
@@ -746,9 +738,9 @@ public:
void swap(vector&)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
+ _NOEXCEPT_DEBUG;
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value);
#endif
@@ -765,6 +757,7 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
+ _LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(pointer __new_last);
void allocate(size_type __n);
void deallocate() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
@@ -794,21 +787,7 @@ private:
_LIBCPP_INLINE_VISIBILITY
void __destruct_at_end(pointer __new_last) _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
- {
- --__p;
- const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
- if (__i->base() > __new_last)
- {
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
-#endif
+ __invalidate_iterators_past(__new_last);
size_type __old_size = size();
__base::__destruct_at_end(__new_last);
__annotate_shrink(__old_size);
@@ -829,30 +808,40 @@ private:
// We call annotatations only for the default Allocator because other allocators
// may not meet the AddressSanitizer alignment constraints.
// See the documentation for __sanitizer_annotate_contiguous_container for more details.
- void __annotate_contiguous_container
- (const void *__beg, const void *__end, const void *__old_mid, const void *__new_mid) const
- {
#ifndef _LIBCPP_HAS_NO_ASAN
+ void __annotate_contiguous_container(const void *__beg, const void *__end,
+ const void *__old_mid,
+ const void *__new_mid) const
+ {
+
if (__beg && is_same<allocator_type, __default_allocator_type>::value)
__sanitizer_annotate_contiguous_container(__beg, __end, __old_mid, __new_mid);
-#endif
}
-
- void __annotate_new(size_type __current_size) const
- {
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ void __annotate_contiguous_container(const void*, const void*, const void*,
+ const void*) const {}
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ void __annotate_new(size_type __current_size) const {
__annotate_contiguous_container(data(), data() + capacity(),
data() + capacity(), data() + __current_size);
}
- void __annotate_delete() const
- {
+
+ _LIBCPP_INLINE_VISIBILITY
+ void __annotate_delete() const {
__annotate_contiguous_container(data(), data() + capacity(),
data() + size(), data() + capacity());
}
+
+ _LIBCPP_INLINE_VISIBILITY
void __annotate_increase(size_type __n) const
{
__annotate_contiguous_container(data(), data() + capacity(),
data() + size(), data() + size() + __n);
}
+
+ _LIBCPP_INLINE_VISIBILITY
void __annotate_shrink(size_type __old_size) const
{
__annotate_contiguous_container(data(), data() + capacity(),
@@ -877,8 +866,9 @@ private:
};
#else
struct __RAII_IncreaseAnnotator {
- inline __RAII_IncreaseAnnotator(const vector &, size_type __n = 1) {}
- inline void __done() {}
+ _LIBCPP_INLINE_VISIBILITY
+ __RAII_IncreaseAnnotator(const vector &, size_type = 1) {}
+ _LIBCPP_INLINE_VISIBILITY void __done() {}
};
#endif
@@ -949,7 +939,8 @@ template <class _Tp, class _Allocator>
typename vector<_Tp, _Allocator>::size_type
vector<_Tp, _Allocator>::max_size() const _NOEXCEPT
{
- return _VSTD::min<size_type>(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2); // end() >= begin(), always
+ return _VSTD::min<size_type>(__alloc_traits::max_size(this->__alloc()),
+ numeric_limits<difference_type>::max());
}
// Precondition: __new_size > capacity()
@@ -1411,6 +1402,7 @@ vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __las
allocate(__recommend(__new_size));
__construct_at_end(__first, __last, __new_size);
}
+ __invalidate_all_iterators();
}
template <class _Tp, class _Allocator>
@@ -1432,6 +1424,7 @@ vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u)
allocate(__recommend(static_cast<size_type>(__n)));
__construct_at_end(__n, __u);
}
+ __invalidate_all_iterators();
}
template <class _Tp, class _Allocator>
@@ -1632,7 +1625,7 @@ vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args)
template <class _Tp, class _Allocator>
template <class... _Args>
inline
-void
+typename vector<_Tp, _Allocator>::reference
vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
{
if (this->__end_ < this->__end_cap())
@@ -1646,6 +1639,7 @@ vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
}
else
__emplace_back_slow_path(_VSTD::forward<_Args>(__args)...);
+ return this->back();
}
#endif // _LIBCPP_HAS_NO_VARIADICS
@@ -1674,8 +1668,9 @@ vector<_Tp, _Allocator>::erase(const_iterator __position)
"vector::erase(iterator) called with a non-dereferenceable iterator");
difference_type __ps = __position - cbegin();
pointer __p = this->__begin_ + __ps;
- iterator __r = __make_iter(__p);
this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));
+ this->__invalidate_iterators_past(__p-1);
+ iterator __r = __make_iter(__p);
return __r;
}
@@ -1687,12 +1682,17 @@ vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last)
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
"vector::erase(iterator, iterator) called with an iterator not"
" referring to this vector");
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__last) == this,
+ "vector::erase(iterator, iterator) called with an iterator not"
+ " referring to this vector");
#endif
_LIBCPP_ASSERT(__first <= __last, "vector::erase(first, last) called with invalid range");
pointer __p = this->__begin_ + (__first - begin());
- iterator __r = __make_iter(__p);
- if (__first != __last)
+ if (__first != __last) {
this->__destruct_at_end(_VSTD::move(__p + (__last - __first), this->__end_, __p));
+ this->__invalidate_iterators_past(__p - 1);
+ }
+ iterator __r = __make_iter(__p);
return __r;
}
@@ -2013,9 +2013,9 @@ template <class _Tp, class _Allocator>
void
vector<_Tp, _Allocator>::swap(vector& __x)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
+ _NOEXCEPT_DEBUG
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value)
#endif
{
@@ -2098,6 +2098,28 @@ vector<_Tp, _Allocator>::__invalidate_all_iterators()
#endif // _LIBCPP_DEBUG_LEVEL >= 2
}
+
+template <class _Tp, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __c_node* __c = __get_db()->__find_c_and_lock(this);
+ for (__i_node** __p = __c->end_; __p != __c->beg_; ) {
+ --__p;
+ const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
+ if (__i->base() > __new_last) {
+ (*__p)->__c_ = nullptr;
+ if (--__c->end_ != __p)
+ memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ }
+ }
+ __get_db()->unlock();
+#else
+ ((void)__new_last);
+#endif
+}
+
// vector<bool>
template <class _Allocator> class vector<bool, _Allocator>;
@@ -2314,8 +2336,10 @@ public:
void push_back(const value_type& __x);
#if _LIBCPP_STD_VER > 11
template <class... _Args>
- _LIBCPP_INLINE_VISIBILITY void emplace_back(_Args&&... __args)
- { push_back ( value_type ( _VSTD::forward<_Args>(__args)... )); }
+ _LIBCPP_INLINE_VISIBILITY reference emplace_back(_Args&&... __args) {
+ push_back ( value_type ( _VSTD::forward<_Args>(__args)... ));
+ return this->back();
+ }
#endif
_LIBCPP_INLINE_VISIBILITY void pop_back() {--__size_;}
@@ -2360,7 +2384,7 @@ public:
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT;
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value);
#endif
static void swap(reference __x, reference __y) _NOEXCEPT { _VSTD::swap(__x, __y); }
@@ -2891,6 +2915,7 @@ vector<bool, _Allocator>::assign(size_type __n, const value_type& __x)
}
_VSTD::fill_n(begin(), __n, __x);
}
+ __invalidate_all_iterators();
}
template <class _Allocator>
@@ -2918,7 +2943,9 @@ typename enable_if
vector<bool, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
{
clear();
- difference_type __n = _VSTD::distance(__first, __last);
+ difference_type __ns = _VSTD::distance(__first, __last);
+ _LIBCPP_ASSERT(__ns >= 0, "invalid range specified");
+ const size_t __n = static_cast<size_type>(__ns);
if (__n)
{
if (__n > capacity())
@@ -3097,7 +3124,9 @@ typename enable_if
>::type
vector<bool, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
{
- difference_type __n = _VSTD::distance(__first, __last);
+ const difference_type __n_signed = _VSTD::distance(__first, __last);
+ _LIBCPP_ASSERT(__n_signed >= 0, "invalid range specified");
+ const size_type __n = static_cast<size_type>(__n_signed);
iterator __r;
size_type __c = capacity();
if (__n <= __c && size() <= __c - __n)
@@ -3148,7 +3177,7 @@ vector<bool, _Allocator>::swap(vector& __x)
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value)
#endif
{
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index afc388e7613f..6beb59feec41 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -6,7 +6,7 @@ if(WIN32)
file(GLOB LIBCXX_WIN32_SOURCES ../src/support/win32/*.cpp)
list(APPEND LIBCXX_SOURCES ${LIBCXX_WIN32_SOURCES})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
- file(GLOB LIBCXX_SOLARIS_SOURCES ../src/support/solaris/*.c)
+ file(GLOB LIBCXX_SOLARIS_SOURCES ../src/support/solaris/*.cpp)
list(APPEND LIBCXX_SOURCES ${LIBCXX_SOLARIS_SOURCES})
endif()
@@ -28,30 +28,35 @@ if(NOT LIBCXX_INSTALL_LIBRARY)
set(exclude_from_all EXCLUDE_FROM_ALL)
endif()
-if (LIBCXX_ENABLE_SHARED)
- add_library(cxx SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
-else()
- add_library(cxx STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
-endif()
-
-if (DEFINED LIBCXX_CXX_ABI_DEPS)
- add_dependencies(cxx LIBCXX_CXX_ABI_DEPS)
-endif()
-
#if LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it to the search path.
add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PATH "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
-add_library_flags_if(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "-Wl,--whole-archive" "-Wl,-Bstatic")
-add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
-add_library_flags_if(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "-Wl,-Bdynamic" "-Wl,--no-whole-archive")
+if (APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
+ LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"))
+ set(LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY ON)
+endif()
+
+if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+ add_library_flags("-Wl,--whole-archive" "-Wl,-Bstatic")
+ add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
+ add_library_flags("-Wl,-Bdynamic" "-Wl,--no-whole-archive")
+elseif (LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY)
+ add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
+else ()
+ add_interface_library("${LIBCXX_CXX_ABI_LIBRARY}")
+endif()
if (APPLE AND LLVM_USE_SANITIZER)
- if ("${LLVM_USE_SANITIZER}" STREQUAL "Address")
+ if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
+ ("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
+ ("${LLVM_USE_SANITIZER}" STREQUAL "Undefined;Address"))
set(LIBFILE "libclang_rt.asan_osx_dynamic.dylib")
elseif("${LLVM_USE_SANITIZER}" STREQUAL "Undefined")
set(LIBFILE "libclang_rt.ubsan_osx_dynamic.dylib")
+ elseif("${LLVM_USE_SANITIZER}" STREQUAL "Thread")
+ set(LIBFILE "libclang_rt.tsan_osx_dynamic.dylib")
else()
message(WARNING "LLVM_USE_SANITIZER=${LLVM_USE_SANITIZER} is not supported on OS X")
endif()
@@ -73,7 +78,7 @@ if (APPLE AND LLVM_USE_SANITIZER)
endif()
endif()
-# Generate library list.
+# Generate private library list.
add_library_flags_if(LIBCXX_HAS_PTHREAD_LIB pthread)
add_library_flags_if(LIBCXX_HAS_C_LIB c)
add_library_flags_if(LIBCXX_HAS_M_LIB m)
@@ -81,12 +86,24 @@ add_library_flags_if(LIBCXX_HAS_RT_LIB rt)
add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s)
add_library_flags_if(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB atomic)
+# Add the unwinder library.
+if (LIBCXXABI_USE_LLVM_UNWINDER)
+ if (TARGET unwind_shared)
+ add_interface_library(unwind_shared)
+ elseif (TARGET unwind_static)
+ add_interface_library(unwind_static)
+ else()
+ add_interface_library(unwind)
+ endif()
+endif()
+
# Setup flags.
-add_flags_if_supported(-fPIC)
+if (NOT WIN32)
+ add_flags_if_supported(-fPIC)
+endif()
add_link_flags_if_supported(-nodefaultlibs)
-if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
- LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"))
+if (LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY)
if (NOT DEFINED LIBCXX_LIBCPPABI_VERSION)
set(LIBCXX_LIBCPPABI_VERSION "2") # Default value
execute_process(
@@ -115,9 +132,9 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
"/usr/lib/libSystem.B.dylib")
else()
- if ( ${CMAKE_OSX_SYSROOT} )
- list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7)
- if (OSX_HAS_ARMV7)
+ if (DEFINED CMAKE_OSX_SYSROOT AND NOT CMAKE_OSX_SYSROOT STREQUAL "")
+ list(FIND CMAKE_OSX_ARCHITECTURES "armv7" OSX_HAS_ARMV7)
+ if (NOT OSX_HAS_ARMV7 EQUAL -1)
set(OSX_RE_EXPORT_LINE
"${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp")
@@ -139,18 +156,69 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
endif()
endif()
-target_link_libraries(cxx ${LIBCXX_LIBRARIES})
split_list(LIBCXX_COMPILE_FLAGS)
split_list(LIBCXX_LINK_FLAGS)
-set_target_properties(cxx
+# Add a object library that contains the compiled source files.
+add_library(cxx_objects OBJECT ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
+
+set_target_properties(cxx_objects
PROPERTIES
COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
- LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
- OUTPUT_NAME "c++"
- VERSION "${LIBCXX_ABI_VERSION}.0"
- SOVERSION "${LIBCXX_ABI_VERSION}"
+)
+
+set(LIBCXX_TARGETS)
+
+# Build the shared library.
+if (LIBCXX_ENABLE_SHARED)
+ add_library(cxx_shared SHARED $<TARGET_OBJECTS:cxx_objects>)
+ target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
+ set_target_properties(cxx_shared
+ PROPERTIES
+ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
+ OUTPUT_NAME "c++"
+ VERSION "${LIBCXX_ABI_VERSION}.0"
+ SOVERSION "${LIBCXX_ABI_VERSION}"
)
+ list(APPEND LIBCXX_TARGETS "cxx_shared")
+endif()
+
+# Build the static library.
+if (LIBCXX_ENABLE_STATIC)
+ add_library(cxx_static STATIC $<TARGET_OBJECTS:cxx_objects>)
+ target_link_libraries(cxx_static ${LIBCXX_LIBRARIES})
+ set_target_properties(cxx_static
+ PROPERTIES
+ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
+ OUTPUT_NAME "c++"
+ )
+ list(APPEND LIBCXX_TARGETS "cxx_static")
+ # Attempt to merge the libc++.a archive and the ABI library archive into one.
+ if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+ set(MERGE_ARCHIVES_SEARCH_PATHS "")
+ if (LIBCXX_CXX_ABI_LIBRARY_PATH)
+ set(MERGE_ARCHIVES_SEARCH_PATHS "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
+ endif()
+ if (TARGET ${LIBCXX_CXX_ABI_LIBRARY})
+ set(MERGE_ARCHIVES_ABI_TARGET "$<TARGET_LINKER_FILE:${LIBCXX_CXX_ABI_LIBRARY}>")
+ else()
+ set(MERGE_ARCHIVES_ABI_TARGET "lib${LIBCXX_CXX_ABI_LIBRARY}.a")
+ endif()
+ add_custom_command(TARGET cxx_static POST_BUILD
+ COMMAND
+ ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/merge_archives.py
+ ARGS
+ -o $<TARGET_LINKER_FILE:cxx_static>
+ "$<TARGET_LINKER_FILE:cxx_static>"
+ "${MERGE_ARCHIVES_ABI_TARGET}"
+ "${MERGE_ARCHIVES_SEARCH_PATHS}"
+ WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
+ )
+ endif()
+endif()
+
+# Add a meta-target for both libraries.
+add_custom_target(cxx DEPENDS ${LIBCXX_TARGETS})
if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp)
@@ -158,7 +226,11 @@ if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
file(GLOB LIBCXX_FILESYSTEM_SOURCES ../src/experimental/filesystem/*.cpp)
endif()
add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES} ${LIBCXX_FILESYSTEM_SOURCES})
- target_link_libraries(cxx_experimental cxx)
+ if (LIBCXX_ENABLE_SHARED)
+ target_link_libraries(cxx_experimental cxx_shared)
+ else()
+ target_link_libraries(cxx_experimental cxx_static)
+ endif()
set(experimental_flags "${LIBCXX_COMPILE_FLAGS}")
check_flag_supported(-std=c++14)
@@ -172,23 +244,46 @@ if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
)
endif()
+if (LIBCXX_HAS_EXTERNAL_THREAD_API)
+ file(GLOB LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES ../test/support/external_threads.cpp)
+
+ if (LIBCXX_ENABLE_SHARED)
+ add_library(cxx_external_threads SHARED ${LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES})
+ else()
+ add_library(cxx_external_threads STATIC ${LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES})
+ endif()
+
+ set_target_properties(cxx_external_threads
+ PROPERTIES
+ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
+ COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
+ OUTPUT_NAME "c++external_threads"
+ )
+endif()
+
# Generate a linker script inplace of a libc++.so symlink. Rerun this command
# after cxx builds.
-if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
# Get the name of the ABI library and handle the case where CXXABI_LIBNAME
# is a target name and not a library. Ex cxxabi_shared.
- set(SCRIPT_ABI_LIBNAME "${LIBCXX_CXX_ABI_LIBRARY}")
- if (SCRIPT_ABI_LIBNAME STREQUAL "cxxabi_shared")
- set(SCRIPT_ABI_LIBNAME "c++abi")
- endif()
+ set(LIBCXX_INTERFACE_LIBRARY_NAMES)
+ foreach(lib ${LIBCXX_INTERFACE_LIBRARIES})
+ # FIXME: Handle cxxabi_static and unwind_static.
+ if (TARGET ${lib})
+ list(APPEND LIBCXX_INTERFACE_LIBRARY_NAMES "$<TARGET_PROPERTY:${lib},OUTPUT_NAME>")
+ else()
+ list(APPEND LIBCXX_INTERFACE_LIBRARY_NAMES "${lib}")
+ endif()
+ endforeach()
+ #split_list(LIBCXX_INTERFACE_LIBRARY_NAMES)
# Generate a linker script inplace of a libc++.so symlink. Rerun this command
# after cxx builds.
- add_custom_command(TARGET cxx POST_BUILD
+ add_custom_command(TARGET cxx_shared POST_BUILD
COMMAND
${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script/gen_link_script.py
ARGS
- "$<TARGET_LINKER_FILE:cxx>"
- "${SCRIPT_ABI_LIBNAME}"
+ "$<TARGET_LINKER_FILE:cxx_shared>"
+ ${LIBCXX_INTERFACE_LIBRARY_NAMES}
WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
)
endif()
@@ -197,13 +292,13 @@ if (LIBCXX_INSTALL_LIBRARY)
if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
set(experimental_lib cxx_experimental)
endif()
- install(TARGETS cxx ${experimental_lib}
- LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
- ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
+ install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib}
+ LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
+ ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
)
# NOTE: This install command must go after the cxx install command otherwise
# it will not be executed after the library symlinks are installed.
- if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
# Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
# after we required CMake 3.0.
install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
@@ -221,13 +316,14 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR
set(experimental_lib_install_target cxx_experimental)
endif()
if(LIBCXX_INSTALL_HEADERS)
- set(header_install_target install-libcxx-headers)
+ set(header_install_target install-cxx-headers)
endif()
- add_custom_target(install-libcxx
+ add_custom_target(install-cxx
DEPENDS ${lib_install_target}
${experimental_lib_install_target}
${header_install_target}
COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=libcxx
+ -DCMAKE_INSTALL_COMPONENT=cxx
-P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
+ add_custom_target(install-libcxx DEPENDS install-cxx)
endif()
diff --git a/lib/abi/3.9/x86_64-apple-darwin16.0.abilist b/lib/abi/3.9/x86_64-apple-darwin16.0.abilist
new file mode 100644
index 000000000000..ea361e9fc44b
--- /dev/null
+++ b/lib/abi/3.9/x86_64-apple-darwin16.0.abilist
@@ -0,0 +1,2448 @@
+{'type': 'U', 'name': '__DefaultRuneLocale'}
+{'type': 'U', 'name': '__Unwind_Resume'}
+{'type': 'I', 'name': '__ZNKSt10bad_typeid4whatEv'}
+{'type': 'U', 'name': '__ZNKSt10bad_typeid4whatEv'}
+{'type': 'I', 'name': '__ZNKSt11logic_error4whatEv'}
+{'type': 'U', 'name': '__ZNKSt11logic_error4whatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'}
+{'type': 'I', 'name': '__ZNKSt13bad_exception4whatEv'}
+{'type': 'U', 'name': '__ZNKSt13bad_exception4whatEv'}
+{'type': 'I', 'name': '__ZNKSt13runtime_error4whatEv'}
+{'type': 'U', 'name': '__ZNKSt13runtime_error4whatEv'}
+{'type': 'I', 'name': '__ZNKSt16bad_array_length4whatEv'}
+{'type': 'U', 'name': '__ZNKSt16bad_array_length4whatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt16nested_exception14rethrow_nestedEv'}
+{'type': 'I', 'name': '__ZNKSt20bad_array_new_length4whatEv'}
+{'type': 'U', 'name': '__ZNKSt20bad_array_new_length4whatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110error_code7messageEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db15__decrementableEPKv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db15__find_c_from_iEPv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db15__subscriptableEPKvl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db17__dereferenceableEPKv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db17__find_c_and_lockEPv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db8__find_cEPv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db9__addableEPKvl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112bad_weak_ptr4whatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE10do_scan_isEjPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE11do_scan_notEjPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pj'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEjw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEwc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112strstreambuf6pcountEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__113random_device7entropyEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114error_category10equivalentERKNS_10error_codeEi'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114error_category23default_error_conditionEi'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115error_condition7messageEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__118__time_get_storageIcE15__do_date_orderEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__118__time_get_storageIwE15__do_date_orderEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE3__XEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE3__cEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE3__rEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE3__xEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE7__am_pmEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE7__weeksEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE8__monthsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE3__XEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE3__cEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE3__rEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE3__xEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE7__am_pmEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE7__weeksEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE8__monthsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE10do_toupperEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE8do_widenEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE9do_narrowEcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE10do_scan_isEjPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE10do_toupperEw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE11do_scan_notEjPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE5do_isEPKwS3_Pj'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE5do_isEjw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE8do_widenEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE9do_narrowEwc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__16locale4nameEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__16locale9has_facetERNS0_2idE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__16locale9use_facetERNS0_2idE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__16localeeqERKS0_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIcE7do_hashEPKcS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIwE7do_hashEPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18ios_base6getlocEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIcE8do_closeEl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIwE8do_closeEl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIcE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIcE11do_truenameEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIcE12do_falsenameEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIcE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIcE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIwE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIwE11do_truenameEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIwE12do_falsenameEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIwE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIwE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe'}
+{'type': 'I', 'name': '__ZNKSt8bad_cast4whatEv'}
+{'type': 'U', 'name': '__ZNKSt8bad_cast4whatEv'}
+{'type': 'I', 'name': '__ZNKSt9bad_alloc4whatEv'}
+{'type': 'U', 'name': '__ZNKSt9bad_alloc4whatEv'}
+{'type': 'I', 'name': '__ZNKSt9exception4whatEv'}
+{'type': 'U', 'name': '__ZNKSt9exception4whatEv'}
+{'type': 'I', 'name': '__ZNSt10bad_typeidC1Ev'}
+{'type': 'U', 'name': '__ZNSt10bad_typeidC1Ev'}
+{'type': 'I', 'name': '__ZNSt10bad_typeidC2Ev'}
+{'type': 'U', 'name': '__ZNSt10bad_typeidC2Ev'}
+{'type': 'I', 'name': '__ZNSt10bad_typeidD0Ev'}
+{'type': 'U', 'name': '__ZNSt10bad_typeidD0Ev'}
+{'type': 'I', 'name': '__ZNSt10bad_typeidD1Ev'}
+{'type': 'U', 'name': '__ZNSt10bad_typeidD1Ev'}
+{'type': 'I', 'name': '__ZNSt10bad_typeidD2Ev'}
+{'type': 'U', 'name': '__ZNSt10bad_typeidD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC1ERKS_'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC2ERKS_'}
+{'type': 'I', 'name': '__ZNSt11logic_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt11logic_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt11logic_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt11logic_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt11logic_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt11logic_errorD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_erroraSERKS_'}
+{'type': 'I', 'name': '__ZNSt11range_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt11range_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt11range_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt11range_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt11range_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt11range_errorD2Ev'}
+{'type': 'I', 'name': '__ZNSt12domain_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt12domain_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt12domain_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt12domain_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt12domain_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt12domain_errorD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt12experimental19bad_optional_accessD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt12experimental19bad_optional_accessD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt12experimental19bad_optional_accessD2Ev'}
+{'type': 'I', 'name': '__ZNSt12length_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt12length_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt12length_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt12length_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt12length_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt12length_errorD2Ev'}
+{'type': 'I', 'name': '__ZNSt12out_of_rangeD0Ev'}
+{'type': 'U', 'name': '__ZNSt12out_of_rangeD0Ev'}
+{'type': 'I', 'name': '__ZNSt12out_of_rangeD1Ev'}
+{'type': 'U', 'name': '__ZNSt12out_of_rangeD1Ev'}
+{'type': 'I', 'name': '__ZNSt12out_of_rangeD2Ev'}
+{'type': 'U', 'name': '__ZNSt12out_of_rangeD2Ev'}
+{'type': 'I', 'name': '__ZNSt13bad_exceptionD0Ev'}
+{'type': 'U', 'name': '__ZNSt13bad_exceptionD0Ev'}
+{'type': 'I', 'name': '__ZNSt13bad_exceptionD1Ev'}
+{'type': 'U', 'name': '__ZNSt13bad_exceptionD1Ev'}
+{'type': 'I', 'name': '__ZNSt13bad_exceptionD2Ev'}
+{'type': 'U', 'name': '__ZNSt13bad_exceptionD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt13exception_ptrC1ERKS_'}
+{'type': 'FUNC', 'name': '__ZNSt13exception_ptrC2ERKS_'}
+{'type': 'FUNC', 'name': '__ZNSt13exception_ptrD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt13exception_ptrD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt13exception_ptraSERKS_'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC1ERKS_'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC2ERKS_'}
+{'type': 'I', 'name': '__ZNSt13runtime_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt13runtime_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt13runtime_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt13runtime_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt13runtime_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt13runtime_errorD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_erroraSERKS_'}
+{'type': 'I', 'name': '__ZNSt14overflow_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt14overflow_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt14overflow_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt14overflow_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt14overflow_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt14overflow_errorD2Ev'}
+{'type': 'I', 'name': '__ZNSt15underflow_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt15underflow_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt15underflow_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt15underflow_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt15underflow_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt15underflow_errorD2Ev'}
+{'type': 'I', 'name': '__ZNSt16bad_array_lengthC1Ev'}
+{'type': 'U', 'name': '__ZNSt16bad_array_lengthC1Ev'}
+{'type': 'I', 'name': '__ZNSt16bad_array_lengthC2Ev'}
+{'type': 'U', 'name': '__ZNSt16bad_array_lengthC2Ev'}
+{'type': 'I', 'name': '__ZNSt16bad_array_lengthD0Ev'}
+{'type': 'U', 'name': '__ZNSt16bad_array_lengthD0Ev'}
+{'type': 'I', 'name': '__ZNSt16bad_array_lengthD1Ev'}
+{'type': 'U', 'name': '__ZNSt16bad_array_lengthD1Ev'}
+{'type': 'I', 'name': '__ZNSt16bad_array_lengthD2Ev'}
+{'type': 'U', 'name': '__ZNSt16bad_array_lengthD2Ev'}
+{'type': 'I', 'name': '__ZNSt16invalid_argumentD0Ev'}
+{'type': 'U', 'name': '__ZNSt16invalid_argumentD0Ev'}
+{'type': 'I', 'name': '__ZNSt16invalid_argumentD1Ev'}
+{'type': 'U', 'name': '__ZNSt16invalid_argumentD1Ev'}
+{'type': 'I', 'name': '__ZNSt16invalid_argumentD2Ev'}
+{'type': 'U', 'name': '__ZNSt16invalid_argumentD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt16nested_exceptionC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt16nested_exceptionC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt16nested_exceptionD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt16nested_exceptionD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt16nested_exceptionD2Ev'}
+{'type': 'I', 'name': '__ZNSt20bad_array_new_lengthC1Ev'}
+{'type': 'U', 'name': '__ZNSt20bad_array_new_lengthC1Ev'}
+{'type': 'I', 'name': '__ZNSt20bad_array_new_lengthC2Ev'}
+{'type': 'U', 'name': '__ZNSt20bad_array_new_lengthC2Ev'}
+{'type': 'I', 'name': '__ZNSt20bad_array_new_lengthD0Ev'}
+{'type': 'U', 'name': '__ZNSt20bad_array_new_lengthD0Ev'}
+{'type': 'I', 'name': '__ZNSt20bad_array_new_lengthD1Ev'}
+{'type': 'U', 'name': '__ZNSt20bad_array_new_lengthD1Ev'}
+{'type': 'I', 'name': '__ZNSt20bad_array_new_lengthD2Ev'}
+{'type': 'U', 'name': '__ZNSt20bad_array_new_lengthD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__110adopt_lockE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5alnumE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5alphaE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5blankE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5cntrlE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5digitE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5graphE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5lowerE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5printE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5punctE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5spaceE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5upperE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base6xdigitE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110defer_lockE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110istrstreamD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIcLb0EE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIcLb1EE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIwLb0EE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIwLb1EE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110ostrstreamD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEd'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEe'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEf'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEx'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEy'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__call_onceERVmPvPFvS2_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db10__insert_cEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db10__insert_iEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db11__insert_icEPvPKv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db15__iterator_copyEPvPKv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db16__invalidate_allEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db4swapEPvS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db9__erase_cEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db9__erase_iEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_dbC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_dbC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_dbD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_dbD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i'}
+{'type': 'FUNC', 'name': '__ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__111regex_errorD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111regex_errorD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111regex_errorD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutexD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutexD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__111try_to_lockE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__112__do_nothingEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__get_sp_mutEPKv'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__next_primeEm'}
+{'type': 'OBJECT', 'name': '__ZNSt3__112__rs_default4__c_E', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultC1ERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultC2ERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultclEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__112bad_weak_ptrD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112bad_weak_ptrD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112bad_weak_ptrD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'OBJECT', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'OBJECT', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112future_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112future_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112future_errorD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112future_errorD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112future_errorD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_1E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_2E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_3E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_4E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_5E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_6E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_7E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_8E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_9E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders3_10E', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf3strEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf4swapERS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf6__initEPclS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf6freezeEb'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf8overflowEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf9pbackfailEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf9underflowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPKal'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPKcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPKhl'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPalS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPclS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPhlS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1El'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPKal'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPKcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPKhl'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPalS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPclS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPhlS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2El'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__113allocator_argE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreEli'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy'}
+{'type': 'FUNC', 'name': '__ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113random_deviceD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113random_deviceD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113random_deviceclEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113shared_futureIvED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113shared_futureIvED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113shared_futureIvEaSERKS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__get_const_dbEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE'}
+{'type': 'OBJECT', 'name': '__ZNSt3__114__num_get_base5__srcE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__114__num_put_base12__format_intEPcPKcbj'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__num_put_base14__format_floatEPcPKcj'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__shared_count12__add_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__shared_count16__release_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__shared_countD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__shared_countD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__shared_countD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114error_categoryC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114error_categoryD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114error_categoryD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114error_categoryD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__get_classnameEPKcb'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_structC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_structC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_structD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_structD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115future_categoryEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcE6__initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwE6__initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutex4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutexC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutexC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutexD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutexD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115system_categoryEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116generic_categoryEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state12__make_readyEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state16__on_zero_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state4copyEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state4waitEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state9__executeEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state9set_valueEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117declare_reachableEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117iostream_categoryEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcEC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcEC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwEC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwEC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variable10notify_allEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variable10notify_oneEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variableD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variableD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__118get_pointer_safetyEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex11lock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex13unlock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex15try_lock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base11lock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base13unlock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base15try_lock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_baseC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_baseC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_count10__add_weakEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_count12__add_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_count14__release_weakEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_count16__release_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_count4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_countD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_countD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_countD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__119__start_std_streamsE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__119__thread_local_dataEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119declare_no_pointersEPcm'}
+{'type': 'OBJECT', 'name': '__ZNSt3__119piecewise_constructE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__120__get_collation_nameEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__120__throw_system_errorEiPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__121__throw_runtime_errorEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__121__undeclare_reachableEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutexD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutexD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__121undeclare_no_pointersEPcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_'}
+{'type': 'OBJECT', 'name': '__ZNSt3__13cinE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__14cerrE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__14clogE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__14coutE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'name': '__ZNSt3__14wcinE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__15alignEmmRPvRm'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcE13classic_tableEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcEC1EPKjbm'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcEC2EPKjbm'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__15ctypeIwE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIwED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15mutex4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__15mutex6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__15mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__15mutexD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15mutexD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'name': '__ZNSt3__15wcerrE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__15wclogE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__15wcoutE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16chrono12steady_clock3nowEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16chrono12system_clock11from_time_tEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__16chrono12system_clock3nowEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__16chrono12system_clock9is_steadyE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__16futureIvE3getEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '__ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '__ZNSt3__16futureIvED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16futureIvED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16gslice6__initEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale2id5__getEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale2id6__initEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale2id9__next_idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale3allE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale4noneE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale4timeE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale5ctypeE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale5facet16__on_zero_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale5facetD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale5facetD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale5facetD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale6globalERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale7classicEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale7collateE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale7numericE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale8__globalEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale8messagesE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale8monetaryE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1ERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1ERKS0_PKci'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1ERKS0_S2_i'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2ERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2ERKS0_PKci'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2ERKS0_S2_i'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeaSERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__16thread20hardware_concurrencyEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16thread4joinEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16thread6detachEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16threadD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16threadD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17collateIcE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIcED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17collateIwE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIwED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvE10get_futureEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvE24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvE9set_valueEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvEC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvEC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__c_node5__addEPNS_8__i_nodeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__c_nodeD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__c_nodeD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__c_nodeD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__get_dbEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__i_nodeD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__i_nodeD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__rs_getEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__sp_mut4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__sp_mut6unlockEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base10floatfieldE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base10scientificE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base11adjustfieldE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base15sync_with_stdioEb'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base16__call_callbacksENS0_5eventE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base2inE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3appE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3ateE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3decE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3hexE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3octE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3outE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4InitC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4InitC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4InitD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4InitD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4initEPv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base4leftE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4moveERS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4swapERS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base5clearEj'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base5fixedE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base5iwordEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base5pwordEi'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base5rightE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base5truncE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base6badbitE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base6binaryE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base6eofbitE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base6skipwsE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base6xallocEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7copyfmtERKS0_'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base7failbitE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base7goodbitE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base7showposE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base7unitbufE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base8internalE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base8showbaseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base9__xindex_E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base9basefieldE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base9boolalphaE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base9showpointE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base9uppercaseE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_baseD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_baseD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_baseD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18messagesIcE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18messagesIwE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18numpunctIcE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIcEC1Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIcEC2Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIcED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18numpunctIwE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIwEC1Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIwEC2Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIwED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18valarrayImE6resizeEmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__18valarrayImEC1Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18valarrayImEC2Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18valarrayImED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18valarrayImED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'}
+{'type': 'OBJECT', 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'}
+{'type': 'OBJECT', 'name': '__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19strstreamD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEd'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEe'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEf'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEx'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEy'}
+{'type': 'FUNC', 'name': '__ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_'}
+{'type': 'I', 'name': '__ZNSt8bad_castC1Ev'}
+{'type': 'U', 'name': '__ZNSt8bad_castC1Ev'}
+{'type': 'I', 'name': '__ZNSt8bad_castC2Ev'}
+{'type': 'U', 'name': '__ZNSt8bad_castC2Ev'}
+{'type': 'I', 'name': '__ZNSt8bad_castD0Ev'}
+{'type': 'U', 'name': '__ZNSt8bad_castD0Ev'}
+{'type': 'I', 'name': '__ZNSt8bad_castD1Ev'}
+{'type': 'U', 'name': '__ZNSt8bad_castD1Ev'}
+{'type': 'I', 'name': '__ZNSt8bad_castD2Ev'}
+{'type': 'U', 'name': '__ZNSt8bad_castD2Ev'}
+{'type': 'I', 'name': '__ZNSt9bad_allocC1Ev'}
+{'type': 'U', 'name': '__ZNSt9bad_allocC1Ev'}
+{'type': 'I', 'name': '__ZNSt9bad_allocC2Ev'}
+{'type': 'U', 'name': '__ZNSt9bad_allocC2Ev'}
+{'type': 'I', 'name': '__ZNSt9bad_allocD0Ev'}
+{'type': 'U', 'name': '__ZNSt9bad_allocD0Ev'}
+{'type': 'I', 'name': '__ZNSt9bad_allocD1Ev'}
+{'type': 'U', 'name': '__ZNSt9bad_allocD1Ev'}
+{'type': 'I', 'name': '__ZNSt9bad_allocD2Ev'}
+{'type': 'U', 'name': '__ZNSt9bad_allocD2Ev'}
+{'type': 'I', 'name': '__ZNSt9exceptionD0Ev'}
+{'type': 'U', 'name': '__ZNSt9exceptionD0Ev'}
+{'type': 'I', 'name': '__ZNSt9exceptionD1Ev'}
+{'type': 'U', 'name': '__ZNSt9exceptionD1Ev'}
+{'type': 'I', 'name': '__ZNSt9exceptionD2Ev'}
+{'type': 'U', 'name': '__ZNSt9exceptionD2Ev'}
+{'type': 'I', 'name': '__ZNSt9type_infoD0Ev'}
+{'type': 'U', 'name': '__ZNSt9type_infoD0Ev'}
+{'type': 'I', 'name': '__ZNSt9type_infoD1Ev'}
+{'type': 'U', 'name': '__ZNSt9type_infoD1Ev'}
+{'type': 'I', 'name': '__ZNSt9type_infoD2Ev'}
+{'type': 'U', 'name': '__ZNSt9type_infoD2Ev'}
+{'type': 'I', 'name': '__ZSt10unexpectedv'}
+{'type': 'U', 'name': '__ZSt10unexpectedv'}
+{'type': 'I', 'name': '__ZSt13get_terminatev'}
+{'type': 'U', 'name': '__ZSt13get_terminatev'}
+{'type': 'I', 'name': '__ZSt13set_terminatePFvvE'}
+{'type': 'U', 'name': '__ZSt13set_terminatePFvvE'}
+{'type': 'I', 'name': '__ZSt14get_unexpectedv'}
+{'type': 'U', 'name': '__ZSt14get_unexpectedv'}
+{'type': 'I', 'name': '__ZSt14set_unexpectedPFvvE'}
+{'type': 'U', 'name': '__ZSt14set_unexpectedPFvvE'}
+{'type': 'I', 'name': '__ZSt15get_new_handlerv'}
+{'type': 'U', 'name': '__ZSt15get_new_handlerv'}
+{'type': 'I', 'name': '__ZSt15set_new_handlerPFvvE'}
+{'type': 'U', 'name': '__ZSt15set_new_handlerPFvvE'}
+{'type': 'FUNC', 'name': '__ZSt17__throw_bad_allocv'}
+{'type': 'FUNC', 'name': '__ZSt17current_exceptionv'}
+{'type': 'FUNC', 'name': '__ZSt17rethrow_exceptionSt13exception_ptr'}
+{'type': 'FUNC', 'name': '__ZSt18uncaught_exceptionv'}
+{'type': 'FUNC', 'name': '__ZSt19uncaught_exceptionsv'}
+{'type': 'OBJECT', 'name': '__ZSt7nothrow', 'size': 0}
+{'type': 'I', 'name': '__ZSt9terminatev'}
+{'type': 'U', 'name': '__ZSt9terminatev'}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'I', 'name': '__ZTIDi'}
+{'type': 'U', 'name': '__ZTIDi'}
+{'type': 'I', 'name': '__ZTIDn'}
+{'type': 'U', 'name': '__ZTIDn'}
+{'type': 'I', 'name': '__ZTIDs'}
+{'type': 'U', 'name': '__ZTIDs'}
+{'type': 'OBJECT', 'name': '__ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110__time_getE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110__time_putE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110ctype_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110money_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__111__money_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__111__money_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__111__money_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__111__money_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112codecvt_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__113messages_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__codecvt_utf8IDiEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__codecvt_utf8IDsEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__codecvt_utf8IwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__num_get_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__num_put_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__shared_countE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117__assoc_sub_stateE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__118__time_get_storageIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__118__time_get_storageIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__119__shared_weak_countE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__120__time_get_c_storageIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__120__time_get_c_storageIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19__num_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19__num_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19__num_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19__num_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19strstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19time_baseE', 'size': 0}
+{'type': 'I', 'name': '__ZTIPDi'}
+{'type': 'U', 'name': '__ZTIPDi'}
+{'type': 'I', 'name': '__ZTIPDn'}
+{'type': 'U', 'name': '__ZTIPDn'}
+{'type': 'I', 'name': '__ZTIPDs'}
+{'type': 'U', 'name': '__ZTIPDs'}
+{'type': 'I', 'name': '__ZTIPKDi'}
+{'type': 'U', 'name': '__ZTIPKDi'}
+{'type': 'I', 'name': '__ZTIPKDn'}
+{'type': 'U', 'name': '__ZTIPKDn'}
+{'type': 'I', 'name': '__ZTIPKDs'}
+{'type': 'U', 'name': '__ZTIPKDs'}
+{'type': 'I', 'name': '__ZTIPKa'}
+{'type': 'U', 'name': '__ZTIPKa'}
+{'type': 'I', 'name': '__ZTIPKb'}
+{'type': 'U', 'name': '__ZTIPKb'}
+{'type': 'I', 'name': '__ZTIPKc'}
+{'type': 'U', 'name': '__ZTIPKc'}
+{'type': 'I', 'name': '__ZTIPKd'}
+{'type': 'U', 'name': '__ZTIPKd'}
+{'type': 'I', 'name': '__ZTIPKe'}
+{'type': 'U', 'name': '__ZTIPKe'}
+{'type': 'I', 'name': '__ZTIPKf'}
+{'type': 'U', 'name': '__ZTIPKf'}
+{'type': 'I', 'name': '__ZTIPKh'}
+{'type': 'U', 'name': '__ZTIPKh'}
+{'type': 'I', 'name': '__ZTIPKi'}
+{'type': 'U', 'name': '__ZTIPKi'}
+{'type': 'I', 'name': '__ZTIPKj'}
+{'type': 'U', 'name': '__ZTIPKj'}
+{'type': 'I', 'name': '__ZTIPKl'}
+{'type': 'U', 'name': '__ZTIPKl'}
+{'type': 'I', 'name': '__ZTIPKm'}
+{'type': 'U', 'name': '__ZTIPKm'}
+{'type': 'I', 'name': '__ZTIPKs'}
+{'type': 'U', 'name': '__ZTIPKs'}
+{'type': 'I', 'name': '__ZTIPKt'}
+{'type': 'U', 'name': '__ZTIPKt'}
+{'type': 'I', 'name': '__ZTIPKv'}
+{'type': 'U', 'name': '__ZTIPKv'}
+{'type': 'I', 'name': '__ZTIPKw'}
+{'type': 'U', 'name': '__ZTIPKw'}
+{'type': 'I', 'name': '__ZTIPKx'}
+{'type': 'U', 'name': '__ZTIPKx'}
+{'type': 'I', 'name': '__ZTIPKy'}
+{'type': 'U', 'name': '__ZTIPKy'}
+{'type': 'I', 'name': '__ZTIPa'}
+{'type': 'U', 'name': '__ZTIPa'}
+{'type': 'I', 'name': '__ZTIPb'}
+{'type': 'U', 'name': '__ZTIPb'}
+{'type': 'I', 'name': '__ZTIPc'}
+{'type': 'U', 'name': '__ZTIPc'}
+{'type': 'I', 'name': '__ZTIPd'}
+{'type': 'U', 'name': '__ZTIPd'}
+{'type': 'I', 'name': '__ZTIPe'}
+{'type': 'U', 'name': '__ZTIPe'}
+{'type': 'I', 'name': '__ZTIPf'}
+{'type': 'U', 'name': '__ZTIPf'}
+{'type': 'I', 'name': '__ZTIPh'}
+{'type': 'U', 'name': '__ZTIPh'}
+{'type': 'I', 'name': '__ZTIPi'}
+{'type': 'U', 'name': '__ZTIPi'}
+{'type': 'I', 'name': '__ZTIPj'}
+{'type': 'U', 'name': '__ZTIPj'}
+{'type': 'I', 'name': '__ZTIPl'}
+{'type': 'U', 'name': '__ZTIPl'}
+{'type': 'I', 'name': '__ZTIPm'}
+{'type': 'U', 'name': '__ZTIPm'}
+{'type': 'I', 'name': '__ZTIPs'}
+{'type': 'U', 'name': '__ZTIPs'}
+{'type': 'I', 'name': '__ZTIPt'}
+{'type': 'U', 'name': '__ZTIPt'}
+{'type': 'I', 'name': '__ZTIPv'}
+{'type': 'U', 'name': '__ZTIPv'}
+{'type': 'I', 'name': '__ZTIPw'}
+{'type': 'U', 'name': '__ZTIPw'}
+{'type': 'I', 'name': '__ZTIPx'}
+{'type': 'U', 'name': '__ZTIPx'}
+{'type': 'I', 'name': '__ZTIPy'}
+{'type': 'U', 'name': '__ZTIPy'}
+{'type': 'I', 'name': '__ZTISt10bad_typeid'}
+{'type': 'U', 'name': '__ZTISt10bad_typeid'}
+{'type': 'I', 'name': '__ZTISt11logic_error'}
+{'type': 'U', 'name': '__ZTISt11logic_error'}
+{'type': 'I', 'name': '__ZTISt11range_error'}
+{'type': 'U', 'name': '__ZTISt11range_error'}
+{'type': 'I', 'name': '__ZTISt12domain_error'}
+{'type': 'U', 'name': '__ZTISt12domain_error'}
+{'type': 'I', 'name': '__ZTISt12length_error'}
+{'type': 'U', 'name': '__ZTISt12length_error'}
+{'type': 'I', 'name': '__ZTISt12out_of_range'}
+{'type': 'U', 'name': '__ZTISt12out_of_range'}
+{'type': 'I', 'name': '__ZTISt13bad_exception'}
+{'type': 'U', 'name': '__ZTISt13bad_exception'}
+{'type': 'I', 'name': '__ZTISt13runtime_error'}
+{'type': 'U', 'name': '__ZTISt13runtime_error'}
+{'type': 'I', 'name': '__ZTISt14overflow_error'}
+{'type': 'U', 'name': '__ZTISt14overflow_error'}
+{'type': 'I', 'name': '__ZTISt15underflow_error'}
+{'type': 'U', 'name': '__ZTISt15underflow_error'}
+{'type': 'I', 'name': '__ZTISt16bad_array_length'}
+{'type': 'U', 'name': '__ZTISt16bad_array_length'}
+{'type': 'I', 'name': '__ZTISt16invalid_argument'}
+{'type': 'U', 'name': '__ZTISt16invalid_argument'}
+{'type': 'OBJECT', 'name': '__ZTISt16nested_exception', 'size': 0}
+{'type': 'I', 'name': '__ZTISt20bad_array_new_length'}
+{'type': 'U', 'name': '__ZTISt20bad_array_new_length'}
+{'type': 'I', 'name': '__ZTISt8bad_cast'}
+{'type': 'U', 'name': '__ZTISt8bad_cast'}
+{'type': 'I', 'name': '__ZTISt9bad_alloc'}
+{'type': 'U', 'name': '__ZTISt9bad_alloc'}
+{'type': 'I', 'name': '__ZTISt9exception'}
+{'type': 'U', 'name': '__ZTISt9exception'}
+{'type': 'I', 'name': '__ZTISt9type_info'}
+{'type': 'U', 'name': '__ZTISt9type_info'}
+{'type': 'I', 'name': '__ZTIa'}
+{'type': 'U', 'name': '__ZTIa'}
+{'type': 'I', 'name': '__ZTIb'}
+{'type': 'U', 'name': '__ZTIb'}
+{'type': 'I', 'name': '__ZTIc'}
+{'type': 'U', 'name': '__ZTIc'}
+{'type': 'I', 'name': '__ZTId'}
+{'type': 'U', 'name': '__ZTId'}
+{'type': 'I', 'name': '__ZTIe'}
+{'type': 'U', 'name': '__ZTIe'}
+{'type': 'I', 'name': '__ZTIf'}
+{'type': 'U', 'name': '__ZTIf'}
+{'type': 'I', 'name': '__ZTIh'}
+{'type': 'U', 'name': '__ZTIh'}
+{'type': 'I', 'name': '__ZTIi'}
+{'type': 'U', 'name': '__ZTIi'}
+{'type': 'I', 'name': '__ZTIj'}
+{'type': 'U', 'name': '__ZTIj'}
+{'type': 'I', 'name': '__ZTIl'}
+{'type': 'U', 'name': '__ZTIl'}
+{'type': 'I', 'name': '__ZTIm'}
+{'type': 'U', 'name': '__ZTIm'}
+{'type': 'I', 'name': '__ZTIs'}
+{'type': 'U', 'name': '__ZTIs'}
+{'type': 'I', 'name': '__ZTIt'}
+{'type': 'U', 'name': '__ZTIt'}
+{'type': 'I', 'name': '__ZTIv'}
+{'type': 'U', 'name': '__ZTIv'}
+{'type': 'I', 'name': '__ZTIw'}
+{'type': 'U', 'name': '__ZTIw'}
+{'type': 'I', 'name': '__ZTIx'}
+{'type': 'U', 'name': '__ZTIx'}
+{'type': 'I', 'name': '__ZTIy'}
+{'type': 'U', 'name': '__ZTIy'}
+{'type': 'I', 'name': '__ZTSDi'}
+{'type': 'U', 'name': '__ZTSDi'}
+{'type': 'I', 'name': '__ZTSDn'}
+{'type': 'U', 'name': '__ZTSDn'}
+{'type': 'I', 'name': '__ZTSDs'}
+{'type': 'U', 'name': '__ZTSDs'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv117__array_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv117__array_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv117__class_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv117__class_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv120__function_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv120__function_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'OBJECT', 'name': '__ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110ctype_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110money_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112codecvt_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__113messages_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19__num_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19__num_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19__num_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19__num_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19strstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19time_baseE', 'size': 0}
+{'type': 'I', 'name': '__ZTSPDi'}
+{'type': 'U', 'name': '__ZTSPDi'}
+{'type': 'I', 'name': '__ZTSPDn'}
+{'type': 'U', 'name': '__ZTSPDn'}
+{'type': 'I', 'name': '__ZTSPDs'}
+{'type': 'U', 'name': '__ZTSPDs'}
+{'type': 'I', 'name': '__ZTSPKDi'}
+{'type': 'U', 'name': '__ZTSPKDi'}
+{'type': 'I', 'name': '__ZTSPKDn'}
+{'type': 'U', 'name': '__ZTSPKDn'}
+{'type': 'I', 'name': '__ZTSPKDs'}
+{'type': 'U', 'name': '__ZTSPKDs'}
+{'type': 'I', 'name': '__ZTSPKa'}
+{'type': 'U', 'name': '__ZTSPKa'}
+{'type': 'I', 'name': '__ZTSPKb'}
+{'type': 'U', 'name': '__ZTSPKb'}
+{'type': 'I', 'name': '__ZTSPKc'}
+{'type': 'U', 'name': '__ZTSPKc'}
+{'type': 'I', 'name': '__ZTSPKd'}
+{'type': 'U', 'name': '__ZTSPKd'}
+{'type': 'I', 'name': '__ZTSPKe'}
+{'type': 'U', 'name': '__ZTSPKe'}
+{'type': 'I', 'name': '__ZTSPKf'}
+{'type': 'U', 'name': '__ZTSPKf'}
+{'type': 'I', 'name': '__ZTSPKh'}
+{'type': 'U', 'name': '__ZTSPKh'}
+{'type': 'I', 'name': '__ZTSPKi'}
+{'type': 'U', 'name': '__ZTSPKi'}
+{'type': 'I', 'name': '__ZTSPKj'}
+{'type': 'U', 'name': '__ZTSPKj'}
+{'type': 'I', 'name': '__ZTSPKl'}
+{'type': 'U', 'name': '__ZTSPKl'}
+{'type': 'I', 'name': '__ZTSPKm'}
+{'type': 'U', 'name': '__ZTSPKm'}
+{'type': 'I', 'name': '__ZTSPKs'}
+{'type': 'U', 'name': '__ZTSPKs'}
+{'type': 'I', 'name': '__ZTSPKt'}
+{'type': 'U', 'name': '__ZTSPKt'}
+{'type': 'I', 'name': '__ZTSPKv'}
+{'type': 'U', 'name': '__ZTSPKv'}
+{'type': 'I', 'name': '__ZTSPKw'}
+{'type': 'U', 'name': '__ZTSPKw'}
+{'type': 'I', 'name': '__ZTSPKx'}
+{'type': 'U', 'name': '__ZTSPKx'}
+{'type': 'I', 'name': '__ZTSPKy'}
+{'type': 'U', 'name': '__ZTSPKy'}
+{'type': 'I', 'name': '__ZTSPa'}
+{'type': 'U', 'name': '__ZTSPa'}
+{'type': 'I', 'name': '__ZTSPb'}
+{'type': 'U', 'name': '__ZTSPb'}
+{'type': 'I', 'name': '__ZTSPc'}
+{'type': 'U', 'name': '__ZTSPc'}
+{'type': 'I', 'name': '__ZTSPd'}
+{'type': 'U', 'name': '__ZTSPd'}
+{'type': 'I', 'name': '__ZTSPe'}
+{'type': 'U', 'name': '__ZTSPe'}
+{'type': 'I', 'name': '__ZTSPf'}
+{'type': 'U', 'name': '__ZTSPf'}
+{'type': 'I', 'name': '__ZTSPh'}
+{'type': 'U', 'name': '__ZTSPh'}
+{'type': 'I', 'name': '__ZTSPi'}
+{'type': 'U', 'name': '__ZTSPi'}
+{'type': 'I', 'name': '__ZTSPj'}
+{'type': 'U', 'name': '__ZTSPj'}
+{'type': 'I', 'name': '__ZTSPl'}
+{'type': 'U', 'name': '__ZTSPl'}
+{'type': 'I', 'name': '__ZTSPm'}
+{'type': 'U', 'name': '__ZTSPm'}
+{'type': 'I', 'name': '__ZTSPs'}
+{'type': 'U', 'name': '__ZTSPs'}
+{'type': 'I', 'name': '__ZTSPt'}
+{'type': 'U', 'name': '__ZTSPt'}
+{'type': 'I', 'name': '__ZTSPv'}
+{'type': 'U', 'name': '__ZTSPv'}
+{'type': 'I', 'name': '__ZTSPw'}
+{'type': 'U', 'name': '__ZTSPw'}
+{'type': 'I', 'name': '__ZTSPx'}
+{'type': 'U', 'name': '__ZTSPx'}
+{'type': 'I', 'name': '__ZTSPy'}
+{'type': 'U', 'name': '__ZTSPy'}
+{'type': 'I', 'name': '__ZTSSt10bad_typeid'}
+{'type': 'U', 'name': '__ZTSSt10bad_typeid'}
+{'type': 'I', 'name': '__ZTSSt11logic_error'}
+{'type': 'U', 'name': '__ZTSSt11logic_error'}
+{'type': 'I', 'name': '__ZTSSt11range_error'}
+{'type': 'U', 'name': '__ZTSSt11range_error'}
+{'type': 'I', 'name': '__ZTSSt12domain_error'}
+{'type': 'U', 'name': '__ZTSSt12domain_error'}
+{'type': 'I', 'name': '__ZTSSt12length_error'}
+{'type': 'U', 'name': '__ZTSSt12length_error'}
+{'type': 'I', 'name': '__ZTSSt12out_of_range'}
+{'type': 'U', 'name': '__ZTSSt12out_of_range'}
+{'type': 'I', 'name': '__ZTSSt13bad_exception'}
+{'type': 'U', 'name': '__ZTSSt13bad_exception'}
+{'type': 'I', 'name': '__ZTSSt13runtime_error'}
+{'type': 'U', 'name': '__ZTSSt13runtime_error'}
+{'type': 'I', 'name': '__ZTSSt14overflow_error'}
+{'type': 'U', 'name': '__ZTSSt14overflow_error'}
+{'type': 'I', 'name': '__ZTSSt15underflow_error'}
+{'type': 'U', 'name': '__ZTSSt15underflow_error'}
+{'type': 'I', 'name': '__ZTSSt16bad_array_length'}
+{'type': 'U', 'name': '__ZTSSt16bad_array_length'}
+{'type': 'I', 'name': '__ZTSSt16invalid_argument'}
+{'type': 'U', 'name': '__ZTSSt16invalid_argument'}
+{'type': 'OBJECT', 'name': '__ZTSSt16nested_exception', 'size': 0}
+{'type': 'I', 'name': '__ZTSSt20bad_array_new_length'}
+{'type': 'U', 'name': '__ZTSSt20bad_array_new_length'}
+{'type': 'I', 'name': '__ZTSSt8bad_cast'}
+{'type': 'U', 'name': '__ZTSSt8bad_cast'}
+{'type': 'I', 'name': '__ZTSSt9bad_alloc'}
+{'type': 'U', 'name': '__ZTSSt9bad_alloc'}
+{'type': 'I', 'name': '__ZTSSt9exception'}
+{'type': 'U', 'name': '__ZTSSt9exception'}
+{'type': 'I', 'name': '__ZTSSt9type_info'}
+{'type': 'U', 'name': '__ZTSSt9type_info'}
+{'type': 'I', 'name': '__ZTSa'}
+{'type': 'U', 'name': '__ZTSa'}
+{'type': 'I', 'name': '__ZTSb'}
+{'type': 'U', 'name': '__ZTSb'}
+{'type': 'I', 'name': '__ZTSc'}
+{'type': 'U', 'name': '__ZTSc'}
+{'type': 'I', 'name': '__ZTSd'}
+{'type': 'U', 'name': '__ZTSd'}
+{'type': 'I', 'name': '__ZTSe'}
+{'type': 'U', 'name': '__ZTSe'}
+{'type': 'I', 'name': '__ZTSf'}
+{'type': 'U', 'name': '__ZTSf'}
+{'type': 'I', 'name': '__ZTSh'}
+{'type': 'U', 'name': '__ZTSh'}
+{'type': 'I', 'name': '__ZTSi'}
+{'type': 'U', 'name': '__ZTSi'}
+{'type': 'I', 'name': '__ZTSj'}
+{'type': 'U', 'name': '__ZTSj'}
+{'type': 'I', 'name': '__ZTSl'}
+{'type': 'U', 'name': '__ZTSl'}
+{'type': 'I', 'name': '__ZTSm'}
+{'type': 'U', 'name': '__ZTSm'}
+{'type': 'I', 'name': '__ZTSs'}
+{'type': 'U', 'name': '__ZTSs'}
+{'type': 'I', 'name': '__ZTSt'}
+{'type': 'U', 'name': '__ZTSt'}
+{'type': 'I', 'name': '__ZTSv'}
+{'type': 'U', 'name': '__ZTSv'}
+{'type': 'I', 'name': '__ZTSw'}
+{'type': 'U', 'name': '__ZTSw'}
+{'type': 'I', 'name': '__ZTSx'}
+{'type': 'U', 'name': '__ZTSx'}
+{'type': 'I', 'name': '__ZTSy'}
+{'type': 'U', 'name': '__ZTSy'}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__19strstreamE', 'size': 0}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv117__array_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv117__array_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv117__class_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv117__class_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv120__function_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv120__function_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'OBJECT', 'name': '__ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114__codecvt_utf8IwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114__shared_countE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117__assoc_sub_stateE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__119__shared_weak_countE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19strstreamE', 'size': 0}
+{'type': 'I', 'name': '__ZTVSt10bad_typeid'}
+{'type': 'U', 'name': '__ZTVSt10bad_typeid'}
+{'type': 'I', 'name': '__ZTVSt11logic_error'}
+{'type': 'U', 'name': '__ZTVSt11logic_error'}
+{'type': 'I', 'name': '__ZTVSt11range_error'}
+{'type': 'U', 'name': '__ZTVSt11range_error'}
+{'type': 'I', 'name': '__ZTVSt12domain_error'}
+{'type': 'U', 'name': '__ZTVSt12domain_error'}
+{'type': 'I', 'name': '__ZTVSt12length_error'}
+{'type': 'U', 'name': '__ZTVSt12length_error'}
+{'type': 'I', 'name': '__ZTVSt12out_of_range'}
+{'type': 'U', 'name': '__ZTVSt12out_of_range'}
+{'type': 'I', 'name': '__ZTVSt13bad_exception'}
+{'type': 'U', 'name': '__ZTVSt13bad_exception'}
+{'type': 'I', 'name': '__ZTVSt13runtime_error'}
+{'type': 'U', 'name': '__ZTVSt13runtime_error'}
+{'type': 'I', 'name': '__ZTVSt14overflow_error'}
+{'type': 'U', 'name': '__ZTVSt14overflow_error'}
+{'type': 'I', 'name': '__ZTVSt15underflow_error'}
+{'type': 'U', 'name': '__ZTVSt15underflow_error'}
+{'type': 'I', 'name': '__ZTVSt16bad_array_length'}
+{'type': 'U', 'name': '__ZTVSt16bad_array_length'}
+{'type': 'I', 'name': '__ZTVSt16invalid_argument'}
+{'type': 'U', 'name': '__ZTVSt16invalid_argument'}
+{'type': 'OBJECT', 'name': '__ZTVSt16nested_exception', 'size': 0}
+{'type': 'I', 'name': '__ZTVSt20bad_array_new_length'}
+{'type': 'U', 'name': '__ZTVSt20bad_array_new_length'}
+{'type': 'I', 'name': '__ZTVSt8bad_cast'}
+{'type': 'U', 'name': '__ZTVSt8bad_cast'}
+{'type': 'I', 'name': '__ZTVSt9bad_alloc'}
+{'type': 'U', 'name': '__ZTVSt9bad_alloc'}
+{'type': 'I', 'name': '__ZTVSt9exception'}
+{'type': 'U', 'name': '__ZTVSt9exception'}
+{'type': 'I', 'name': '__ZTVSt9type_info'}
+{'type': 'U', 'name': '__ZTVSt9type_info'}
+{'type': 'FUNC', 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZThn16_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZThn16_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZdaPv'}
+{'type': 'FUNC', 'name': '__ZdaPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '__ZdaPvm'}
+{'type': 'FUNC', 'name': '__ZdlPv'}
+{'type': 'FUNC', 'name': '__ZdlPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '__ZdlPvm'}
+{'type': 'FUNC', 'name': '__Znam'}
+{'type': 'FUNC', 'name': '__ZnamRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '__Znwm'}
+{'type': 'FUNC', 'name': '__ZnwmRKSt9nothrow_t'}
+{'type': 'U', 'name': '____mb_cur_max_l'}
+{'type': 'U', 'name': '____tolower_l'}
+{'type': 'U', 'name': '____toupper_l'}
+{'type': 'U', 'name': '___assert_rtn'}
+{'type': 'U', 'name': '___bzero'}
+{'type': 'I', 'name': '___cxa_allocate_exception'}
+{'type': 'U', 'name': '___cxa_allocate_exception'}
+{'type': 'U', 'name': '___cxa_atexit'}
+{'type': 'I', 'name': '___cxa_bad_cast'}
+{'type': 'U', 'name': '___cxa_bad_cast'}
+{'type': 'I', 'name': '___cxa_bad_typeid'}
+{'type': 'U', 'name': '___cxa_bad_typeid'}
+{'type': 'I', 'name': '___cxa_begin_catch'}
+{'type': 'U', 'name': '___cxa_begin_catch'}
+{'type': 'I', 'name': '___cxa_call_unexpected'}
+{'type': 'U', 'name': '___cxa_call_unexpected'}
+{'type': 'I', 'name': '___cxa_current_exception_type'}
+{'type': 'U', 'name': '___cxa_current_exception_type'}
+{'type': 'U', 'name': '___cxa_current_primary_exception'}
+{'type': 'U', 'name': '___cxa_decrement_exception_refcount'}
+{'type': 'I', 'name': '___cxa_demangle'}
+{'type': 'U', 'name': '___cxa_demangle'}
+{'type': 'I', 'name': '___cxa_end_catch'}
+{'type': 'U', 'name': '___cxa_end_catch'}
+{'type': 'I', 'name': '___cxa_free_exception'}
+{'type': 'U', 'name': '___cxa_free_exception'}
+{'type': 'I', 'name': '___cxa_get_exception_ptr'}
+{'type': 'U', 'name': '___cxa_get_exception_ptr'}
+{'type': 'I', 'name': '___cxa_get_globals'}
+{'type': 'U', 'name': '___cxa_get_globals'}
+{'type': 'I', 'name': '___cxa_get_globals_fast'}
+{'type': 'U', 'name': '___cxa_get_globals_fast'}
+{'type': 'I', 'name': '___cxa_guard_abort'}
+{'type': 'U', 'name': '___cxa_guard_abort'}
+{'type': 'I', 'name': '___cxa_guard_acquire'}
+{'type': 'U', 'name': '___cxa_guard_acquire'}
+{'type': 'I', 'name': '___cxa_guard_release'}
+{'type': 'U', 'name': '___cxa_guard_release'}
+{'type': 'U', 'name': '___cxa_increment_exception_refcount'}
+{'type': 'I', 'name': '___cxa_pure_virtual'}
+{'type': 'U', 'name': '___cxa_pure_virtual'}
+{'type': 'I', 'name': '___cxa_rethrow'}
+{'type': 'U', 'name': '___cxa_rethrow'}
+{'type': 'U', 'name': '___cxa_rethrow_primary_exception'}
+{'type': 'I', 'name': '___cxa_throw'}
+{'type': 'U', 'name': '___cxa_throw'}
+{'type': 'U', 'name': '___cxa_uncaught_exception'}
+{'type': 'I', 'name': '___cxa_vec_cctor'}
+{'type': 'U', 'name': '___cxa_vec_cctor'}
+{'type': 'I', 'name': '___cxa_vec_cleanup'}
+{'type': 'U', 'name': '___cxa_vec_cleanup'}
+{'type': 'I', 'name': '___cxa_vec_ctor'}
+{'type': 'U', 'name': '___cxa_vec_ctor'}
+{'type': 'I', 'name': '___cxa_vec_delete'}
+{'type': 'U', 'name': '___cxa_vec_delete'}
+{'type': 'I', 'name': '___cxa_vec_delete2'}
+{'type': 'U', 'name': '___cxa_vec_delete2'}
+{'type': 'I', 'name': '___cxa_vec_delete3'}
+{'type': 'U', 'name': '___cxa_vec_delete3'}
+{'type': 'I', 'name': '___cxa_vec_dtor'}
+{'type': 'U', 'name': '___cxa_vec_dtor'}
+{'type': 'I', 'name': '___cxa_vec_new'}
+{'type': 'U', 'name': '___cxa_vec_new'}
+{'type': 'I', 'name': '___cxa_vec_new2'}
+{'type': 'U', 'name': '___cxa_vec_new2'}
+{'type': 'I', 'name': '___cxa_vec_new3'}
+{'type': 'U', 'name': '___cxa_vec_new3'}
+{'type': 'I', 'name': '___dynamic_cast'}
+{'type': 'U', 'name': '___dynamic_cast'}
+{'type': 'U', 'name': '___error'}
+{'type': 'I', 'name': '___gxx_personality_v0'}
+{'type': 'U', 'name': '___gxx_personality_v0'}
+{'type': 'U', 'name': '___maskrune_l'}
+{'type': 'U', 'name': '___stack_chk_fail'}
+{'type': 'U', 'name': '___stack_chk_guard'}
+{'type': 'U', 'name': '___stderrp'}
+{'type': 'U', 'name': '___stdinp'}
+{'type': 'U', 'name': '___stdoutp'}
+{'type': 'U', 'name': '_abort'}
+{'type': 'U', 'name': '_asprintf_l'}
+{'type': 'U', 'name': '_btowc_l'}
+{'type': 'U', 'name': '_calloc'}
+{'type': 'U', 'name': '_catclose'}
+{'type': 'U', 'name': '_catgets'}
+{'type': 'U', 'name': '_catopen'}
+{'type': 'U', 'name': '_clock_gettime'}
+{'type': 'U', 'name': '_close'}
+{'type': 'U', 'name': '_dlopen'}
+{'type': 'U', 'name': '_dlsym'}
+{'type': 'U', 'name': '_fflush'}
+{'type': 'U', 'name': '_fprintf'}
+{'type': 'U', 'name': '_free'}
+{'type': 'U', 'name': '_freelocale'}
+{'type': 'U', 'name': '_fwrite'}
+{'type': 'U', 'name': '_getc'}
+{'type': 'U', 'name': '_localeconv_l'}
+{'type': 'U', 'name': '_malloc'}
+{'type': 'U', 'name': '_mbrlen_l'}
+{'type': 'U', 'name': '_mbrtowc_l'}
+{'type': 'U', 'name': '_mbsnrtowcs_l'}
+{'type': 'U', 'name': '_mbsrtowcs_l'}
+{'type': 'U', 'name': '_mbtowc_l'}
+{'type': 'U', 'name': '_memchr'}
+{'type': 'U', 'name': '_memcmp'}
+{'type': 'U', 'name': '_memcpy'}
+{'type': 'U', 'name': '_memmove'}
+{'type': 'U', 'name': '_memset'}
+{'type': 'U', 'name': '_nanosleep'}
+{'type': 'U', 'name': '_newlocale'}
+{'type': 'U', 'name': '_open'}
+{'type': 'U', 'name': '_pthread_cond_broadcast'}
+{'type': 'U', 'name': '_pthread_cond_destroy'}
+{'type': 'U', 'name': '_pthread_cond_signal'}
+{'type': 'U', 'name': '_pthread_cond_timedwait'}
+{'type': 'U', 'name': '_pthread_cond_wait'}
+{'type': 'U', 'name': '_pthread_detach'}
+{'type': 'U', 'name': '_pthread_equal'}
+{'type': 'U', 'name': '_pthread_getspecific'}
+{'type': 'U', 'name': '_pthread_join'}
+{'type': 'U', 'name': '_pthread_key_create'}
+{'type': 'U', 'name': '_pthread_mutex_destroy'}
+{'type': 'U', 'name': '_pthread_mutex_init'}
+{'type': 'U', 'name': '_pthread_mutex_lock'}
+{'type': 'U', 'name': '_pthread_mutex_trylock'}
+{'type': 'U', 'name': '_pthread_mutex_unlock'}
+{'type': 'U', 'name': '_pthread_mutexattr_destroy'}
+{'type': 'U', 'name': '_pthread_mutexattr_init'}
+{'type': 'U', 'name': '_pthread_mutexattr_settype'}
+{'type': 'U', 'name': '_pthread_self'}
+{'type': 'U', 'name': '_read'}
+{'type': 'U', 'name': '_realloc'}
+{'type': 'U', 'name': '_sched_yield'}
+{'type': 'U', 'name': '_setlocale'}
+{'type': 'U', 'name': '_snprintf'}
+{'type': 'U', 'name': '_snprintf_l'}
+{'type': 'U', 'name': '_sscanf'}
+{'type': 'U', 'name': '_sscanf_l'}
+{'type': 'U', 'name': '_strcmp'}
+{'type': 'U', 'name': '_strcoll_l'}
+{'type': 'U', 'name': '_strerror_r'}
+{'type': 'U', 'name': '_strftime_l'}
+{'type': 'U', 'name': '_strlen'}
+{'type': 'U', 'name': '_strtod'}
+{'type': 'U', 'name': '_strtod_l'}
+{'type': 'U', 'name': '_strtof'}
+{'type': 'U', 'name': '_strtof_l'}
+{'type': 'U', 'name': '_strtol'}
+{'type': 'U', 'name': '_strtold'}
+{'type': 'U', 'name': '_strtold_l'}
+{'type': 'U', 'name': '_strtoll'}
+{'type': 'U', 'name': '_strtoll_l'}
+{'type': 'U', 'name': '_strtoul'}
+{'type': 'U', 'name': '_strtoull'}
+{'type': 'U', 'name': '_strtoull_l'}
+{'type': 'U', 'name': '_strxfrm_l'}
+{'type': 'U', 'name': '_swprintf'}
+{'type': 'U', 'name': '_sysctl'}
+{'type': 'U', 'name': '_ungetc'}
+{'type': 'U', 'name': '_wcrtomb_l'}
+{'type': 'U', 'name': '_wcscoll_l'}
+{'type': 'U', 'name': '_wcslen'}
+{'type': 'U', 'name': '_wcsnrtombs_l'}
+{'type': 'U', 'name': '_wcstod'}
+{'type': 'U', 'name': '_wcstof'}
+{'type': 'U', 'name': '_wcstol'}
+{'type': 'U', 'name': '_wcstold'}
+{'type': 'U', 'name': '_wcstoll'}
+{'type': 'U', 'name': '_wcstoul'}
+{'type': 'U', 'name': '_wcstoull'}
+{'type': 'U', 'name': '_wcsxfrm_l'}
+{'type': 'U', 'name': '_wctob_l'}
+{'type': 'U', 'name': '_wmemchr'}
+{'type': 'U', 'name': '_wmemcmp'}
+{'type': 'U', 'name': '_wmemcpy'}
+{'type': 'U', 'name': '_wmemmove'}
+{'type': 'U', 'name': '_wmemset'}
+{'type': 'U', 'name': 'dyld_stub_binder'}
diff --git a/lib/abi/3.9/x86_64-linux-gnu.abilist b/lib/abi/3.9/x86_64-linux-gnu.abilist
new file mode 100644
index 000000000000..8edeffbcd346
--- /dev/null
+++ b/lib/abi/3.9/x86_64-linux-gnu.abilist
@@ -0,0 +1,2010 @@
+{'type': 'FUNC', 'name': '_Unwind_Resume@GCC_3.0'}
+{'type': 'FUNC', 'name': '_ZNKSt11logic_error4whatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt13runtime_error4whatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt16nested_exception14rethrow_nestedEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110error_code7messageEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db15__decrementableEPKv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db15__find_c_from_iEPv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db15__subscriptableEPKvl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db17__dereferenceableEPKv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db17__find_c_and_lockEPv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db8__find_cEPv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db9__addableEPKvl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112bad_weak_ptr4whatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_scan_isEtPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE11do_scan_notEtPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pt'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE5do_isEtw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEwc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112strstreambuf6pcountEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__113random_device7entropyEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114error_category10equivalentERKNS_10error_codeEi'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114error_category23default_error_conditionEi'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115error_condition7messageEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__118__time_get_storageIcE15__do_date_orderEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__118__time_get_storageIwE15__do_date_orderEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__XEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__cEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__rEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__xEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE7__am_pmEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE7__weeksEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE8__monthsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__XEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__cEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__rEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__xEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE7__am_pmEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE7__weeksEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE8__monthsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_tolowerEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_toupperEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE8do_widenEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE9do_narrowEcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_scan_isEtPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_tolowerEw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_toupperEw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE11do_scan_notEtPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE5do_isEPKwS3_Pt'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE5do_isEtw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE8do_widenEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE9do_narrowEwc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__16locale4nameEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__16locale9has_facetERNS0_2idE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__16locale9use_facetERNS0_2idE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__16localeeqERKS0_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIcE7do_hashEPKcS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIwE7do_hashEPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18ios_base6getlocEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIcE8do_closeEl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIwE8do_closeEl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE11do_truenameEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE12do_falsenameEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE11do_truenameEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE12do_falsenameEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC1ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC2ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_erroraSERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt12experimental15fundamentals_v112bad_any_castD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt12experimental19bad_optional_accessD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt12experimental19bad_optional_accessD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt12experimental19bad_optional_accessD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt12length_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt12out_of_rangeD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt13exception_ptrC1ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt13exception_ptrC2ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt13exception_ptrD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt13exception_ptrD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt13exception_ptraSERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC1ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC2ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_erroraSERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt14overflow_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16invalid_argumentD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16nested_exceptionC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16nested_exceptionC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16nested_exceptionD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16nested_exceptionD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16nested_exceptionD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__110adopt_lockE', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5alnumE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5alphaE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5blankE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5cntrlE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5digitE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5graphE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5lowerE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5printE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5punctE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5spaceE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5upperE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base6xdigitE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110defer_lockE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110istrstreamD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb0EE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb1EE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb0EE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb1EE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110ostrstreamD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEd'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEe'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEf'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEx'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEy'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__call_onceERVmPvPFvS2_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db10__insert_cEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db10__insert_iEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db11__insert_icEPvPKv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db15__iterator_copyEPvPKv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db16__invalidate_allEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db4swapEPvS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db9__erase_cEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db9__erase_iEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i'}
+{'type': 'FUNC', 'name': '_ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__111regex_errorD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111regex_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111regex_errorD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__111try_to_lockE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__112__do_nothingEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__get_sp_mutEPKv'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__next_primeEm'}
+{'type': 'OBJECT', 'name': '_ZNSt3__112__rs_default4__c_E', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC1ERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC2ERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultclEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__112bad_weak_ptrD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112bad_weak_ptrD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112bad_weak_ptrD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'OBJECT', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 8}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPKcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendIPcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertIPKcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPcEEE4typeENSB_IS8_EESA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceIPKcEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'OBJECT', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 8}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initIPKwEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendIPwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignIPwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertIPKwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPwEEE4typeENSB_IS8_EESA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceIPKwEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112future_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112future_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112future_errorD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112future_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112future_errorD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_1E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_2E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_3E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_4E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_5E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_6E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_7E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_8E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_9E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders3_10E', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf3strEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf4swapERS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf6__initEPclS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf6freezeEb'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf8overflowEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf9pbackfailEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf9underflowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPKal'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPKcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPKhl'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPalS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPclS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPhlS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1El'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPKal'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPKcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPKhl'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPalS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPclS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPhlS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2El'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__113allocator_argE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreElj'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy'}
+{'type': 'FUNC', 'name': '_ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113random_deviceD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113random_deviceD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113random_deviceclEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113shared_futureIvED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113shared_futureIvED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113shared_futureIvEaSERKS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__codecvt_utf8IDiED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__codecvt_utf8IDsED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__codecvt_utf8IwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__get_const_dbEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE'}
+{'type': 'OBJECT', 'name': '_ZNSt3__114__num_get_base5__srcE', 'size': 33}
+{'type': 'FUNC', 'name': '_ZNSt3__114__num_put_base12__format_intEPcPKcbj'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__num_put_base14__format_floatEPcPKcj'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__shared_count12__add_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__shared_count16__release_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__shared_countD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__shared_countD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__shared_countD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114error_categoryC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114error_categoryD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114error_categoryD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114error_categoryD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IDiLb0EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IDiLb1EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IDsLb0EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IDsLb1EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IwLb0EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IwLb1EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__get_classnameEPKcb'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__num_get_floatIdEET_PKcS3_Rj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__num_get_floatIeEET_PKcS3_Rj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__num_get_floatIfEET_PKcS3_Rj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_structC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_structC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_structD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_structD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115future_categoryEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcE6__initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwE6__initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutex4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115system_categoryEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116generic_categoryEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state12__make_readyEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state16__on_zero_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state4copyEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state4waitEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state9__executeEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state9set_valueEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_stateD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_stateD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__libcpp_sscanf_lEPKcP15__locale_structS1_z'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117declare_reachableEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117iostream_categoryEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variable10notify_allEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variable10notify_oneEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variableD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variableD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__118get_pointer_safetyEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex11lock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex13unlock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex15try_lock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__libcpp_asprintf_lEPPcP15__locale_structPKcz'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__libcpp_snprintf_lEPcmP15__locale_structPKcz'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base11lock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base13unlock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base15try_lock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_baseC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_baseC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count10__add_weakEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count12__add_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count14__release_weakEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count16__release_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_countD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_countD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_countD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__119__start_std_streamsE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__119__thread_local_dataEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119declare_no_pointersEPcm'}
+{'type': 'OBJECT', 'name': '_ZNSt3__119piecewise_constructE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__120__codecvt_utf8_utf16IDiED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__120__codecvt_utf8_utf16IDsED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__120__codecvt_utf8_utf16IwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__120__get_collation_nameEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__120__throw_system_errorEiPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__121__throw_runtime_errorEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__121__undeclare_reachableEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__121undeclare_no_pointersEPcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__125__num_get_signed_integralIlEET_PKcS3_Rji'}
+{'type': 'FUNC', 'name': '_ZNSt3__125__num_get_signed_integralIxEET_PKcS3_Rji'}
+{'type': 'FUNC', 'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralIjEET_PKcS3_Rji'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralImEET_PKcS3_Rji'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralItEET_PKcS3_Rji'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralIyEET_PKcS3_Rji'}
+{'type': 'OBJECT', 'name': '_ZNSt3__13cinE', 'size': 168}
+{'type': 'OBJECT', 'name': '_ZNSt3__14cerrE', 'size': 160}
+{'type': 'OBJECT', 'name': '_ZNSt3__14clogE', 'size': 160}
+{'type': 'OBJECT', 'name': '_ZNSt3__14coutE', 'size': 160}
+{'type': 'FUNC', 'name': '_ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'name': '_ZNSt3__14wcinE', 'size': 168}
+{'type': 'FUNC', 'name': '_ZNSt3__15alignEmmRPvRm'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcE13classic_tableEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcE21__classic_lower_tableEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcE21__classic_upper_tableEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__15ctypeIcE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcEC1EPKtbm'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcEC2EPKtbm'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__15ctypeIwE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIwED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15mutex4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__15mutex6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__15mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__15mutexD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15mutexD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'name': '_ZNSt3__15wcerrE', 'size': 160}
+{'type': 'OBJECT', 'name': '_ZNSt3__15wclogE', 'size': 160}
+{'type': 'OBJECT', 'name': '_ZNSt3__15wcoutE', 'size': 160}
+{'type': 'FUNC', 'name': '_ZNSt3__16__clocEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16chrono12steady_clock3nowEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__16chrono12system_clock11from_time_tEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__16chrono12system_clock3nowEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__16chrono12system_clock9is_steadyE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__16futureIvE3getEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '_ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '_ZNSt3__16futureIvED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16futureIvED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16gslice6__initEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale2id5__getEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale2id6__initEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale2id9__next_idE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale3allE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale4noneE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale4timeE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale5ctypeE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale5facet16__on_zero_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale5facetD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale5facetD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale5facetD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale6globalERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale7classicEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale7collateE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale7numericE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale8__globalEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale8messagesE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale8monetaryE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_PKci'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_S2_i'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_PKci'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_S2_i'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeaSERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__16thread20hardware_concurrencyEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16thread4joinEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16thread6detachEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16threadD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16threadD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIaaEEPaEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIccEEPcEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIddEEPdEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIffEEPfEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIhhEEPhEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIiiEEPiEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIjjEEPjEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIllEEPlEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessImmEEPmEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIssEEPsEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIttEEPtEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIxxEEPxEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIyyEEPyEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17collateIcE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIcED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17collateIwE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIwED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE10get_futureEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE9set_valueEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvEC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvEC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__c_node5__addEPNS_8__i_nodeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__c_nodeD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__c_nodeD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__c_nodeD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__get_dbEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__i_nodeD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__i_nodeD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__rs_getEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__sp_mut4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__sp_mut6unlockEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base10floatfieldE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base10scientificE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base11adjustfieldE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base15sync_with_stdioEb'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base16__call_callbacksENS0_5eventE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base2inE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3appE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3ateE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3decE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3hexE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3octE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3outE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4initEPv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base4leftE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4moveERS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4swapERS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base5clearEj'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base5fixedE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base5iwordEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base5pwordEi'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base5rightE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base5truncE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6badbitE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6binaryE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6eofbitE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6skipwsE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base6xallocEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7copyfmtERKS0_'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7failbitE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7goodbitE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7showposE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7unitbufE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base8internalE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base8showbaseE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9__xindex_E', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9basefieldE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9boolalphaE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9showpointE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9uppercaseE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_baseD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_baseD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_baseD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18messagesIcE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__18messagesIwE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__18numpunctIcE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcEC1Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcEC2Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18numpunctIwE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwEC1Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwEC2Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__18valarrayImE6resizeEmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__18valarrayImEC1Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18valarrayImEC2Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18valarrayImED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18valarrayImED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'}
+{'type': 'OBJECT', 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'}
+{'type': 'OBJECT', 'name': '_ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19strstreamD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEd'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEe'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEf'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEx'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEy'}
+{'type': 'FUNC', 'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_'}
+{'type': 'FUNC', 'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_'}
+{'type': 'FUNC', 'name': '_ZNSt8bad_castC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt8bad_castD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt8bad_castD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt9bad_allocC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt9bad_allocD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt9exceptionD2Ev'}
+{'type': 'FUNC', 'name': '_ZSt15get_new_handlerv'}
+{'type': 'FUNC', 'name': '_ZSt17__throw_bad_allocv'}
+{'type': 'FUNC', 'name': '_ZSt17current_exceptionv'}
+{'type': 'FUNC', 'name': '_ZSt17rethrow_exceptionSt13exception_ptr'}
+{'type': 'FUNC', 'name': '_ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_'}
+{'type': 'FUNC', 'name': '_ZSt18uncaught_exceptionv'}
+{'type': 'FUNC', 'name': '_ZSt19uncaught_exceptionsv'}
+{'type': 'OBJECT', 'name': '_ZSt7nothrow', 'size': 1}
+{'type': 'FUNC', 'name': '_ZSt9terminatev'}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 120}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt12experimental19bad_optional_accessE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110__time_getE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110__time_putE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110ctype_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110istrstreamE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110money_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIcLb0EEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIcLb1EEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIwLb0EEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIwLb1EEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110ostrstreamE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__111__money_getIcEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__111__money_getIwEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__111__money_putIcEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__111__money_putIwEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__111regex_errorE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112bad_weak_ptrE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112codecvt_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112ctype_bynameIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112ctype_bynameIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112future_errorE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112strstreambufE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112system_errorE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__113messages_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__codecvt_utf8IDiEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__codecvt_utf8IDsEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__codecvt_utf8IwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__num_get_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__num_put_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__shared_countE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114collate_bynameIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114collate_bynameIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114error_categoryE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115messages_bynameIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115messages_bynameIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115numpunct_bynameIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115numpunct_bynameIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117__assoc_sub_stateE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__118__time_get_storageIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__118__time_get_storageIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__119__shared_weak_countE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__120__time_get_c_storageIcEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__120__time_get_c_storageIwEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__15ctypeIcEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__15ctypeIwEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__16locale5facetE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17collateIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17collateIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18__c_nodeE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18ios_base7failureE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18ios_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18messagesIcEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18messagesIwEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18numpunctIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18numpunctIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 72}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 72}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19__num_getIcEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19__num_getIwEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19__num_putIcEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19__num_putIwEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19strstreamE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19time_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTISt11logic_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt12length_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt12out_of_range', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt13runtime_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt14overflow_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt16invalid_argument', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt16nested_exception', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTISt8bad_cast', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt9bad_alloc', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt9exception', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 50}
+{'type': 'OBJECT', 'name': '_ZTSNSt12experimental19bad_optional_accessE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110__time_getE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110__time_putE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110ctype_baseE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110istrstreamE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110money_baseE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIcLb0EEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIcLb1EEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIwLb0EEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIwLb1EEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110ostrstreamE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_getIcEE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_getIwEE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_putIcEE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_putIwEE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__111regex_errorE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112bad_weak_ptrE', 'size': 23}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112codecvt_baseE', 'size': 23}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112ctype_bynameIcEE', 'size': 26}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112ctype_bynameIwEE', 'size': 26}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112future_errorE', 'size': 23}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112strstreambufE', 'size': 23}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112system_errorE', 'size': 23}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 47}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 47}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 47}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 47}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__113messages_baseE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__codecvt_utf8IDiEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__codecvt_utf8IDsEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__codecvt_utf8IwEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__num_get_baseE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__num_put_baseE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__shared_countE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 43}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 43}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 42}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 42}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114collate_bynameIcEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114collate_bynameIwEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114error_categoryE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IwLb0EEE', 'size': 33}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IwLb1EEE', 'size': 33}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 49}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 49}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115messages_bynameIcEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115messages_bynameIwEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115numpunct_bynameIcEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115numpunct_bynameIwEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 77}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 77}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 77}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 77}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__116__narrow_to_utf8ILm16EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__116__narrow_to_utf8ILm32EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117__assoc_sub_stateE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117__widen_from_utf8ILm16EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117__widen_from_utf8ILm32EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__118__time_get_storageIcEE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__118__time_get_storageIwEE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__119__shared_weak_countE', 'size': 30}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IwEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__120__time_get_c_storageIcEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__120__time_get_c_storageIwEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__15ctypeIcEE', 'size': 18}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__15ctypeIwEE', 'size': 18}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__16locale5facetE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17collateIcEE', 'size': 20}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17collateIwEE', 'size': 20}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 68}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 68}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 68}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 68}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18__c_nodeE', 'size': 18}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18ios_base7failureE', 'size': 26}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18ios_baseE', 'size': 18}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18messagesIcEE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18messagesIwEE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18numpunctIcEE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18numpunctIwEE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 69}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 69}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 69}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 69}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_getIcEE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_getIwEE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_putIcEE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_putIwEE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 42}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 42}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 70}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 70}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 70}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 70}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19strstreamE', 'size': 19}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19time_baseE', 'size': 19}
+{'type': 'OBJECT', 'name': '_ZTSSt16nested_exception', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__110istrstreamE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__110ostrstreamE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__19strstreamE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVN10__cxxabiv117__class_type_infoE', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVN10__cxxabiv120__si_class_type_infoE', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVN10__cxxabiv121__vmi_class_type_infoE', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt12experimental19bad_optional_accessE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110istrstreamE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIcLb0EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIcLb1EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIwLb0EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIwLb1EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110ostrstreamE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__111regex_errorE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112bad_weak_ptrE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112ctype_bynameIcEE', 'size': 104}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112ctype_bynameIwEE', 'size': 136}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112future_errorE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112strstreambufE', 'size': 128}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112system_errorE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114__codecvt_utf8IwEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114__shared_countE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 120}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114collate_bynameIcEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114collate_bynameIwEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114error_categoryE', 'size': 72}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 128}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 128}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115messages_bynameIcEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115messages_bynameIwEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115numpunct_bynameIcEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115numpunct_bynameIwEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 224}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 224}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117__assoc_sub_stateE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__119__shared_weak_countE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__15ctypeIcEE', 'size': 104}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__15ctypeIwEE', 'size': 136}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__16locale5facetE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17collateIcEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17collateIwEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 128}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 128}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 104}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 104}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18__c_nodeE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18ios_base7failureE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18ios_baseE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18messagesIcEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18messagesIwEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18numpunctIcEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18numpunctIwEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 168}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 168}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19strstreamE', 'size': 120}
+{'type': 'OBJECT', 'name': '_ZTVSt11logic_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt12length_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt12out_of_range', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt13runtime_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt14overflow_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt16invalid_argument', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt16nested_exception', 'size': 32}
+{'type': 'FUNC', 'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZThn16_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZThn16_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZdaPv'}
+{'type': 'FUNC', 'name': '_ZdaPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '_ZdaPvm'}
+{'type': 'FUNC', 'name': '_ZdlPv'}
+{'type': 'FUNC', 'name': '_ZdlPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '_ZdlPvm'}
+{'type': 'FUNC', 'name': '_Znam'}
+{'type': 'FUNC', 'name': '_ZnamRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '_Znwm'}
+{'type': 'FUNC', 'name': '_ZnwmRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '__assert_fail@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': '__ctype_get_mb_cur_max@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': '__cxa_allocate_exception'}
+{'type': 'FUNC', 'name': '__cxa_atexit@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': '__cxa_begin_catch'}
+{'type': 'FUNC', 'name': '__cxa_current_primary_exception'}
+{'type': 'FUNC', 'name': '__cxa_decrement_exception_refcount'}
+{'type': 'FUNC', 'name': '__cxa_end_catch'}
+{'type': 'FUNC', 'name': '__cxa_finalize@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': '__cxa_free_exception'}
+{'type': 'FUNC', 'name': '__cxa_guard_abort'}
+{'type': 'FUNC', 'name': '__cxa_guard_acquire'}
+{'type': 'FUNC', 'name': '__cxa_guard_release'}
+{'type': 'FUNC', 'name': '__cxa_increment_exception_refcount'}
+{'type': 'FUNC', 'name': '__cxa_pure_virtual'}
+{'type': 'FUNC', 'name': '__cxa_rethrow'}
+{'type': 'FUNC', 'name': '__cxa_rethrow_primary_exception'}
+{'type': 'FUNC', 'name': '__cxa_throw'}
+{'type': 'FUNC', 'name': '__cxa_uncaught_exception'}
+{'type': 'FUNC', 'name': '__errno_location@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': '__gxx_personality_v0'}
+{'type': 'FUNC', 'name': '_fini'}
+{'type': 'FUNC', 'name': '_init'}
+{'type': 'FUNC', 'name': 'abort@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'btowc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'calloc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'catclose@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'catgets@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'catopen@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'clock_gettime@GLIBC_2.17'}
+{'type': 'FUNC', 'name': 'close@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'fflush@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'fprintf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'free@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'freelocale@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'fwrite@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'getc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'iswalpha_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswblank_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswcntrl_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswdigit_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswlower_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswprint_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswpunct_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswspace_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswupper_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswxdigit_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'localeconv@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'malloc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'mbrtowc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'mbsnrtowcs@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'mbsrtowcs@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'mbtowc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'memchr@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'memcmp@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'memcpy@GLIBC_2.14'}
+{'type': 'FUNC', 'name': 'memmove@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'memset@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'nanosleep@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'newlocale@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'open@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_cond_broadcast@GLIBC_2.3.2'}
+{'type': 'FUNC', 'name': 'pthread_cond_destroy@GLIBC_2.3.2'}
+{'type': 'FUNC', 'name': 'pthread_cond_signal@GLIBC_2.3.2'}
+{'type': 'FUNC', 'name': 'pthread_cond_timedwait@GLIBC_2.3.2'}
+{'type': 'FUNC', 'name': 'pthread_cond_wait@GLIBC_2.3.2'}
+{'type': 'FUNC', 'name': 'pthread_detach@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_getspecific@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_join@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_key_create@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutex_destroy@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutex_init@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutex_lock@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutex_trylock@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutex_unlock@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutexattr_destroy@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutexattr_init@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutexattr_settype@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_self@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'read@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'realloc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'sched_yield@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'setlocale@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'snprintf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'sscanf@GLIBC_2.2.5'}
+{'type': 'OBJECT', 'name': 'stderr@GLIBC_2.2.5', 'size': 0}
+{'type': 'OBJECT', 'name': 'stdin@GLIBC_2.2.5', 'size': 0}
+{'type': 'OBJECT', 'name': 'stdout@GLIBC_2.2.5', 'size': 0}
+{'type': 'FUNC', 'name': 'strcmp@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strcoll_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'strerror_r@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strftime_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'strlen@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtod@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtod_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'strtof@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtof_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'strtol@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtold@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtold_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'strtoll@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtoll_l@GLIBC_2.3.3'}
+{'type': 'FUNC', 'name': 'strtoul@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtoull@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtoull_l@GLIBC_2.3.3'}
+{'type': 'FUNC', 'name': 'strxfrm_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'swprintf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'sysconf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'tolower_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'toupper_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'towlower_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'towupper_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'ungetc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'uselocale@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'vasprintf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'vsnprintf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'vsscanf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcrtomb@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcscoll_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'wcslen@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcsnrtombs@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstod@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstof@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstol@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstold@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstoll@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstoul@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstoull@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcsxfrm_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'wctob@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wmemchr@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wmemcmp@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wmemcpy@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wmemmove@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wmemset@GLIBC_2.2.5'}
diff --git a/lib/abi/CHANGELOG.TXT b/lib/abi/CHANGELOG.TXT
new file mode 100644
index 000000000000..15703feb638f
--- /dev/null
+++ b/lib/abi/CHANGELOG.TXT
@@ -0,0 +1,135 @@
+ABI Changelog
+==============
+This changelog contains information about ABI changes in libc++. Specifically
+the addition and deletion of symbols from the libc++ dylib.
+
+Each entry should start with the revision number followed by a description of
+the change. The entry should contain a summary of the ABI changes made,
+including what symbols were added, removed, or changed.
+
+To generate a summary use "sym_diff.py" diffing against the appropriate ABI list.
+Afterwards the ABI list should be updated to include the new changes.
+
+New entries should be added directly below the "Version" header.
+
+-----------
+Version 4.0
+-----------
+
+* r290651 - Add _LIBCPP_ASSERT debug handling functions
+
+ All Platforms
+ -------------
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionD1Ev
+ Symbol added: _ZTINSt3__124__libcpp_debug_exceptionE
+ Symbol added: _ZNSt3__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionD2Ev
+ Symbol added: _ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC2ERKS0_
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC1Ev
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC2Ev
+ Symbol added: _ZTSNSt3__124__libcpp_debug_exceptionE
+ Symbol added: _ZNSt3__123__libcpp_debug_functionE
+ Symbol added: _ZNKSt3__124__libcpp_debug_exception4whatEv
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC1ERKS0_
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionD0Ev
+ Symbol added: _ZTVNSt3__124__libcpp_debug_exceptionE
+ Symbol added: _ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE
+
+* r288547 - Implement C++17 <variant>
+
+ All Platforms
+ -------------
+ Symbol added: _ZTVSt18bad_variant_access
+ Symbol added: _ZTISt18bad_variant_access
+ Symbol added: _ZTSSt18bad_variant_access
+ Symbol added: _ZNKSt18bad_variant_access4whatEv
+
+* rTBD - Remove std::string::append template methods which should be inline
+
+ These functions should never have had visible definitions in the dylib but
+ since they were previously not specified with 'inline' they accidentally
+ got emitted. This change is non-ABI breaking because every "linkage unit"
+ must contain its own definition.
+
+ x86_64-linux-gnu
+ ----------------
+ SYMBOL REMOVED: _ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendIPcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_
+ SYMBOL REMOVED: _ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendIPwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_
+
+ x86_64-apple-darwin16.0
+ -----------------------
+ No changes
+
+* r285101 - Add -fvisibility-inlines-hidden when building libc++.
+
+ Although this change removes symbols, it should still be non-ABI breaking
+ since all of the definitions removed are inline functions. For this reason
+ removing these symbols is safe because every "linkage unit" which uses these
+ functions will contain their own definition.
+
+ x86_64-linux-gnu
+ ----------------
+ SYMBOL REMOVED: _ZNSt12bad_any_castD0Ev
+ SYMBOL REMOVED: _ZNSt12experimental15fundamentals_v112bad_any_castD0Ev
+ SYMBOL REMOVED: _ZNSt3__114__codecvt_utf8IDiED0Ev
+ SYMBOL REMOVED: _ZNSt3__114__codecvt_utf8IDsED0Ev
+ SYMBOL REMOVED: _ZNSt3__114__codecvt_utf8IwED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IDiLb0EED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IDiLb1EED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IDsLb0EED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IDsLb1EED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IwLb0EED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IwLb1EED0Ev
+ SYMBOL REMOVED: _ZNSt3__117__assoc_sub_stateD0Ev
+ SYMBOL REMOVED: _ZNSt3__117__assoc_sub_stateD2Ev
+ SYMBOL REMOVED: _ZNSt3__117__libcpp_sscanf_lEPKcP15__locale_structS1_z
+ SYMBOL REMOVED: _ZNSt3__119__libcpp_asprintf_lEPPcP15__locale_structPKcz
+ SYMBOL REMOVED: _ZNSt3__119__libcpp_snprintf_lEPcmP15__locale_structPKcz
+ SYMBOL REMOVED: _ZNSt3__120__codecvt_utf8_utf16IDiED0Ev
+ SYMBOL REMOVED: _ZNSt3__120__codecvt_utf8_utf16IDsED0Ev
+ SYMBOL REMOVED: _ZNSt3__120__codecvt_utf8_utf16IwED0Ev
+
+ x86_64-apple-darwin16.0
+ -----------------------
+ No Changes - inline symbols are already hidden
+
+
+* r284206 - Implement C++17 aligned allocation in <new>
+
+ x86_64-linux-gnu
+ ----------------
+ Symbol added: posix_memalign@GLIBC_2.2.5
+ Symbol added: _ZdaPvSt11align_val_t
+ Symbol added: _ZdlPvSt11align_val_t
+ Symbol added: _ZnamSt11align_val_t
+ Symbol added: _ZdaPvmSt11align_val_t
+ Symbol added: _ZdlPvmSt11align_val_t
+ Symbol added: _ZdlPvSt11align_val_tRKSt9nothrow_t
+ Symbol added: _ZnwmSt11align_val_tRKSt9nothrow_t
+ Symbol added: _ZnamSt11align_val_tRKSt9nothrow_t
+ Symbol added: _ZdaPvSt11align_val_tRKSt9nothrow_t
+ Symbol added: _ZnwmSt11align_val_t
+
+* r283980 - Implement C++17 <optional>
+
+ x86_64-linux-gnu
+ ----------------
+ Symbol added: _ZTISt19bad_optional_access
+ Symbol added: _ZNSt19bad_optional_accessD0Ev
+ Symbol added: _ZNSt19bad_optional_accessD1Ev
+ Symbol added: _ZNSt19bad_optional_accessD2Ev
+ Symbol added: _ZTVSt19bad_optional_access
+ Symbol added: _ZTSSt19bad_optional_access
+
+* r278310 - Implement C++17 <any>
+
+ x86_64-linux-gnu
+ ----------------
+ Symbol added: _ZNKSt12bad_any_cast4whatEv
+ Symbol added: _ZNSt12bad_any_castD0Ev
+ Symbol added: _ZTISt12bad_any_cast
+ Symbol added: _ZTSSt12bad_any_cast
+ Symbol added: _ZTVSt12bad_any_cast
diff --git a/lib/abi/CMakeLists.txt b/lib/abi/CMakeLists.txt
new file mode 100644
index 000000000000..223dbdbcb577
--- /dev/null
+++ b/lib/abi/CMakeLists.txt
@@ -0,0 +1,28 @@
+
+# Detect if we are building in the same configuration used to generate
+# the abilist files.
+if (DEFINED TARGET_TRIPLE
+ AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${TARGET_TRIPLE}.abilist"
+ AND TARGET cxx_shared
+ AND ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi" OR
+ (APPLE AND "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "none"))
+ AND NOT LIBCXX_ABI_UNSTABLE
+ AND LIBCXX_ABI_VERSION EQUAL "1")
+ set(LIBCXX_HAS_ABILIST_CONFIGURATION 1 CACHE INTERNAL "")
+else()
+ if (NOT DEFINED LIBCXX_HAS_ABILIST_CONFIGURATION)
+ message(STATUS "libc++ configuration differs from the abilist configuration. "
+ "check-cxx-abilist target is not supported")
+ endif()
+ set(LIBCXX_HAS_ABILIST_CONFIGURATION 0 CACHE INTERNAL "")
+endif()
+
+
+if (LIBCXX_HAS_ABILIST_CONFIGURATION)
+ set(ABILIST_FILE "${CMAKE_CURRENT_LIST_DIR}/${TARGET_TRIPLE}.abilist")
+ set(SYMDIFF_EXE "${LIBCXX_SOURCE_DIR}/utils/sym_check/sym_diff.py")
+ add_custom_target(check-cxx-abilist
+ ${SYMDIFF_EXE} --only-stdlib-symbols ${ABILIST_FILE} $<TARGET_SONAME_FILE:cxx_shared>
+ DEPENDS cxx_shared
+ COMMENT "Testing ABI compatibility...")
+endif()
diff --git a/lib/abi/README.TXT b/lib/abi/README.TXT
new file mode 100644
index 000000000000..f098b80403aa
--- /dev/null
+++ b/lib/abi/README.TXT
@@ -0,0 +1,8 @@
+This directory contains abi lists representing the symbols exported
+by the libc++ library. The lists are generated using sym_extract.py.
+
+Every time a symbol is added or removed from the libc++ library each of the
+lists *MUST* be updated to reflect the changes.
+
+TODO Add more documentation about generating and using the lists.
+TODO Add more documentation about the build configuration the lists are generated against.
diff --git a/lib/abi/x86_64-apple-darwin16.0.0.abilist b/lib/abi/x86_64-apple-darwin16.0.0.abilist
new file mode 100644
index 000000000000..f7218a45fbb6
--- /dev/null
+++ b/lib/abi/x86_64-apple-darwin16.0.0.abilist
@@ -0,0 +1,2375 @@
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt10bad_typeid4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt10bad_typeid4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt11logic_error4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt11logic_error4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12bad_any_cast4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13bad_exception4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13bad_exception4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13runtime_error4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13runtime_error4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt16bad_array_length4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt16bad_array_length4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt16nested_exception14rethrow_nestedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt18bad_variant_access4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt20bad_array_new_length4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt20bad_array_new_length4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110error_code7messageEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__decrementableEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__find_c_from_iEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__subscriptableEPKvl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db17__dereferenceableEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db17__find_c_and_lockEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db8__find_cEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db9__addableEPKvl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112bad_weak_ptr4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_scan_isEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE11do_scan_notEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEjw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEwc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112strstreambuf6pcountEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__113random_device7entropyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114error_category10equivalentERKNS_10error_codeEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114error_category23default_error_conditionEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115error_condition7messageEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__118__time_get_storageIcE15__do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__118__time_get_storageIwE15__do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__XEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__cEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__rEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__xEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE7__am_pmEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE7__weeksEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE8__monthsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__XEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__cEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__rEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__xEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE7__am_pmEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE7__weeksEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE8__monthsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__124__libcpp_debug_exception4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_toupperEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE8do_widenEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE9do_narrowEcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_scan_isEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_toupperEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE11do_scan_notEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE5do_isEPKwS3_Pj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE5do_isEjw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE8do_widenEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE9do_narrowEwc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16locale4nameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16locale9has_facetERNS0_2idE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16locale9use_facetERNS0_2idE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16localeeqERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIcE7do_hashEPKcS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIwE7do_hashEPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18ios_base6getlocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIcE8do_closeEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIwE8do_closeEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE11do_truenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE12do_falsenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE11do_truenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE12do_falsenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt8bad_cast4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt8bad_cast4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9bad_alloc4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9bad_alloc4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9exception4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9exception4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_erroraSERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrC1ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrC2ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptraSERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC1ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_erroraSERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt19bad_optional_accessD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt19bad_optional_accessD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt19bad_optional_accessD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110adopt_lockE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5alnumE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5alphaE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5blankE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5cntrlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5digitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5graphE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5lowerE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5printE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5punctE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5spaceE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5upperE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base6xdigitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110defer_lockE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb0EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb1EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb0EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb1EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110ostrstreamD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__call_onceERVmPvPFvS2_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db10__insert_cEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db10__insert_iEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db11__insert_icEPvPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db15__iterator_copyEPvPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db16__invalidate_allEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db4swapEPvS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db9__erase_cEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db9__erase_iEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__111try_to_lockE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__do_nothingEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__get_sp_mutEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__next_primeEm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112__rs_default4__c_E', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC1ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC2ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultclEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_1E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_2E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_3E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_4E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_5E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_6E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_7E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_8E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_9E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders3_10E', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf3strEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf4swapERS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf6__initEPclS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf6freezeEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf8overflowEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf9pbackfailEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf9underflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKal'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKhl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPalS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPclS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPhlS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1El'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKal'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKhl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPalS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPclS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPhlS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2El'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__113allocator_argE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreEli'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceclEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113shared_futureIvED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113shared_futureIvED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113shared_futureIvEaSERKS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__get_const_dbEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__114__num_get_base5__srcE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_put_base12__format_intEPcPKcbj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_put_base14__format_floatEPcPKcj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_count12__add_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_count16__release_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_countD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_countD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_countD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__get_classnameEPKcb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115future_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcE6__initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwE6__initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115system_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116generic_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state12__make_readyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state16__on_zero_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state4copyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state4waitEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state9__executeEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state9set_valueEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117declare_reachableEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117iostream_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable10notify_allEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable10notify_oneEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variableD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variableD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118get_pointer_safetyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex11lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex13unlock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex15try_lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base11lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base13unlock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base15try_lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_baseC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_baseC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count10__add_weakEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count12__add_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count14__release_weakEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count16__release_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__119__start_std_streamsE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__thread_local_dataEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119declare_no_pointersEPcm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__119piecewise_constructE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__120__get_collation_nameEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__120__throw_system_errorEiPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__throw_runtime_errorEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__undeclare_reachableEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121undeclare_no_pointersEPcm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__123__libcpp_debug_functionE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__13cinE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14cerrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14clogE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14coutE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14wcinE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15alignEmmRPvRm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcE13classic_tableEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC1EPKjbm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC2EPKjbm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutexD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15wcerrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15wclogE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15wcoutE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock3nowEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock11from_time_tEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock3nowEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9is_steadyE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvE3getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16gslice6__initEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale2id5__getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale2id6__initEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale2id9__next_idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale3allE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale4noneE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale4timeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale5ctypeE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facet16__on_zero_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facetD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facetD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facetD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale6globalERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale7classicEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale7collateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale7numericE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale8__globalEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale8messagesE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale8monetaryE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_PKci'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_S2_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_PKci'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_S2_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeaSERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16thread20hardware_concurrencyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16thread4joinEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16thread6detachEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16threadD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16threadD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17collateIcE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17collateIwE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE10get_futureEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE9set_valueEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvEC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvEC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_node5__addEPNS_8__i_nodeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_nodeD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_nodeD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_nodeD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__get_dbEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__i_nodeD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__i_nodeD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__rs_getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__sp_mut4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__sp_mut6unlockEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base10floatfieldE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base10scientificE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base11adjustfieldE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base15sync_with_stdioEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base16__call_callbacksENS0_5eventE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base2inE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3appE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3ateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3decE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3hexE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3octE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3outE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4initEPv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base4leftE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4moveERS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4swapERS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5clearEj'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5fixedE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5iwordEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5pwordEi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5rightE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5truncE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6badbitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6binaryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6eofbitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6skipwsE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base6xallocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7copyfmtERKS0_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failbitE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7goodbitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7showposE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7unitbufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base8internalE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base8showbaseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9__xindex_E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9basefieldE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9boolalphaE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9showpointE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9uppercaseE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_baseD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_baseD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_baseD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18messagesIcE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18messagesIwE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImE6resizeEmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19strstreamD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt10unexpectedv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt10unexpectedv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt13get_terminatev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt13get_terminatev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt13set_terminatePFvvE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt13set_terminatePFvvE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt14get_unexpectedv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt14get_unexpectedv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt14set_unexpectedPFvvE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt14set_unexpectedPFvvE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt15get_new_handlerv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt15get_new_handlerv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt15set_new_handlerPFvvE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt15set_new_handlerPFvvE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt17__throw_bad_allocv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt17current_exceptionv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt17rethrow_exceptionSt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt18uncaught_exceptionv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt19uncaught_exceptionsv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZSt7nothrow', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt9terminatev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt9terminatev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIDs'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110__time_getE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110__time_putE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110ctype_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110money_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112codecvt_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113messages_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__num_get_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__num_put_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__shared_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117__assoc_sub_stateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__118__time_get_storageIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__118__time_get_storageIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__119__shared_weak_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__time_get_c_storageIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__time_get_c_storageIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__124__libcpp_debug_exceptionE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19strstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19time_baseE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt10bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt10bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt11logic_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt11logic_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt11range_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt11range_error'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt12bad_any_cast', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt12domain_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt12domain_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt12length_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt12length_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt12out_of_range'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt12out_of_range'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt13bad_exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt13bad_exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt13runtime_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt13runtime_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt14overflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt14overflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt15underflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt15underflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt16bad_array_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt16bad_array_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt16invalid_argument'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt16invalid_argument'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt16nested_exception', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt18bad_variant_access', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt19bad_optional_access', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt20bad_array_new_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt20bad_array_new_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt8bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt8bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt9bad_alloc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt9bad_alloc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt9exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt9exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt9type_info'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt9type_info'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTId'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTId'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110ctype_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110money_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112codecvt_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113messages_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19strstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19time_baseE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt10bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt10bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11logic_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11logic_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11range_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11range_error'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt12bad_any_cast', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12domain_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12domain_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12length_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12length_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12out_of_range'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12out_of_range'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13bad_exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13bad_exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13runtime_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13runtime_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt14overflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt14overflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt15underflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt15underflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16bad_array_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16bad_array_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16invalid_argument'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16invalid_argument'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt16nested_exception', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt18bad_variant_access', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt19bad_optional_access', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt20bad_array_new_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt20bad_array_new_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt8bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt8bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9bad_alloc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9bad_alloc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9type_info'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9type_info'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSy'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__19strstreamE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__shared_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117__assoc_sub_stateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__119__shared_weak_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__124__libcpp_debug_exceptionE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19strstreamE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt10bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt10bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11logic_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11logic_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11range_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11range_error'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt12bad_any_cast', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12domain_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12domain_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12length_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12length_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12out_of_range'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12out_of_range'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13bad_exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13bad_exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13runtime_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13runtime_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt14overflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt14overflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt15underflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt15underflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16bad_array_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16bad_array_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16invalid_argument'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16invalid_argument'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt16nested_exception', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt18bad_variant_access', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt19bad_optional_access', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt20bad_array_new_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt20bad_array_new_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt8bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt8bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9bad_alloc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9bad_alloc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9type_info'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9type_info'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_tRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvmSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_tRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvmSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__Znam'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_tRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__Znwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_tRKSt9nothrow_t'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_allocate_exception'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_allocate_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_atexit'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_begin_catch'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_begin_catch'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_call_unexpected'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_call_unexpected'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_current_exception_type'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_current_exception_type'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_current_primary_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_decrement_exception_refcount'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_demangle'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_demangle'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_end_catch'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_end_catch'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_free_exception'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_free_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_get_exception_ptr'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_get_exception_ptr'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals_fast'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals_fast'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_abort'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_abort'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_acquire'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_acquire'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_release'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_release'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_increment_exception_refcount'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_pure_virtual'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_pure_virtual'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_rethrow'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow_primary_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_throw'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_throw'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_uncaught_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cctor'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cctor'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cleanup'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cleanup'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_ctor'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_ctor'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete2'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete2'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete3'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete3'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_dtor'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_dtor'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new2'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new2'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new3'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new3'}
+{'type': 'U', 'is_defined': False, 'name': '___dynamic_cast'}
+{'type': 'I', 'is_defined': True, 'name': '___dynamic_cast'}
+{'type': 'U', 'is_defined': False, 'name': '___gxx_personality_v0'}
+{'type': 'I', 'is_defined': True, 'name': '___gxx_personality_v0'}
diff --git a/lib/abi/x86_64-unknown-linux-gnu.abilist b/lib/abi/x86_64-unknown-linux-gnu.abilist
new file mode 100644
index 000000000000..7282fa7b2198
--- /dev/null
+++ b/lib/abi/x86_64-unknown-linux-gnu.abilist
@@ -0,0 +1,1905 @@
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNKSt11logic_error4whatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt12bad_any_cast4whatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNKSt13runtime_error4whatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt16nested_exception14rethrow_nestedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt18bad_variant_access4whatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110error_code7messageEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE11do_groupingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE11do_groupingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE11do_groupingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE11do_groupingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db15__decrementableEPKv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db15__find_c_from_iEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db15__subscriptableEPKvl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db17__dereferenceableEPKv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db17__find_c_and_lockEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db6unlockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db8__find_cEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db9__addableEPKvl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112bad_weak_ptr4whatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_scan_isEtPKwS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE11do_scan_notEtPKwS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pt'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE5do_isEtw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEwc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__112strstreambuf6pcountEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__113random_device7entropyEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114error_category10equivalentERKNS_10error_codeEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__114error_category23default_error_conditionEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__115error_condition7messageEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__118__time_get_storageIcE15__do_date_orderEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__118__time_get_storageIwE15__do_date_orderEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__XEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__cEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__rEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__xEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE7__am_pmEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE7__weeksEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE8__monthsEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__XEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__cEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__rEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__xEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE7__am_pmEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE7__weeksEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE8__monthsEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__124__libcpp_debug_exception4whatEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_tolowerEPcPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_tolowerEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_toupperEPcPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_toupperEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE8do_widenEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE9do_narrowEcc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_scan_isEtPKwS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_tolowerEPwPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_tolowerEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_toupperEPwPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_toupperEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE11do_scan_notEtPKwS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE5do_isEPKwS3_Pt'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE5do_isEtw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE8do_widenEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE9do_narrowEwc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__16locale4nameEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__16locale9has_facetERNS0_2idE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__16locale9use_facetERNS0_2idE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__16localeeqERKS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17collateIcE12do_transformEPKcS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17collateIcE7do_hashEPKcS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17collateIwE12do_transformEPKwS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17collateIwE7do_hashEPKwS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18ios_base6getlocEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18messagesIcE8do_closeEl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18messagesIwE8do_closeEl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE11do_groupingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE11do_truenameEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE12do_falsenameEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE16do_decimal_pointEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE16do_thousands_sepEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE11do_groupingEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE11do_truenameEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE12do_falsenameEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE16do_decimal_pointEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE16do_thousands_sepEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt11logic_errorC1EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt11logic_errorC1ERKS_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt11logic_errorC2EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt11logic_errorC2ERKS_'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt11logic_errorD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt11logic_erroraSERKS_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt12experimental19bad_optional_accessD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt12experimental19bad_optional_accessD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt12experimental19bad_optional_accessD2Ev'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt12length_errorD1Ev'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt12out_of_rangeD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13exception_ptrC1ERKS_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13exception_ptrC2ERKS_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13exception_ptrD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13exception_ptrD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13exception_ptraSERKS_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13runtime_errorC1EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13runtime_errorC1ERKS_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13runtime_errorC2EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13runtime_errorC2ERKS_'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt13runtime_errorD1Ev'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt13runtime_errorD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt13runtime_erroraSERKS_'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt14overflow_errorD1Ev'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt16invalid_argumentD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt16nested_exceptionC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt16nested_exceptionC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt16nested_exceptionD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt16nested_exceptionD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt16nested_exceptionD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt19bad_optional_accessD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt19bad_optional_accessD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt19bad_optional_accessD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_getC1EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_getC2EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_getD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_getD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_putC1EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_putC2EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_putD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110__time_putD2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110adopt_lockE', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5alnumE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5alphaE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5blankE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5cntrlE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5digitE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5graphE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5lowerE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5printE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5punctE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5spaceE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5upperE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base6xdigitE', 'size': 2}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110defer_lockE', 'size': 1}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110istrstreamD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110istrstreamD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110istrstreamD2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb0EE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb1EE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb0EE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb1EE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 1}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110ostrstreamD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110ostrstreamD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110ostrstreamD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEd'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEf'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEx'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEy'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__call_onceERVmPvPFvS2_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db10__insert_cEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db10__insert_iEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db11__insert_icEPvPKv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db15__iterator_copyEPvPKv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db16__invalidate_allEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db4swapEPvS1_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db9__erase_cEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db9__erase_iEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111regex_errorD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111regex_errorD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111regex_errorD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111timed_mutex4lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111timed_mutex6unlockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111timed_mutex8try_lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexD2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__111try_to_lockE', 'size': 1}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112__do_nothingEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112__get_sp_mutEPKv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112__next_primeEm'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112__rs_default4__c_E', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC1ERKS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC2ERKS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultclEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112bad_weak_ptrD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112bad_weak_ptrD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112bad_weak_ptrD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 8}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertIPKcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPcEEE4typeENSB_IS8_EESA_SA_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceIPKcEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 8}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignIPwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertIPKwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPwEEE4typeENSB_IS8_EESA_SA_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceIPKwEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC1EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC2EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC1EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC2EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112future_errorC1ENS_10error_codeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112future_errorC2ENS_10error_codeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112future_errorD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112future_errorD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112future_errorD2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_1E', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_2E', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_3E', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_4E', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_5E', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_6E', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_7E', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_8E', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_9E', 'size': 1}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__112placeholders3_10E', 'size': 1}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf3strEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf4swapERS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf6__initEPclS1_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf6freezeEb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf8overflowEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf9pbackfailEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf9underflowEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPFPvmEPFvS1_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPKal'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPKcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPKhl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPalS1_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPclS1_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPhlS1_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1El'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPFPvmEPFvS1_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPKal'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPKcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPKhl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPalS1_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPclS1_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPhlS1_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2El'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112strstreambufD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1ENS_10error_codeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1ENS_10error_codeEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2ENS_10error_codeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2ENS_10error_codeEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__112system_errorD2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__113allocator_argE', 'size': 1}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreElj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113random_deviceD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113random_deviceD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113random_deviceclEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113shared_futureIvED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113shared_futureIvED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__113shared_futureIvEaSERKS1_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114__get_const_dbEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__114__num_get_base5__srcE', 'size': 33}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114__num_put_base12__format_intEPcPKcbj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114__num_put_base14__format_floatEPcPKcj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114__shared_count12__add_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114__shared_count16__release_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114__shared_countD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114__shared_countD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114__shared_countD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC1EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC2EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC1EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC2EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114error_categoryC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114error_categoryD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114error_categoryD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__114error_categoryD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115__get_classnameEPKcb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115__thread_structC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115__thread_structC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115__thread_structD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115__thread_structD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115future_categoryEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcE6__initEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC1EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC2EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwE6__initEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC1EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC2EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutex4lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutex6unlockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutex8try_lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__115system_categoryEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__116generic_categoryEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state12__make_readyEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state16__on_zero_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state4copyEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state4waitEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state9__executeEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state9set_valueEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm16EED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm16EED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm16EED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm32EED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm32EED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm32EED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117declare_reachableEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117iostream_categoryEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC1EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC2EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC1EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC2EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118condition_variable10notify_allEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118condition_variable10notify_oneEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118condition_variableD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118condition_variableD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118get_pointer_safetyEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex11lock_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex13unlock_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex15try_lock_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex4lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex6unlockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex8try_lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutexC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutexC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base11lock_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base13unlock_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base15try_lock_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base4lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base6unlockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base8try_lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_baseC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_baseC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count10__add_weakEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count12__add_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count14__release_weakEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count16__release_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count4lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_countD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_countD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_countD2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__119__start_std_streamsE', 'size': 1}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119__thread_local_dataEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__119declare_no_pointersEPcm'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__119piecewise_constructE', 'size': 1}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__120__get_collation_nameEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__120__throw_system_errorEiPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121__throw_runtime_errorEPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121__undeclare_reachableEPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutex4lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutex8try_lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__121undeclare_no_pointersEPcm'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__123__libcpp_debug_functionE', 'size': 8}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__124__libcpp_debug_exceptionC1ERKS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__124__libcpp_debug_exceptionC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__124__libcpp_debug_exceptionC2ERKS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__124__libcpp_debug_exceptionC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__124__libcpp_debug_exceptionD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__124__libcpp_debug_exceptionD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__124__libcpp_debug_exceptionD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__125__num_get_signed_integralIlEET_PKcS3_Rji'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__125__num_get_signed_integralIxEET_PKcS3_Rji'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralIjEET_PKcS3_Rji'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralImEET_PKcS3_Rji'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralItEET_PKcS3_Rji'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralIyEET_PKcS3_Rji'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__13cinE', 'size': 168}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__14cerrE', 'size': 160}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__14clogE', 'size': 160}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__14coutE', 'size': 160}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__14wcinE', 'size': 168}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15alignEmmRPvRm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcE13classic_tableEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcE21__classic_lower_tableEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcE21__classic_upper_tableEv'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__15ctypeIcE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcEC1EPKtbm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcEC2EPKtbm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcED2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__15ctypeIwE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIwED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIwED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15ctypeIwED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15mutex4lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15mutex6unlockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15mutex8try_lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15mutexD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15mutexD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__15wcerrE', 'size': 160}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__15wclogE', 'size': 160}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__15wcoutE', 'size': 160}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__clocEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16chrono12steady_clock3nowEv'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 1}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16chrono12system_clock11from_time_tEl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16chrono12system_clock3nowEv'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16chrono12system_clock9is_steadyE', 'size': 1}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16futureIvE3getEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16futureIvED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16futureIvED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16gslice6__initEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16locale2id5__getEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16locale2id6__initEv'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16locale2id9__next_idE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16locale3allE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16locale4noneE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16locale4timeE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16locale5ctypeE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16locale5facet16__on_zero_sharedEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16locale5facetD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16locale5facetD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16locale5facetD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16locale6globalERKS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16locale7classicEv'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16locale7collateE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16locale7numericE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16locale8__globalEv'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16locale8messagesE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__16locale8monetaryE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC1EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_PKci'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_S2_i'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC2EPKc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_PKci'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_S2_i'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16localeaSERKS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16thread20hardware_concurrencyEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16thread4joinEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16thread6detachEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16threadD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__16threadD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIaaEEPaEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIccEEPcEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIddEEPdEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIffEEPfEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIhhEEPhEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIiiEEPiEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIjjEEPjEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIllEEPlEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessImmEEPmEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIssEEPsEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIttEEPtEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIxxEEPxEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIyyEEPyEEjT0_S5_S5_S5_S5_T_'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1Em'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2Em'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__17collateIcE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17collateIcED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17collateIcED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17collateIcED2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__17collateIwE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17collateIwED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17collateIwED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17collateIwED2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE10get_futureEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE24set_value_at_thread_exitEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE9set_valueEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17promiseIvEC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17promiseIvEC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17promiseIvED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__17promiseIvED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18__c_node5__addEPNS_8__i_nodeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18__c_nodeD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18__c_nodeD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18__c_nodeD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18__get_dbEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18__i_nodeD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18__i_nodeD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18__rs_getEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18__sp_mut4lockEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18__sp_mut6unlockEv'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base10floatfieldE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base10scientificE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base11adjustfieldE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base15sync_with_stdioEb'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base16__call_callbacksENS0_5eventE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base2inE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3appE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3ateE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3decE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3hexE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3octE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3outE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitC1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitC2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base4initEPv'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base4leftE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base4moveERS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base4swapERS0_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base5clearEj'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base5fixedE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base5imbueERKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base5iwordEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base5pwordEi'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base5rightE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base5truncE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6badbitE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6binaryE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6eofbitE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6skipwsE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base6xallocEv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base7copyfmtERKS0_'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7failbitE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureD2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7goodbitE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7showposE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7unitbufE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base8internalE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base8showbaseE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9__xindex_E', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9basefieldE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9boolalphaE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9showpointE', 'size': 4}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9uppercaseE', 'size': 4}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_baseD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_baseD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18ios_baseD2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18messagesIcE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18messagesIwE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18numpunctIcE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcEC1Em'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcEC2Em'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcED2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18numpunctIwE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwEC1Em'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwEC2Em'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwED2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18valarrayImE6resizeEmm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18valarrayImEC1Em'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18valarrayImEC2Em'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18valarrayImED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__18valarrayImED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19strstreamD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19strstreamD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19strstreamD2Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19to_stringEd'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19to_stringEe'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19to_stringEf'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19to_stringEi'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19to_stringEj'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19to_stringEl'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19to_stringEm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19to_stringEx'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__19to_stringEy'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt8bad_castC1Ev'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt8bad_castD1Ev'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt8bad_castD2Ev'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt9bad_allocC1Ev'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt9bad_allocD1Ev'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZNSt9exceptionD2Ev'}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZSt15get_new_handlerv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZSt17__throw_bad_allocv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZSt17current_exceptionv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZSt17rethrow_exceptionSt13exception_ptr'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZSt18uncaught_exceptionv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZSt19uncaught_exceptionsv'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZSt7nothrow', 'size': 1}
+{'is_defined': False, 'type': 'FUNC', 'name': '_ZSt9terminatev'}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 120}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt12experimental19bad_optional_accessE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__110__time_getE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__110__time_putE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__110ctype_baseE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__110istrstreamE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__110money_baseE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIcLb0EEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIcLb1EEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIwLb0EEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIwLb1EEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__110ostrstreamE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__111__money_getIcEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__111__money_getIwEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__111__money_putIcEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__111__money_putIwEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__111regex_errorE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__112bad_weak_ptrE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__112codecvt_baseE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__112ctype_bynameIcEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__112ctype_bynameIwEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__112future_errorE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__112strstreambufE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__112system_errorE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__113messages_baseE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114__codecvt_utf8IDiEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114__codecvt_utf8IDsEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114__codecvt_utf8IwEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114__num_get_baseE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114__num_put_baseE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114__shared_countE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114collate_bynameIcEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114collate_bynameIwEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__114error_categoryE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115messages_bynameIcEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115messages_bynameIwEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115numpunct_bynameIcEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115numpunct_bynameIwEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__117__assoc_sub_stateE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__118__time_get_storageIcEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__118__time_get_storageIwEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__119__shared_weak_countE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__120__time_get_c_storageIcEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__120__time_get_c_storageIwEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__124__libcpp_debug_exceptionE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__15ctypeIcEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__15ctypeIwEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__16locale5facetE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__17collateIcEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__17collateIwEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18__c_nodeE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18ios_base7failureE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18ios_baseE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18messagesIcEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18messagesIwEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18numpunctIcEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18numpunctIwEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 72}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 72}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19__num_getIcEE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19__num_getIwEE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19__num_putIcEE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19__num_putIwEE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19strstreamE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTINSt3__19time_baseE', 'size': 16}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTISt11logic_error', 'size': 0}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTISt12bad_any_cast', 'size': 24}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTISt12length_error', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTISt12out_of_range', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTISt13runtime_error', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTISt14overflow_error', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTISt16invalid_argument', 'size': 0}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTISt16nested_exception', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTISt18bad_variant_access', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTISt19bad_optional_access', 'size': 24}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTISt8bad_cast', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTISt9bad_alloc', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTISt9exception', 'size': 0}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 50}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt12experimental19bad_optional_accessE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__110__time_getE', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__110__time_putE', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__110ctype_baseE', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__110istrstreamE', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__110money_baseE', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIcLb0EEE', 'size': 28}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIcLb1EEE', 'size': 28}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIwLb0EEE', 'size': 28}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIwLb1EEE', 'size': 28}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__110ostrstreamE', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_getIcEE', 'size': 25}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_getIwEE', 'size': 25}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_putIcEE', 'size': 25}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_putIwEE', 'size': 25}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__111regex_errorE', 'size': 22}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__112bad_weak_ptrE', 'size': 23}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__112codecvt_baseE', 'size': 23}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__112ctype_bynameIcEE', 'size': 26}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__112ctype_bynameIwEE', 'size': 26}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__112future_errorE', 'size': 23}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__112strstreambufE', 'size': 23}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__112system_errorE', 'size': 23}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 47}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 47}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 47}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 47}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__113messages_baseE', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114__codecvt_utf8IDiEE', 'size': 29}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114__codecvt_utf8IDsEE', 'size': 29}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114__codecvt_utf8IwEE', 'size': 28}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114__num_get_baseE', 'size': 25}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114__num_put_baseE', 'size': 25}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114__shared_countE', 'size': 25}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 48}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 43}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 43}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 42}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 42}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114collate_bynameIcEE', 'size': 28}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114collate_bynameIwEE', 'size': 28}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__114error_categoryE', 'size': 25}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IwLb0EEE', 'size': 33}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IwLb1EEE', 'size': 33}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 49}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 49}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115messages_bynameIcEE', 'size': 29}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115messages_bynameIwEE', 'size': 29}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115numpunct_bynameIcEE', 'size': 29}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115numpunct_bynameIwEE', 'size': 29}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 77}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 77}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 77}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 77}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__116__narrow_to_utf8ILm16EEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__116__narrow_to_utf8ILm32EEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__117__assoc_sub_stateE', 'size': 28}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__117__widen_from_utf8ILm16EEE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__117__widen_from_utf8ILm32EEE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__118__time_get_storageIcEE', 'size': 32}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__118__time_get_storageIwEE', 'size': 32}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__119__shared_weak_countE', 'size': 30}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IwEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__120__time_get_c_storageIcEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__120__time_get_c_storageIwEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__124__libcpp_debug_exceptionE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__15ctypeIcEE', 'size': 18}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__15ctypeIwEE', 'size': 18}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__16locale5facetE', 'size': 22}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 35}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 34}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__17collateIcEE', 'size': 20}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__17collateIwEE', 'size': 20}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 68}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 68}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 68}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 68}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18__c_nodeE', 'size': 18}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18ios_base7failureE', 'size': 26}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18ios_baseE', 'size': 18}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18messagesIcEE', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18messagesIwEE', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18numpunctIcEE', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18numpunctIwEE', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 69}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 69}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 69}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 69}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_getIcEE', 'size': 22}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_getIwEE', 'size': 22}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_putIcEE', 'size': 22}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_putIwEE', 'size': 22}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 42}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 42}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 70}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 70}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 70}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 70}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19strstreamE', 'size': 19}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSNSt3__19time_baseE', 'size': 19}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSSt12bad_any_cast', 'size': 17}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSSt16nested_exception', 'size': 21}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSSt18bad_variant_access', 'size': 23}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTSSt19bad_optional_access', 'size': 24}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTTNSt3__110istrstreamE', 'size': 32}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTTNSt3__110ostrstreamE', 'size': 32}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 16}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTTNSt3__19strstreamE', 'size': 80}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTVN10__cxxabiv117__class_type_infoE', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTVN10__cxxabiv120__si_class_type_infoE', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTVN10__cxxabiv121__vmi_class_type_infoE', 'size': 0}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt12experimental19bad_optional_accessE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__110istrstreamE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIcLb0EEE', 'size': 112}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIcLb1EEE', 'size': 112}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIwLb0EEE', 'size': 112}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIwLb1EEE', 'size': 112}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__110ostrstreamE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__111regex_errorE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__112bad_weak_ptrE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__112ctype_bynameIcEE', 'size': 104}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__112ctype_bynameIwEE', 'size': 136}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__112future_errorE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__112strstreambufE', 'size': 128}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__112system_errorE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114__codecvt_utf8IwEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114__shared_countE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 120}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114collate_bynameIcEE', 'size': 64}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114collate_bynameIwEE', 'size': 64}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__114error_categoryE', 'size': 72}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 128}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 128}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115messages_bynameIcEE', 'size': 64}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115messages_bynameIwEE', 'size': 64}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115numpunct_bynameIcEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115numpunct_bynameIwEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 224}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 224}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 48}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 48}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__117__assoc_sub_stateE', 'size': 48}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 112}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 112}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 112}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 112}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__119__shared_weak_countE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__124__libcpp_debug_exceptionE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__15ctypeIcEE', 'size': 104}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__15ctypeIwEE', 'size': 136}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__16locale5facetE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 96}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__17collateIcEE', 'size': 64}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__17collateIwEE', 'size': 64}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 128}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 128}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 104}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 104}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18__c_nodeE', 'size': 64}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18ios_base7failureE', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18ios_baseE', 'size': 32}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18messagesIcEE', 'size': 64}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18messagesIwEE', 'size': 64}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18numpunctIcEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18numpunctIwEE', 'size': 80}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 168}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 168}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 48}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 48}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 32}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 32}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVNSt3__19strstreamE', 'size': 120}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTVSt11logic_error', 'size': 0}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVSt12bad_any_cast', 'size': 40}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTVSt12length_error', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTVSt12out_of_range', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTVSt13runtime_error', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTVSt14overflow_error', 'size': 0}
+{'is_defined': False, 'type': 'OBJECT', 'name': '_ZTVSt16invalid_argument', 'size': 0}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVSt16nested_exception', 'size': 32}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVSt18bad_variant_access', 'size': 40}
+{'is_defined': True, 'type': 'OBJECT', 'name': '_ZTVSt19bad_optional_access', 'size': 40}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZThn16_NSt3__19strstreamD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZThn16_NSt3__19strstreamD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110istrstreamD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110istrstreamD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110ostrstreamD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110ostrstreamD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__19strstreamD0Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdaPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdaPvRKSt9nothrow_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdaPvSt11align_val_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdaPvSt11align_val_tRKSt9nothrow_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdaPvm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdaPvmSt11align_val_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdlPv'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdlPvRKSt9nothrow_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdlPvSt11align_val_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdlPvSt11align_val_tRKSt9nothrow_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdlPvm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZdlPvmSt11align_val_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_Znam'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZnamRKSt9nothrow_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZnamSt11align_val_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZnamSt11align_val_tRKSt9nothrow_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_Znwm'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZnwmRKSt9nothrow_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZnwmSt11align_val_t'}
+{'is_defined': True, 'type': 'FUNC', 'name': '_ZnwmSt11align_val_tRKSt9nothrow_t'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_allocate_exception'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_begin_catch'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_current_primary_exception'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_decrement_exception_refcount'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_end_catch'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_free_exception'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_guard_abort'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_guard_acquire'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_guard_release'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_increment_exception_refcount'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_pure_virtual'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_rethrow'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_rethrow_primary_exception'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_throw'}
+{'is_defined': False, 'type': 'FUNC', 'name': '__cxa_uncaught_exception'}
diff --git a/lib/buildit b/lib/buildit
index 6451a9bfad6c..6c28f7525a60 100755
--- a/lib/buildit
+++ b/lib/buildit
@@ -41,7 +41,7 @@ then
fi
EXTRA_FLAGS="-nostdinc++ -std=${CXX_LANG} -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
- -Wstrict-aliasing=2 -Wstrict-overflow=4 "
+ -Wstrict-aliasing=2 -Wstrict-overflow=4 -D_LIBCPP_BUILDING_LIBRARY "
case $TRIPLE in
*-apple-*)
diff --git a/src/algorithm.cpp b/src/algorithm.cpp
index e9752b0653e0..f036eb7abe1c 100644
--- a/src/algorithm.cpp
+++ b/src/algorithm.cpp
@@ -48,7 +48,7 @@ template bool __insertion_sort_incomplete<__less<long double>&, long double*>(lo
template unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&);
#ifndef _LIBCPP_HAS_NO_THREADS
-static __libcpp_mutex_t __rs_mut = _LIBCPP_MUTEX_INITIALIZER;
+_LIBCPP_SAFE_STATIC static __libcpp_mutex_t __rs_mut = _LIBCPP_MUTEX_INITIALIZER;
#endif
unsigned __rs_default::__c_ = 0;
diff --git a/src/any.cpp b/src/any.cpp
index f77684578905..45b2337eb353 100644
--- a/src/any.cpp
+++ b/src/any.cpp
@@ -7,12 +7,17 @@
//
//===----------------------------------------------------------------------===//
+#include "any"
#include "experimental/any"
-_LIBCPP_BEGIN_NAMESPACE_LFTS
-
+namespace std {
const char* bad_any_cast::what() const _NOEXCEPT {
return "bad any cast";
}
+}
+_LIBCPP_BEGIN_NAMESPACE_LFTS
+const char* bad_any_cast::what() const _NOEXCEPT {
+ return "bad any cast";
+}
_LIBCPP_END_NAMESPACE_LFTS
diff --git a/src/chrono.cpp b/src/chrono.cpp
index 62149fbf420c..b9d6bf97be33 100644
--- a/src/chrono.cpp
+++ b/src/chrono.cpp
@@ -12,14 +12,23 @@
#include "system_error" // __throw_system_error
#include <time.h> // clock_gettime, CLOCK_MONOTONIC and CLOCK_REALTIME
+#if defined(_WIN32)
+#define WIN32_LEAN_AND_MEAN
+#define VC_EXTRA_LEAN
+#include <Windows.h>
+#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
+#include <winapifamily.h>
+#endif
+#else
#if !defined(CLOCK_REALTIME)
#include <sys/time.h> // for gettimeofday and timeval
#endif
+#endif
-#if !defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(CLOCK_MONOTONIC)
+#if !defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK)
#if __APPLE__
#include <mach/mach_time.h> // mach_absolute_time, mach_timebase_info_data_t
-#else
+#elif !defined(_WIN32) && !defined(CLOCK_MONOTONIC)
#error "Monotonic clock not implemented"
#endif
#endif
@@ -36,6 +45,32 @@ const bool system_clock::is_steady;
system_clock::time_point
system_clock::now() _NOEXCEPT
{
+#if defined(_WIN32)
+ // FILETIME is in 100ns units
+ using filetime_duration =
+ _VSTD::chrono::duration<__int64,
+ _VSTD::ratio_multiply<_VSTD::ratio<100, 1>,
+ nanoseconds::period>>;
+
+ // The Windows epoch is Jan 1 1601, the Unix epoch Jan 1 1970.
+ static _LIBCPP_CONSTEXPR const filetime_duration
+ nt_to_unix_epoch{11644473600};
+
+ FILETIME ft;
+#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ GetSystemTimePreciseAsFileTime(&ft);
+#else
+ GetSystemTimeAsFileTime(&ft);
+#endif
+#else
+ GetSystemTimeAsFileTime(&ft);
+#endif
+
+ filetime_duration d{(static_cast<__int64>(ft.dwHighDateTime) << 32) |
+ static_cast<__int64>(ft.dwLowDateTime)};
+ return time_point(duration_cast<duration>(d - nt_to_unix_epoch));
+#else
#ifdef CLOCK_REALTIME
struct timespec tp;
if (0 != clock_gettime(CLOCK_REALTIME, &tp))
@@ -46,6 +81,7 @@ system_clock::now() _NOEXCEPT
gettimeofday(&tv, 0);
return time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec));
#endif // CLOCK_REALTIME
+#endif
}
time_t
@@ -69,18 +105,7 @@ system_clock::from_time_t(time_t t) _NOEXCEPT
const bool steady_clock::is_steady;
-#ifdef CLOCK_MONOTONIC
-
-steady_clock::time_point
-steady_clock::now() _NOEXCEPT
-{
- struct timespec tp;
- if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))
- __throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC) failed");
- return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
-}
-
-#elif defined(__APPLE__)
+#if defined(__APPLE__)
// mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
// nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom
@@ -90,8 +115,6 @@ steady_clock::now() _NOEXCEPT
// MachInfo.numer / MachInfo.denom is often 1 on the latest equipment. Specialize
// for that case as an optimization.
-#pragma GCC visibility push(hidden)
-
static
steady_clock::rep
steady_simplified()
@@ -129,8 +152,6 @@ init_steady_clock()
return &steady_full;
}
-#pragma GCC visibility pop
-
steady_clock::time_point
steady_clock::now() _NOEXCEPT
{
@@ -138,6 +159,32 @@ steady_clock::now() _NOEXCEPT
return time_point(duration(fp()));
}
+#elif defined(_WIN32)
+
+steady_clock::time_point
+steady_clock::now() _NOEXCEPT
+{
+ static LARGE_INTEGER freq;
+ static BOOL initialized = FALSE;
+ if (!initialized)
+ initialized = QueryPerformanceFrequency(&freq); // always succceeds
+
+ LARGE_INTEGER counter;
+ QueryPerformanceCounter(&counter);
+ return time_point(duration(counter.QuadPart * nano::den / freq.QuadPart));
+}
+
+#elif defined(CLOCK_MONOTONIC)
+
+steady_clock::time_point
+steady_clock::now() _NOEXCEPT
+{
+ struct timespec tp;
+ if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))
+ __throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC) failed");
+ return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
+}
+
#else
#error "Monotonic clock not implemented"
#endif
diff --git a/src/condition_variable.cpp b/src/condition_variable.cpp
index bfb4bf3925f7..25e66038eec0 100644
--- a/src/condition_variable.cpp
+++ b/src/condition_variable.cpp
@@ -79,6 +79,12 @@ condition_variable::__do_timed_wait(unique_lock<mutex>& lk,
void
notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk)
{
+ auto& tl_ptr = __thread_local_data();
+ // If this thread was not created using std::thread then it will not have
+ // previously allocated.
+ if (tl_ptr.get() == nullptr) {
+ tl_ptr.set_pointer(new __thread_struct);
+ }
__thread_local_data()->notify_all_at_thread_exit(&cond, lk.release());
}
diff --git a/src/debug.cpp b/src/debug.cpp
index b1a16e6e72d4..f2fc1ceb495a 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -7,16 +7,79 @@
//
//===----------------------------------------------------------------------===//
-#define _LIBCPP_DEBUG 1
#include "__config"
#include "__debug"
#include "functional"
#include "algorithm"
+#include "string"
+#include "cstdio"
#include "__hash_table"
#include "mutex"
_LIBCPP_BEGIN_NAMESPACE_STD
+static std::string make_what_str(__libcpp_debug_info const& info) {
+ string msg = info.__file_;
+ msg += ":" + to_string(info.__line_) + ": _LIBCPP_ASSERT '";
+ msg += info.__pred_;
+ msg += "' failed. ";
+ msg += info.__msg_;
+ return msg;
+}
+
+_LIBCPP_SAFE_STATIC __libcpp_debug_function_type
+ __libcpp_debug_function = __libcpp_abort_debug_function;
+
+bool __libcpp_set_debug_function(__libcpp_debug_function_type __func) {
+ __libcpp_debug_function = __func;
+ return true;
+}
+
+_LIBCPP_NORETURN void __libcpp_abort_debug_function(__libcpp_debug_info const& info) {
+ std::fprintf(stderr, "%s\n", make_what_str(info).c_str());
+ std::abort();
+}
+
+_LIBCPP_NORETURN void __libcpp_throw_debug_function(__libcpp_debug_info const& info) {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw __libcpp_debug_exception(info);
+#else
+ __libcpp_abort_debug_function(info);
+#endif
+}
+
+struct __libcpp_debug_exception::__libcpp_debug_exception_imp {
+ __libcpp_debug_info __info_;
+ std::string __what_str_;
+};
+
+__libcpp_debug_exception::__libcpp_debug_exception() _NOEXCEPT
+ : __imp_(nullptr) {
+}
+
+__libcpp_debug_exception::__libcpp_debug_exception(
+ __libcpp_debug_info const& info) : __imp_(new __libcpp_debug_exception_imp)
+{
+ __imp_->__info_ = info;
+ __imp_->__what_str_ = make_what_str(info);
+}
+__libcpp_debug_exception::__libcpp_debug_exception(
+ __libcpp_debug_exception const& other) : __imp_(nullptr) {
+ if (other.__imp_)
+ __imp_ = new __libcpp_debug_exception_imp(*other.__imp_);
+}
+
+__libcpp_debug_exception::~__libcpp_debug_exception() _NOEXCEPT {
+ if (__imp_)
+ delete __imp_;
+}
+
+const char* __libcpp_debug_exception::what() const _NOEXCEPT {
+ if (__imp_)
+ return __imp_->__what_str_.c_str();
+ return "__libcpp_debug_exception";
+}
+
_LIBCPP_FUNC_VIS
__libcpp_db*
__get_db()
@@ -152,11 +215,8 @@ __libcpp_db::__insert_c(void* __c)
size_t nc = __next_prime(2*static_cast<size_t>(__cend_ - __cbeg_) + 1);
__c_node** cbeg = static_cast<__c_node**>(calloc(nc, sizeof(void*)));
if (cbeg == nullptr)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
+
for (__c_node** p = __cbeg_; p != __cend_; ++p)
{
__c_node* q = *p;
@@ -178,11 +238,8 @@ __libcpp_db::__insert_c(void* __c)
__c_node* r = __cbeg_[hc] =
static_cast<__c_node*>(malloc(sizeof(__c_node)));
if (__cbeg_[hc] == nullptr)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
+
r->__c_ = __c;
r->__next_ = p;
++__csz_;
@@ -475,11 +532,8 @@ __c_node::__add(__i_node* i)
__i_node** beg =
static_cast<__i_node**>(malloc(nc * sizeof(__i_node*)));
if (beg == nullptr)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
+
if (nc > 1)
memcpy(beg, beg_, nc/2*sizeof(__i_node*));
free(beg_);
@@ -501,11 +555,8 @@ __libcpp_db::__insert_iterator(void* __i)
size_t nc = __next_prime(2*static_cast<size_t>(__iend_ - __ibeg_) + 1);
__i_node** ibeg = static_cast<__i_node**>(calloc(nc, sizeof(void*)));
if (ibeg == nullptr)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
+
for (__i_node** p = __ibeg_; p != __iend_; ++p)
{
__i_node* q = *p;
@@ -527,11 +578,8 @@ __libcpp_db::__insert_iterator(void* __i)
__i_node* r = __ibeg_[hi] =
static_cast<__i_node*>(malloc(sizeof(__i_node)));
if (r == nullptr)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
+
::new(r) __i_node(__i, p, nullptr);
++__isz_;
return r;
diff --git a/src/exception.cpp b/src/exception.cpp
index e172f642d483..96bd7ee59a02 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -32,8 +32,8 @@
#define HAVE_DEPENDENT_EH_ABI 1
#endif
#elif !defined(__GLIBCXX__) // defined(LIBCXX_BUILDING_LIBCXXABI)
- static std::terminate_handler __terminate_handler;
- static std::unexpected_handler __unexpected_handler;
+ _LIBCPP_SAFE_STATIC static std::terminate_handler __terminate_handler;
+ _LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
#endif // defined(LIBCXX_BUILDING_LIBCXXABI)
namespace std
diff --git a/src/experimental/filesystem/directory_iterator.cpp b/src/experimental/filesystem/directory_iterator.cpp
index fa217ba7a12c..a888dcfa1190 100644
--- a/src/experimental/filesystem/directory_iterator.cpp
+++ b/src/experimental/filesystem/directory_iterator.cpp
@@ -20,7 +20,7 @@ inline bool capture_error_or_throw(std::error_code* user_ec,
*user_ec = my_ec;
return true;
}
- __libcpp_throw(filesystem_error(msg, std::forward<Args>(args)..., my_ec));
+ __throw_filesystem_error(msg, std::forward<Args>(args)..., my_ec);
return false;
}
@@ -33,7 +33,7 @@ inline bool set_or_throw(std::error_code& my_ec,
*user_ec = my_ec;
return true;
}
- __libcpp_throw(filesystem_error(msg, std::forward<Args>(args)..., my_ec));
+ __throw_filesystem_error(msg, std::forward<Args>(args)..., my_ec);
return false;
}
diff --git a/src/experimental/filesystem/operations.cpp b/src/experimental/filesystem/operations.cpp
index 369996fcbe62..6c7e4cf24888 100644
--- a/src/experimental/filesystem/operations.cpp
+++ b/src/experimental/filesystem/operations.cpp
@@ -51,7 +51,7 @@ void set_or_throw(std::error_code const& m_ec, std::error_code* ec,
} else {
string msg_s("std::experimental::filesystem::");
msg_s += msg;
- __libcpp_throw(filesystem_error(msg_s, p, p2, m_ec));
+ __throw_filesystem_error(msg_s, p, p2, m_ec);
}
}
@@ -236,12 +236,11 @@ void __copy(const path& from, const path& to, copy_options options,
}
return;
}
- else if (is_directory(f)) {
- if (not bool(copy_options::recursive & options) &&
- bool(copy_options::__in_recursive_copy & options))
- {
- return;
- }
+ else if (is_directory(f) && bool(copy_options::create_symlinks & options)) {
+ return set_or_throw(make_error_code(errc::is_a_directory), ec, "copy");
+ }
+ else if (is_directory(f) && (bool(copy_options::recursive & options) ||
+ copy_options::none == options)) {
if (!exists(t)) {
// create directory to with attributes from 'from'.
@@ -283,6 +282,10 @@ bool __copy_file(const path& from, const path& to, copy_options options,
}
const bool to_exists = exists(to_st);
+ if (to_exists && !is_regular_file(to_st)) {
+ set_or_throw(make_error_code(errc::not_supported), ec, "copy_file", from, to);
+ return false;
+ }
if (to_exists && bool(copy_options::skip_existing & options)) {
return false;
}
@@ -303,6 +306,8 @@ bool __copy_file(const path& from, const path& to, copy_options options,
set_or_throw(make_error_code(errc::file_exists), ec, "copy", from, to);
return false;
}
+
+ _LIBCPP_UNREACHABLE();
}
void __copy_symlink(const path& existing_symlink, const path& new_symlink,
@@ -476,18 +481,32 @@ bool __fs_is_empty(const path& p, std::error_code *ec)
std::error_code m_ec;
struct ::stat pst;
auto st = detail::posix_stat(p, pst, &m_ec);
- if (is_directory(st))
- return directory_iterator(p) == directory_iterator{};
+ if (m_ec) {
+ set_or_throw(m_ec, ec, "is_empty", p);
+ return false;
+ }
+ else if (!is_directory(st) && !is_regular_file(st)) {
+ m_ec = make_error_code(errc::not_supported);
+ set_or_throw(m_ec, ec, "is_empty");
+ return false;
+ }
+ else if (is_directory(st)) {
+ auto it = ec ? directory_iterator(p, *ec) : directory_iterator(p);
+ if (ec && *ec)
+ return false;
+ return it == directory_iterator{};
+ }
else if (is_regular_file(st))
return static_cast<std::uintmax_t>(pst.st_size) == 0;
- // else
- set_or_throw(m_ec, ec, "is_empty", p);
- return false;
+
+ _LIBCPP_UNREACHABLE();
}
namespace detail { namespace {
+using namespace std::chrono;
+
template <class CType, class ChronoType>
bool checked_set(CType* out, ChronoType time) {
using Lim = numeric_limits<CType>;
@@ -497,8 +516,127 @@ bool checked_set(CType* out, ChronoType time) {
return true;
}
-constexpr long long min_seconds = file_time_type::duration::min().count()
- / file_time_type::period::den;
+using TimeSpec = struct ::timespec;
+using StatT = struct ::stat;
+
+#if defined(__APPLE__)
+TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
+TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }
+#else
+TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }
+__attribute__((unused)) // Suppress warning
+TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
+#endif
+
+constexpr auto max_seconds = duration_cast<seconds>(
+ file_time_type::duration::max()).count();
+
+constexpr auto max_nsec = duration_cast<nanoseconds>(
+ file_time_type::duration::max() - seconds(max_seconds)).count();
+
+constexpr auto min_seconds = duration_cast<seconds>(
+ file_time_type::duration::min()).count();
+
+constexpr auto min_nsec_timespec = duration_cast<nanoseconds>(
+ (file_time_type::duration::min() - seconds(min_seconds)) + seconds(1)).count();
+
+// Static assert that these values properly round trip.
+static_assert((seconds(min_seconds) + duration_cast<microseconds>(nanoseconds(min_nsec_timespec)))
+ - duration_cast<microseconds>(seconds(1))
+ == file_time_type::duration::min(), "");
+
+constexpr auto max_time_t = numeric_limits<time_t>::max();
+constexpr auto min_time_t = numeric_limits<time_t>::min();
+
+#if !defined(__LP64__) && defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare"
+#endif
+
+_LIBCPP_CONSTEXPR_AFTER_CXX11
+bool is_representable(TimeSpec const& tm) {
+ if (tm.tv_sec >= 0) {
+ return (tm.tv_sec < max_seconds) ||
+ (tm.tv_sec == max_seconds && tm.tv_nsec <= max_nsec);
+ } else if (tm.tv_sec == (min_seconds - 1)) {
+ return tm.tv_nsec >= min_nsec_timespec;
+ } else {
+ return (tm.tv_sec >= min_seconds);
+ }
+}
+#ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+#if defined(__LP64__)
+static_assert(is_representable({max_seconds, max_nsec}), "");
+static_assert(!is_representable({max_seconds + 1, 0}), "");
+static_assert(!is_representable({max_seconds, max_nsec + 1}), "");
+static_assert(!is_representable({max_time_t, 0}), "");
+static_assert(is_representable({min_seconds, 0}), "");
+static_assert(is_representable({min_seconds - 1, min_nsec_timespec}), "");
+static_assert(is_representable({min_seconds - 1, min_nsec_timespec + 1}), "");
+static_assert(!is_representable({min_seconds - 1, min_nsec_timespec - 1}), "");
+static_assert(!is_representable({min_time_t, 999999999}), "");
+#else
+static_assert(is_representable({max_time_t, 999999999}), "");
+static_assert(is_representable({max_time_t, 1000000000}), "");
+static_assert(is_representable({min_time_t, 0}), "");
+#endif
+#endif
+
+_LIBCPP_CONSTEXPR_AFTER_CXX11
+bool is_representable(file_time_type const& tm) {
+ auto secs = duration_cast<seconds>(tm.time_since_epoch());
+ auto nsecs = duration_cast<nanoseconds>(tm.time_since_epoch() - secs);
+ if (nsecs.count() < 0) {
+ secs = secs + seconds(1);
+ nsecs = nsecs + seconds(1);
+ }
+ using TLim = numeric_limits<time_t>;
+ if (secs.count() >= 0)
+ return secs.count() <= TLim::max();
+ return secs.count() >= TLim::min();
+}
+#ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+#if defined(__LP64__)
+static_assert(is_representable(file_time_type::max()), "");
+static_assert(is_representable(file_time_type::min()), "");
+#else
+static_assert(!is_representable(file_time_type::max()), "");
+static_assert(!is_representable(file_time_type::min()), "");
+static_assert(is_representable(file_time_type(seconds(max_time_t))), "");
+static_assert(is_representable(file_time_type(seconds(min_time_t))), "");
+#endif
+#endif
+
+_LIBCPP_CONSTEXPR_AFTER_CXX11
+file_time_type convert_timespec(TimeSpec const& tm) {
+ auto adj_msec = duration_cast<microseconds>(nanoseconds(tm.tv_nsec));
+ if (tm.tv_sec >= 0) {
+ auto Dur = seconds(tm.tv_sec) + microseconds(adj_msec);
+ return file_time_type(Dur);
+ } else if (duration_cast<microseconds>(nanoseconds(tm.tv_nsec)).count() == 0) {
+ return file_time_type(seconds(tm.tv_sec));
+ } else { // tm.tv_sec < 0
+ auto adj_subsec = duration_cast<microseconds>(seconds(1) - nanoseconds(tm.tv_nsec));
+ auto Dur = seconds(tm.tv_sec + 1) - adj_subsec;
+ return file_time_type(Dur);
+ }
+}
+#ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+#if defined(__LP64__)
+static_assert(convert_timespec({max_seconds, max_nsec}) == file_time_type::max(), "");
+static_assert(convert_timespec({max_seconds, max_nsec - 1}) < file_time_type::max(), "");
+static_assert(convert_timespec({max_seconds - 1, 999999999}) < file_time_type::max(), "");
+static_assert(convert_timespec({min_seconds - 1, min_nsec_timespec}) == file_time_type::min(), "");
+static_assert(convert_timespec({min_seconds - 1, min_nsec_timespec + 1}) > file_time_type::min(), "");
+static_assert(convert_timespec({min_seconds , 0}) > file_time_type::min(), "");
+#else
+// FIXME add tests for 32 bit builds
+#endif
+#endif
+
+#if !defined(__LP64__) && defined(__clang__)
+#pragma clang diagnostic pop
+#endif
template <class SubSecDurT, class SubSecT>
bool set_times_checked(time_t* sec_out, SubSecT* subsec_out, file_time_type tp) {
@@ -509,7 +647,6 @@ bool set_times_checked(time_t* sec_out, SubSecT* subsec_out, file_time_type tp)
// The tv_nsec and tv_usec fields must not be negative so adjust accordingly
if (subsec_dur.count() < 0) {
if (sec_dur.count() > min_seconds) {
-
sec_dur -= seconds(1);
subsec_dur += seconds(1);
} else {
@@ -522,9 +659,9 @@ bool set_times_checked(time_t* sec_out, SubSecT* subsec_out, file_time_type tp)
}} // end namespace detail
-
file_time_type __last_write_time(const path& p, std::error_code *ec)
{
+ using namespace ::std::chrono;
std::error_code m_ec;
struct ::stat st;
detail::posix_stat(p, st, &m_ec);
@@ -533,7 +670,13 @@ file_time_type __last_write_time(const path& p, std::error_code *ec)
return file_time_type::min();
}
if (ec) ec->clear();
- return file_time_type::clock::from_time_t(st.st_mtime);
+ auto ts = detail::extract_mtime(st);
+ if (!detail::is_representable(ts)) {
+ set_or_throw(error_code(EOVERFLOW, generic_category()), ec,
+ "last_write_time", p);
+ return file_time_type::min();
+ }
+ return detail::convert_timespec(ts);
}
void __last_write_time(const path& p, file_time_type new_time,
@@ -554,9 +697,10 @@ void __last_write_time(const path& p, file_time_type new_time,
set_or_throw(m_ec, ec, "last_write_time", p);
return;
}
+ auto atime = detail::extract_atime(st);
struct ::timeval tbuf[2];
- tbuf[0].tv_sec = st.st_atime;
- tbuf[0].tv_usec = 0;
+ tbuf[0].tv_sec = atime.tv_sec;
+ tbuf[0].tv_usec = duration_cast<microseconds>(nanoseconds(atime.tv_nsec)).count();
const bool overflowed = !detail::set_times_checked<microseconds>(
&tbuf[1].tv_sec, &tbuf[1].tv_usec, new_time);
@@ -720,7 +864,7 @@ space_info __space(const path& p, std::error_code *ec) {
// Multiply with overflow checking.
auto do_mult = [&](std::uintmax_t& out, std::uintmax_t other) {
out = other * m_svfs.f_frsize;
- if (out / other != m_svfs.f_frsize || other == 0)
+ if (other == 0 || out / other != m_svfs.f_frsize)
out = static_cast<std::uintmax_t>(-1);
};
do_mult(si.capacity, m_svfs.f_blocks);
diff --git a/src/experimental/filesystem/path.cpp b/src/experimental/filesystem/path.cpp
index 38c449832f6e..96b81f7b0a70 100644
--- a/src/experimental/filesystem/path.cpp
+++ b/src/experimental/filesystem/path.cpp
@@ -6,242 +6,279 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+#undef NDEBUG
#include "experimental/filesystem"
-#include "experimental/string_view"
+#include "string_view"
#include "utility"
-
-_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
-
-_LIBCPP_CONSTEXPR path::value_type path::preferred_separator;
+#include "cassert"
namespace { namespace parser
{
+using namespace std;
+using namespace std::experimental::filesystem;
+
+using string_view_t = path::__string_view;
+using string_view_pair = pair<string_view_t, string_view_t>;
+using PosPtr = path::value_type const*;
+
+struct PathParser {
+ enum ParserState : unsigned char {
+ // Zero is a special sentinel value used by default constructed iterators.
+ PS_BeforeBegin = 1,
+ PS_InRootName,
+ PS_InRootDir,
+ PS_InFilenames,
+ PS_InTrailingSep,
+ PS_AtEnd
+ };
-using string_type = string_view;
-using value_type = path::value_type;
-
-using string_view_pair = pair<string_view, string_view>;
-
-// status reporting
-constexpr size_t npos = static_cast<size_t>(-1);
-
-inline bool good(size_t pos) { return pos != npos; }
-
-// lexical elements
-constexpr value_type preferred_separator = path::preferred_separator;
-constexpr value_type const * preferred_separator_str = "/";
-constexpr value_type const * dot = ".";
-
-// forward //
-bool is_separator(string_type const &, size_t);
-bool is_root_name(const string_type&, size_t);
-bool is_root_directory(string_type const &, size_t);
-bool is_trailing_separator(string_type const &, size_t);
-
-size_t start_of(string_type const &, size_t);
-size_t end_of(string_type const &, size_t);
-
-size_t root_name_start(const string_type& s);
-size_t root_name_end(const string_type&);
-
-size_t root_directory_start(string_type const &);
-size_t root_directory_end(string_type const &);
+ const string_view_t Path;
+ string_view_t RawEntry;
+ ParserState State;
-string_view_pair separate_filename(string_type const &);
-string_view extract_raw(string_type const &, size_t);
-string_view extract_preferred(string_type const &, size_t);
+private:
+ PathParser(string_view_t P, ParserState State) noexcept
+ : Path(P), State(State) {}
-inline bool is_separator(const string_type& s, size_t pos) {
- return (pos < s.size() && s[pos] == preferred_separator);
-}
+public:
+ PathParser(string_view_t P, string_view_t E, unsigned char S)
+ : Path(P), RawEntry(E), State(static_cast<ParserState>(S)) {
+ // S cannot be '0' or PS_BeforeBegin.
+ }
-inline bool is_root_name(const string_type& s, size_t pos) {
- return good(pos) && pos == 0 ? root_name_start(s) == pos : false;
-}
+ static PathParser CreateBegin(string_view_t P) noexcept {
+ PathParser PP(P, PS_BeforeBegin);
+ PP.increment();
+ return PP;
+ }
-inline bool is_root_directory(const string_type& s, size_t pos) {
- return good(pos) ? root_directory_start(s) == pos : false;
-}
+ static PathParser CreateEnd(string_view_t P) noexcept {
+ PathParser PP(P, PS_AtEnd);
+ return PP;
+ }
-inline bool is_trailing_separator(const string_type& s, size_t pos) {
- return (pos < s.size() && is_separator(s, pos) &&
- end_of(s, pos) == s.size()-1 &&
- !is_root_directory(s, pos) && !is_root_name(s, pos));
-}
+ PosPtr peek() const noexcept {
+ auto End = &Path.back() + 1;
+ auto TkEnd = getNextTokenStartPos();
+ return TkEnd == End ? nullptr : TkEnd;
+ }
-size_t start_of(const string_type& s, size_t pos) {
- if (pos >= s.size()) return npos;
- bool in_sep = (s[pos] == preferred_separator);
- while (pos - 1 < s.size() &&
- (s[pos-1] == preferred_separator) == in_sep)
- { --pos; }
- if (pos == 2 && !in_sep && s[0] == preferred_separator &&
- s[1] == preferred_separator)
- { return 0; }
- return pos;
-}
+ void increment() noexcept {
+ const PosPtr End = &Path.back() + 1;
+ const PosPtr Start = getNextTokenStartPos();
+ if (Start == End)
+ return makeState(PS_AtEnd);
+
+ switch (State) {
+ case PS_BeforeBegin: {
+ PosPtr TkEnd = consumeSeparator(Start, End);
+ // If we consumed exactly two separators we have a root name.
+ if (TkEnd && TkEnd == Start + 2) {
+ // FIXME Do we need to consume a name or is '//' a root name on its own?
+ // what about '//.', '//..', '//...'?
+ auto NameEnd = consumeName(TkEnd, End);
+ if (NameEnd)
+ TkEnd = NameEnd;
+ return makeState(PS_InRootName, Start, TkEnd);
+ }
+ else if (TkEnd)
+ return makeState(PS_InRootDir, Start, TkEnd);
+ else
+ return makeState(PS_InFilenames, Start, consumeName(Start, End));
+ }
-size_t end_of(const string_type& s, size_t pos) {
- if (pos >= s.size()) return npos;
- // special case for root name
- if (pos == 0 && is_root_name(s, pos)) return root_name_end(s);
- bool in_sep = (s[pos] == preferred_separator);
- while (pos + 1 < s.size() && (s[pos+1] == preferred_separator) == in_sep)
- { ++pos; }
- return pos;
-}
+ case PS_InRootName:
+ return makeState(PS_InRootDir, Start, consumeSeparator(Start, End));
+ case PS_InRootDir:
+ return makeState(PS_InFilenames, Start, consumeName(Start, End));
+
+ case PS_InFilenames: {
+ PosPtr SepEnd = consumeSeparator(Start, End);
+ if (SepEnd != End) {
+ PosPtr TkEnd = consumeName(SepEnd, End);
+ if (TkEnd)
+ return makeState(PS_InFilenames, SepEnd, TkEnd);
+ }
+ return makeState(PS_InTrailingSep, Start, SepEnd);
+ }
-inline size_t root_name_start(const string_type& s) {
- return good(root_name_end(s)) ? 0 : npos;
-}
+ case PS_InTrailingSep:
+ return makeState(PS_AtEnd);
-size_t root_name_end(const string_type& s) {
- if (s.size() < 2 || s[0] != preferred_separator
- || s[1] != preferred_separator) {
- return npos;
+ case PS_AtEnd:
+ _LIBCPP_UNREACHABLE();
}
- if (s.size() == 2) {
- return 1;
+ }
+
+ void decrement() noexcept {
+ const PosPtr REnd = &Path.front() - 1;
+ const PosPtr RStart = getCurrentTokenStartPos() - 1;
+ assert(RStart != REnd);
+
+ switch (State) {
+ case PS_AtEnd: {
+ // Try to consume a trailing separator or root directory first.
+ if (PosPtr SepEnd = consumeSeparator(RStart, REnd)) {
+ if (SepEnd == REnd)
+ return makeState((RStart == REnd + 2) ? PS_InRootName : PS_InRootDir,
+ Path.data(), RStart + 1);
+ // Check if we're seeing the root directory separator
+ auto PP = CreateBegin(Path);
+ bool InRootDir = PP.State == PS_InRootName &&
+ &PP.RawEntry.back() == SepEnd;
+ return makeState(InRootDir ? PS_InRootDir : PS_InTrailingSep,
+ SepEnd + 1, RStart + 1);
+ } else {
+ PosPtr TkStart = consumeName(RStart, REnd);
+ if (TkStart == REnd + 2 && consumeSeparator(TkStart, REnd) == REnd)
+ return makeState(PS_InRootName, Path.data(), RStart + 1);
+ else
+ return makeState(PS_InFilenames, TkStart + 1, RStart + 1);
+ }
}
- size_t index = 2; // current position
- if (s[index] == preferred_separator) {
- return npos;
+ case PS_InTrailingSep:
+ return makeState(PS_InFilenames, consumeName(RStart, REnd) + 1, RStart + 1);
+ case PS_InFilenames: {
+ PosPtr SepEnd = consumeSeparator(RStart, REnd);
+ if (SepEnd == REnd)
+ return makeState((RStart == REnd + 2) ? PS_InRootName : PS_InRootDir,
+ Path.data(), RStart + 1);
+ PosPtr TkEnd = consumeName(SepEnd, REnd);
+ if (TkEnd == REnd + 2 && consumeSeparator(TkEnd, REnd) == REnd)
+ return makeState(PS_InRootDir, SepEnd + 1, RStart + 1);
+ return makeState(PS_InFilenames, TkEnd + 1, SepEnd + 1);
}
- while (index + 1 < s.size() && s[index+1] != preferred_separator) {
- ++index;
+ case PS_InRootDir:
+ return makeState(PS_InRootName, Path.data(), RStart + 1);
+ case PS_InRootName:
+ case PS_BeforeBegin:
+ _LIBCPP_UNREACHABLE();
}
- return index;
-}
-
-size_t root_directory_start(const string_type& s) {
- size_t e = root_name_end(s);
- if (!good(e))
- return is_separator(s, 0) ? 0 : npos;
- return is_separator(s, e + 1) ? e + 1 : npos;
-}
-
-size_t root_directory_end(const string_type& s) {
- size_t st = root_directory_start(s);
- if (!good(st)) return npos;
- size_t index = st;
- while (index + 1 < s.size() && s[index + 1] == preferred_separator)
- { ++index; }
- return index;
-}
-
-string_view_pair separate_filename(string_type const & s) {
- if (s == "." || s == ".." || s.empty()) return string_view_pair{s, ""};
- auto pos = s.find_last_of('.');
- if (pos == string_type::npos) return string_view_pair{s, string_view{}};
- return string_view_pair{s.substr(0, pos), s.substr(pos)};
-}
-
-inline string_view extract_raw(const string_type& s, size_t pos) {
- size_t end_i = end_of(s, pos);
- if (!good(end_i)) return string_view{};
- return string_view(s).substr(pos, end_i - pos + 1);
-}
-
-string_view extract_preferred(const string_type& s, size_t pos) {
- string_view raw = extract_raw(s, pos);
- if (raw.empty())
- return raw;
- if (is_trailing_separator(s, pos))
- return string_view{dot};
- if (is_separator(s, pos) && !is_root_name(s, pos))
- return string_view(preferred_separator_str);
- return raw;
-}
-
-}} // namespace parser
-
-
-////////////////////////////////////////////////////////////////////////////////
-// path_view_iterator
-////////////////////////////////////////////////////////////////////////////////
-namespace {
-
-struct path_view_iterator {
- const string_view __s_;
- size_t __pos_;
+ }
- explicit path_view_iterator(string_view const& __s) : __s_(__s), __pos_(__s_.empty() ? parser::npos : 0) {}
- explicit path_view_iterator(string_view const& __s, size_t __p) : __s_(__s), __pos_(__p) {}
+ /// \brief Return a view with the "preferred representation" of the current
+ /// element. For example trailing separators are represented as a '.'
+ string_view_t operator*() const noexcept {
+ switch (State) {
+ case PS_BeforeBegin:
+ case PS_AtEnd:
+ return "";
+ case PS_InRootDir:
+ return "/";
+ case PS_InTrailingSep:
+ return ".";
+ case PS_InRootName:
+ case PS_InFilenames:
+ return RawEntry;
+ }
+ _LIBCPP_UNREACHABLE();
+ }
- string_view operator*() const {
- return parser::extract_preferred(__s_, __pos_);
+ explicit operator bool() const noexcept {
+ return State != PS_BeforeBegin && State != PS_AtEnd;
}
- path_view_iterator& operator++() {
+ PathParser& operator++() noexcept {
increment();
return *this;
}
- path_view_iterator& operator--() {
+ PathParser& operator--() noexcept {
decrement();
return *this;
}
- void increment() {
- if (__pos_ == parser::npos) return;
- while (! set_position(parser::end_of(__s_, __pos_)+1))
- ;
- return;
+private:
+ void makeState(ParserState NewState, PosPtr Start, PosPtr End) noexcept {
+ State = NewState;
+ RawEntry = string_view_t(Start, End - Start);
+ }
+ void makeState(ParserState NewState) noexcept {
+ State = NewState;
+ RawEntry = {};
}
- void decrement() {
- if (__pos_ == 0) {
- set_position(0);
- }
- else if (__pos_ == parser::npos) {
- auto const str_size = __s_.size();
- set_position(parser::start_of(
- __s_, str_size != 0 ? str_size - 1 : str_size));
- } else {
- while (!set_position(parser::start_of(__s_, __pos_-1)))
- ;
+ /// \brief Return a pointer to the first character after the currently
+ /// lexed element.
+ PosPtr getNextTokenStartPos() const noexcept {
+ switch (State) {
+ case PS_BeforeBegin:
+ return &Path.front();
+ case PS_InRootName:
+ case PS_InRootDir:
+ case PS_InFilenames:
+ return &RawEntry.back() + 1;
+ case PS_InTrailingSep:
+ case PS_AtEnd:
+ return &Path.back() + 1;
}
+ _LIBCPP_UNREACHABLE();
}
- bool set_position(size_t pos) {
- if (pos >= __s_.size()) {
- __pos_ = parser::npos;
- } else {
- __pos_ = pos;
+ /// \brief Return a pointer to the first character in the currently lexed
+ /// element.
+ PosPtr getCurrentTokenStartPos() const noexcept {
+ switch (State) {
+ case PS_BeforeBegin:
+ case PS_InRootName:
+ return &Path.front();
+ case PS_InRootDir:
+ case PS_InFilenames:
+ case PS_InTrailingSep:
+ return &RawEntry.front();
+ case PS_AtEnd:
+ return &Path.back() + 1;
}
- return valid_iterator_position();
+ _LIBCPP_UNREACHABLE();
}
- bool valid_iterator_position() const {
- if (__pos_ == parser::npos) return true; // end position is valid
- return (!parser::is_separator (__s_, __pos_) ||
- parser::is_root_directory (__s_, __pos_) ||
- parser::is_trailing_separator(__s_, __pos_) ||
- parser::is_root_name (__s_, __pos_));
+ PosPtr consumeSeparator(PosPtr P, PosPtr End) const noexcept {
+ if (P == End || *P != '/')
+ return nullptr;
+ const int Inc = P < End ? 1 : -1;
+ P += Inc;
+ while (P != End && *P == '/')
+ P += Inc;
+ return P;
}
- bool is_end() const { return __pos_ == parser::npos; }
-
- inline bool operator==(path_view_iterator const& __p) {
- return __pos_ == __p.__pos_;
+ PosPtr consumeName(PosPtr P, PosPtr End) const noexcept {
+ if (P == End || *P == '/')
+ return nullptr;
+ const int Inc = P < End ? 1 : -1;
+ P += Inc;
+ while (P != End && *P != '/')
+ P += Inc;
+ return P;
}
};
-path_view_iterator pbegin(path const& p) {
- return path_view_iterator(p.native());
+string_view_pair separate_filename(string_view_t const & s) {
+ if (s == "." || s == ".." || s.empty()) return string_view_pair{s, ""};
+ auto pos = s.find_last_of('.');
+ if (pos == string_view_t::npos) return string_view_pair{s, string_view{}};
+ return string_view_pair{s.substr(0, pos), s.substr(pos)};
}
-path_view_iterator pend(path const& p) {
- path_view_iterator __p(p.native());
- __p.__pos_ = parser::npos;
- return __p;
+string_view_t createView(PosPtr S, PosPtr E) noexcept {
+ return {S, static_cast<size_t>(E - S) + 1};
}
-} // end namespace
+}} // namespace parser
+
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
+
+using parser::string_view_t;
+using parser::string_view_pair;
+using parser::PathParser;
+using parser::createView;
+
///////////////////////////////////////////////////////////////////////////////
// path definitions
///////////////////////////////////////////////////////////////////////////////
+constexpr path::value_type path::preferred_separator;
+
path & path::replace_extension(path const & replacement)
{
path p = extension();
@@ -260,131 +297,146 @@ path & path::replace_extension(path const & replacement)
///////////////////////////////////////////////////////////////////////////////
// path.decompose
-string_view path::__root_name() const
+string_view_t path::__root_name() const
{
- return parser::is_root_name(__pn_, 0)
- ? parser::extract_preferred(__pn_, 0)
- : string_view{};
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (PP.State == PathParser::PS_InRootName)
+ return *PP;
+ return {};
}
-string_view path::__root_directory() const
+string_view_t path::__root_directory() const
{
- auto start_i = parser::root_directory_start(__pn_);
- if(!parser::good(start_i)) {
- return {};
- }
- return parser::extract_preferred(__pn_, start_i);
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (PP.State == PathParser::PS_InRootName)
+ ++PP;
+ if (PP.State == PathParser::PS_InRootDir)
+ return *PP;
+ return {};
}
-string_view path::__relative_path() const
+string_view_t path::__root_path_raw() const
{
- if (empty()) {
- return {__pn_};
- }
- auto end_i = parser::root_directory_end(__pn_);
- if (not parser::good(end_i)) {
- end_i = parser::root_name_end(__pn_);
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (PP.State == PathParser::PS_InRootName) {
+ auto NextCh = PP.peek();
+ if (NextCh && *NextCh == '/') {
+ ++PP;
+ assert(PP.State == PathParser::PS_InRootDir);
+ return createView(__pn_.data(), &PP.RawEntry.back());
+ }
+ return PP.RawEntry;
}
- if (not parser::good(end_i)) {
- return {__pn_};
- }
- return string_view(__pn_).substr(end_i+1);
+ if (PP.State == PathParser::PS_InRootDir)
+ return *PP;
+ return {};
}
-string_view path::__parent_path() const
+string_view_t path::__relative_path() const
{
- if (empty() || pbegin(*this) == --pend(*this)) {
- return {};
- }
- auto end_it = --(--pend(*this));
- auto end_i = parser::end_of(__pn_, end_it.__pos_);
- return string_view(__pn_).substr(0, end_i+1);
+ auto PP = PathParser::CreateBegin(__pn_);
+ while (PP.State <= PathParser::PS_InRootDir)
+ ++PP;
+ if (PP.State == PathParser::PS_AtEnd)
+ return {};
+ return createView(PP.RawEntry.data(), &__pn_.back());
}
-string_view path::__filename() const
+string_view_t path::__parent_path() const
{
- return empty() ? string_view{} : *--pend(*this);
+ if (empty())
+ return {};
+ auto PP = PathParser::CreateEnd(__pn_);
+ --PP;
+ if (PP.RawEntry.data() == __pn_.data())
+ return {};
+ --PP;
+ return createView(__pn_.data(), &PP.RawEntry.back());
}
-string_view path::__stem() const
+string_view_t path::__filename() const
+{
+ if (empty()) return {};
+ return *(--PathParser::CreateEnd(__pn_));
+}
+
+string_view_t path::__stem() const
{
return parser::separate_filename(__filename()).first;
}
-string_view path::__extension() const
+string_view_t path::__extension() const
{
return parser::separate_filename(__filename()).second;
}
////////////////////////////////////////////////////////////////////////////
// path.comparisons
-int path::__compare(const value_type* __s) const {
- path_view_iterator thisIter(this->native());
- path_view_iterator sIter(__s);
- while (!thisIter.is_end() && !sIter.is_end()) {
- int res = (*thisIter).compare(*sIter);
+int path::__compare(string_view_t __s) const {
+ auto PP = PathParser::CreateBegin(__pn_);
+ auto PP2 = PathParser::CreateBegin(__s);
+ while (PP && PP2) {
+ int res = (*PP).compare(*PP2);
if (res != 0) return res;
- ++thisIter; ++sIter;
+ ++PP; ++PP2;
}
- if (thisIter.is_end() && sIter.is_end())
+ if (PP.State == PP2.State && PP.State == PathParser::PS_AtEnd)
return 0;
- if (thisIter.is_end())
+ if (PP.State == PathParser::PS_AtEnd)
return -1;
return 1;
}
////////////////////////////////////////////////////////////////////////////
// path.nonmembers
-size_t hash_value(const path& __p) _NOEXCEPT {
- path_view_iterator thisIter(__p.native());
- struct HashPairT {
- size_t first;
- size_t second;
- };
- HashPairT hp = {0, 0};
+size_t hash_value(const path& __p) noexcept {
+ auto PP = PathParser::CreateBegin(__p.native());
+ size_t hash_value = 0;
std::hash<string_view> hasher;
- std::__scalar_hash<decltype(hp)> pair_hasher;
- while (!thisIter.is_end()) {
- hp.second = hasher(*thisIter);
- hp.first = pair_hasher(hp);
- ++thisIter;
+ while (PP) {
+ hash_value = __hash_combine(hash_value, hasher(*PP));
+ ++PP;
}
- return hp.first;
+ return hash_value;
}
////////////////////////////////////////////////////////////////////////////
// path.itr
path::iterator path::begin() const
{
- path_view_iterator pit = pbegin(*this);
+ auto PP = PathParser::CreateBegin(__pn_);
iterator it;
it.__path_ptr_ = this;
- it.__pos_ = pit.__pos_;
- it.__elem_.__assign_view(*pit);
+ it.__state_ = PP.State;
+ it.__entry_ = PP.RawEntry;
+ it.__stashed_elem_.__assign_view(*PP);
return it;
}
path::iterator path::end() const
{
iterator it{};
+ it.__state_ = PathParser::PS_AtEnd;
it.__path_ptr_ = this;
- it.__pos_ = parser::npos;
return it;
}
path::iterator& path::iterator::__increment() {
- path_view_iterator it(__path_ptr_->native(), __pos_);
- it.increment();
- __pos_ = it.__pos_;
- __elem_.__assign_view(*it);
+ static_assert(__at_end == PathParser::PS_AtEnd, "");
+ PathParser PP(__path_ptr_->native(), __entry_, __state_);
+ ++PP;
+ __state_ = PP.State;
+ __entry_ = PP.RawEntry;
+ __stashed_elem_.__assign_view(*PP);
return *this;
}
path::iterator& path::iterator::__decrement() {
- path_view_iterator it(__path_ptr_->native(), __pos_);
- it.decrement();
- __pos_ = it.__pos_;
- __elem_.__assign_view(*it);
+ PathParser PP(__path_ptr_->native(), __entry_, __state_);
+ --PP;
+ __state_ = PP.State;
+ __entry_ = PP.RawEntry;
+ __stashed_elem_.__assign_view(*PP);
return *this;
}
diff --git a/src/experimental/memory_resource.cpp b/src/experimental/memory_resource.cpp
index c01eb0823bae..3e87a2dedded 100644
--- a/src/experimental/memory_resource.cpp
+++ b/src/experimental/memory_resource.cpp
@@ -50,11 +50,7 @@ public:
protected:
virtual void* do_allocate(size_t, size_t) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw std::bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
}
virtual void do_deallocate(void *, size_t, size_t) {}
virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT
@@ -74,7 +70,10 @@ union ResourceInitHelper {
};
// When compiled in C++14 this initialization should be a constant expression.
// Only in C++11 is "init_priority" needed to ensure initialization order.
-ResourceInitHelper res_init __attribute__((init_priority (101)));
+#if _LIBCPP_STD_VER > 11
+_LIBCPP_SAFE_STATIC
+#endif
+ResourceInitHelper res_init __attribute__((init_priority (101)));
} // end namespace
@@ -93,7 +92,7 @@ static memory_resource *
__default_memory_resource(bool set = false, memory_resource * new_res = nullptr) _NOEXCEPT
{
#ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER
- static atomic<memory_resource*> __res =
+ _LIBCPP_SAFE_STATIC static atomic<memory_resource*> __res =
ATOMIC_VAR_INIT(&res_init.resources.new_delete_res);
if (set) {
new_res = new_res ? new_res : new_delete_resource();
@@ -106,7 +105,7 @@ __default_memory_resource(bool set = false, memory_resource * new_res = nullptr)
&__res, memory_order::memory_order_acquire);
}
#elif !defined(_LIBCPP_HAS_NO_THREADS)
- static memory_resource * res = &res_init.resources.new_delete_res;
+ _LIBCPP_SAFE_STATIC static memory_resource * res = &res_init.resources.new_delete_res;
static mutex res_lock;
if (set) {
new_res = new_res ? new_res : new_delete_resource();
@@ -119,7 +118,7 @@ __default_memory_resource(bool set = false, memory_resource * new_res = nullptr)
return res;
}
#else
- static memory_resource* res = &res_init.resources.new_delete_res;
+ _LIBCPP_SAFE_STATIC static memory_resource* res = &res_init.resources.new_delete_res;
if (set) {
new_res = new_res ? new_res : new_delete_resource();
memory_resource * old_res = res;
diff --git a/src/include/atomic_support.h b/src/include/atomic_support.h
index 8b719c5f2214..af0f5f505ea5 100644
--- a/src/include/atomic_support.h
+++ b/src/include/atomic_support.h
@@ -45,7 +45,7 @@ namespace {
enum __libcpp_atomic_order {
_AO_Relaxed = __ATOMIC_RELAXED,
_AO_Consume = __ATOMIC_CONSUME,
- _AO_Aquire = __ATOMIC_ACQUIRE,
+ _AO_Acquire = __ATOMIC_ACQUIRE,
_AO_Release = __ATOMIC_RELEASE,
_AO_Acq_Rel = __ATOMIC_ACQ_REL,
_AO_Seq = __ATOMIC_SEQ_CST
diff --git a/src/include/config_elast.h b/src/include/config_elast.h
index 9d6a76b0c004..53b3184d4c17 100644
--- a/src/include/config_elast.h
+++ b/src/include/config_elast.h
@@ -20,6 +20,8 @@
#define _LIBCPP_ELAST ELAST
#elif defined(_NEWLIB_VERSION)
#define _LIBCPP_ELAST __ELASTERROR
+#elif defined(__Fuchsia__)
+// No _LIBCPP_ELAST needed on Fuchsia
#elif defined(__linux__)
#define _LIBCPP_ELAST 4095
#elif defined(__APPLE__)
diff --git a/src/ios.cpp b/src/ios.cpp
index 23e3ee0ca044..7c76ca258b26 100644
--- a/src/ios.cpp
+++ b/src/ios.cpp
@@ -25,19 +25,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template class basic_ios<char>;
-template class basic_ios<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<wchar_t>;
-template class basic_streambuf<char>;
-template class basic_streambuf<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<wchar_t>;
-template class basic_istream<char>;
-template class basic_istream<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<wchar_t>;
-template class basic_ostream<char>;
-template class basic_ostream<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
-template class basic_iostream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream<char>;
class _LIBCPP_HIDDEN __iostream_category
: public __do_message
diff --git a/src/locale.cpp b/src/locale.cpp
index da2fd11678d6..5d6ccd5fb02e 100644
--- a/src/locale.cpp
+++ b/src/locale.cpp
@@ -28,7 +28,7 @@
#include "__sso_allocator"
#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
#include "support/win32/locale_win32.h"
-#elif !defined(__ANDROID__)
+#elif !defined(__BIONIC__)
#include <langinfo.h>
#endif
#include <stdlib.h>
@@ -107,6 +107,16 @@ countof(const T * const begin, const T * const end)
return static_cast<size_t>(end - begin);
}
+_LIBCPP_NORETURN static void __throw_runtime_error(const string &msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw runtime_error(msg);
+#else
+ (void)msg;
+ _VSTD::abort();
+#endif
+}
+
}
#if defined(_AIX)
@@ -646,22 +656,18 @@ collate_byname<char>::collate_byname(const char* n, size_t refs)
: collate<char>(refs),
__l(newlocale(LC_ALL_MASK, n, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("collate_byname<char>::collate_byname"
+ __throw_runtime_error("collate_byname<char>::collate_byname"
" failed to construct for " + string(n));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
collate_byname<char>::collate_byname(const string& name, size_t refs)
: collate<char>(refs),
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("collate_byname<char>::collate_byname"
+ __throw_runtime_error("collate_byname<char>::collate_byname"
" failed to construct for " + name);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
collate_byname<char>::~collate_byname()
@@ -698,22 +704,18 @@ collate_byname<wchar_t>::collate_byname(const char* n, size_t refs)
: collate<wchar_t>(refs),
__l(newlocale(LC_ALL_MASK, n, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
+ __throw_runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
" failed to construct for " + string(n));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
collate_byname<wchar_t>::collate_byname(const string& name, size_t refs)
: collate<wchar_t>(refs),
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
+ __throw_runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
" failed to construct for " + name);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
collate_byname<wchar_t>::~collate_byname()
@@ -1172,22 +1174,18 @@ ctype_byname<char>::ctype_byname(const char* name, size_t refs)
: ctype<char>(0, false, refs),
__l(newlocale(LC_ALL_MASK, name, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("ctype_byname<char>::ctype_byname"
+ __throw_runtime_error("ctype_byname<char>::ctype_byname"
" failed to construct for " + string(name));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
ctype_byname<char>::ctype_byname(const string& name, size_t refs)
: ctype<char>(0, false, refs),
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("ctype_byname<char>::ctype_byname"
+ __throw_runtime_error("ctype_byname<char>::ctype_byname"
" failed to construct for " + name);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
ctype_byname<char>::~ctype_byname()
@@ -1229,22 +1227,18 @@ ctype_byname<wchar_t>::ctype_byname(const char* name, size_t refs)
: ctype<wchar_t>(refs),
__l(newlocale(LC_ALL_MASK, name, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("ctype_byname<wchar_t>::ctype_byname"
+ __throw_runtime_error("ctype_byname<wchar_t>::ctype_byname"
" failed to construct for " + string(name));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
ctype_byname<wchar_t>::ctype_byname(const string& name, size_t refs)
: ctype<wchar_t>(refs),
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("ctype_byname<wchar_t>::ctype_byname"
+ __throw_runtime_error("ctype_byname<wchar_t>::ctype_byname"
" failed to construct for " + name);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
ctype_byname<wchar_t>::~ctype_byname()
@@ -1504,11 +1498,9 @@ codecvt<wchar_t, char, mbstate_t>::codecvt(const char* nm, size_t refs)
: locale::facet(refs),
__l(newlocale(LC_ALL_MASK, nm, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("codecvt_byname<wchar_t, char, mbstate_t>::codecvt_byname"
+ __throw_runtime_error("codecvt_byname<wchar_t, char, mbstate_t>::codecvt_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
codecvt<wchar_t, char, mbstate_t>::~codecvt()
@@ -4191,6 +4183,54 @@ __widen_from_utf8<32>::~__widen_from_utf8()
{
}
+
+static bool checked_string_to_wchar_convert(wchar_t& dest,
+ const char* ptr,
+ __locale_struct* loc) {
+ if (*ptr == '\0')
+ return false;
+ mbstate_t mb = {};
+ wchar_t out;
+ size_t ret = __libcpp_mbrtowc_l(&out, ptr, strlen(ptr), &mb, loc);
+ if (ret == static_cast<size_t>(-1) || ret == static_cast<size_t>(-2)) {
+ return false;
+ }
+ dest = out;
+ return true;
+}
+
+static bool checked_string_to_char_convert(char& dest,
+ const char* ptr,
+ __locale_struct* __loc) {
+ if (*ptr == '\0')
+ return false;
+ if (!ptr[1]) {
+ dest = *ptr;
+ return true;
+ }
+ // First convert the MBS into a wide char then attempt to narrow it using
+ // wctob_l.
+ wchar_t wout;
+ if (!checked_string_to_wchar_convert(wout, ptr, __loc))
+ return false;
+ int res;
+ if ((res = __libcpp_wctob_l(wout, __loc)) != char_traits<char>::eof()) {
+ dest = res;
+ return true;
+ }
+ // FIXME: Work around specific multibyte sequences that we can reasonable
+ // translate into a different single byte.
+ switch (wout) {
+ case L'\u00A0': // non-breaking space
+ dest = ' ';
+ return true;
+ default:
+ return false;
+ }
+ _LIBCPP_UNREACHABLE();
+}
+
+
// numpunct<char> && numpunct<wchar_t>
locale::id numpunct< char >::id;
@@ -4257,16 +4297,15 @@ numpunct_byname<char>::__init(const char* nm)
if (strcmp(nm, "C") != 0)
{
__locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (loc == nullptr)
- throw runtime_error("numpunct_byname<char>::numpunct_byname"
+ __throw_runtime_error("numpunct_byname<char>::numpunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
+
lconv* lc = __libcpp_localeconv_l(loc.get());
- if (*lc->decimal_point)
- __decimal_point_ = *lc->decimal_point;
- if (*lc->thousands_sep)
- __thousands_sep_ = *lc->thousands_sep;
+ checked_string_to_char_convert(__decimal_point_, lc->decimal_point,
+ loc.get());
+ checked_string_to_char_convert(__thousands_sep_, lc->thousands_sep,
+ loc.get());
__grouping_ = lc->grouping;
// localization for truename and falsename is not available
}
@@ -4296,18 +4335,17 @@ numpunct_byname<wchar_t>::__init(const char* nm)
if (strcmp(nm, "C") != 0)
{
__locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (loc == nullptr)
- throw runtime_error("numpunct_byname<char>::numpunct_byname"
+ __throw_runtime_error("numpunct_byname<wchar_t>::numpunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
+
lconv* lc = __libcpp_localeconv_l(loc.get());
- if (*lc->decimal_point)
- __decimal_point_ = *lc->decimal_point;
- if (*lc->thousands_sep)
- __thousands_sep_ = *lc->thousands_sep;
+ checked_string_to_wchar_convert(__decimal_point_, lc->decimal_point,
+ loc.get());
+ checked_string_to_wchar_convert(__thousands_sep_, lc->thousands_sep,
+ loc.get());
__grouping_ = lc->grouping;
- // locallization for truename and falsename is not available
+ // localization for truename and falsename is not available
}
}
@@ -4703,21 +4741,17 @@ __time_get_c_storage<wchar_t>::__r() const
__time_get::__time_get(const char* nm)
: __loc_(newlocale(LC_ALL_MASK, nm, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__loc_ == 0)
- throw runtime_error("time_get_byname"
+ __throw_runtime_error("time_get_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
__time_get::__time_get(const string& nm)
: __loc_(newlocale(LC_ALL_MASK, nm.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__loc_ == 0)
- throw runtime_error("time_get_byname"
+ __throw_runtime_error("time_get_byname"
" failed to construct for " + nm);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
__time_get::~__time_get()
@@ -5363,21 +5397,17 @@ __time_get_storage<wchar_t>::__do_date_order() const
__time_put::__time_put(const char* nm)
: __loc_(newlocale(LC_ALL_MASK, nm, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__loc_ == 0)
- throw runtime_error("time_put_byname"
+ __throw_runtime_error("time_put_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
__time_put::__time_put(const string& nm)
: __loc_(newlocale(LC_ALL_MASK, nm.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__loc_ == 0)
- throw runtime_error("time_put_byname"
+ __throw_runtime_error("time_put_byname"
" failed to construct for " + nm);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
__time_put::~__time_put()
@@ -5792,20 +5822,20 @@ moneypunct_byname<char, false>::init(const char* nm)
{
typedef moneypunct<char, false> base;
__locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (loc == nullptr)
- throw runtime_error("moneypunct_byname"
+ __throw_runtime_error("moneypunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
+
lconv* lc = __libcpp_localeconv_l(loc.get());
- if (*lc->mon_decimal_point)
- __decimal_point_ = *lc->mon_decimal_point;
- else
- __decimal_point_ = base::do_decimal_point();
- if (*lc->mon_thousands_sep)
- __thousands_sep_ = *lc->mon_thousands_sep;
- else
- __thousands_sep_ = base::do_thousands_sep();
+ if (!checked_string_to_char_convert(__decimal_point_,
+ lc->mon_decimal_point,
+ loc.get()))
+ __decimal_point_ = base::do_decimal_point();
+ if (!checked_string_to_char_convert(__thousands_sep_,
+ lc->mon_thousands_sep,
+ loc.get()))
+ __thousands_sep_ = base::do_thousands_sep();
+
__grouping_ = lc->mon_grouping;
__curr_symbol_ = lc->currency_symbol;
if (lc->frac_digits != CHAR_MAX)
@@ -5836,20 +5866,19 @@ moneypunct_byname<char, true>::init(const char* nm)
{
typedef moneypunct<char, true> base;
__locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (loc == nullptr)
- throw runtime_error("moneypunct_byname"
+ __throw_runtime_error("moneypunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
+
lconv* lc = __libcpp_localeconv_l(loc.get());
- if (*lc->mon_decimal_point)
- __decimal_point_ = *lc->mon_decimal_point;
- else
- __decimal_point_ = base::do_decimal_point();
- if (*lc->mon_thousands_sep)
- __thousands_sep_ = *lc->mon_thousands_sep;
- else
- __thousands_sep_ = base::do_thousands_sep();
+ if (!checked_string_to_char_convert(__decimal_point_,
+ lc->mon_decimal_point,
+ loc.get()))
+ __decimal_point_ = base::do_decimal_point();
+ if (!checked_string_to_char_convert(__thousands_sep_,
+ lc->mon_thousands_sep,
+ loc.get()))
+ __thousands_sep_ = base::do_thousands_sep();
__grouping_ = lc->mon_grouping;
__curr_symbol_ = lc->int_curr_symbol;
if (lc->int_frac_digits != CHAR_MAX)
@@ -5897,20 +5926,18 @@ moneypunct_byname<wchar_t, false>::init(const char* nm)
{
typedef moneypunct<wchar_t, false> base;
__locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (loc == nullptr)
- throw runtime_error("moneypunct_byname"
+ __throw_runtime_error("moneypunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
lconv* lc = __libcpp_localeconv_l(loc.get());
- if (*lc->mon_decimal_point)
- __decimal_point_ = static_cast<wchar_t>(*lc->mon_decimal_point);
- else
- __decimal_point_ = base::do_decimal_point();
- if (*lc->mon_thousands_sep)
- __thousands_sep_ = static_cast<wchar_t>(*lc->mon_thousands_sep);
- else
- __thousands_sep_ = base::do_thousands_sep();
+ if (!checked_string_to_wchar_convert(__decimal_point_,
+ lc->mon_decimal_point,
+ loc.get()))
+ __decimal_point_ = base::do_decimal_point();
+ if (!checked_string_to_wchar_convert(__thousands_sep_,
+ lc->mon_thousands_sep,
+ loc.get()))
+ __thousands_sep_ = base::do_thousands_sep();
__grouping_ = lc->mon_grouping;
wchar_t wbuf[100];
mbstate_t mb = {0};
@@ -5964,20 +5991,19 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
{
typedef moneypunct<wchar_t, true> base;
__locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (loc == nullptr)
- throw runtime_error("moneypunct_byname"
+ __throw_runtime_error("moneypunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
+
lconv* lc = __libcpp_localeconv_l(loc.get());
- if (*lc->mon_decimal_point)
- __decimal_point_ = static_cast<wchar_t>(*lc->mon_decimal_point);
- else
- __decimal_point_ = base::do_decimal_point();
- if (*lc->mon_thousands_sep)
- __thousands_sep_ = static_cast<wchar_t>(*lc->mon_thousands_sep);
- else
- __thousands_sep_ = base::do_thousands_sep();
+ if (!checked_string_to_wchar_convert(__decimal_point_,
+ lc->mon_decimal_point,
+ loc.get()))
+ __decimal_point_ = base::do_decimal_point();
+ if (!checked_string_to_wchar_convert(__thousands_sep_,
+ lc->mon_thousands_sep,
+ loc.get()))
+ __thousands_sep_ = base::do_thousands_sep();
__grouping_ = lc->mon_grouping;
wchar_t wbuf[100];
mbstate_t mb = {0};
@@ -6050,69 +6076,70 @@ void __throw_runtime_error(const char* msg)
throw runtime_error(msg);
#else
(void)msg;
+ _VSTD::abort();
#endif
}
-template class collate<char>;
-template class collate<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<wchar_t>;
-template class num_get<char>;
-template class num_get<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<wchar_t>;
-template struct __num_get<char>;
-template struct __num_get<wchar_t>;
+template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<char>;
+template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<wchar_t>;
-template class num_put<char>;
-template class num_put<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<wchar_t>;
-template struct __num_put<char>;
-template struct __num_put<wchar_t>;
+template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<char>;
+template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<wchar_t>;
-template class time_get<char>;
-template class time_get<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<wchar_t>;
-template class time_get_byname<char>;
-template class time_get_byname<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<wchar_t>;
-template class time_put<char>;
-template class time_put<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<wchar_t>;
-template class time_put_byname<char>;
-template class time_put_byname<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<wchar_t>;
-template class moneypunct<char, false>;
-template class moneypunct<char, true>;
-template class moneypunct<wchar_t, false>;
-template class moneypunct<wchar_t, true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, false>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, false>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, true>;
-template class moneypunct_byname<char, false>;
-template class moneypunct_byname<char, true>;
-template class moneypunct_byname<wchar_t, false>;
-template class moneypunct_byname<wchar_t, true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, false>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, false>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, true>;
-template class money_get<char>;
-template class money_get<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<wchar_t>;
-template class __money_get<char>;
-template class __money_get<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<wchar_t>;
-template class money_put<char>;
-template class money_put<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<wchar_t>;
-template class __money_put<char>;
-template class __money_put<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<wchar_t>;
-template class messages<char>;
-template class messages<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<wchar_t>;
-template class messages_byname<char>;
-template class messages_byname<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<wchar_t>;
-template class codecvt_byname<char, char, mbstate_t>;
-template class codecvt_byname<wchar_t, char, mbstate_t>;
-template class codecvt_byname<char16_t, char, mbstate_t>;
-template class codecvt_byname<char32_t, char, mbstate_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char, char, mbstate_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<wchar_t, char, mbstate_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char, mbstate_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char, mbstate_t>;
-template class __vector_base_common<true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __vector_base_common<true>;
_LIBCPP_END_NAMESPACE_STD
diff --git a/src/memory.cpp b/src/memory.cpp
index 15e947fc0ff8..514a2ce22667 100644
--- a/src/memory.cpp
+++ b/src/memory.cpp
@@ -96,7 +96,35 @@ __shared_weak_count::__release_shared() _NOEXCEPT
void
__shared_weak_count::__release_weak() _NOEXCEPT
{
- if (decrement(__shared_weak_owners_) == -1)
+ // NOTE: The acquire load here is an optimization of the very
+ // common case where a shared pointer is being destructed while
+ // having no other contended references.
+ //
+ // BENEFIT: We avoid expensive atomic stores like XADD and STREX
+ // in a common case. Those instructions are slow and do nasty
+ // things to caches.
+ //
+ // IS THIS SAFE? Yes. During weak destruction, if we see that we
+ // are the last reference, we know that no-one else is accessing
+ // us. If someone were accessing us, then they would be doing so
+ // while the last shared / weak_ptr was being destructed, and
+ // that's undefined anyway.
+ //
+ // If we see anything other than a 0, then we have possible
+ // contention, and need to use an atomicrmw primitive.
+ // The same arguments don't apply for increment, where it is legal
+ // (though inadvisable) to share shared_ptr references between
+ // threads, and have them all get copied at once. The argument
+ // also doesn't apply for __release_shared, because an outstanding
+ // weak_ptr::lock() could read / modify the shared count.
+ if (__libcpp_atomic_load(&__shared_weak_owners_, _AO_Acquire) == 0)
+ {
+ // no need to do this store, because we are about
+ // to destroy everything.
+ //__libcpp_atomic_store(&__shared_weak_owners_, -1, _AO_Release);
+ __on_zero_shared_weak();
+ }
+ else if (decrement(__shared_weak_owners_) == -1)
__on_zero_shared_weak();
}
@@ -126,8 +154,8 @@ __shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
-static const std::size_t __sp_mut_count = 16;
-static __libcpp_mutex_t mut_back_imp[__sp_mut_count] =
+_LIBCPP_SAFE_STATIC static const std::size_t __sp_mut_count = 16;
+_LIBCPP_SAFE_STATIC static __libcpp_mutex_t mut_back[__sp_mut_count] =
{
_LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER,
_LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER,
@@ -135,8 +163,6 @@ static __libcpp_mutex_t mut_back_imp[__sp_mut_count] =
_LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER
};
-static mutex* mut_back = reinterpret_cast<std::mutex*>(mut_back_imp);
-
_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT
: __lx(p)
{
@@ -145,13 +171,13 @@ _LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT
void
__sp_mut::lock() _NOEXCEPT
{
- mutex& m = *static_cast<mutex*>(__lx);
+ auto m = static_cast<__libcpp_mutex_t*>(__lx);
unsigned count = 0;
- while (!m.try_lock())
+ while (__libcpp_mutex_trylock(m) != 0)
{
if (++count > 16)
{
- m.lock();
+ __libcpp_mutex_lock(m);
break;
}
this_thread::yield();
@@ -161,13 +187,13 @@ __sp_mut::lock() _NOEXCEPT
void
__sp_mut::unlock() _NOEXCEPT
{
- static_cast<mutex*>(__lx)->unlock();
+ __libcpp_mutex_unlock(static_cast<__libcpp_mutex_t*>(__lx));
}
__sp_mut&
__get_sp_mut(const void* p)
{
- static __sp_mut muts[__sp_mut_count]
+ static __sp_mut muts[__sp_mut_count]
{
&mut_back[ 0], &mut_back[ 1], &mut_back[ 2], &mut_back[ 3],
&mut_back[ 4], &mut_back[ 5], &mut_back[ 6], &mut_back[ 7],
diff --git a/src/mutex.cpp b/src/mutex.cpp
index 9f808ca5076c..dc530ceeac0d 100644
--- a/src/mutex.cpp
+++ b/src/mutex.cpp
@@ -195,13 +195,10 @@ recursive_timed_mutex::unlock() _NOEXCEPT
// keep in sync with: 7741191.
#ifndef _LIBCPP_HAS_NO_THREADS
-static __libcpp_mutex_t mut = _LIBCPP_MUTEX_INITIALIZER;
-static __libcpp_condvar_t cv = _LIBCPP_CONDVAR_INITIALIZER;
+_LIBCPP_SAFE_STATIC static __libcpp_mutex_t mut = _LIBCPP_MUTEX_INITIALIZER;
+_LIBCPP_SAFE_STATIC static __libcpp_condvar_t cv = _LIBCPP_CONDVAR_INITIALIZER;
#endif
-/// NOTE: Changes to flag are done via relaxed atomic stores
-/// even though the accesses are protected by a mutex because threads
-/// just entering 'call_once` concurrently read from flag.
void
__call_once(volatile unsigned long& flag, void* arg, void(*func)(void*))
{
@@ -238,7 +235,7 @@ __call_once(volatile unsigned long& flag, void* arg, void(*func)(void*))
__libcpp_mutex_unlock(&mut);
func(arg);
__libcpp_mutex_lock(&mut);
- __libcpp_relaxed_store(&flag, ~0ul);
+ __libcpp_atomic_store(&flag, ~0ul, _AO_Release);
__libcpp_mutex_unlock(&mut);
__libcpp_condvar_broadcast(&cv);
#ifndef _LIBCPP_NO_EXCEPTIONS
diff --git a/src/new.cpp b/src/new.cpp
index f4f73d86803d..3d8b2a9d8a66 100644
--- a/src/new.cpp
+++ b/src/new.cpp
@@ -37,12 +37,9 @@
// in this shared library, so that they can be overridden by programs
// that define non-weak copies of the functions.
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void *
-operator new(std::size_t size)
-#if !__has_feature(cxx_noexcept)
- throw(std::bad_alloc)
-#endif
+operator new(std::size_t size) _THROW_BAD_ALLOC
{
if (size == 0)
size = 1;
@@ -64,7 +61,39 @@ operator new(std::size_t size)
return p;
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
+void *
+operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
+{
+ if (size == 0)
+ size = 1;
+ if (static_cast<size_t>(alignment) < sizeof(void*))
+ alignment = std::align_val_t(sizeof(void*));
+ void* p;
+#if defined(_WIN32)
+ while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
+#else
+ while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
+#endif
+ {
+ // If posix_memalign fails and there is a new_handler,
+ // call it to try free up memory.
+ std::new_handler nh = std::get_new_handler();
+ if (nh)
+ nh();
+ else {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw std::bad_alloc();
+#else
+ p = nullptr; // posix_memalign doesn't initialize 'p' on failure
+ break;
+#endif
+ }
+ }
+ return p;
+}
+
+_LIBCPP_WEAK
void*
operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
{
@@ -83,17 +112,40 @@ operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
return p;
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void*
-operator new[](size_t size)
-#if !__has_feature(cxx_noexcept)
- throw(std::bad_alloc)
-#endif
+operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+{
+ void* p = 0;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ p = ::operator new(size, alignment);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+ return p;
+}
+
+_LIBCPP_WEAK
+void*
+operator new[](size_t size) _THROW_BAD_ALLOC
{
return ::operator new(size);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
+void*
+operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
+{
+ return ::operator new(size, alignment);
+}
+
+_LIBCPP_WEAK
void*
operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
{
@@ -112,7 +164,26 @@ operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
return p;
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
+void*
+operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+{
+ void* p = 0;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ p = ::operator new[](size, alignment);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+ return p;
+}
+
+_LIBCPP_WEAK
void
operator delete(void* ptr) _NOEXCEPT
{
@@ -120,41 +191,84 @@ operator delete(void* ptr) _NOEXCEPT
::free(ptr);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
+void
+operator delete(void* ptr, std::align_val_t) _NOEXCEPT
+{
+ if (ptr)
+ ::free(ptr);
+}
+
+_LIBCPP_WEAK
void
operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT
{
::operator delete(ptr);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
+void
+operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+{
+ ::operator delete(ptr, alignment);
+}
+
+_LIBCPP_WEAK
void
operator delete(void* ptr, size_t) _NOEXCEPT
{
::operator delete(ptr);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
+void
+operator delete(void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
+{
+ ::operator delete(ptr, alignment);
+}
+
+_LIBCPP_WEAK
void
operator delete[] (void* ptr) _NOEXCEPT
{
::operator delete(ptr);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
+void
+operator delete[] (void* ptr, std::align_val_t alignment) _NOEXCEPT
+{
+ ::operator delete(ptr, alignment);
+}
+
+_LIBCPP_WEAK
void
operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT
{
::operator delete[](ptr);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
+void
+operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+{
+ ::operator delete[](ptr, alignment);
+}
+
+_LIBCPP_WEAK
void
operator delete[] (void* ptr, size_t) _NOEXCEPT
{
::operator delete[](ptr);
}
+_LIBCPP_WEAK
+void
+operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
+{
+ ::operator delete[](ptr, alignment);
+}
+
#endif // !__GLIBCXX__
namespace std
@@ -206,6 +320,8 @@ bad_array_new_length::bad_array_new_length() _NOEXCEPT
{
}
+#ifndef __GLIBCXX__
+
bad_array_new_length::~bad_array_new_length() _NOEXCEPT
{
}
@@ -216,22 +332,28 @@ bad_array_new_length::what() const _NOEXCEPT
return "bad_array_new_length";
}
+#endif // !__GLIBCXX__
+
#endif //LIBCXXRT
-const char*
-bad_array_length::what() const _NOEXCEPT
+bad_array_length::bad_array_length() _NOEXCEPT
{
- return "bad_array_length";
}
-bad_array_length::bad_array_length() _NOEXCEPT
+#ifndef __GLIBCXX__
+
+bad_array_length::~bad_array_length() _NOEXCEPT
{
}
-bad_array_length::~bad_array_length() _NOEXCEPT
+const char*
+bad_array_length::what() const _NOEXCEPT
{
+ return "bad_array_length";
}
+#endif // !__GLIBCXX__
+
#endif // _LIBCPPABI_VERSION
#ifndef LIBSTDCXX
@@ -241,6 +363,8 @@ __throw_bad_alloc()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw bad_alloc();
+#else
+ _VSTD::abort();
#endif
}
diff --git a/src/optional.cpp b/src/optional.cpp
index 8c5dd76d86d6..f2fbfdfec1ce 100644
--- a/src/optional.cpp
+++ b/src/optional.cpp
@@ -7,18 +7,18 @@
//
//===----------------------------------------------------------------------===//
+#include "optional"
#include "experimental/optional"
-_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
+namespace std
+{
-#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
-bad_optional_access::~bad_optional_access() _NOEXCEPT {}
+} // std
-#else
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
-#endif
-
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
diff --git a/src/random.cpp b/src/random.cpp
index 4ab424eaa6e5..eb2510a48c85 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+#include <__config>
+
#if defined(_LIBCPP_USING_WIN32_RANDOM)
// Must be defined before including stdlib.h to enable rand_s().
#define _CRT_RAND_S
diff --git a/src/stdexcept.cpp b/src/stdexcept.cpp
index 0a08bfec27ec..90d8a34b82de 100644
--- a/src/stdexcept.cpp
+++ b/src/stdexcept.cpp
@@ -7,11 +7,11 @@
//
//===----------------------------------------------------------------------===//
-#include "__refstring"
#include "stdexcept"
#include "new"
#include "string"
#include "system_error"
+#include "__refstring"
/* For _LIBCPPABI_VERSION */
#if defined(LIBCXX_BUILDING_LIBCXXABI) || defined(__APPLE__) || defined(LIBCXXRT)
@@ -20,6 +20,7 @@
static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), "");
+
namespace std // purposefully not using versioning namespace
{
diff --git a/src/string.cpp b/src/string.cpp
index d3f29df639f4..cd644330b3a7 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -20,10 +20,10 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template class __basic_string_common<true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __basic_string_common<true>;
-template class basic_string<char>;
-template class basic_string<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_string<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_string<wchar_t>;
template
string
@@ -40,7 +40,7 @@ void throw_helper( const string& msg )
throw T( msg );
#else
fprintf(stderr, "%s\n", msg.c_str());
- abort();
+ _VSTD::abort();
#endif
}
diff --git a/src/strstream.cpp b/src/strstream.cpp
index 0e2d7ff21bb9..be94f9c89e83 100644
--- a/src/strstream.cpp
+++ b/src/strstream.cpp
@@ -11,6 +11,7 @@
#include "algorithm"
#include "climits"
#include "cstring"
+#include "cstdlib"
#include "__debug"
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -266,6 +267,8 @@ strstreambuf::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmod
case ios::end:
newoff = seekhigh - eback();
break;
+ default:
+ _LIBCPP_UNREACHABLE();
}
newoff += __off;
if (0 <= newoff && newoff <= seekhigh - eback())
diff --git a/src/support/solaris/xlocale.c b/src/support/solaris/xlocale.cpp
index 9125eea73777..6eaf317c768a 100644
--- a/src/support/solaris/xlocale.c
+++ b/src/support/solaris/xlocale.cpp
@@ -14,12 +14,13 @@
#include <stdio.h>
#include <sys/localedef.h>
+extern "C" {
int isxdigit_l(int __c, locale_t __l) {
return isxdigit(__c);
}
-int iswxdigit_l(wchar_t __c, locale_t __l) {
+int iswxdigit_l(wint_t __c, locale_t __l) {
return isxdigit(__c);
}
@@ -63,4 +64,6 @@ struct lconv *localeconv_l(locale_t __l) {
return localeconv();
}
+};
+
#endif // __sun__
diff --git a/src/support/win32/locale_win32.cpp b/src/support/win32/locale_win32.cpp
index 5a43743470d5..7300451101eb 100644
--- a/src/support/win32/locale_win32.cpp
+++ b/src/support/win32/locale_win32.cpp
@@ -10,6 +10,11 @@
#include <locale>
#include <cstdarg> // va_start, va_end
+#include <memory>
+#include <type_traits>
+
+typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
+typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
// FIXME: base currently unused. Needs manual work to construct the new locale
locale_t newlocale( int mask, const char * locale, locale_t /*base*/ )
diff --git a/src/system_error.cpp b/src/system_error.cpp
index 87f35ae37f39..3a2255425f09 100644
--- a/src/system_error.cpp
+++ b/src/system_error.cpp
@@ -55,6 +55,7 @@ error_category::equivalent(const error_code& code, int condition) const _NOEXCEP
return *this == code.category() && code.value() == condition;
}
+#if !defined(_LIBCPP_HAS_NO_THREADS)
namespace {
// GLIBC also uses 1024 as the maximum buffer size internally.
@@ -96,6 +97,7 @@ string do_strerror_r(int ev) {
#endif
} // end namespace
+#endif
string
__do_message::message(int ev) const
@@ -258,6 +260,7 @@ __throw_system_error(int ev, const char* what_arg)
#else
(void)ev;
(void)what_arg;
+ _VSTD::abort();
#endif
}
diff --git a/src/thread.cpp b/src/thread.cpp
index 467402b6b423..4775e10f6ab5 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -53,10 +53,9 @@ thread::join()
if (ec == 0)
__t_ = 0;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (ec)
- throw system_error(error_code(ec, system_category()), "thread::join failed");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_system_error(ec, "thread::join failed");
}
void
@@ -69,10 +68,9 @@ thread::detach()
if (ec == 0)
__t_ = 0;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (ec)
- throw system_error(error_code(ec, system_category()), "thread::detach failed");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_system_error(ec, "thread::detach failed");
}
unsigned
diff --git a/src/typeinfo.cpp b/src/typeinfo.cpp
index 5c0a609b5e5c..3033c9800f18 100644
--- a/src/typeinfo.cpp
+++ b/src/typeinfo.cpp
@@ -54,12 +54,16 @@ std::bad_typeid::what() const _NOEXCEPT
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw std::bad_typeid();
+#else
+ _VSTD::abort();
#endif
}
void __cxxabiv1::__cxa_bad_cast()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw std::bad_cast();
+#else
+ _VSTD::abort();
#endif
}
#endif
diff --git a/src/variant.cpp b/src/variant.cpp
new file mode 100644
index 000000000000..5bb508c3f467
--- /dev/null
+++ b/src/variant.cpp
@@ -0,0 +1,18 @@
+//===------------------------ variant.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.
+//
+//===----------------------------------------------------------------------===//
+
+#include "variant"
+
+namespace std {
+
+const char* bad_variant_access::what() const noexcept {
+ return "bad_variant_access";
+}
+
+} // namespace std
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index d47a9e003fc0..edebaee55408 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,3 +1,5 @@
+include(AddLLVM) # for add_lit_testsuite
+
macro(pythonize_bool var)
if (${var})
set(${var} True)
@@ -9,6 +11,18 @@ endmacro()
set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING
"Configuration variant to use for LIT.")
+# The tests shouldn't link to any ABI library when it has been linked into
+# libc++ statically or via a linker script.
+if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY OR LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ set(LIBCXX_CXX_ABI_LIBNAME "none")
+endif()
+
+# The tests shouldn't link to libunwind if we have a linker script which
+# already does so.
+if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ set(LIBCXXABI_USE_LLVM_UNWINDER OFF)
+endif()
+
pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)
pythonize_bool(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
pythonize_bool(LIBCXX_ENABLE_FILESYSTEM)
@@ -20,12 +34,7 @@ pythonize_bool(LIBCXXABI_ENABLE_SHARED)
pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
pythonize_bool(LIBCXX_HAS_ATOMIC_LIB)
pythonize_bool(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB)
-
-# The tests shouldn't link to any ABI library when it has been linked into
-# libc++ statically or via a linker script.
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY OR LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
- set(LIBCXX_CXX_ABI_LIBNAME "none")
-endif()
+pythonize_bool(LIBCXX_HAS_EXTERNAL_THREAD_API)
# By default, for non-standalone builds, libcxx and libcxxabi share a library
# directory.
@@ -50,10 +59,16 @@ if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
set(experimental_dep cxx_experimental)
endif()
-add_lit_testsuite(check-libcxx
+if (LIBCXX_HAS_EXTERNAL_THREAD_API)
+ set(external_threads_dep cxx_external_threads)
+endif()
+
+add_lit_testsuite(check-cxx
"Running libcxx tests"
${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS cxx ${experimental_dep})
+ DEPENDS cxx ${experimental_dep} ${external_threads_dep})
+
+add_custom_target(check-libcxx DEPENDS check-cxx)
if (LIBCXX_GENERATE_COVERAGE)
include(CodeCoverage)
diff --git a/test/libcxx/algorithms/debug_less.pass.cpp b/test/libcxx/algorithms/debug_less.pass.cpp
new file mode 100644
index 000000000000..2e875ff277c4
--- /dev/null
+++ b/test/libcxx/algorithms/debug_less.pass.cpp
@@ -0,0 +1,167 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: libcpp-no-exceptions
+
+// <algorithm>
+
+// template <class _Compare> struct __debug_less
+
+// __debug_less checks that a comparator actually provides a strict-weak ordering.
+
+struct DebugException {};
+
+#define _LIBCPP_DEBUG 0
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw ::DebugException())
+
+#include <algorithm>
+#include <cassert>
+
+template <int ID>
+struct MyType {
+ int value;
+ explicit MyType(int xvalue = 0) : value(xvalue) {}
+};
+
+template <int ID1, int ID2>
+bool operator<(MyType<ID1> const& LHS, MyType<ID2> const& RHS) {
+ return LHS.value < RHS.value;
+}
+
+struct CompareBase {
+ static int called;
+ static void reset() {
+ called = 0;
+ }
+};
+
+int CompareBase::called = 0;
+
+template <class ValueType>
+struct GoodComparator : public CompareBase {
+ bool operator()(ValueType const& lhs, ValueType const& rhs) const {
+ ++CompareBase::called;
+ return lhs < rhs;
+ }
+};
+
+template <class ValueType>
+struct BadComparator : public CompareBase {
+ bool operator()(ValueType const&, ValueType const&) const {
+ ++CompareBase::called;
+ return true;
+ }
+};
+
+template <class T1, class T2>
+struct TwoWayHomoComparator : public CompareBase {
+ bool operator()(T1 const& lhs, T2 const& rhs) const {
+ ++CompareBase::called;
+ return lhs < rhs;
+ }
+
+ bool operator()(T2 const& lhs, T1 const& rhs) const {
+ ++CompareBase::called;
+ return lhs < rhs;
+ }
+};
+
+template <class T1, class T2>
+struct OneWayHomoComparator : public CompareBase {
+ bool operator()(T1 const& lhs, T2 const& rhs) const {
+ ++CompareBase::called;
+ return lhs < rhs;
+ }
+};
+
+using std::__debug_less;
+
+typedef MyType<0> MT0;
+typedef MyType<1> MT1;
+
+void test_passing() {
+ int& called = CompareBase::called;
+ called = 0;
+ MT0 one(1);
+ MT0 two(2);
+ MT1 three(3);
+ MT1 four(4);
+
+ {
+ typedef GoodComparator<MT0> C;
+ typedef __debug_less<C> D;
+
+ C c;
+ D d(c);
+
+ assert(d(one, two) == true);
+ assert(called == 2);
+ called = 0;
+
+ assert(d(one, one) == false);
+ assert(called == 1);
+ called = 0;
+
+ assert(d(two, one) == false);
+ assert(called == 1);
+ called = 0;
+ }
+ {
+ typedef TwoWayHomoComparator<MT0, MT1> C;
+ typedef __debug_less<C> D;
+ C c;
+ D d(c);
+
+ assert(d(one, three) == true);
+ assert(called == 2);
+ called = 0;
+
+ assert(d(three, one) == false);
+ assert(called == 1);
+ called = 0;
+ }
+ {
+ typedef OneWayHomoComparator<MT0, MT1> C;
+ typedef __debug_less<C> D;
+ C c;
+ D d(c);
+
+ assert(d(one, three) == true);
+ assert(called == 1);
+ called = 0;
+ }
+}
+
+void test_failing() {
+ int& called = CompareBase::called;
+ called = 0;
+ MT0 one(1);
+ MT0 two(2);
+
+ {
+ typedef BadComparator<MT0> C;
+ typedef __debug_less<C> D;
+ C c;
+ D d(c);
+
+ try {
+ d(one, two);
+ assert(false);
+ } catch (DebugException const&) {
+ }
+
+ assert(called == 2);
+ called = 0;
+ }
+}
+
+int main() {
+ test_passing();
+ test_failing();
+} \ No newline at end of file
diff --git a/test/libcxx/atomics/atomics.align/align.pass.sh.cpp b/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
new file mode 100644
index 000000000000..e0ae37e9c3bc
--- /dev/null
+++ b/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
@@ -0,0 +1,93 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: libcpp-has-no-threads, c++98, c++03
+// REQUIRES: libatomic
+// RUN: %build -latomic
+// RUN: %run
+//
+// GCC currently fails because it needs -fabi-version=6 to fix mangling of
+// std::atomic when used with __attribute__((vector(X))).
+// XFAIL: gcc
+
+// <atomic>
+
+// Verify that the content of atomic<T> is properly aligned if the type is
+// lock-free. This can't be observed through the atomic<T> API. It is
+// nonetheless required for correctness of the implementation: lock-free implies
+// that ISA instructions are used, and these instructions assume "suitable
+// alignment". Supported architectures all require natural alignment for
+// lock-freedom (e.g. load-linked / store-conditional, or cmpxchg).
+
+#include <atomic>
+#include <cassert>
+
+template <typename T> struct atomic_test : public std::__atomic_base<T> {
+ atomic_test() {
+ if (this->is_lock_free())
+ assert(alignof(this->__a_) >= sizeof(this->__a_) &&
+ "expected natural alignment for lock-free type");
+ }
+};
+
+int main() {
+
+// structs and unions can't be defined in the template invocation.
+// Work around this with a typedef.
+#define CHECK_ALIGNMENT(T) \
+ do { \
+ typedef T type; \
+ atomic_test<type> t; \
+ } while (0)
+
+ CHECK_ALIGNMENT(bool);
+ CHECK_ALIGNMENT(char);
+ CHECK_ALIGNMENT(signed char);
+ CHECK_ALIGNMENT(unsigned char);
+ CHECK_ALIGNMENT(char16_t);
+ CHECK_ALIGNMENT(char32_t);
+ CHECK_ALIGNMENT(wchar_t);
+ CHECK_ALIGNMENT(short);
+ CHECK_ALIGNMENT(unsigned short);
+ CHECK_ALIGNMENT(int);
+ CHECK_ALIGNMENT(unsigned int);
+ CHECK_ALIGNMENT(long);
+ CHECK_ALIGNMENT(unsigned long);
+ CHECK_ALIGNMENT(long long);
+ CHECK_ALIGNMENT(unsigned long long);
+ CHECK_ALIGNMENT(std::nullptr_t);
+ CHECK_ALIGNMENT(void *);
+ CHECK_ALIGNMENT(float);
+ CHECK_ALIGNMENT(double);
+ CHECK_ALIGNMENT(long double);
+ CHECK_ALIGNMENT(int __attribute__((vector_size(1 * sizeof(int)))));
+ CHECK_ALIGNMENT(int __attribute__((vector_size(2 * sizeof(int)))));
+ CHECK_ALIGNMENT(int __attribute__((vector_size(4 * sizeof(int)))));
+ CHECK_ALIGNMENT(int __attribute__((vector_size(16 * sizeof(int)))));
+ CHECK_ALIGNMENT(int __attribute__((vector_size(32 * sizeof(int)))));
+ CHECK_ALIGNMENT(float __attribute__((vector_size(1 * sizeof(float)))));
+ CHECK_ALIGNMENT(float __attribute__((vector_size(2 * sizeof(float)))));
+ CHECK_ALIGNMENT(float __attribute__((vector_size(4 * sizeof(float)))));
+ CHECK_ALIGNMENT(float __attribute__((vector_size(16 * sizeof(float)))));
+ CHECK_ALIGNMENT(float __attribute__((vector_size(32 * sizeof(float)))));
+ CHECK_ALIGNMENT(double __attribute__((vector_size(1 * sizeof(double)))));
+ CHECK_ALIGNMENT(double __attribute__((vector_size(2 * sizeof(double)))));
+ CHECK_ALIGNMENT(double __attribute__((vector_size(4 * sizeof(double)))));
+ CHECK_ALIGNMENT(double __attribute__((vector_size(16 * sizeof(double)))));
+ CHECK_ALIGNMENT(double __attribute__((vector_size(32 * sizeof(double)))));
+ CHECK_ALIGNMENT(struct Empty {});
+ CHECK_ALIGNMENT(struct OneInt { int i; });
+ CHECK_ALIGNMENT(struct IntArr2 { int i[2]; });
+ CHECK_ALIGNMENT(struct LLIArr2 { long long int i[2]; });
+ CHECK_ALIGNMENT(struct LLIArr4 { long long int i[4]; });
+ CHECK_ALIGNMENT(struct LLIArr8 { long long int i[8]; });
+ CHECK_ALIGNMENT(struct LLIArr16 { long long int i[16]; });
+ CHECK_ALIGNMENT(struct Padding { char c; /* padding */ long long int i; });
+ CHECK_ALIGNMENT(union IntFloat { int i; float f; });
+}
diff --git a/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp b/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
index fe95e6a5983a..38f89db1749a 100644
--- a/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
+++ b/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
@@ -12,6 +12,7 @@
// Test that including <atomic> fails to compile when _LIBCPP_HAS_NO_THREADS
// is defined.
+// MODULES_DEFINES: _LIBCPP_HAS_NO_THREADS
#ifndef _LIBCPP_HAS_NO_THREADS
#define _LIBCPP_HAS_NO_THREADS
#endif
diff --git a/test/libcxx/compiler.py b/test/libcxx/compiler.py
index 17e6cf441ec1..8585f44ed35f 100644
--- a/test/libcxx/compiler.py
+++ b/test/libcxx/compiler.py
@@ -7,22 +7,85 @@
#
#===----------------------------------------------------------------------===##
+import platform
import os
import lit.util
import libcxx.util
class CXXCompiler(object):
+ CM_Default = 0
+ CM_PreProcess = 1
+ CM_Compile = 2
+ CM_Link = 3
+
def __init__(self, path, flags=None, compile_flags=None, link_flags=None,
- use_ccache=False):
+ warning_flags=None, verify_supported=None,
+ verify_flags=None, use_verify=False,
+ modules_flags=None, use_modules=False,
+ use_ccache=False, use_warnings=False, compile_env=None,
+ cxx_type=None, cxx_version=None):
self.path = path
self.flags = list(flags or [])
self.compile_flags = list(compile_flags or [])
self.link_flags = list(link_flags or [])
+ self.warning_flags = list(warning_flags or [])
+ self.verify_supported = verify_supported
+ self.use_verify = use_verify
+ self.verify_flags = list(verify_flags or [])
+ assert not use_verify or verify_supported
+ assert not use_verify or verify_flags is not None
+ self.modules_flags = list(modules_flags or [])
+ self.use_modules = use_modules
+ assert not use_modules or modules_flags is not None
self.use_ccache = use_ccache
- self.type = None
- self.version = None
- self._initTypeAndVersion()
+ self.use_warnings = use_warnings
+ if compile_env is not None:
+ self.compile_env = dict(compile_env)
+ else:
+ self.compile_env = None
+ self.type = cxx_type
+ self.version = cxx_version
+ if self.type is None or self.version is None:
+ self._initTypeAndVersion()
+
+ def copy(self):
+ new_cxx = CXXCompiler(
+ self.path, flags=self.flags, compile_flags=self.compile_flags,
+ link_flags=self.link_flags, warning_flags=self.warning_flags,
+ verify_supported=self.verify_supported,
+ verify_flags=self.verify_flags, use_verify=self.use_verify,
+ modules_flags=self.modules_flags, use_modules=self.use_modules,
+ use_ccache=self.use_ccache, use_warnings=self.use_warnings,
+ compile_env=self.compile_env, cxx_type=self.type,
+ cxx_version=self.version)
+ return new_cxx
+
+ def isVerifySupported(self):
+ if self.verify_supported is None:
+ self.verify_supported = self.hasCompileFlag(['-Xclang',
+ '-verify-ignore-unexpected'])
+ if self.verify_supported:
+ self.verify_flags = [
+ '-Xclang', '-verify',
+ '-Xclang', '-verify-ignore-unexpected=note',
+ '-ferror-limit=1024'
+ ]
+ return self.verify_supported
+
+ def useVerify(self, value=True):
+ self.use_verify = value
+ assert not self.use_verify or self.verify_flags is not None
+
+ def useModules(self, value=True):
+ self.use_modules = value
+ assert not self.use_modules or self.modules_flags is not None
+
+ def useCCache(self, value=True):
+ self.use_ccache = value
+
+ def useWarnings(self, value=True):
+ self.use_warnings = value
def _initTypeAndVersion(self):
# Get compiler type and version
@@ -47,10 +110,12 @@ class CXXCompiler(object):
self.type = compiler_type
self.version = (major_ver, minor_ver, patchlevel)
- def _basicCmd(self, source_files, out, is_link=False, input_is_cxx=False,
- disable_ccache=False):
+ def _basicCmd(self, source_files, out, mode=CM_Default, flags=[],
+ input_is_cxx=False):
cmd = []
- if self.use_ccache and not disable_ccache and not is_link:
+ if self.use_ccache \
+ and not mode == self.CM_Link \
+ and not mode == self.CM_PreProcess:
cmd += ['ccache']
cmd += [self.path]
if out is not None:
@@ -63,57 +128,69 @@ class CXXCompiler(object):
cmd += [source_files]
else:
raise TypeError('source_files must be a string or list')
+ if mode == self.CM_PreProcess:
+ cmd += ['-E']
+ elif mode == self.CM_Compile:
+ cmd += ['-c']
+ cmd += self.flags
+ if self.use_verify:
+ cmd += self.verify_flags
+ assert mode in [self.CM_Default, self.CM_Compile]
+ if self.use_modules:
+ cmd += self.modules_flags
+ if mode != self.CM_Link:
+ cmd += self.compile_flags
+ if self.use_warnings:
+ cmd += self.warning_flags
+ if mode != self.CM_PreProcess and mode != self.CM_Compile:
+ cmd += self.link_flags
+ cmd += flags
return cmd
def preprocessCmd(self, source_files, out=None, flags=[]):
- cmd = self._basicCmd(source_files, out, input_is_cxx=True,
- disable_ccache=True) + ['-E']
- cmd += self.flags + self.compile_flags + flags
- return cmd
+ return self._basicCmd(source_files, out, flags=flags,
+ mode=self.CM_PreProcess,
+ input_is_cxx=True)
- def compileCmd(self, source_files, out=None, flags=[],
- disable_ccache=False):
- cmd = self._basicCmd(source_files, out, input_is_cxx=True,
- disable_ccache=disable_ccache) + ['-c']
- cmd += self.flags + self.compile_flags + flags
- return cmd
+ def compileCmd(self, source_files, out=None, flags=[]):
+ return self._basicCmd(source_files, out, flags=flags,
+ mode=self.CM_Compile,
+ input_is_cxx=True) + ['-c']
def linkCmd(self, source_files, out=None, flags=[]):
- cmd = self._basicCmd(source_files, out, is_link=True)
- cmd += self.flags + self.link_flags + flags
- return cmd
+ return self._basicCmd(source_files, out, flags=flags,
+ mode=self.CM_Link)
def compileLinkCmd(self, source_files, out=None, flags=[]):
- cmd = self._basicCmd(source_files, out, is_link=True)
- cmd += self.flags + self.compile_flags + self.link_flags + flags
- return cmd
+ return self._basicCmd(source_files, out, flags=flags)
- def preprocess(self, source_files, out=None, flags=[], env=None, cwd=None):
+ def preprocess(self, source_files, out=None, flags=[], cwd=None):
cmd = self.preprocessCmd(source_files, out, flags)
- out, err, rc = lit.util.executeCommand(cmd, env=env, cwd=cwd)
+ out, err, rc = lit.util.executeCommand(cmd, env=self.compile_env,
+ cwd=cwd)
return cmd, out, err, rc
- def compile(self, source_files, out=None, flags=[], env=None, cwd=None,
- disable_ccache=False):
- cmd = self.compileCmd(source_files, out, flags,
- disable_ccache=disable_ccache)
- out, err, rc = lit.util.executeCommand(cmd, env=env, cwd=cwd)
+ def compile(self, source_files, out=None, flags=[], cwd=None):
+ cmd = self.compileCmd(source_files, out, flags)
+ out, err, rc = lit.util.executeCommand(cmd, env=self.compile_env,
+ cwd=cwd)
return cmd, out, err, rc
- def link(self, source_files, out=None, flags=[], env=None, cwd=None):
+ def link(self, source_files, out=None, flags=[], cwd=None):
cmd = self.linkCmd(source_files, out, flags)
- out, err, rc = lit.util.executeCommand(cmd, env=env, cwd=cwd)
+ out, err, rc = lit.util.executeCommand(cmd, env=self.compile_env,
+ cwd=cwd)
return cmd, out, err, rc
- def compileLink(self, source_files, out=None, flags=[], env=None,
+ def compileLink(self, source_files, out=None, flags=[],
cwd=None):
cmd = self.compileLinkCmd(source_files, out, flags)
- out, err, rc = lit.util.executeCommand(cmd, env=env, cwd=cwd)
+ out, err, rc = lit.util.executeCommand(cmd, env=self.compile_env,
+ cwd=cwd)
return cmd, out, err, rc
def compileLinkTwoSteps(self, source_file, out=None, object_file=None,
- flags=[], env=None, cwd=None,
- disable_ccache=False):
+ flags=[], cwd=None):
if not isinstance(source_file, str):
raise TypeError('This function only accepts a single input file')
if object_file is None:
@@ -124,22 +201,20 @@ class CXXCompiler(object):
with_fn = lambda: libcxx.util.nullContext(object_file)
with with_fn() as object_file:
cc_cmd, cc_stdout, cc_stderr, rc = self.compile(
- source_file, object_file, flags=flags, env=env, cwd=cwd,
- disable_ccache=disable_ccache)
+ source_file, object_file, flags=flags, cwd=cwd)
if rc != 0:
return cc_cmd, cc_stdout, cc_stderr, rc
link_cmd, link_stdout, link_stderr, rc = self.link(
- object_file, out=out, flags=flags, env=env, cwd=cwd)
+ object_file, out=out, flags=flags, cwd=cwd)
return (cc_cmd + ['&&'] + link_cmd, cc_stdout + link_stdout,
cc_stderr + link_stderr, rc)
- def dumpMacros(self, source_files=None, flags=[], env=None, cwd=None):
+ def dumpMacros(self, source_files=None, flags=[], cwd=None):
if source_files is None:
source_files = os.devnull
flags = ['-dM'] + flags
- cmd, out, err, rc = self.preprocess(source_files, flags=flags, env=env,
- cwd=cwd)
+ cmd, out, err, rc = self.preprocess(source_files, flags=flags, cwd=cwd)
if rc != 0:
return None
parsed_macros = {}
@@ -163,11 +238,22 @@ class CXXCompiler(object):
# Add -Werror to ensure that an unrecognized flag causes a non-zero
# exit code. -Werror is supported on all known compiler types.
if self.type is not None:
- flags += ['-Werror']
+ flags += ['-Werror', '-fsyntax-only']
cmd, out, err, rc = self.compile(os.devnull, out=os.devnull,
flags=flags)
return rc == 0
+ def addFlagIfSupported(self, flag):
+ if isinstance(flag, list):
+ flags = list(flag)
+ else:
+ flags = [flag]
+ if self.hasCompileFlag(flags):
+ self.flags += flags
+ return True
+ else:
+ return False
+
def addCompileFlagIfSupported(self, flag):
if isinstance(flag, list):
flags = list(flag)
@@ -179,27 +265,38 @@ class CXXCompiler(object):
else:
return False
- def addWarningFlagIfSupported(self, flag):
+ def hasWarningFlag(self, flag):
"""
- addWarningFlagIfSupported - Add a warning flag if the compiler
- supports it. Unlike addCompileFlagIfSupported, this function detects
- when "-Wno-<warning>" flags are unsupported. If flag is a
+ hasWarningFlag - Test if the compiler supports a given warning flag.
+ Unlike addCompileFlagIfSupported, this function detects when
+ "-Wno-<warning>" flags are unsupported. If flag is a
"-Wno-<warning>" GCC will not emit an unknown option diagnostic unless
another error is triggered during compilation.
"""
assert isinstance(flag, str)
+ assert flag.startswith('-W')
if not flag.startswith('-Wno-'):
- return self.addCompileFlagIfSupported(flag)
+ return self.hasCompileFlag(flag)
flags = ['-Werror', flag]
+ old_use_warnings = self.use_warnings
+ self.useWarnings(False)
cmd = self.compileCmd('-', os.devnull, flags)
+ self.useWarnings(old_use_warnings)
# Remove '-v' because it will cause the command line invocation
# to be printed as part of the error output.
# TODO(EricWF): Are there other flags we need to worry about?
if '-v' in cmd:
cmd.remove('-v')
out, err, rc = lit.util.executeCommand(cmd, input='#error\n')
+
assert rc != 0
if flag in err:
return False
- self.compile_flags += [flag]
return True
+
+ def addWarningFlagIfSupported(self, flag):
+ if self.hasWarningFlag(flag):
+ assert flag not in self.warning_flags
+ self.warning_flags += [flag]
+ return True
+ return False
diff --git a/test/libcxx/containers/sequences/deque/incomplete.pass.cpp b/test/libcxx/containers/sequences/deque/incomplete.pass.cpp
index dbeea5f9aefb..c23195ed297f 100644
--- a/test/libcxx/containers/sequences/deque/incomplete.pass.cpp
+++ b/test/libcxx/containers/sequences/deque/incomplete.pass.cpp
@@ -12,6 +12,7 @@
// deque()
// deque::iterator()
+// MODULES_DEFINES: _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
#define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
#include <deque>
#include <cassert>
diff --git a/test/libcxx/containers/sequences/list/db_iterators_6.pass.cpp b/test/libcxx/containers/sequences/list/db_iterators_6.pass.cpp
deleted file mode 100644
index 3f0fd015e9a4..000000000000
--- a/test/libcxx/containers/sequences/list/db_iterators_6.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Decrement iterator prior to begin.
-
-#define _LIBCPP_DEBUG 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-int main()
-{
- typedef int T;
- typedef std::list<T> C;
- C c(1);
- C::iterator i = c.end();
- --i;
- assert(i == c.begin());
- --i;
- assert(false);
-}
diff --git a/test/libcxx/containers/sequences/list/db_iterators_7.pass.cpp b/test/libcxx/containers/sequences/list/db_iterators_7.pass.cpp
deleted file mode 100644
index bc2b7f4e1da2..000000000000
--- a/test/libcxx/containers/sequences/list/db_iterators_7.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Increment iterator past end.
-
-#define _LIBCPP_DEBUG 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-int main()
-{
- typedef int T;
- typedef std::list<T> C;
- C c(1);
- C::iterator i = c.begin();
- ++i;
- assert(i == c.end());
- ++i;
- assert(false);
-}
diff --git a/test/libcxx/containers/sequences/list/db_iterators_9.pass.cpp b/test/libcxx/containers/sequences/list/db_iterators_9.pass.cpp
deleted file mode 100644
index e2b95d8b1664..000000000000
--- a/test/libcxx/containers/sequences/list/db_iterators_9.pass.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-// UNSUPPORTED: libcpp-no-exceptions
-
-// <list>
-
-// Operations on "NULL" iterators
-
-#define _LIBCPP_DEBUG 1
-#define _LIBCPP_ASSERT(x, m) do { if (!x) throw 1; } while(0)
-
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
-
-struct S { int val; };
-
-int main()
-{
- {
- unsigned lib_asserts;
-
- typedef S T;
- typedef std::list<T> C;
- C::iterator i{};
- C::const_iterator ci{};
-
- lib_asserts = 0;
- try { ++i; } catch (int) { ++lib_asserts; }
- try { i++; } catch (int) { ++lib_asserts; }
- try { ++ci; } catch (int) { ++lib_asserts; }
- try { ci++; } catch (int) { ++lib_asserts; }
- assert(lib_asserts == 4);
-
- lib_asserts = 0;
- try { --i; } catch (int) { ++lib_asserts; }
- try { i--; } catch (int) { ++lib_asserts; }
- try { --ci; } catch (int) { ++lib_asserts; }
- try { ci--; } catch (int) { ++lib_asserts; }
- assert(lib_asserts == 4);
-
- lib_asserts = 0;
- try { *i; } catch (int) { ++lib_asserts; }
- try { *ci; } catch (int) { ++lib_asserts; }
- try { (void) i->val; } catch (int) { ++lib_asserts; }
- try { (void) ci->val; } catch (int) { ++lib_asserts; }
- assert(lib_asserts == 4);
- }
-}
diff --git a/test/libcxx/containers/sequences/list/list.special/db_swap_1.pass.cpp b/test/libcxx/containers/sequences/list/list.special/db_swap_1.pass.cpp
deleted file mode 100644
index 900f338c29eb..000000000000
--- a/test/libcxx/containers/sequences/list/list.special/db_swap_1.pass.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// template <class T, class Alloc>
-// void swap(list<T,Alloc>& x, list<T,Alloc>& y);
-
-#define _LIBCPP_DEBUG 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cstdlib>
-#include <cassert>
-
-int main()
-{
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::list<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::list<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- std::list<int>::iterator i1 = c1.begin();
- std::list<int>::iterator i2 = c2.begin();
- swap(c1, c2);
- c1.erase(i2);
- c2.erase(i1);
- std::list<int>::iterator j = i1;
- c1.erase(i1); // called with iterator not refering to list.
- assert(false);
-}
diff --git a/test/libcxx/containers/sequences/list/list.special/db_swap_2.pass.cpp b/test/libcxx/containers/sequences/list/list.special/db_swap_2.pass.cpp
deleted file mode 100644
index ace9a713aae7..000000000000
--- a/test/libcxx/containers/sequences/list/list.special/db_swap_2.pass.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// template <class T, class Alloc>
-// void swap(list<T,Alloc>& x, list<T,Alloc>& y);
-
-
-#define _LIBCPP_DEBUG 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
-#include <cassert>
-#include "test_allocator.h"
-#include "min_allocator.h"
-
-int main()
-{
- // allocators do not compare equal
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- typedef test_allocator<int> A;
- std::list<int, A> c1(a1, a1+sizeof(a1)/sizeof(a1[0]), A(1));
- std::list<int, A> c2(a2, a2+sizeof(a2)/sizeof(a2[0]), A(2));
- swap(c1, c2);
- assert(false);
- }
-}
diff --git a/test/libcxx/containers/sequences/vector/asan.pass.cpp b/test/libcxx/containers/sequences/vector/asan.pass.cpp
index b102fc08dafb..db337e6b2364 100644
--- a/test/libcxx/containers/sequences/vector/asan.pass.cpp
+++ b/test/libcxx/containers/sequences/vector/asan.pass.cpp
@@ -38,7 +38,8 @@ int main()
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c(std::begin(t), std::end(t));
c.reserve(2*c.size());
- T foo = c[c.size()]; // bad, but not caught by ASAN
+ volatile T foo = c[c.size()]; // bad, but not caught by ASAN
+ ((void)foo);
}
#endif
@@ -61,9 +62,10 @@ int main()
C c(std::begin(t), std::end(t));
c.reserve(2*c.size());
assert(is_contiguous_container_asan_correct(c));
- assert(!__sanitizer_verify_contiguous_container ( c.data(), c.data() + 1, c.data() + c.capacity()));
- T foo = c[c.size()]; // should trigger ASAN
+ assert(!__sanitizer_verify_contiguous_container( c.data(), c.data() + 1, c.data() + c.capacity()));
+ volatile T foo = c[c.size()]; // should trigger ASAN. Use volatile to prevent being optimized away.
assert(false); // if we got here, ASAN didn't trigger
+ ((void)foo);
}
}
#else
diff --git a/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp b/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
index 9af3f6be53e8..43324e9418f9 100644
--- a/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
+++ b/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// Test asan vector annotations with a class that throws in a CTOR.
#include <vector>
@@ -41,7 +41,7 @@ private:
class ThrowOnCopy {
public:
ThrowOnCopy() : should_throw(false) {}
- explicit ThrowOnCopy(bool should_throw) : should_throw(should_throw) {}
+ explicit ThrowOnCopy(bool xshould_throw) : should_throw(xshould_throw) {}
ThrowOnCopy(ThrowOnCopy const & other)
: should_throw(other.should_throw)
diff --git a/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp b/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
new file mode 100644
index 000000000000..c2c2d9221cf1
--- /dev/null
+++ b/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-exceptions, libcpp-no-if-constexpr
+
+// test container debugging
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
+#include <map>
+#include <set>
+#include <utility>
+#include <cassert>
+#include "debug_mode_helper.h"
+
+using namespace IteratorDebugChecks;
+
+template <class Container, ContainerType CT>
+struct AssociativeContainerChecks : BasicContainerChecks<Container, CT> {
+ using Base = BasicContainerChecks<Container, CT>;
+ using value_type = typename Container::value_type;
+ using iterator = typename Container::iterator;
+ using const_iterator = typename Container::const_iterator;
+ using traits = std::iterator_traits<iterator>;
+ using category = typename traits::iterator_category;
+
+ using Base::makeContainer;
+public:
+ static void run() {
+ Base::run();
+ try {
+ // FIXME Add tests
+ } catch (...) {
+ assert(false && "uncaught debug exception");
+ }
+ }
+
+private:
+ // FIXME Add tests here
+};
+
+int main()
+{
+ using SetAlloc = test_allocator<int>;
+ using MapAlloc = test_allocator<std::pair<const int, int>>;
+ // FIXME: Add debug mode to these containers
+ if ((false)) {
+ AssociativeContainerChecks<
+ std::set<int, std::less<int>, SetAlloc>, CT_Set>::run();
+ AssociativeContainerChecks<
+ std::multiset<int, std::less<int>, SetAlloc>, CT_MultiSet>::run();
+ AssociativeContainerChecks<
+ std::map<int, int, std::less<int>, MapAlloc>, CT_Map>::run();
+ AssociativeContainerChecks<
+ std::multimap<int, int, std::less<int>, MapAlloc>, CT_MultiMap>::run();
+ }
+}
diff --git a/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp b/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
new file mode 100644
index 000000000000..46f960c15b1e
--- /dev/null
+++ b/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
@@ -0,0 +1,265 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-exceptions, libcpp-no-if-constexpr
+
+// test container debugging
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
+#include <forward_list>
+#include <list>
+#include <vector>
+#include <deque>
+#include "debug_mode_helper.h"
+
+using namespace IteratorDebugChecks;
+
+template <class Container, ContainerType CT>
+struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
+ using Base = BasicContainerChecks<Container, CT>;
+ using value_type = typename Container::value_type;
+ using allocator_type = typename Container::allocator_type;
+ using iterator = typename Container::iterator;
+ using const_iterator = typename Container::const_iterator;
+
+ using Base::makeContainer;
+ using Base::makeValueType;
+public:
+ static void run() {
+ Base::run();
+ try {
+ FrontOnEmptyContainer();
+ if constexpr (CT != CT_ForwardList) {
+ AssignInvalidates();
+ BackOnEmptyContainer();
+ InsertIterValue();
+ InsertIterSizeValue();
+ InsertIterIterIter();
+ EmplaceIterValue();
+ EraseIterIter();
+ }
+ if constexpr (CT == CT_Vector || CT == CT_Deque || CT == CT_List) {
+ PopBack();
+ }
+ if constexpr (CT == CT_List || CT == CT_Deque) {
+ PopFront(); // FIXME: Run with forward list as well
+ }
+ } catch (...) {
+ assert(false && "uncaught debug exception");
+ }
+ }
+
+private:
+ static void AssignInvalidates() {
+ CHECKPOINT("assign(Size, Value)");
+ Container C(allocator_type{});
+ iterator it1, it2, it3;
+ auto reset = [&]() {
+ C = makeContainer(3);
+ it1 = C.begin();
+ it2 = ++C.begin();
+ it3 = C.end();
+ };
+ auto check = [&]() {
+ CHECK_DEBUG_THROWS( C.erase(it1) );
+ CHECK_DEBUG_THROWS( C.erase(it2) );
+ CHECK_DEBUG_THROWS( C.erase(it3, C.end()) );
+ };
+ reset();
+ C.assign(2, makeValueType(4));
+ check();
+ reset();
+ CHECKPOINT("assign(Iter, Iter)");
+ std::vector<value_type> V = {
+ makeValueType(1),
+ makeValueType(2),
+ makeValueType(3)
+ };
+ C.assign(V.begin(), V.end());
+ check();
+ reset();
+ CHECKPOINT("assign(initializer_list)");
+ C.assign({makeValueType(1), makeValueType(2), makeValueType(3)});
+ check();
+ }
+
+ static void BackOnEmptyContainer() {
+ CHECKPOINT("testing back on empty");
+ Container C = makeContainer(1);
+ Container const& CC = C;
+ (void)C.back();
+ (void)CC.back();
+ C.clear();
+ CHECK_DEBUG_THROWS( C.back() );
+ CHECK_DEBUG_THROWS( CC.back() );
+ }
+
+ static void FrontOnEmptyContainer() {
+ CHECKPOINT("testing front on empty");
+ Container C = makeContainer(1);
+ Container const& CC = C;
+ (void)C.front();
+ (void)CC.front();
+ C.clear();
+ CHECK_DEBUG_THROWS( C.front() );
+ CHECK_DEBUG_THROWS( CC.front() );
+ }
+
+ static void EraseIterIter() {
+ CHECKPOINT("testing erase iter iter invalidation");
+ Container C1 = makeContainer(3);
+ iterator it1 = C1.begin();
+ iterator it1_next = ++C1.begin();
+ iterator it1_after_next = ++C1.begin();
+ ++it1_after_next;
+ iterator it1_back = --C1.end();
+ assert(it1_next != it1_back);
+ if (CT == CT_Vector) {
+ CHECK_DEBUG_THROWS( C1.erase(it1_next, it1) ); // bad range
+ }
+ C1.erase(it1, it1_after_next);
+ CHECK_DEBUG_THROWS( C1.erase(it1) );
+ CHECK_DEBUG_THROWS( C1.erase(it1_next) );
+ if (CT == CT_List) {
+ C1.erase(it1_back);
+ } else {
+ CHECK_DEBUG_THROWS( C1.erase(it1_back) );
+ }
+ }
+
+ static void PopBack() {
+ CHECKPOINT("testing pop_back() invalidation");
+ Container C1 = makeContainer(2);
+ iterator it1 = C1.end();
+ --it1;
+ C1.pop_back();
+ CHECK_DEBUG_THROWS( C1.erase(it1) );
+ C1.erase(C1.begin());
+ assert(C1.size() == 0);
+ CHECK_DEBUG_THROWS( C1.pop_back() );
+ }
+
+ static void PopFront() {
+ CHECKPOINT("testing pop_front() invalidation");
+ Container C1 = makeContainer(2);
+ iterator it1 = C1.begin();
+ C1.pop_front();
+ CHECK_DEBUG_THROWS( C1.erase(it1) );
+ C1.erase(C1.begin());
+ assert(C1.size() == 0);
+ CHECK_DEBUG_THROWS( C1.pop_front() );
+ }
+
+ static void InsertIterValue() {
+ CHECKPOINT("testing insert(iter, value)");
+ Container C1 = makeContainer(2);
+ iterator it1 = C1.begin();
+ iterator it1_next = it1;
+ ++it1_next;
+ Container C2 = C1;
+ const value_type value = makeValueType(3);
+ value_type rvalue = makeValueType(3);
+ CHECK_DEBUG_THROWS( C2.insert(it1, value) ); // wrong container
+ CHECK_DEBUG_THROWS( C2.insert(it1, std::move(rvalue)) ); // wrong container
+ C1.insert(it1_next, value);
+ if (CT == CT_List) {
+ C1.insert(it1_next, value);
+ C1.insert(it1, value);
+ C1.insert(it1_next, std::move(rvalue));
+ C1.insert(it1, std::move(rvalue));
+ } else {
+ CHECK_DEBUG_THROWS( C1.insert(it1_next, value) ); // invalidated iterator
+ CHECK_DEBUG_THROWS( C1.insert(it1, value) ); // invalidated iterator
+ CHECK_DEBUG_THROWS( C1.insert(it1_next, std::move(rvalue)) ); // invalidated iterator
+ CHECK_DEBUG_THROWS( C1.insert(it1, std::move(rvalue)) ); // invalidated iterator
+ }
+ }
+
+ static void EmplaceIterValue() {
+ CHECKPOINT("testing emplace(iter, value)");
+ Container C1 = makeContainer(2);
+ iterator it1 = C1.begin();
+ iterator it1_next = it1;
+ ++it1_next;
+ Container C2 = C1;
+ const value_type value = makeValueType(3);
+ CHECK_DEBUG_THROWS( C2.emplace(it1, value) ); // wrong container
+ CHECK_DEBUG_THROWS( C2.emplace(it1, makeValueType(4)) ); // wrong container
+ C1.emplace(it1_next, value);
+ if (CT == CT_List) {
+ C1.emplace(it1_next, value);
+ C1.emplace(it1, value);
+ } else {
+ CHECK_DEBUG_THROWS( C1.emplace(it1_next, value) ); // invalidated iterator
+ CHECK_DEBUG_THROWS( C1.emplace(it1, value) ); // invalidated iterator
+ }
+ }
+
+ static void InsertIterSizeValue() {
+ CHECKPOINT("testing insert(iter, size, value)");
+ Container C1 = makeContainer(2);
+ iterator it1 = C1.begin();
+ iterator it1_next = it1;
+ ++it1_next;
+ Container C2 = C1;
+ const value_type value = makeValueType(3);
+ CHECK_DEBUG_THROWS( C2.insert(it1, 1, value) ); // wrong container
+ C1.insert(it1_next, 2, value);
+ if (CT == CT_List) {
+ C1.insert(it1_next, 3, value);
+ C1.insert(it1, 1, value);
+ } else {
+ CHECK_DEBUG_THROWS( C1.insert(it1_next, 1, value) ); // invalidated iterator
+ CHECK_DEBUG_THROWS( C1.insert(it1, 1, value) ); // invalidated iterator
+ }
+ }
+
+ static void InsertIterIterIter() {
+ CHECKPOINT("testing insert(iter, iter, iter)");
+ Container C1 = makeContainer(2);
+ iterator it1 = C1.begin();
+ iterator it1_next = it1;
+ ++it1_next;
+ Container C2 = C1;
+ std::vector<value_type> V = {
+ makeValueType(1),
+ makeValueType(2),
+ makeValueType(3)
+ };
+ CHECK_DEBUG_THROWS( C2.insert(it1, V.begin(), V.end()) ); // wrong container
+ C1.insert(it1_next, V.begin(), V.end());
+ if (CT == CT_List) {
+ C1.insert(it1_next, V.begin(), V.end());
+ C1.insert(it1, V.begin(), V.end());
+ } else {
+ CHECK_DEBUG_THROWS( C1.insert(it1_next, V.begin(), V.end()) ); // invalidated iterator
+ CHECK_DEBUG_THROWS( C1.insert(it1, V.begin(), V.end()) ); // invalidated iterator
+ }
+ }
+};
+
+int main()
+{
+ using Alloc = test_allocator<int>;
+ {
+ SequenceContainerChecks<std::list<int, Alloc>, CT_List>::run();
+ SequenceContainerChecks<std::vector<int, Alloc>, CT_Vector>::run();
+ }
+ // FIXME these containers don't support iterator debugging
+ if ((false)) {
+ SequenceContainerChecks<
+ std::vector<bool, test_allocator<bool>>, CT_VectorBool>::run();
+ SequenceContainerChecks<
+ std::forward_list<int, Alloc>, CT_ForwardList>::run();
+ SequenceContainerChecks<
+ std::deque<int, Alloc>, CT_Deque>::run();
+ }
+}
diff --git a/test/libcxx/debug/containers/db_string.pass.cpp b/test/libcxx/debug/containers/db_string.pass.cpp
new file mode 100644
index 000000000000..ee1634140ff6
--- /dev/null
+++ b/test/libcxx/debug/containers/db_string.pass.cpp
@@ -0,0 +1,96 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-exceptions, libcpp-no-if-constexpr
+
+// test container debugging
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
+#include <string>
+#include <vector>
+
+#include "test_macros.h"
+#include "debug_mode_helper.h"
+
+using namespace IteratorDebugChecks;
+
+typedef std::basic_string<char, std::char_traits<char>, test_allocator<char>> StringType;
+
+template <class Container = StringType, ContainerType CT = CT_String>
+struct StringContainerChecks : BasicContainerChecks<Container, CT> {
+ using Base = BasicContainerChecks<Container, CT_String>;
+ using value_type = typename Container::value_type;
+ using allocator_type = typename Container::allocator_type;
+ using iterator = typename Container::iterator;
+ using const_iterator = typename Container::const_iterator;
+
+ using Base::makeContainer;
+ using Base::makeValueType;
+
+public:
+ static void run() {
+ Base::run_iterator_tests();
+ // FIXME: get these passing
+ // Base::run_allocator_aware_tests();
+ try {
+ for (int N : {3, 128}) {
+ FrontOnEmptyContainer(N);
+ BackOnEmptyContainer(N);
+ PopBack(N);
+ }
+ } catch (...) {
+ assert(false && "uncaught debug exception");
+ }
+ }
+
+private:
+ static void BackOnEmptyContainer(int N) {
+ CHECKPOINT("testing back on empty");
+ Container C = makeContainer(N);
+ Container const& CC = C;
+ iterator it = --C.end();
+ (void)C.back();
+ (void)CC.back();
+ C.pop_back();
+ CHECK_DEBUG_THROWS( C.erase(it) );
+ C.clear();
+ CHECK_DEBUG_THROWS( C.back() );
+ CHECK_DEBUG_THROWS( CC.back() );
+ }
+
+ static void FrontOnEmptyContainer(int N) {
+ CHECKPOINT("testing front on empty");
+ Container C = makeContainer(N);
+ Container const& CC = C;
+ (void)C.front();
+ (void)CC.front();
+ C.clear();
+ CHECK_DEBUG_THROWS( C.front() );
+ CHECK_DEBUG_THROWS( CC.front() );
+ }
+
+ static void PopBack(int N) {
+ CHECKPOINT("testing pop_back() invalidation");
+ Container C1 = makeContainer(N);
+ iterator it1 = C1.end();
+ --it1;
+ C1.pop_back();
+ CHECK_DEBUG_THROWS( C1.erase(it1) );
+ C1.erase(C1.begin(), C1.end());
+ assert(C1.size() == 0);
+ CHECK_DEBUG_THROWS( C1.pop_back() );
+ }
+};
+
+int main()
+{
+ StringContainerChecks<>::run();
+}
diff --git a/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp b/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
new file mode 100644
index 000000000000..708fc7f8b950
--- /dev/null
+++ b/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-exceptions, libcpp-no-if-constexpr
+
+// test container debugging
+
+#define _LIBCPP_DEBUG 1
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
+#include <unordered_map>
+#include <unordered_set>
+#include <utility>
+#include <cassert>
+#include "debug_mode_helper.h"
+
+using namespace IteratorDebugChecks;
+
+template <class Container, ContainerType CT>
+struct UnorderedContainerChecks : BasicContainerChecks<Container, CT> {
+ using Base = BasicContainerChecks<Container, CT>;
+ using value_type = typename Container::value_type;
+ using iterator = typename Container::iterator;
+ using const_iterator = typename Container::const_iterator;
+ using traits = std::iterator_traits<iterator>;
+ using category = typename traits::iterator_category;
+
+ using Base::makeContainer;
+public:
+ static void run() {
+ Base::run();
+ try {
+ // FIXME
+ } catch (...) {
+ assert(false && "uncaught debug exception");
+ }
+ }
+private:
+
+};
+
+int main()
+{
+ using SetAlloc = test_allocator<int>;
+ using MapAlloc = test_allocator<std::pair<const int, int>>;
+ {
+ UnorderedContainerChecks<
+ std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, MapAlloc>,
+ CT_UnorderedMap>::run();
+ UnorderedContainerChecks<
+ std::unordered_set<int, std::hash<int>, std::equal_to<int>, SetAlloc>,
+ CT_UnorderedSet>::run();
+ UnorderedContainerChecks<
+ std::unordered_multimap<int, int, std::hash<int>, std::equal_to<int>, MapAlloc>,
+ CT_UnorderedMultiMap>::run();
+ UnorderedContainerChecks<
+ std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, SetAlloc>,
+ CT_UnorderedMultiSet>::run();
+ }
+}
diff --git a/test/libcxx/debug/debug_abort.pass.cpp b/test/libcxx/debug/debug_abort.pass.cpp
new file mode 100644
index 000000000000..cfe63202705d
--- /dev/null
+++ b/test/libcxx/debug/debug_abort.pass.cpp
@@ -0,0 +1,30 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// Test that the default debug handler aborts the program.
+
+#define _LIBCPP_DEBUG 0
+
+#include <csignal>
+#include <cstdlib>
+#include <__debug>
+
+void signal_handler(int signal)
+{
+ if (signal == SIGABRT)
+ std::_Exit(EXIT_SUCCESS);
+ std::_Exit(EXIT_FAILURE);
+}
+
+int main()
+{
+ if (std::signal(SIGABRT, signal_handler) != SIG_ERR)
+ _LIBCPP_ASSERT(false, "foo");
+ return EXIT_FAILURE;
+}
diff --git a/test/libcxx/debug/debug_throw.pass.cpp b/test/libcxx/debug/debug_throw.pass.cpp
new file mode 100644
index 000000000000..bc5625c60093
--- /dev/null
+++ b/test/libcxx/debug/debug_throw.pass.cpp
@@ -0,0 +1,36 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// UNSUPPORTED: libcpp-no-exceptions
+
+// Test that the default debug handler can be overridden and test the
+// throwing debug handler.
+
+#define _LIBCPP_DEBUG 0
+
+#include <cstdlib>
+#include <exception>
+#include <type_traits>
+#include <__debug>
+
+int main()
+{
+ {
+ std::__libcpp_debug_function = std::__libcpp_throw_debug_function;
+ try {
+ _LIBCPP_ASSERT(false, "foo");
+ } catch (std::__libcpp_debug_exception const&) {}
+ }
+ {
+ // test that the libc++ exception type derives from std::exception
+ static_assert((std::is_base_of<std::exception,
+ std::__libcpp_debug_exception
+ >::value), "must be an exception");
+ }
+}
diff --git a/test/libcxx/containers/sequences/list/db_cfront.pass.cpp b/test/libcxx/debug/debug_throw_register.pass.cpp
index 9501ce193138..21b1d5255d3d 100644
--- a/test/libcxx/containers/sequences/list/db_cfront.pass.cpp
+++ b/test/libcxx/debug/debug_throw_register.pass.cpp
@@ -1,3 +1,4 @@
+// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
@@ -6,25 +7,24 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: libcpp-no-exceptions
-// <list>
-
-// Call front() on empty const container.
+// Test that defining _LIBCPP_DEBUG_USE_EXCEPTIONS causes _LIBCPP_ASSERT
+// to throw on failure.
#define _LIBCPP_DEBUG 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
-#include <list>
-#include <cassert>
-#include <iterator>
-#include <exception>
#include <cstdlib>
+#include <exception>
+#include <type_traits>
+#include <__debug>
+#include <cassert>
int main()
{
- typedef int T;
- typedef std::list<T> C;
- const C c;
- assert(c.front() == 0);
+ try {
+ _LIBCPP_ASSERT(false, "foo");
assert(false);
+ } catch (...) {}
}
diff --git a/test/std/utilities/utility/forward/forward1.fail.cpp b/test/libcxx/depr/depr.c.headers/ciso646.pass.cpp
index 43884d54bf86..725a7ab1331b 100644
--- a/test/std/utilities/utility/forward/forward1.fail.cpp
+++ b/test/libcxx/depr/depr.c.headers/ciso646.pass.cpp
@@ -7,18 +7,14 @@
//
//===----------------------------------------------------------------------===//
-// test forward
+// <ciso646>
-#include <utility>
+#include <ciso646>
-struct A
-{
-};
-
-A source() {return A();}
-const A csource() {return A();}
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
int main()
{
- std::forward<A&>(source()); // error
}
diff --git a/test/std/utilities/utility/forward/forward3.fail.cpp b/test/libcxx/depr/depr.c.headers/complex.h.pass.cpp
index 7e1e9b38fdc2..da0707990d80 100644
--- a/test/std/utilities/utility/forward/forward3.fail.cpp
+++ b/test/libcxx/depr/depr.c.headers/complex.h.pass.cpp
@@ -7,18 +7,15 @@
//
//===----------------------------------------------------------------------===//
-// test forward
+// <complex.h>
-#include <utility>
+#include <complex.h>
-struct A
-{
-};
-
-A source() {return A();}
-const A csource() {return A();}
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
int main()
{
- std::forward<A&>(csource()); // error
+ std::complex<double> d;
}
diff --git a/test/libcxx/depr/depr.c.headers/locale_h.pass.cpp b/test/libcxx/depr/depr.c.headers/locale_h.pass.cpp
new file mode 100644
index 000000000000..bd4d3501d072
--- /dev/null
+++ b/test/libcxx/depr/depr.c.headers/locale_h.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale.h>
+
+#include <locale.h>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
diff --git a/test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp b/test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp
new file mode 100644
index 000000000000..a2ef814dcae1
--- /dev/null
+++ b/test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <tgmath.h>
+
+#include <tgmath.h>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+ std::complex<double> cd;
+ double x = sin(1.0);
+ (void)x; // to placate scan-build
+}
diff --git a/test/libcxx/double_include.sh.cpp b/test/libcxx/double_include.sh.cpp
index 99767cf1bbc8..46dfc999be8b 100644
--- a/test/libcxx/double_include.sh.cpp
+++ b/test/libcxx/double_include.sh.cpp
@@ -15,14 +15,18 @@
// RUN: %cxx -o %t.exe %t.first.o %t.second.o %flags %link_flags
// RUN: %run
-
// Prevent <ext/hash_map> from generating deprecated warnings for this test.
#if defined(__DEPRECATED)
#undef __DEPRECATED
#endif
+// Top level headers
#include <algorithm>
+#include <any>
#include <array>
+#ifndef _LIBCPP_HAS_NO_THREADS
+#include <atomic>
+#endif
#include <bitset>
#include <cassert>
#include <ccomplex>
@@ -51,25 +55,21 @@
#include <cstring>
#include <ctgmath>
#include <ctime>
+#include <ctype.h>
#include <cwchar>
#include <cwctype>
#include <deque>
+#include <errno.h>
#include <exception>
-#include <experimental/algorithm>
-#include <experimental/any>
-#include <experimental/chrono>
-#include <experimental/dynarray>
-#include <experimental/optional>
-#include <experimental/string_view>
-#include <experimental/system_error>
-#include <experimental/type_traits>
-#include <experimental/utility>
-#include <ext/hash_map>
-#include <ext/hash_set>
+#include <float.h>
#include <forward_list>
#include <fstream>
#include <functional>
+#ifndef _LIBCPP_HAS_NO_THREADS
+#include <future>
+#endif
#include <initializer_list>
+#include <inttypes.h>
#include <iomanip>
#include <ios>
#include <iosfwd>
@@ -77,12 +77,19 @@
#include <istream>
#include <iterator>
#include <limits>
+#include <limits.h>
#include <list>
#include <locale>
+#include <locale.h>
#include <map>
+#include <math.h>
#include <memory>
+#ifndef _LIBCPP_HAS_NO_THREADS
+#include <mutex>
+#endif
#include <new>
#include <numeric>
+#include <optional>
#include <ostream>
#include <queue>
#include <random>
@@ -90,14 +97,28 @@
#include <regex>
#include <scoped_allocator>
#include <set>
+#include <setjmp.h>
+#ifndef _LIBCPP_HAS_NO_THREADS
+#include <shared_mutex>
+#endif
#include <sstream>
#include <stack>
+#include <stdbool.h>
+#include <stddef.h>
#include <stdexcept>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <streambuf>
#include <string>
+#include <string.h>
+#include <string_view>
#include <strstream>
#include <system_error>
#include <tgmath.h>
+#ifndef _LIBCPP_HAS_NO_THREADS
+#include <thread>
+#endif
#include <tuple>
#include <typeindex>
#include <typeinfo>
@@ -106,15 +127,45 @@
#include <unordered_set>
#include <utility>
#include <valarray>
+#include <variant>
#include <vector>
+#include <wchar.h>
+#include <wctype.h>
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include <atomic>
-#include <future>
-#include <mutex>
-#include <shared_mutex>
-#include <thread>
-#endif
+// experimental headers
+#if __cplusplus >= 201103L
+#include <experimental/algorithm>
+#include <experimental/any>
+#include <experimental/chrono>
+#include <experimental/deque>
+#include <experimental/dynarray>
+#include <experimental/filesystem>
+#include <experimental/forward_list>
+#include <experimental/functional>
+#include <experimental/iterator>
+#include <experimental/list>
+#include <experimental/map>
+#include <experimental/memory_resource>
+#include <experimental/numeric>
+#include <experimental/optional>
+#include <experimental/propagate_const>
+#include <experimental/ratio>
+#include <experimental/regex>
+#include <experimental/set>
+#include <experimental/string>
+#include <experimental/string_view>
+#include <experimental/system_error>
+#include <experimental/tuple>
+#include <experimental/type_traits>
+#include <experimental/unordered_map>
+#include <experimental/unordered_set>
+#include <experimental/utility>
+#include <experimental/vector>
+#endif // __cplusplus >= 201103L
+
+// extended headers
+#include <ext/hash_map>
+#include <ext/hash_set>
#if defined(WITH_MAIN)
int main() {}
diff --git a/test/libcxx/experimental/any/small_type.pass.cpp b/test/libcxx/experimental/any/small_type.pass.cpp
index e6595d4a4ab3..96754126c996 100644
--- a/test/libcxx/experimental/any/small_type.pass.cpp
+++ b/test/libcxx/experimental/any/small_type.pass.cpp
@@ -14,7 +14,7 @@
// Check that the size and alignment of any are what we expect.
#include <experimental/any>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
constexpr std::size_t BufferSize = (sizeof(void*) * 3);
constexpr std::size_t BufferAlignment = alignof(void*);
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
index cd5c56c7ac51..14f5c4ed8596 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: c++98, c++03, c++11
// dynarray.cons
@@ -29,6 +28,8 @@
#include <new>
#include <string>
+#include "test_macros.h"
+
using std::experimental::dynarray;
@@ -61,12 +62,14 @@ void test ( const T &val, bool DefaultValueIsIndeterminate = false) {
assert ( std::all_of ( d3.begin (), d3.end (), [&val]( const T &item ){ return item == val; } ));
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
void test_bad_length () {
try { dynarray<int> ( std::numeric_limits<size_t>::max() / sizeof ( int ) + 1 ); }
catch ( std::bad_array_length & ) { return ; }
catch (...) { assert(false); }
assert ( false );
}
+#endif
int main()
@@ -87,5 +90,7 @@ int main()
assert ( d1.size() == 20 );
assert ( std::all_of ( d1.begin (), d1.end (), []( long item ){ return item == 3L; } ));
+#ifndef TEST_HAS_NO_EXCEPTIONS
test_bad_length ();
+#endif
}
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp
index 612e661ea6db..8d7d28b8395f 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// dynarray.cons
// explicit dynarray(size_type c);
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
index a6825b68d0f1..ef9be4532dd7 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// dynarray.overview
// const_reference at(size_type n) const;
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp
index fe425b7e8c18..38aefdfbaf47 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp
@@ -29,6 +29,7 @@
#include <__config>
#include <experimental/dynarray>
+#include <cstddef>
#include <cassert>
#include <algorithm>
@@ -46,10 +47,11 @@ void dyn_test_const ( const dynarray<T> &dyn ) {
assert ( data + dyn.size() - 1 == &*dyn.rbegin ());
assert ( data + dyn.size() - 1 == &*dyn.crbegin ());
- assert ( dyn.size () == std::distance ( dyn.begin(), dyn.end()));
- assert ( dyn.size () == std::distance ( dyn.cbegin(), dyn.cend()));
- assert ( dyn.size () == std::distance ( dyn.rbegin(), dyn.rend()));
- assert ( dyn.size () == std::distance ( dyn.crbegin(), dyn.crend()));
+ std::ptrdiff_t ds = static_cast<std::ptrdiff_t>(dyn.size());
+ assert (ds == std::distance ( dyn.begin(), dyn.end()));
+ assert (ds == std::distance ( dyn.cbegin(), dyn.cend()));
+ assert (ds == std::distance ( dyn.rbegin(), dyn.rend()));
+ assert (ds == std::distance ( dyn.crbegin(), dyn.crend()));
assert ( dyn.begin () == dyn.cbegin ());
assert ( &*dyn.begin () == &*dyn.cbegin ());
@@ -68,10 +70,11 @@ void dyn_test ( dynarray<T> &dyn ) {
assert ( data + dyn.size() - 1 == &*dyn.rbegin ());
assert ( data + dyn.size() - 1 == &*dyn.crbegin ());
- assert ( dyn.size () == std::distance ( dyn.begin(), dyn.end()));
- assert ( dyn.size () == std::distance ( dyn.cbegin(), dyn.cend()));
- assert ( dyn.size () == std::distance ( dyn.rbegin(), dyn.rend()));
- assert ( dyn.size () == std::distance ( dyn.crbegin(), dyn.crend()));
+ std::ptrdiff_t ds = static_cast<std::ptrdiff_t>(dyn.size());
+ assert (ds == std::distance ( dyn.begin(), dyn.end()));
+ assert (ds == std::distance ( dyn.cbegin(), dyn.cend()));
+ assert (ds == std::distance ( dyn.rbegin(), dyn.rend()));
+ assert (ds == std::distance ( dyn.crbegin(), dyn.crend()));
assert ( dyn.begin () == dyn.cbegin ());
assert ( &*dyn.begin () == &*dyn.cbegin ());
diff --git a/test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp b/test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp
new file mode 100644
index 000000000000..a98a9ccd2a80
--- /dev/null
+++ b/test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+// UNSUPPORTED: libcpp-no-exceptions
+
+// <experimental/filesystem>
+
+// class path
+
+#define _LIBCPP_DEBUG 0
+#define _LIBCPP_ASSERT(cond, msg) ((cond) ? ((void)0) : throw 42)
+
+#include <experimental/filesystem>
+#include <iterator>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "filesystem_test_helper.hpp"
+
+namespace fs = std::experimental::filesystem;
+
+int main() {
+ using namespace fs;
+ // Test incrementing/decrementing a singular iterator
+ {
+ path::iterator singular;
+ try {
+ ++singular;
+ assert(false);
+ } catch (int) {}
+ try {
+ --singular;
+ assert(false);
+ } catch (int) {}
+ }
+ // Test decrementing the begin iterator
+ {
+ path p("foo/bar");
+ auto it = p.begin();
+ try {
+ --it;
+ assert(false);
+ } catch (int) {}
+ ++it;
+ ++it;
+ try {
+ ++it;
+ assert(false);
+ } catch (int) {}
+ }
+ // Test incrementing the end iterator
+ {
+ path p("foo/bar");
+ auto it = p.end();
+ try {
+ ++it;
+ assert(false);
+ } catch (int) {}
+ --it;
+ --it;
+ try {
+ --it;
+ assert(false);
+ } catch (int) {}
+ }
+} \ No newline at end of file
diff --git a/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp b/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp
new file mode 100644
index 000000000000..c43ea078f989
--- /dev/null
+++ b/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <experimental/filesystem>
+
+// class path
+
+// path& operator/=(path const&)
+// path operator/(path const&, path const&)
+
+
+#define _LIBCPP_DEBUG 0
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (void)::AssertCount++)
+int AssertCount = 0;
+
+#include <experimental/filesystem>
+#include <type_traits>
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "count_new.hpp"
+#include "filesystem_test_helper.hpp"
+
+namespace fs = std::experimental::filesystem;
+
+int main()
+{
+ using namespace fs;
+ {
+ path lhs("//foo");
+ path rhs("/bar");
+ assert(AssertCount == 0);
+ lhs /= rhs;
+ assert(AssertCount == 0);
+ }
+ {
+ path lhs("//foo");
+ path rhs("/bar");
+ assert(AssertCount == 0);
+ (void)(lhs / rhs);
+ assert(AssertCount == 0);
+ }
+ {
+ path lhs("//foo");
+ path rhs("//bar");
+ assert(AssertCount == 0);
+ lhs /= rhs;
+ assert(AssertCount == 1);
+ AssertCount = 0;
+ }
+ {
+ path lhs("//foo");
+ path rhs("//bar");
+ assert(AssertCount == 0);
+ (void)(lhs / rhs);
+ assert(AssertCount == 1);
+ }
+ // FIXME The same error is not diagnosed for the append(Source) and
+ // append(It, It) overloads.
+}
diff --git a/test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp b/test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp
index 94de2108f8b5..61d322524071 100644
--- a/test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp
+++ b/test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp
@@ -28,6 +28,7 @@
#include "test_macros.h"
#include "test_iterators.h"
#include "min_allocator.h"
+#include "constexpr_char_traits.hpp"
namespace fs = std::experimental::filesystem;
@@ -59,6 +60,8 @@ struct MakeTestType {
using value_type = CharT;
using string_type = std::basic_string<CharT>;
using string_type2 = std::basic_string<CharT, std::char_traits<CharT>, min_allocator<CharT>>;
+ using string_view_type = std::basic_string_view<CharT>;
+ using string_view_type2 = std::basic_string_view<CharT, constexpr_char_traits<CharT>>;
using cstr_type = CharT* const;
using const_cstr_type = const CharT*;
using array_type = CharT[25];
@@ -81,6 +84,8 @@ struct MakeTestType {
static void Test() {
AssertPathable<string_type>();
AssertPathable<string_type2>();
+ AssertPathable<string_view_type>();
+ AssertPathable<string_view_type2>();
AssertPathable<cstr_type>();
AssertPathable<const_cstr_type>();
AssertPathable<array_type>();
diff --git a/test/libcxx/iterators/trivial_iterators.pass.cpp b/test/libcxx/iterators/trivial_iterators.pass.cpp
index 33c830251769..c4b3aae92ff2 100644
--- a/test/libcxx/iterators/trivial_iterators.pass.cpp
+++ b/test/libcxx/iterators/trivial_iterators.pass.cpp
@@ -42,7 +42,7 @@ class my_input_iterator
{
It it_;
- template <class U> friend class input_iterator;
+ template <class U> friend class my_input_iterator;
public:
typedef my_input_iterator_tag iterator_category;
typedef typename std::iterator_traits<It>::value_type value_type;
@@ -55,7 +55,7 @@ public:
my_input_iterator() : it_() {}
explicit my_input_iterator(It it) : it_(it) {}
template <class U>
- my_input_iterator(const input_iterator<U>& u) :it_(u.it_) {}
+ my_input_iterator(const my_input_iterator<U>& u) :it_(u.it_) {}
reference operator*() const {return *it_;}
pointer operator->() const {return it_;}
diff --git a/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp b/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
new file mode 100644
index 000000000000..04b40009cda9
--- /dev/null
+++ b/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
@@ -0,0 +1,77 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// test libc++'s implementation of align_val_t, and the relevent new/delete
+// overloads in all dialects when -faligned-allocation is present.
+
+// REQUIRES: -faligned-allocation
+
+// RUN: %build -faligned-allocation
+// RUN: %run
+
+#include <new>
+#include <typeinfo>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main() {
+ {
+ static_assert(std::is_enum<std::align_val_t>::value, "");
+ typedef std::underlying_type<std::align_val_t>::type UT;
+ static_assert((std::is_same<UT, std::size_t>::value), "");
+ }
+ {
+ static_assert((!std::is_constructible<std::align_val_t, std::size_t>::value), "");
+#if TEST_STD_VER >= 11
+ static_assert(!std::is_constructible<std::size_t, std::align_val_t>::value, "");
+#else
+ static_assert((std::is_constructible<std::size_t, std::align_val_t>::value), "");
+#endif
+ }
+ {
+ std::align_val_t a = std::align_val_t(0);
+ std::align_val_t b = std::align_val_t(32);
+ assert(a != b);
+ assert(a == std::align_val_t(0));
+ assert(b == std::align_val_t(32));
+ }
+ {
+ void *ptr = ::operator new(1, std::align_val_t(128));
+ assert(ptr);
+ assert(reinterpret_cast<std::uintptr_t>(ptr) % 128 == 0);
+ ::operator delete(ptr, std::align_val_t(128));
+ }
+ {
+ void *ptr = ::operator new(1, std::align_val_t(128), std::nothrow);
+ assert(ptr);
+ assert(reinterpret_cast<std::uintptr_t>(ptr) % 128 == 0);
+ ::operator delete(ptr, std::align_val_t(128), std::nothrow);
+ }
+ {
+ void *ptr = ::operator new[](1, std::align_val_t(128));
+ assert(ptr);
+ assert(reinterpret_cast<std::uintptr_t>(ptr) % 128 == 0);
+ ::operator delete[](ptr, std::align_val_t(128));
+ }
+ {
+ void *ptr = ::operator new[](1, std::align_val_t(128), std::nothrow);
+ assert(ptr);
+ assert(reinterpret_cast<std::uintptr_t>(ptr) % 128 == 0);
+ ::operator delete[](ptr, std::align_val_t(128), std::nothrow);
+ }
+#ifndef TEST_HAS_NO_RTTI
+ {
+ // Check that libc++ doesn't define align_val_t in a versioning namespace.
+ // And that it mangles the same in C++03 through C++17
+ assert(typeid(std::align_val_t).name() == std::string("St11align_val_t"));
+ }
+#endif
+} \ No newline at end of file
diff --git a/test/libcxx/libcpp_version.pass.cpp b/test/libcxx/libcpp_version.pass.cpp
new file mode 100644
index 000000000000..b83233837c9f
--- /dev/null
+++ b/test/libcxx/libcpp_version.pass.cpp
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// Test that the __libcpp_version file matches the value of _LIBCPP_VERSION
+
+#include <__config>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION must be defined
+#endif
+
+static const int libcpp_version =
+#include <__libcpp_version>
+;
+
+static_assert(_LIBCPP_VERSION == libcpp_version,
+ "_LIBCPP_VERSION doesn't match __libcpp_version");
+
+int main() {
+
+}
diff --git a/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp b/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
index 75e2aeb064eb..9ba422fc0c9e 100644
--- a/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
+++ b/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
@@ -27,9 +27,9 @@ int main()
// interesting state.
Myconv myconv;
myconv.from_bytes("\xF1\x80\x80\x83");
- const int old_converted = myconv.converted();
+ const auto old_converted = myconv.converted();
assert(myconv.converted() == 4);
// move construct a new converter and make sure the state is the same.
Myconv myconv2(std::move(myconv));
- assert(myconv2.converted() == 4);
+ assert(myconv2.converted() == old_converted);
}
diff --git a/test/libcxx/modules/cinttypes_exports.sh.cpp b/test/libcxx/modules/cinttypes_exports.sh.cpp
new file mode 100644
index 000000000000..99d20ec65027
--- /dev/null
+++ b/test/libcxx/modules/cinttypes_exports.sh.cpp
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: modules-support
+
+// Test that <cinttypes> re-exports <cstdint>
+
+// RUN: %build_module
+
+#include <cinttypes>
+
+int main() {
+ int8_t x; ((void)x);
+ std::int8_t y; ((void)y);
+}
diff --git a/test/libcxx/modules/clocale_exports.sh.cpp b/test/libcxx/modules/clocale_exports.sh.cpp
new file mode 100644
index 000000000000..69b1a9bd6624
--- /dev/null
+++ b/test/libcxx/modules/clocale_exports.sh.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: modules-support
+// UNSUPPORTED: c++98, c++03
+
+// RUN: %build_module
+
+#include <clocale>
+
+#define TEST(...) do { using T = decltype( __VA_ARGS__ ); } while(false)
+
+int main() {
+ std::lconv l; ((void)l);
+
+ TEST(std::setlocale(0, ""));
+ TEST(std::localeconv());
+}
diff --git a/test/std/utilities/utility/forward/forward4.fail.cpp b/test/libcxx/modules/cstdint_exports.sh.cpp
index 276506f811b5..8ecc1da28f1a 100644
--- a/test/std/utilities/utility/forward/forward4.fail.cpp
+++ b/test/libcxx/modules/cstdint_exports.sh.cpp
@@ -7,19 +7,15 @@
//
//===----------------------------------------------------------------------===//
-// test forward
+// REQUIRES: modules-support
-#include <utility>
+// Test that <cstdint> re-exports <stdint.h>
-struct A
-{
-};
+// RUN: %build_module
-A source() {return A();}
-const A csource() {return A();}
+#include <cstdint>
-int main()
-{
- const A ca = A();
- std::forward<A>(ca); // error
+int main() {
+ int8_t x; ((void)x);
+ std::int8_t y; ((void)y);
}
diff --git a/test/libcxx/modules/inttypes_h_exports.sh.cpp b/test/libcxx/modules/inttypes_h_exports.sh.cpp
new file mode 100644
index 000000000000..d1598d7eab3f
--- /dev/null
+++ b/test/libcxx/modules/inttypes_h_exports.sh.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: modules-support
+
+// Test that intypes.h re-exports stdint.h
+
+// RUN: %build_module
+
+#include <inttypes.h>
+
+int main() {
+ int8_t x; ((void)x);
+}
diff --git a/test/libcxx/modules/stdint_h_exports.sh.cpp b/test/libcxx/modules/stdint_h_exports.sh.cpp
new file mode 100644
index 000000000000..78e1101383b1
--- /dev/null
+++ b/test/libcxx/modules/stdint_h_exports.sh.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: modules-support
+
+// Test that int8_t and the like are exported from stdint.h not inttypes.h
+
+// RUN: %build_module
+
+#include <stdint.h>
+
+int main() {
+ int8_t x; ((void)x);
+}
diff --git a/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp b/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp
new file mode 100644
index 000000000000..9123be1f0990
--- /dev/null
+++ b/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// Check that the overloads of std::__libcpp_{isnan,isinf,isfinite} that take
+// floating-point values are evaluatable from constexpr contexts.
+//
+// These functions need to be constexpr in order to be called from CUDA, see
+// https://reviews.llvm.org/D25403. They don't actually need to be
+// constexpr-evaluatable, but that's what we check here, since we can't check
+// true constexpr-ness.
+//
+// This fails with gcc because __builtin_isnan and friends, which libcpp_isnan
+// and friends call, are not themselves constexpr-evaluatable.
+//
+// UNSUPPORTED: c++98, c++03
+// XFAIL: gcc
+
+#include <cmath>
+
+static_assert(std::__libcpp_isnan(0.) == false, "");
+static_assert(std::__libcpp_isinf(0.0) == false, "");
+static_assert(std::__libcpp_isfinite(0.0) == true, "");
+
+int main()
+{
+}
diff --git a/test/libcxx/numerics/c.math/ctgmath.pass.cpp b/test/libcxx/numerics/c.math/ctgmath.pass.cpp
new file mode 100644
index 000000000000..815502f1ccaf
--- /dev/null
+++ b/test/libcxx/numerics/c.math/ctgmath.pass.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <ctgmath>
+
+#include <ctgmath>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+ std::complex<double> cd;
+ ((void)cd);
+ double x = std::sin(0);
+ ((void)x);
+}
diff --git a/test/libcxx/numerics/c.math/tgmath_h.pass.cpp b/test/libcxx/numerics/c.math/tgmath_h.pass.cpp
new file mode 100644
index 000000000000..23143c7140a6
--- /dev/null
+++ b/test/libcxx/numerics/c.math/tgmath_h.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <tgmath.h>
+
+#include <tgmath.h>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
diff --git a/test/std/numerics/c.math/version_cmath.pass.cpp b/test/libcxx/numerics/c.math/version_cmath.pass.cpp
index 1249a902e7af..1249a902e7af 100644
--- a/test/std/numerics/c.math/version_cmath.pass.cpp
+++ b/test/libcxx/numerics/c.math/version_cmath.pass.cpp
diff --git a/test/libcxx/numerics/complex.number/ccmplx/ccomplex.pass.cpp b/test/libcxx/numerics/complex.number/ccmplx/ccomplex.pass.cpp
new file mode 100644
index 000000000000..21aaa669fd43
--- /dev/null
+++ b/test/libcxx/numerics/complex.number/ccmplx/ccomplex.pass.cpp
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <ccomplex>
+
+#include <ccomplex>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+ std::complex<double> d;
+}
diff --git a/test/libcxx/strings/iterators.exceptions.pass.cpp b/test/libcxx/strings/iterators.exceptions.pass.cpp
index 02ec921cc613..b236c5180b93 100644
--- a/test/libcxx/strings/iterators.exceptions.pass.cpp
+++ b/test/libcxx/strings/iterators.exceptions.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// <iterator>
// __libcpp_is_trivial_iterator<Tp>
@@ -26,6 +25,15 @@
#include "test_macros.h"
#include "test_iterators.h"
+#ifndef TEST_HAS_NO_EXCEPTIONS
+static const bool expected = false;
+#else
+// Under libcpp-no-exceptions all noexcept expressions are trivially true, so
+// any check for a noexcept returning false must actually check for it being
+// true.
+static const bool expected = true;
+#endif
+
int main()
{
// basic tests
@@ -43,17 +51,17 @@ int main()
static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::reverse_iterator<std::__wrap_iter<char *> > > ::value), "");
// iterators in the libc++ test suite
- static_assert((!std::__libcpp_string_gets_noexcept_iterator<output_iterator <char *> >::value), "");
- static_assert((!std::__libcpp_string_gets_noexcept_iterator<input_iterator <char *> >::value), "");
- static_assert((!std::__libcpp_string_gets_noexcept_iterator<forward_iterator <char *> >::value), "");
- static_assert((!std::__libcpp_string_gets_noexcept_iterator<bidirectional_iterator<char *> >::value), "");
- static_assert((!std::__libcpp_string_gets_noexcept_iterator<random_access_iterator<char *> >::value), "");
- static_assert((!std::__libcpp_string_gets_noexcept_iterator<ThrowingIterator <char *> >::value), "");
+ static_assert(std::__libcpp_string_gets_noexcept_iterator<output_iterator <char *> >::value == expected, "");
+ static_assert(std::__libcpp_string_gets_noexcept_iterator<input_iterator <char *> >::value == expected, "");
+ static_assert(std::__libcpp_string_gets_noexcept_iterator<forward_iterator <char *> >::value == expected, "");
+ static_assert(std::__libcpp_string_gets_noexcept_iterator<bidirectional_iterator<char *> >::value == expected, "");
+ static_assert(std::__libcpp_string_gets_noexcept_iterator<random_access_iterator<char *> >::value == expected, "");
+ static_assert(std::__libcpp_string_gets_noexcept_iterator<ThrowingIterator <char *> >::value == expected, "");
#if TEST_STD_VER >= 11
static_assert(( std::__libcpp_string_gets_noexcept_iterator<NonThrowingIterator <char *> >::value), "");
#else
- static_assert((!std::__libcpp_string_gets_noexcept_iterator<NonThrowingIterator <char *> >::value), "");
+ static_assert(std::__libcpp_string_gets_noexcept_iterator<NonThrowingIterator <char *> >::value == expected, "");
#endif
//
diff --git a/test/libcxx/strings/iterators.noexcept.pass.cpp b/test/libcxx/strings/iterators.noexcept.pass.cpp
index 283cf0897cca..b8e0b4cdf34d 100644
--- a/test/libcxx/strings/iterators.noexcept.pass.cpp
+++ b/test/libcxx/strings/iterators.noexcept.pass.cpp
@@ -19,6 +19,7 @@
// When exceptions are disabled, all iterators should get this "fast path"
//
+// MODULES_DEFINES: _LIBCPP_NO_EXCEPTIONS
#define _LIBCPP_NO_EXCEPTIONS
#include <iterator>
diff --git a/test/libcxx/test/config.py b/test/libcxx/test/config.py
index 593f9805447d..4551845104d2 100644
--- a/test/libcxx/test/config.py
+++ b/test/libcxx/test/config.py
@@ -13,6 +13,7 @@ import platform
import pkgutil
import re
import shlex
+import shutil
import sys
import lit.Test # pylint: disable=import-error,no-name-in-module
@@ -57,6 +58,7 @@ class Configuration(object):
self.lit_config = lit_config
self.config = config
self.cxx = None
+ self.cxx_stdlib_under_test = None
self.project_obj_root = None
self.libcxx_src_root = None
self.libcxx_obj_root = None
@@ -82,6 +84,10 @@ class Configuration(object):
conf = self.get_lit_conf(name)
if conf is None:
return default
+ if isinstance(conf, bool):
+ return conf
+ if not isinstance(conf, str):
+ raise TypeError('expected bool or string')
if conf.lower() in ('1', 'true'):
return True
if conf.lower() in ('', '0', 'false'):
@@ -96,6 +102,7 @@ class Configuration(object):
self.configure_triple()
self.configure_src_root()
self.configure_obj_root()
+ self.configure_cxx_stdlib_under_test()
self.configure_cxx_library_root()
self.configure_use_system_cxx_lib()
self.configure_use_clang_verify()
@@ -111,6 +118,7 @@ class Configuration(object):
self.configure_warnings()
self.configure_sanitizer()
self.configure_coverage()
+ self.configure_modules()
self.configure_substitutions()
self.configure_features()
@@ -118,8 +126,13 @@ class Configuration(object):
# Print the final compile and link flags.
self.lit_config.note('Using compiler: %s' % self.cxx.path)
self.lit_config.note('Using flags: %s' % self.cxx.flags)
+ if self.cxx.use_modules:
+ self.lit_config.note('Using modules flags: %s' %
+ self.cxx.modules_flags)
self.lit_config.note('Using compile flags: %s'
% self.cxx.compile_flags)
+ if len(self.cxx.warning_flags):
+ self.lit_config.note('Using warnings: %s' % self.cxx.warning_flags)
self.lit_config.note('Using link flags: %s' % self.cxx.link_flags)
# Print as list to prevent "set([...])" from being printed.
self.lit_config.note('Using available_features: %s' %
@@ -177,6 +190,7 @@ class Configuration(object):
assert self.cxx.version is not None
maj_v, min_v, _ = self.cxx.version
self.config.available_features.add(cxx_type)
+ self.config.available_features.add('%s-%s' % (cxx_type, maj_v))
self.config.available_features.add('%s-%s.%s' % (
cxx_type, maj_v, min_v))
@@ -212,14 +226,34 @@ class Configuration(object):
self.lit_config.note(
"inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
+ def configure_cxx_stdlib_under_test(self):
+ self.cxx_stdlib_under_test = self.get_lit_conf(
+ 'cxx_stdlib_under_test', 'libc++')
+ if self.cxx_stdlib_under_test not in \
+ ['libc++', 'libstdc++', 'cxx_default']:
+ self.lit_config.fatal(
+ 'unsupported value for "cxx_stdlib_under_test": %s'
+ % self.cxx_stdlib_under_test)
+ self.config.available_features.add(self.cxx_stdlib_under_test)
+ if self.cxx_stdlib_under_test == 'libstdc++':
+ self.config.available_features.add('libstdc++')
+ # Manually enable the experimental and filesystem tests for libstdc++
+ # if the options aren't present.
+ # FIXME this is a hack.
+ if self.get_lit_conf('enable_experimental') is None:
+ self.config.enable_experimental = 'true'
+ if self.get_lit_conf('enable_filesystem') is None:
+ self.config.enable_filesystem = 'true'
+
def configure_use_clang_verify(self):
'''If set, run clang with -verify on failing tests.'''
self.use_clang_verify = self.get_lit_bool('use_clang_verify')
if self.use_clang_verify is None:
# NOTE: We do not test for the -verify flag directly because
# -verify will always exit with non-zero on an empty file.
- self.use_clang_verify = self.cxx.hasCompileFlag(
- ['-Xclang', '-verify-ignore-unexpected'])
+ self.use_clang_verify = self.cxx.isVerifySupported()
+ if self.use_clang_verify:
+ self.config.available_features.add('verify-support')
self.lit_config.note(
"inferred use_clang_verify as: %r" % self.use_clang_verify)
@@ -267,6 +301,7 @@ class Configuration(object):
# XFAIL markers for tests that are known to fail with versions of
# libc++ as were shipped with a particular triple.
if self.use_system_cxx_lib:
+ self.config.available_features.add('with_system_cxx_lib')
self.config.available_features.add(
'with_system_cxx_lib=%s' % self.config.target_triple)
@@ -290,9 +325,19 @@ class Configuration(object):
if self.cxx.hasCompileFlag('-fsized-deallocation'):
self.config.available_features.add('fsized-deallocation')
+ if self.cxx.hasCompileFlag('-faligned-allocation'):
+ self.config.available_features.add('-faligned-allocation')
+ else:
+ # FIXME remove this once more than just clang-4.0 support
+ # C++17 aligned allocation.
+ self.config.available_features.add('no-aligned-allocation')
+
if self.get_lit_bool('has_libatomic', False):
self.config.available_features.add('libatomic')
+ if '__cpp_if_constexpr' not in self.cxx.dumpMacros():
+ self.config.available_features.add('libcpp-no-if-constexpr')
+
def configure_compile_flags(self):
no_default_flags = self.get_lit_bool('no_default_flags', False)
if not no_default_flags:
@@ -324,9 +369,8 @@ class Configuration(object):
'Failed to infer a supported language dialect from one of %r'
% possible_stds)
self.cxx.compile_flags += ['-std={0}'.format(std)]
- self.config.available_features.add(std)
+ self.config.available_features.add(std.replace('gnu++', 'c++'))
# Configure include paths
- self.cxx.compile_flags += ['-nostdinc++']
self.configure_compile_flags_header_includes()
self.target_info.add_cxx_compile_flags(self.cxx.compile_flags)
# Configure feature flags.
@@ -345,18 +389,32 @@ class Configuration(object):
if gcc_toolchain:
self.cxx.flags += ['-gcc-toolchain', gcc_toolchain]
if self.use_target:
- self.cxx.flags += ['-target', self.config.target_triple]
+ if not self.cxx.addFlagIfSupported(
+ ['-target', self.config.target_triple]):
+ self.lit_config.warning('use_target is true but -target is '\
+ 'not supported by the compiler')
def configure_compile_flags_header_includes(self):
support_path = os.path.join(self.libcxx_src_root, 'test/support')
- self.cxx.compile_flags += ['-include', os.path.join(support_path, 'nasty_macros.hpp')]
+ if self.cxx_stdlib_under_test != 'libstdc++':
+ self.cxx.compile_flags += [
+ '-include', os.path.join(support_path, 'nasty_macros.hpp')]
self.configure_config_site_header()
- libcxx_headers = self.get_lit_conf(
- 'libcxx_headers', os.path.join(self.libcxx_src_root, 'include'))
- if not os.path.isdir(libcxx_headers):
- self.lit_config.fatal("libcxx_headers='%s' is not a directory."
- % libcxx_headers)
- self.cxx.compile_flags += ['-I' + libcxx_headers]
+ cxx_headers = self.get_lit_conf('cxx_headers')
+ if cxx_headers == '' or (cxx_headers is None
+ and self.cxx_stdlib_under_test != 'libc++'):
+ self.lit_config.note('using the system cxx headers')
+ return
+ self.cxx.compile_flags += ['-nostdinc++']
+ if cxx_headers is None:
+ cxx_headers = os.path.join(self.libcxx_src_root, 'include')
+ if not os.path.isdir(cxx_headers):
+ self.lit_config.fatal("cxx_headers='%s' is not a directory."
+ % cxx_headers)
+ self.cxx.compile_flags += ['-I' + cxx_headers]
+ cxxabi_headers = os.path.join(self.libcxx_obj_root, 'include', 'c++-build')
+ if os.path.isdir(cxxabi_headers):
+ self.cxx.compile_flags += ['-I' + cxxabi_headers]
def configure_config_site_header(self):
# Check for a possible __config_site in the build directory. We
@@ -446,7 +504,7 @@ class Configuration(object):
assert os.path.isdir(static_env)
self.cxx.compile_flags += ['-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="%s"' % static_env]
- dynamic_env = os.path.join(self.libcxx_obj_root, 'test',
+ dynamic_env = os.path.join(self.config.test_exec_root,
'filesystem', 'Output', 'dynamic_env')
dynamic_env = os.path.realpath(dynamic_env)
if not os.path.isdir(dynamic_env):
@@ -465,16 +523,29 @@ class Configuration(object):
def configure_link_flags(self):
no_default_flags = self.get_lit_bool('no_default_flags', False)
if not no_default_flags:
- self.cxx.link_flags += ['-nodefaultlibs']
-
# Configure library path
self.configure_link_flags_cxx_library_path()
self.configure_link_flags_abi_library_path()
# Configure libraries
- self.configure_link_flags_cxx_library()
- self.configure_link_flags_abi_library()
- self.configure_extra_library_flags()
+ if self.cxx_stdlib_under_test == 'libc++':
+ self.cxx.link_flags += ['-nodefaultlibs']
+ self.configure_link_flags_cxx_library()
+ self.configure_link_flags_abi_library()
+ self.configure_extra_library_flags()
+ elif self.cxx_stdlib_under_test == 'libstdc++':
+ enable_fs = self.get_lit_bool('enable_filesystem',
+ default=False)
+ if enable_fs:
+ self.config.available_features.add('c++experimental')
+ self.cxx.link_flags += ['-lstdc++fs']
+ self.cxx.link_flags += ['-lm', '-pthread']
+ elif self.cxx_stdlib_under_test == 'cxx_default':
+ self.cxx.link_flags += ['-pthread']
+ else:
+ self.lit_config.fatal(
+ 'unsupported value for "use_stdlib_type": %s'
+ % use_stdlib_type)
link_flags_str = self.get_lit_conf('link_flags', '')
self.cxx.link_flags += shlex.split(link_flags_str)
@@ -508,6 +579,10 @@ class Configuration(object):
self.cxx.link_flags += [abs_path]
else:
self.cxx.link_flags += ['-lc++']
+ # This needs to come after -lc++ as we want its unresolved thread-api symbols
+ # to be picked up from this one.
+ if self.get_lit_bool('libcxx_external_thread_api', default=False):
+ self.cxx.link_flags += ['-lc++external_threads']
def configure_link_flags_abi_library(self):
cxx_abi = self.get_lit_conf('cxx_abi', 'libcxxabi')
@@ -567,23 +642,34 @@ class Configuration(object):
self.cxx.compile_flags += ['-D_LIBCPP_DEBUG=%s' % debug_level]
def configure_warnings(self):
- enable_warnings = self.get_lit_bool('enable_warnings', False)
+ # Turn on warnings by default for Clang based compilers when C++ >= 11
+ default_enable_warnings = self.cxx.type in ['clang', 'apple-clang'] \
+ and len(self.config.available_features.intersection(
+ ['c++11', 'c++14', 'c++1z'])) != 0
+ enable_warnings = self.get_lit_bool('enable_warnings',
+ default_enable_warnings)
if enable_warnings:
- self.cxx.compile_flags += [
+ self.cxx.useWarnings(True)
+ self.cxx.warning_flags += [
'-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER',
'-Wall', '-Wextra', '-Werror'
]
+ self.cxx.addWarningFlagIfSupported('-Wshadow')
self.cxx.addWarningFlagIfSupported('-Wno-unused-command-line-argument')
self.cxx.addWarningFlagIfSupported('-Wno-attributes')
self.cxx.addWarningFlagIfSupported('-Wno-pessimizing-move')
self.cxx.addWarningFlagIfSupported('-Wno-c++11-extensions')
self.cxx.addWarningFlagIfSupported('-Wno-user-defined-literals')
- # TODO(EricWF) Remove the unused warnings once the test suite
- # compiles clean with them.
+ # These warnings should be enabled in order to support the MSVC
+ # team using the test suite; They enable the warnings below and
+ # expect the test suite to be clean.
+ self.cxx.addWarningFlagIfSupported('-Wsign-compare')
+ self.cxx.addWarningFlagIfSupported('-Wunused-variable')
+ self.cxx.addWarningFlagIfSupported('-Wunused-parameter')
+ self.cxx.addWarningFlagIfSupported('-Wunreachable-code')
+ # FIXME: Enable the two warnings below.
+ self.cxx.addWarningFlagIfSupported('-Wno-conversion')
self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef')
- self.cxx.addWarningFlagIfSupported('-Wno-unused-variable')
- self.cxx.addWarningFlagIfSupported('-Wno-unused-parameter')
- self.cxx.addWarningFlagIfSupported('-Wno-sign-compare')
std = self.get_lit_conf('std', None)
if std in ['c++98', 'c++03']:
# The '#define static_assert' provided by libc++ in C++03 mode
@@ -604,9 +690,17 @@ class Configuration(object):
os.pathsep + symbolizer_search_paths)
llvm_symbolizer = lit.util.which('llvm-symbolizer',
symbolizer_search_paths)
+
+ def add_ubsan():
+ self.cxx.flags += ['-fsanitize=undefined',
+ '-fno-sanitize=vptr,function,float-divide-by-zero',
+ '-fno-sanitize-recover=all']
+ self.env['UBSAN_OPTIONS'] = 'print_stacktrace=1'
+ self.config.available_features.add('ubsan')
+
# Setup the sanitizer compile flags
self.cxx.flags += ['-g', '-fno-omit-frame-pointer']
- if san == 'Address':
+ if san == 'Address' or san == 'Address;Undefined' or san == 'Undefined;Address':
self.cxx.flags += ['-fsanitize=address']
if llvm_symbolizer is not None:
self.env['ASAN_SYMBOLIZER_PATH'] = llvm_symbolizer
@@ -615,6 +709,9 @@ class Configuration(object):
self.env['ASAN_OPTIONS'] = 'detect_odr_violation=0'
self.config.available_features.add('asan')
self.config.available_features.add('sanitizer-new-delete')
+ self.cxx.compile_flags += ['-O1']
+ if san == 'Address;Undefined' or san == 'Undefined;Address':
+ add_ubsan()
elif san == 'Memory' or san == 'MemoryWithOrigins':
self.cxx.flags += ['-fsanitize=memory']
if san == 'MemoryWithOrigins':
@@ -624,16 +721,10 @@ class Configuration(object):
self.env['MSAN_SYMBOLIZER_PATH'] = llvm_symbolizer
self.config.available_features.add('msan')
self.config.available_features.add('sanitizer-new-delete')
+ self.cxx.compile_flags += ['-O1']
elif san == 'Undefined':
- blacklist = os.path.join(self.libcxx_src_root,
- 'test/ubsan_blacklist.txt')
- self.cxx.flags += ['-fsanitize=undefined',
- '-fno-sanitize=vptr,function,float-divide-by-zero',
- '-fno-sanitize-recover=all',
- '-fsanitize-blacklist=' + blacklist]
- self.cxx.compile_flags += ['-O3']
- self.env['UBSAN_OPTIONS'] = 'print_stacktrace=1'
- self.config.available_features.add('ubsan')
+ add_ubsan()
+ self.cxx.compile_flags += ['-O2']
elif san == 'Thread':
self.cxx.flags += ['-fsanitize=thread']
self.config.available_features.add('tsan')
@@ -652,9 +743,36 @@ class Configuration(object):
self.cxx.flags += ['-g', '--coverage']
self.cxx.compile_flags += ['-O0']
+ def configure_modules(self):
+ modules_flags = ['-fmodules']
+ if platform.system() != 'Darwin':
+ modules_flags += ['-Xclang', '-fmodules-local-submodule-visibility']
+ supports_modules = self.cxx.hasCompileFlag(modules_flags)
+ enable_modules_default = supports_modules and \
+ os.environ.get('LIBCXX_USE_MODULES') is not None
+ enable_modules = self.get_lit_bool('enable_modules',
+ enable_modules_default)
+ if enable_modules and not supports_modules:
+ self.lit_config.fatal(
+ '-fmodules is enabled but not supported by the compiler')
+ if not supports_modules:
+ return
+ self.config.available_features.add('modules-support')
+ module_cache = os.path.join(self.config.test_exec_root,
+ 'modules.cache')
+ module_cache = os.path.realpath(module_cache)
+ if os.path.isdir(module_cache):
+ shutil.rmtree(module_cache)
+ os.makedirs(module_cache)
+ self.cxx.modules_flags = modules_flags + \
+ ['-fmodules-cache-path=' + module_cache]
+ if enable_modules:
+ self.config.available_features.add('-fmodules')
+ self.cxx.useModules()
+
def configure_substitutions(self):
sub = self.config.substitutions
- # Configure compiler substitions
+ # Configure compiler substitutions
sub.append(('%cxx', self.cxx.path))
# Configure flags substitutions
flags_str = ' '.join(self.cxx.flags)
@@ -665,13 +783,23 @@ class Configuration(object):
sub.append(('%compile_flags', compile_flags_str))
sub.append(('%link_flags', link_flags_str))
sub.append(('%all_flags', all_flags))
+ if self.cxx.isVerifySupported():
+ verify_str = ' ' + ' '.join(self.cxx.verify_flags) + ' '
+ sub.append(('%verify', verify_str))
# Add compile and link shortcuts
compile_str = (self.cxx.path + ' -o %t.o %s -c ' + flags_str
- + compile_flags_str)
- link_str = (self.cxx.path + ' -o %t.exe %t.o ' + flags_str
+ + ' ' + compile_flags_str)
+ link_str = (self.cxx.path + ' -o %t.exe %t.o ' + flags_str + ' '
+ link_flags_str)
assert type(link_str) is str
build_str = self.cxx.path + ' -o %t.exe %s ' + all_flags
+ if self.cxx.use_modules:
+ sub.append(('%compile_module', compile_str))
+ sub.append(('%build_module', build_str))
+ elif self.cxx.modules_flags is not None:
+ modules_str = ' '.join(self.cxx.modules_flags) + ' '
+ sub.append(('%compile_module', compile_str + ' ' + modules_str))
+ sub.append(('%build_module', build_str + ' ' + modules_str))
sub.append(('%compile', compile_str))
sub.append(('%link', link_str))
sub.append(('%build', build_str))
@@ -686,18 +814,20 @@ class Configuration(object):
sub.append(('%exec', exec_str))
# Configure run shortcut
sub.append(('%run', exec_str + ' %t.exe'))
- # Configure not program substitions
+ # Configure not program substitutions
not_py = os.path.join(self.libcxx_src_root, 'utils', 'not', 'not.py')
- not_str = '%s %s' % (sys.executable, not_py)
- sub.append(('not', not_str))
+ not_str = '%s %s ' % (sys.executable, not_py)
+ sub.append(('not ', not_str))
def configure_triple(self):
# Get or infer the target triple.
self.config.target_triple = self.get_lit_conf('target_triple')
- self.use_target = bool(self.config.target_triple)
+ self.use_target = self.get_lit_bool('use_target', False)
+ if self.use_target and self.config.target_triple:
+ self.lit_config.warning('use_target is true but no triple is specified')
# If no target triple was given, try to infer it from the compiler
# under test.
- if not self.use_target:
+ if not self.config.target_triple:
target_triple = self.cxx.getTriple()
# Drop sub-major version components from the triple, because the
# current XFAIL handling expects exact matches for feature checks.
diff --git a/test/libcxx/test/format.py b/test/libcxx/test/format.py
index b9ec2ba2aa7b..ee6ab82c6e3a 100644
--- a/test/libcxx/test/format.py
+++ b/test/libcxx/test/format.py
@@ -10,11 +10,15 @@
import errno
import os
import time
+import random
import lit.Test # pylint: disable=import-error
import lit.TestRunner # pylint: disable=import-error
+from lit.TestRunner import ParserKind, IntegratedTestKeywordParser \
+ # pylint: disable=import-error
import lit.util # pylint: disable=import-error
+
from libcxx.test.executor import LocalExecutor as LocalExecutor
import libcxx.util
@@ -32,11 +36,32 @@ class LibcxxTestFormat(object):
def __init__(self, cxx, use_verify_for_fail, execute_external,
executor, exec_env):
- self.cxx = cxx
+ self.cxx = cxx.copy()
self.use_verify_for_fail = use_verify_for_fail
self.execute_external = execute_external
self.executor = executor
self.exec_env = dict(exec_env)
+ self.cxx.compile_env = dict(os.environ)
+ # 'CCACHE_CPP2' prevents ccache from stripping comments while
+ # preprocessing. This is required to prevent stripping of '-verify'
+ # comments.
+ self.cxx.compile_env['CCACHE_CPP2'] = '1'
+
+ @staticmethod
+ def _make_custom_parsers():
+ return [
+ IntegratedTestKeywordParser('FLAKY_TEST.', ParserKind.TAG,
+ initial_value=False),
+ IntegratedTestKeywordParser('MODULES_DEFINES:', ParserKind.LIST,
+ initial_value=[])
+ ]
+
+ @staticmethod
+ def _get_parser(key, parsers):
+ for p in parsers:
+ if p.keyword == key:
+ return p
+ assert False and "parser not found"
# TODO: Move this into lit's FileBasedTest
def getTestsInDirectory(self, testSuite, path_in_suite,
@@ -65,16 +90,20 @@ class LibcxxTestFormat(object):
def _execute(self, test, lit_config):
name = test.path_in_suite[-1]
- is_sh_test = name.endswith('.sh.cpp')
+ name_root, name_ext = os.path.splitext(name)
+ is_libcxx_test = test.path_in_suite[0] == 'libcxx'
+ is_sh_test = name_root.endswith('.sh')
is_pass_test = name.endswith('.pass.cpp')
is_fail_test = name.endswith('.fail.cpp')
+ assert is_sh_test or name_ext == '.cpp', 'non-cpp file must be sh test'
if test.config.unsupported:
return (lit.Test.UNSUPPORTED,
"A lit.local.cfg marked this unsupported")
+ parsers = self._make_custom_parsers()
script = lit.TestRunner.parseIntegratedTestScript(
- test, require_script=is_sh_test)
+ test, additional_parsers=parsers, require_script=is_sh_test)
# Check if a result for the test was returned. If so return that
# result.
if isinstance(script, lit.Test.Result):
@@ -91,6 +120,25 @@ class LibcxxTestFormat(object):
tmpBase)
script = lit.TestRunner.applySubstitutions(script, substitutions)
+ test_cxx = self.cxx.copy()
+ if is_fail_test:
+ test_cxx.useCCache(False)
+ test_cxx.useWarnings(False)
+ extra_modules_defines = self._get_parser('MODULES_DEFINES:',
+ parsers).getValue()
+ if '-fmodules' in test.config.available_features:
+ test_cxx.compile_flags += [('-D%s' % mdef.strip()) for
+ mdef in extra_modules_defines]
+ test_cxx.addWarningFlagIfSupported('-Wno-macro-redefined')
+ # FIXME: libc++ debug tests #define _LIBCPP_ASSERT to override it
+ # If we see this we need to build the test against uniquely built
+ # modules.
+ if is_libcxx_test:
+ with open(test.getSourcePath(), 'r') as f:
+ contents = f.read()
+ if '#define _LIBCPP_ASSERT' in contents:
+ test_cxx.useModules(False)
+
# Dispatch the test based on its suffix.
if is_sh_test:
if not isinstance(self.executor, LocalExecutor):
@@ -101,9 +149,10 @@ class LibcxxTestFormat(object):
self.execute_external, script,
tmpBase)
elif is_fail_test:
- return self._evaluate_fail_test(test)
+ return self._evaluate_fail_test(test, test_cxx, parsers)
elif is_pass_test:
- return self._evaluate_pass_test(test, tmpBase, lit_config)
+ return self._evaluate_pass_test(test, tmpBase, lit_config,
+ test_cxx, parsers)
else:
# No other test type is supported
assert False
@@ -111,7 +160,8 @@ class LibcxxTestFormat(object):
def _clean(self, exec_path): # pylint: disable=no-self-use
libcxx.util.cleanFile(exec_path)
- def _evaluate_pass_test(self, test, tmpBase, lit_config):
+ def _evaluate_pass_test(self, test, tmpBase, lit_config,
+ test_cxx, parsers):
execDir = os.path.dirname(test.getExecPath())
source_path = test.getSourcePath()
exec_path = tmpBase + '.exe'
@@ -120,7 +170,7 @@ class LibcxxTestFormat(object):
lit.util.mkdir_p(os.path.dirname(tmpBase))
try:
# Compile the test
- cmd, out, err, rc = self.cxx.compileLinkTwoSteps(
+ cmd, out, err, rc = test_cxx.compileLinkTwoSteps(
source_path, out=exec_path, object_file=object_path,
cwd=execDir)
compile_cmd = cmd
@@ -139,22 +189,31 @@ class LibcxxTestFormat(object):
# should add a `// FILE-DEP: foo.dat` to each test to track this.
data_files = [os.path.join(local_cwd, f)
for f in os.listdir(local_cwd) if f.endswith('.dat')]
- cmd, out, err, rc = self.executor.run(exec_path, [exec_path],
- local_cwd, data_files, env)
- if rc != 0:
- report = libcxx.util.makeReport(cmd, out, err, rc)
- report = "Compiled With: %s\n%s" % (compile_cmd, report)
- report += "Compiled test failed unexpectedly!"
- return lit.Test.FAIL, report
- return lit.Test.PASS, ''
+ is_flaky = self._get_parser('FLAKY_TEST.', parsers).getValue()
+ max_retry = 3 if is_flaky else 1
+ for retry_count in range(max_retry):
+ cmd, out, err, rc = self.executor.run(exec_path, [exec_path],
+ local_cwd, data_files,
+ env)
+ if rc == 0:
+ res = lit.Test.PASS if retry_count == 0 else lit.Test.FLAKYPASS
+ return res, ''
+ elif rc != 0 and retry_count + 1 == max_retry:
+ report = libcxx.util.makeReport(cmd, out, err, rc)
+ report = "Compiled With: %s\n%s" % (compile_cmd, report)
+ report += "Compiled test failed unexpectedly!"
+ return lit.Test.FAIL, report
+
+ assert False # Unreachable
finally:
# Note that cleanup of exec_file happens in `_clean()`. If you
# override this, cleanup is your reponsibility.
libcxx.util.cleanFile(object_path)
self._clean(exec_path)
- def _evaluate_fail_test(self, test):
+ def _evaluate_fail_test(self, test, test_cxx, parsers):
source_path = test.getSourcePath()
+ # FIXME: lift this detection into LLVM/LIT.
with open(source_path, 'r') as f:
contents = f.read()
verify_tags = ['expected-note', 'expected-remark', 'expected-warning',
@@ -165,15 +224,11 @@ class LibcxxTestFormat(object):
# are dependant on a template parameter when '-fsyntax-only' is passed.
# This is fixed in GCC 6. However for now we only pass "-fsyntax-only"
# when using Clang.
- extra_flags = []
- if self.cxx.type != 'gcc':
- extra_flags += ['-fsyntax-only']
+ if test_cxx.type != 'gcc':
+ test_cxx.flags += ['-fsyntax-only']
if use_verify:
- extra_flags += ['-Xclang', '-verify',
- '-Xclang', '-verify-ignore-unexpected=note']
- cmd, out, err, rc = self.cxx.compile(source_path, out=os.devnull,
- flags=extra_flags,
- disable_ccache=True)
+ test_cxx.useVerify()
+ cmd, out, err, rc = test_cxx.compile(source_path, out=os.devnull)
expected_rc = 0 if use_verify else 1
if rc == expected_rc:
return lit.Test.PASS, ''
diff --git a/test/libcxx/test/target_info.py b/test/libcxx/test/target_info.py
index a743595a1046..dc94e7afe0a9 100644
--- a/test/libcxx/test/target_info.py
+++ b/test/libcxx/test/target_info.py
@@ -115,7 +115,7 @@ class DarwinLocalTI(DefaultTargetInfo):
return False
def add_sanitizer_features(self, sanitizer_type, features):
- if san == 'Undefined':
+ if sanitizer_type == 'Undefined':
features.add('sanitizer-new-delete')
@@ -180,7 +180,8 @@ class LinuxLocalTI(DefaultTargetInfo):
if llvm_unwinder:
flags += ['-lunwind', '-ldl']
else:
- flags += ['-lgcc_s', '-lgcc']
+ flags += ['-lgcc_s']
+ flags += ['-lgcc']
use_libatomic = self.full_config.get_lit_bool('use_libatomic', False)
if use_libatomic:
flags += ['-latomic']
diff --git a/test/libcxx/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp b/test/libcxx/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp
index bf28e01a0e86..6ebba1467db9 100644
--- a/test/libcxx/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp
+++ b/test/libcxx/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: libcpp-has-no-threads, libcpp-has-thread-api-external
// <condition_variable>
diff --git a/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp b/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp
index aae0afbffd37..d3568caa81a3 100644
--- a/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp
@@ -23,6 +23,7 @@
// C++11 and C++03. This is important since the mangling of `lock_guard` depends
// on it being declared as a variadic template, even in C++03.
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#include <mutex>
#include <string>
diff --git a/test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/native_handle.pass.cpp b/test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/native_handle.pass.cpp
index 12c80f02c340..c6ed66ce41d9 100644
--- a/test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/native_handle.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/native_handle.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: libcpp-has-no-threads, libcpp-has-thread-api-external
// <mutex>
diff --git a/test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/native_handle.pass.cpp b/test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/native_handle.pass.cpp
index 10626bc4072e..2031e4d7d4bb 100644
--- a/test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/native_handle.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/native_handle.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: libcpp-has-no-threads, libcpp-has-thread-api-external
// <mutex>
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp b/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
index 4e85a039686a..bff682ec4e00 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
@@ -12,6 +12,7 @@
// <mutex>
+// MODULES_DEFINES: _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
#define _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
#include <mutex>
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp b/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
index 40b97c396ad6..3898d08d8378 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
@@ -12,6 +12,7 @@
// <mutex>
+// MODULES_DEFINES: _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
#define _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
#include <mutex>
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp b/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
index c1425c960c00..941e9ff8f678 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
@@ -12,6 +12,7 @@
// <mutex>
+// MODULES_DEFINES: _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
#define _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
#include <mutex>
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp b/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
index e03f5eabffcf..1a5685e8deb8 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
@@ -12,6 +12,7 @@
// <mutex>
+// MODULES_DEFINES: _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
#define _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
#include <mutex>
diff --git a/test/libcxx/thread/thread.threads/thread.thread.class/thread.thread.member/native_handle.pass.cpp b/test/libcxx/thread/thread.threads/thread.thread.class/thread.thread.member/native_handle.pass.cpp
index c8807a965c44..1b1cbf89a099 100644
--- a/test/libcxx/thread/thread.threads/thread.thread.class/thread.thread.member/native_handle.pass.cpp
+++ b/test/libcxx/thread/thread.threads/thread.thread.class/thread.thread.member/native_handle.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: libcpp-has-no-threads, libcpp-has-thread-api-external
// <thread>
diff --git a/test/libcxx/thread/thread.threads/thread.thread.class/types.pass.cpp b/test/libcxx/thread/thread.threads/thread.thread.class/types.pass.cpp
index a5bf77031cca..e864af7f05b2 100644
--- a/test/libcxx/thread/thread.threads/thread.thread.class/types.pass.cpp
+++ b/test/libcxx/thread/thread.threads/thread.thread.class/types.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: libcpp-has-no-threads, libcpp-has-thread-api-external
// <thread>
diff --git a/test/libcxx/utilities/any/size_and_alignment.pass.cpp b/test/libcxx/utilities/any/size_and_alignment.pass.cpp
new file mode 100644
index 000000000000..a1bdf1604907
--- /dev/null
+++ b/test/libcxx/utilities/any/size_and_alignment.pass.cpp
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// Check that the size and alignment of any are what we expect.
+
+#include <any>
+
+int main()
+{
+ using std::any;
+ static_assert(sizeof(any) == sizeof(void*)*4, "");
+ static_assert(alignof(any) == alignof(void*), "");
+}
diff --git a/test/libcxx/utilities/any/small_type.pass.cpp b/test/libcxx/utilities/any/small_type.pass.cpp
new file mode 100644
index 000000000000..54de0c3ead57
--- /dev/null
+++ b/test/libcxx/utilities/any/small_type.pass.cpp
@@ -0,0 +1,114 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// Check that the size and alignment of any are what we expect.
+
+#include <any>
+#include "any_helpers.h"
+
+constexpr std::size_t BufferSize = (sizeof(void*) * 3);
+constexpr std::size_t BufferAlignment = alignof(void*);
+// Clang doesn't like "alignof(BufferAlignment * 2)" due to PR13986.
+// So we create "DoubleBufferAlignment" instead.
+constexpr std::size_t DoubleBufferAlignment = BufferAlignment * 2;
+
+class SmallThrowsDtor
+{
+public:
+ SmallThrowsDtor() {}
+ SmallThrowsDtor(SmallThrowsDtor const &) noexcept {}
+ SmallThrowsDtor(SmallThrowsDtor &&) noexcept {}
+ ~SmallThrowsDtor() noexcept(false) {}
+};
+
+
+struct alignas(1) MaxSizeType {
+ char buff[BufferSize];
+};
+
+struct alignas(BufferAlignment) MaxAlignType {
+};
+
+struct alignas(BufferAlignment) MaxSizeAndAlignType {
+ char buff[BufferSize];
+};
+
+
+struct alignas(1) OverSizeType {
+ char buff[BufferSize + 1];
+};
+
+struct alignas(DoubleBufferAlignment) OverAlignedType {
+};
+
+struct alignas(DoubleBufferAlignment) OverSizeAndAlignedType {
+ char buff[BufferSize + 1];
+};
+
+int main()
+{
+ using std::any;
+ using std::__any_imp::_IsSmallObject;
+ static_assert(_IsSmallObject<small>::value, "");
+ static_assert(_IsSmallObject<void*>::value, "");
+ static_assert(!_IsSmallObject<SmallThrowsDtor>::value, "");
+ static_assert(!_IsSmallObject<large>::value, "");
+ {
+ // Check a type that meets the size requirement *exactly* and has
+ // a lesser alignment requirement is considered small.
+ typedef MaxSizeType T;
+ static_assert(sizeof(T) == BufferSize, "");
+ static_assert(alignof(T) < BufferAlignment, "");
+ static_assert(_IsSmallObject<T>::value, "");
+ }
+ {
+ // Check a type that meets the alignment requirement *exactly* and has
+ // a lesser size is considered small.
+ typedef MaxAlignType T;
+ static_assert(sizeof(T) < BufferSize, "");
+ static_assert(alignof(T) == BufferAlignment, "");
+ static_assert(_IsSmallObject<T>::value, "");
+ }
+ {
+ // Check a type that meets the size and alignment requirements *exactly*
+ // is considered small.
+ typedef MaxSizeAndAlignType T;
+ static_assert(sizeof(T) == BufferSize, "");
+ static_assert(alignof(T) == BufferAlignment, "");
+ static_assert(_IsSmallObject<T>::value, "");
+ }
+ {
+ // Check a type that meets the alignment requirements but is over-sized
+ // is not considered small.
+ typedef OverSizeType T;
+ static_assert(sizeof(T) > BufferSize, "");
+ static_assert(alignof(T) < BufferAlignment, "");
+ static_assert(!_IsSmallObject<T>::value, "");
+ }
+ {
+ // Check a type that meets the size requirements but is over-aligned
+ // is not considered small.
+ typedef OverAlignedType T;
+ static_assert(sizeof(T) < BufferSize, "");
+ static_assert(alignof(T) > BufferAlignment, "");
+ static_assert(!_IsSmallObject<T>::value, "");
+ }
+ {
+ // Check a type that exceeds both the size an alignment requirements
+ // is not considered small.
+ typedef OverSizeAndAlignedType T;
+ static_assert(sizeof(T) > BufferSize, "");
+ static_assert(alignof(T) > BufferAlignment, "");
+ static_assert(!_IsSmallObject<T>::value, "");
+ }
+}
diff --git a/test/std/utilities/utility/forward/forward6.fail.cpp b/test/libcxx/utilities/any/version.pass.cpp
index 1f4b37d946ca..5edee710d585 100644
--- a/test/std/utilities/utility/forward/forward6.fail.cpp
+++ b/test/libcxx/utilities/any/version.pass.cpp
@@ -7,16 +7,14 @@
//
//===----------------------------------------------------------------------===//
-// test forward
+// <any>
-#include <utility>
+#include <any>
-struct A
-{
-};
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
int main()
{
- A a;
- std::forward(a); // error
}
diff --git a/test/libcxx/utilities/function.objects/func.require/bullet_1_2_3.pass.cpp b/test/libcxx/utilities/function.objects/func.require/bullet_1_2_3.pass.cpp
index 509c751b455d..7fb1568c0619 100644
--- a/test/libcxx/utilities/function.objects/func.require/bullet_1_2_3.pass.cpp
+++ b/test/libcxx/utilities/function.objects/func.require/bullet_1_2_3.pass.cpp
@@ -266,6 +266,7 @@ void test_derived_from_ref_wrap() {
auto& ret2 = std::__invoke(get_fn, d);
auto& cret2 = std::__invoke_constexpr(get_fn, d);
assert(&ret2 == &x);
+ assert(&cret2 == &x);
auto& ret3 = std::__invoke(get_fn, r2);
assert(&ret3 == &x);
}
@@ -367,4 +368,4 @@ int main() {
test_derived_from_ref_wrap();
#endif
-} \ No newline at end of file
+}
diff --git a/test/libcxx/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp b/test/libcxx/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp
new file mode 100644
index 000000000000..cc04e4e87f0c
--- /dev/null
+++ b/test/libcxx/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// optional<T>& operator=(const optional<T>& rhs);
+
+#include <optional>
+#include <string>
+#include <type_traits>
+
+using std::optional;
+
+struct X {};
+
+struct Y
+{
+ Y() = default;
+ Y& operator=(const Y&) { return *this; }
+};
+
+struct Z1
+{
+ Z1() = default;
+ Z1(Z1&&) = default;
+ Z1(const Z1&) = default;
+ Z1& operator=(Z1&&) = default;
+ Z1& operator=(const Z1&) = delete;
+};
+
+struct Z2
+{
+ Z2() = default;
+ Z2(Z2&&) = default;
+ Z2(const Z2&) = delete;
+ Z2& operator=(Z2&&) = default;
+ Z2& operator=(const Z2&) = default;
+};
+
+template <class T>
+constexpr bool
+test()
+{
+ optional<T> opt;
+ optional<T> opt2;
+ opt = opt2;
+ return true;
+}
+
+int main()
+{
+ {
+ using T = int;
+ static_assert((std::is_trivially_copy_assignable<optional<T>>::value), "");
+ static_assert(test<T>(), "");
+ }
+ {
+ using T = X;
+ static_assert((std::is_trivially_copy_assignable<optional<T>>::value), "");
+ static_assert(test<T>(), "");
+ }
+ static_assert(!(std::is_trivially_copy_assignable<optional<Y>>::value), "");
+ static_assert(!(std::is_trivially_copy_assignable<optional<std::string>>::value), "");
+
+ static_assert(!(std::is_copy_assignable<optional<Z1>>::value), "");
+ static_assert(!(std::is_copy_assignable<optional<Z2>>::value), "");
+}
diff --git a/test/libcxx/utilities/optional/optional.object/optional.object.assign/move.pass.cpp b/test/libcxx/utilities/optional/optional.object/optional.object.assign/move.pass.cpp
new file mode 100644
index 000000000000..6f421153cafb
--- /dev/null
+++ b/test/libcxx/utilities/optional/optional.object/optional.object.assign/move.pass.cpp
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// optional<T>& operator=(optional<T>&& rhs);
+
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+using std::optional;
+
+struct X {};
+
+struct Y
+{
+ Y() = default;
+ Y& operator=(Y&&) { return *this; }
+};
+
+struct Z1
+{
+ Z1() = default;
+ Z1(Z1&&) = default;
+ Z1& operator=(Z1&&) = delete;
+};
+
+struct Z2
+{
+ Z2() = default;
+ Z2(Z2&&) = delete;
+ Z2& operator=(Z2&&) = default;
+};
+
+template <class T>
+constexpr bool
+test()
+{
+ optional<T> opt;
+ optional<T> opt2;
+ opt = std::move(opt2);
+ return true;
+}
+
+int main()
+{
+ {
+ using T = int;
+ static_assert((std::is_trivially_copy_constructible<optional<T>>::value), "");
+ static_assert(test<T>(), "");
+ }
+ {
+ using T = X;
+ static_assert((std::is_trivially_copy_constructible<optional<T>>::value), "");
+ static_assert(test<T>(), "");
+ }
+ static_assert(!(std::is_trivially_move_assignable<optional<Y>>::value), "");
+ static_assert(!(std::is_trivially_move_assignable<optional<std::string>>::value), "");
+
+ static_assert(!(std::is_move_assignable<optional<Z1>>::value), "");
+ static_assert(!(std::is_move_assignable<optional<Z2>>::value), "");
+}
diff --git a/test/libcxx/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp b/test/libcxx/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp
new file mode 100644
index 000000000000..62eb6cd34880
--- /dev/null
+++ b/test/libcxx/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <optional>
+
+// optional(const optional<T>& rhs);
+
+#include <optional>
+#include <string>
+#include <type_traits>
+
+using std::optional;
+
+struct X {};
+
+struct Y
+{
+ Y() = default;
+ Y(const Y&) {}
+};
+
+struct Z
+{
+ Z() = default;
+ Z(Z&&) = delete;
+ Z(const Z&) = delete;
+ Z& operator=(Z&&) = delete;
+ Z& operator=(const Z&) = delete;
+};
+
+int main()
+{
+ {
+ using T = int;
+ static_assert((std::is_trivially_copy_constructible<optional<T>>::value), "");
+ constexpr optional<T> opt;
+ constexpr optional<T> opt2 = opt;
+ (void)opt2;
+ }
+ {
+ using T = X;
+ static_assert((std::is_trivially_copy_constructible<optional<T>>::value), "");
+ constexpr optional<T> opt;
+ constexpr optional<T> opt2 = opt;
+ (void)opt2;
+ }
+ static_assert(!(std::is_trivially_copy_constructible<optional<Y>>::value), "");
+ static_assert(!(std::is_trivially_copy_constructible<optional<std::string>>::value), "");
+
+ static_assert(!(std::is_copy_constructible<optional<Z>>::value), "");
+}
diff --git a/test/libcxx/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp b/test/libcxx/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
new file mode 100644
index 000000000000..f13ca92e2807
--- /dev/null
+++ b/test/libcxx/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <optional>
+
+// optional(optional<T>&& rhs);
+
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+using std::optional;
+
+struct X {};
+
+struct Y
+{
+ Y() = default;
+ Y(Y&&) {}
+};
+
+struct Z
+{
+ Z() = default;
+ Z(Z&&) = delete;
+ Z(const Z&) = delete;
+ Z& operator=(Z&&) = delete;
+ Z& operator=(const Z&) = delete;
+};
+
+int main()
+{
+ {
+ using T = int;
+ static_assert((std::is_trivially_copy_constructible<optional<T>>::value), "");
+ constexpr optional<T> opt;
+ constexpr optional<T> opt2 = std::move(opt);
+ (void)opt2;
+ }
+ {
+ using T = X;
+ static_assert((std::is_trivially_copy_constructible<optional<T>>::value), "");
+ constexpr optional<T> opt;
+ constexpr optional<T> opt2 = std::move(opt);
+ (void)opt2;
+ }
+ static_assert(!(std::is_trivially_move_constructible<optional<Y>>::value), "");
+ static_assert(!(std::is_trivially_move_constructible<optional<std::string>>::value), "");
+
+ static_assert(!(std::is_move_constructible<optional<Z>>::value), "");
+}
diff --git a/test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp b/test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp
new file mode 100644
index 000000000000..9493d6bb766c
--- /dev/null
+++ b/test/libcxx/utilities/optional/optional.object/special_member_gen.pass.cpp
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "archetypes.hpp"
+
+template <class T>
+struct SpecialMemberTest {
+ using O = std::optional<T>;
+
+ template <template <class> class TestMF>
+ static constexpr bool check_same() {
+ return TestMF<O>::value == TestMF<T>::value;
+ }
+
+ // Test that optional inherits the correct trivial/non-trivial members
+ static_assert(check_same<std::is_trivially_destructible>(), "");
+ static_assert(check_same<std::is_trivially_copyable>(), "");
+};
+
+template <class ...Args> static void sink(Args&&...) {}
+
+template <class ...TestTypes>
+struct DoTestsMetafunction {
+ DoTestsMetafunction() { sink(SpecialMemberTest<TestTypes>{}...); }
+};
+
+struct TrivialMoveNonTrivialCopy {
+ TrivialMoveNonTrivialCopy() = default;
+ TrivialMoveNonTrivialCopy(const TrivialMoveNonTrivialCopy&) {}
+ TrivialMoveNonTrivialCopy(TrivialMoveNonTrivialCopy&&) = default;
+ TrivialMoveNonTrivialCopy& operator=(const TrivialMoveNonTrivialCopy&) { return *this; }
+ TrivialMoveNonTrivialCopy& operator=(TrivialMoveNonTrivialCopy&&) = default;
+};
+
+struct TrivialCopyNonTrivialMove {
+ TrivialCopyNonTrivialMove() = default;
+ TrivialCopyNonTrivialMove(const TrivialCopyNonTrivialMove&) = default;
+ TrivialCopyNonTrivialMove(TrivialCopyNonTrivialMove&&) {}
+ TrivialCopyNonTrivialMove& operator=(const TrivialCopyNonTrivialMove&) = default;
+ TrivialCopyNonTrivialMove& operator=(TrivialCopyNonTrivialMove&&) { return *this; }
+};
+
+int main()
+{
+ sink(
+ ImplicitTypes::ApplyTypes<DoTestsMetafunction>{},
+ ExplicitTypes::ApplyTypes<DoTestsMetafunction>{},
+ NonLiteralTypes::ApplyTypes<DoTestsMetafunction>{},
+ NonTrivialTypes::ApplyTypes<DoTestsMetafunction>{},
+ DoTestsMetafunction<TrivialMoveNonTrivialCopy, TrivialCopyNonTrivialMove>{}
+ );
+}
diff --git a/test/libcxx/utilities/optional/version.pass.cpp b/test/libcxx/utilities/optional/version.pass.cpp
new file mode 100644
index 000000000000..e7581b5431b1
--- /dev/null
+++ b/test/libcxx/utilities/optional/version.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <optional>
+
+#include <optional>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
diff --git a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp b/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp
new file mode 100644
index 000000000000..a35dfd696259
--- /dev/null
+++ b/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <tuple>
+
+// Test the diagnostics libc++ generates for invalid reference binding.
+// Libc++ attempts to diagnose the following cases:
+// * Constructing an lvalue reference from an rvalue.
+// * Constructing an rvalue reference from an lvalue.
+
+#include <tuple>
+#include <string>
+
+int main() {
+ std::allocator<void> alloc;
+
+ // expected-error@tuple:* 4 {{static_assert failed "Attempted to construct a reference element in a tuple with an rvalue"}}
+
+ // bind lvalue to rvalue
+ std::tuple<int const&> t(42); // expected-note {{requested here}}
+ std::tuple<int const&> t1(std::allocator_arg, alloc, 42); // expected-note {{requested here}}
+ // bind rvalue to constructed non-rvalue
+ std::tuple<std::string &&> t2("hello"); // expected-note {{requested here}}
+ std::tuple<std::string &&> t3(std::allocator_arg, alloc, "hello"); // expected-note {{requested here}}
+}
diff --git a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.pass.cpp b/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.pass.cpp
new file mode 100644
index 000000000000..a90a2912d3a8
--- /dev/null
+++ b/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.pass.cpp
@@ -0,0 +1,71 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <tuple>
+
+// Test the diagnostics libc++ generates for invalid reference binding.
+// Libc++ attempts to diagnose the following cases:
+// * Constructing an lvalue reference from an rvalue.
+// * Constructing an rvalue reference from an lvalue.
+
+#include <tuple>
+#include <string>
+#include <functional>
+#include <cassert>
+
+static_assert(std::is_constructible<int&, std::reference_wrapper<int>>::value, "");
+static_assert(std::is_constructible<int const&, std::reference_wrapper<int>>::value, "");
+
+
+int main() {
+ std::allocator<void> alloc;
+ int x = 42;
+ {
+ std::tuple<int&> t(std::ref(x));
+ assert(&std::get<0>(t) == &x);
+ std::tuple<int&> t1(std::allocator_arg, alloc, std::ref(x));
+ assert(&std::get<0>(t1) == &x);
+ }
+ {
+ auto r = std::ref(x);
+ auto const& cr = r;
+ std::tuple<int&> t(r);
+ assert(&std::get<0>(t) == &x);
+ std::tuple<int&> t1(cr);
+ assert(&std::get<0>(t1) == &x);
+ std::tuple<int&> t2(std::allocator_arg, alloc, r);
+ assert(&std::get<0>(t2) == &x);
+ std::tuple<int&> t3(std::allocator_arg, alloc, cr);
+ assert(&std::get<0>(t3) == &x);
+ }
+ {
+ std::tuple<int const&> t(std::ref(x));
+ assert(&std::get<0>(t) == &x);
+ std::tuple<int const&> t2(std::cref(x));
+ assert(&std::get<0>(t2) == &x);
+ std::tuple<int const&> t3(std::allocator_arg, alloc, std::ref(x));
+ assert(&std::get<0>(t3) == &x);
+ std::tuple<int const&> t4(std::allocator_arg, alloc, std::cref(x));
+ assert(&std::get<0>(t4) == &x);
+ }
+ {
+ auto r = std::ref(x);
+ auto cr = std::cref(x);
+ std::tuple<int const&> t(r);
+ assert(&std::get<0>(t) == &x);
+ std::tuple<int const&> t2(cr);
+ assert(&std::get<0>(t2) == &x);
+ std::tuple<int const&> t3(std::allocator_arg, alloc, r);
+ assert(&std::get<0>(t3) == &x);
+ std::tuple<int const&> t4(std::allocator_arg, alloc, cr);
+ assert(&std::get<0>(t4) == &x);
+ }
+} \ No newline at end of file
diff --git a/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/disable_reduced_arity_initialization_extension.pass.cpp b/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/disable_reduced_arity_initialization_extension.pass.cpp
new file mode 100644
index 000000000000..4808c51cd4d1
--- /dev/null
+++ b/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/disable_reduced_arity_initialization_extension.pass.cpp
@@ -0,0 +1,108 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <tuple>
+
+// template <class... Types> class tuple;
+
+// template <class... UTypes>
+// explicit tuple(UTypes&&... u);
+
+// UNSUPPORTED: c++98, c++03
+
+#include <tuple>
+#include <cassert>
+#include <type_traits>
+#include <string>
+#include <system_error>
+
+#include "test_macros.h"
+#include "test_convertible.hpp"
+#include "MoveOnly.h"
+
+#if defined(_LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION)
+#error This macro should not be defined by default
+#endif
+
+struct NoDefault { NoDefault() = delete; };
+
+
+// Make sure the _Up... constructor SFINAEs out when the types that
+// are not explicitly initialized are not all default constructible.
+// Otherwise, std::is_constructible would return true but instantiating
+// the constructor would fail.
+void test_default_constructible_extension_sfinae()
+{
+ typedef MoveOnly MO;
+ typedef NoDefault ND;
+ {
+ typedef std::tuple<MO, ND> Tuple;
+ static_assert(!std::is_constructible<Tuple, MO>::value, "");
+ static_assert(std::is_constructible<Tuple, MO, ND>::value, "");
+ static_assert(test_convertible<Tuple, MO, ND>(), "");
+ }
+ {
+ typedef std::tuple<MO, MO, ND> Tuple;
+ static_assert(!std::is_constructible<Tuple, MO, MO>::value, "");
+ static_assert(std::is_constructible<Tuple, MO, MO, ND>::value, "");
+ static_assert(test_convertible<Tuple, MO, MO, ND>(), "");
+ }
+ {
+ // Same idea as above but with a nested tuple type.
+ typedef std::tuple<MO, ND> Tuple;
+ typedef std::tuple<MO, Tuple, MO, MO> NestedTuple;
+
+ static_assert(!std::is_constructible<
+ NestedTuple, MO, MO, MO, MO>::value, "");
+ static_assert(std::is_constructible<
+ NestedTuple, MO, Tuple, MO, MO>::value, "");
+ }
+}
+
+using ExplicitTup = std::tuple<std::string, int, std::error_code>;
+ExplicitTup doc_example() {
+ return ExplicitTup{"hello world", 42}; // explicit constructor called. OK.
+}
+
+// Test that the example given in UsingLibcxx.rst actually works.
+void test_example_from_docs() {
+ auto tup = doc_example();
+ assert(std::get<0>(tup) == "hello world");
+ assert(std::get<1>(tup) == 42);
+ assert(std::get<2>(tup) == std::error_code{});
+}
+
+int main()
+{
+ {
+ using E = MoveOnly;
+ using Tup = std::tuple<E, E, E>;
+ // Test that the reduced arity initialization extension is only
+ // allowed on the explicit constructor.
+ static_assert(test_convertible<Tup, E, E, E>(), "");
+
+ Tup t(E(0), E(1));
+ static_assert(std::is_constructible<Tup, E, E>::value, "");
+ static_assert(!test_convertible<Tup, E, E>(), "");
+ assert(std::get<0>(t) == 0);
+ assert(std::get<1>(t) == 1);
+ assert(std::get<2>(t) == MoveOnly());
+
+ Tup t2(E(0));
+ static_assert(std::is_constructible<Tup, E>::value, "");
+ static_assert(!test_convertible<Tup, E>(), "");
+ assert(std::get<0>(t) == 0);
+ assert(std::get<1>(t) == E());
+ assert(std::get<2>(t) == E());
+ }
+ // Check that SFINAE is properly applied with the default reduced arity
+ // constructor extensions.
+ test_default_constructible_extension_sfinae();
+ test_example_from_docs();
+}
diff --git a/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/enable_reduced_arity_initialization_extension.pass.cpp b/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/enable_reduced_arity_initialization_extension.pass.cpp
new file mode 100644
index 000000000000..99b6eb78f268
--- /dev/null
+++ b/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/enable_reduced_arity_initialization_extension.pass.cpp
@@ -0,0 +1,117 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <tuple>
+
+// template <class... Types> class tuple;
+
+// template <class... UTypes>
+// explicit tuple(UTypes&&... u);
+
+// UNSUPPORTED: c++98, c++03
+
+// MODULES_DEFINES: _LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION
+#define _LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION
+#include <tuple>
+#include <cassert>
+#include <type_traits>
+#include <string>
+#include <system_error>
+
+#include "test_macros.h"
+#include "test_convertible.hpp"
+#include "MoveOnly.h"
+
+
+struct NoDefault { NoDefault() = delete; };
+
+
+// Make sure the _Up... constructor SFINAEs out when the types that
+// are not explicitly initialized are not all default constructible.
+// Otherwise, std::is_constructible would return true but instantiating
+// the constructor would fail.
+void test_default_constructible_extension_sfinae()
+{
+ typedef MoveOnly MO;
+ typedef NoDefault ND;
+ {
+ typedef std::tuple<MO, ND> Tuple;
+ static_assert(!std::is_constructible<Tuple, MO>::value, "");
+ static_assert(std::is_constructible<Tuple, MO, ND>::value, "");
+ static_assert(test_convertible<Tuple, MO, ND>(), "");
+ }
+ {
+ typedef std::tuple<MO, MO, ND> Tuple;
+ static_assert(!std::is_constructible<Tuple, MO, MO>::value, "");
+ static_assert(std::is_constructible<Tuple, MO, MO, ND>::value, "");
+ static_assert(test_convertible<Tuple, MO, MO, ND>(), "");
+ }
+ {
+ // Same idea as above but with a nested tuple type.
+ typedef std::tuple<MO, ND> Tuple;
+ typedef std::tuple<MO, Tuple, MO, MO> NestedTuple;
+
+ static_assert(!std::is_constructible<
+ NestedTuple, MO, MO, MO, MO>::value, "");
+ static_assert(std::is_constructible<
+ NestedTuple, MO, Tuple, MO, MO>::value, "");
+ }
+ {
+ typedef std::tuple<MO, int> Tuple;
+ typedef std::tuple<MO, Tuple, MO, MO> NestedTuple;
+
+ static_assert(std::is_constructible<
+ NestedTuple, MO, MO, MO, MO>::value, "");
+ static_assert(test_convertible<
+ NestedTuple, MO, MO, MO, MO>(), "");
+
+ static_assert(std::is_constructible<
+ NestedTuple, MO, Tuple, MO, MO>::value, "");
+ static_assert(test_convertible<
+ NestedTuple, MO, Tuple, MO, MO>(), "");
+ }
+}
+
+std::tuple<std::string, int, std::error_code> doc_example() {
+ return {"hello world", 42};
+}
+
+// Test that the example given in UsingLibcxx.rst actually works.
+void test_example_from_docs() {
+ auto tup = doc_example();
+ assert(std::get<0>(tup) == "hello world");
+ assert(std::get<1>(tup) == 42);
+ assert(std::get<2>(tup) == std::error_code{});
+}
+
+int main()
+{
+
+ {
+ using E = MoveOnly;
+ using Tup = std::tuple<E, E, E>;
+ static_assert(test_convertible<Tup, E, E, E>(), "");
+
+ Tup t = {E(0), E(1)};
+ static_assert(test_convertible<Tup, E, E>(), "");
+ assert(std::get<0>(t) == 0);
+ assert(std::get<1>(t) == 1);
+ assert(std::get<2>(t) == MoveOnly());
+
+ Tup t2 = {E(0)};
+ static_assert(test_convertible<Tup, E>(), "");
+ assert(std::get<0>(t) == 0);
+ assert(std::get<1>(t) == E());
+ assert(std::get<2>(t) == E());
+ }
+ // Check that SFINAE is properly applied with the default reduced arity
+ // constructor extensions.
+ test_default_constructible_extension_sfinae();
+ test_example_from_docs();
+}
diff --git a/test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp b/test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp
index c012ac6265e0..8b5969d5198c 100644
--- a/test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp
+++ b/test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp
@@ -7,49 +7,146 @@
//
//===----------------------------------------------------------------------===//
+// The test fails due to the missing is_trivially_constructible intrinsic.
+// XFAIL: gcc-4.9
+
+// The test suite needs to define the ABI macros on the command line when
+// modules are enabled.
+// UNSUPPORTED: -fmodules
+
// <utility>
// template <class T1, class T2> struct pair
-// Test that we properly provide the old non-trivial copy operations
-// when the ABI macro is defined.
+// Test that we properly provide the trivial copy operations by default.
+// FreeBSD provides the old ABI. This test checks the new ABI so we need
+// to manually turn it on.
+#undef _LIBCPP_ABI_UNSTABLE
+#undef _LIBCPP_ABI_VERSION
+#define _LIBCPP_ABI_VERSION 1
#define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
+
#include <utility>
+#include <type_traits>
+#include <cstdlib>
#include <cassert>
#include "test_macros.h"
+#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+#error trivial ctor ABI macro defined
+#endif
+
+template <class T>
+struct HasNonTrivialABI : std::integral_constant<bool,
+ !std::is_trivially_destructible<T>::value
+ || (std::is_copy_constructible<T>::value && !std::is_trivially_copy_constructible<T>::value)
#if TEST_STD_VER >= 11
-struct Dummy {
- Dummy(Dummy const&) = delete;
- Dummy(Dummy &&) = default;
+ || (std::is_move_constructible<T>::value && !std::is_trivially_move_constructible<T>::value)
+#endif
+> {};
+
+#if TEST_STD_VER >= 11
+struct NonTrivialDtor {
+ NonTrivialDtor(NonTrivialDtor const&) = default;
+ ~NonTrivialDtor();
+};
+NonTrivialDtor::~NonTrivialDtor() {}
+static_assert(HasNonTrivialABI<NonTrivialDtor>::value, "");
+
+struct NonTrivialCopy {
+ NonTrivialCopy(NonTrivialCopy const&);
+};
+NonTrivialCopy::NonTrivialCopy(NonTrivialCopy const&) {}
+static_assert(HasNonTrivialABI<NonTrivialCopy>::value, "");
+
+struct NonTrivialMove {
+ NonTrivialMove(NonTrivialMove const&) = default;
+ NonTrivialMove(NonTrivialMove&&);
+};
+NonTrivialMove::NonTrivialMove(NonTrivialMove&&) {}
+static_assert(HasNonTrivialABI<NonTrivialMove>::value, "");
+
+struct DeletedCopy {
+ DeletedCopy(DeletedCopy const&) = delete;
+ DeletedCopy(DeletedCopy&&) = default;
+};
+static_assert(!HasNonTrivialABI<DeletedCopy>::value, "");
+
+struct TrivialMove {
+ TrivialMove(TrivialMove &&) = default;
};
+static_assert(!HasNonTrivialABI<TrivialMove>::value, "");
+
+struct Trivial {
+ Trivial(Trivial const&) = default;
+};
+static_assert(!HasNonTrivialABI<Trivial>::value, "");
#endif
+
int main()
{
- typedef std::pair<int, short> P;
{
+ typedef std::pair<int, short> P;
static_assert(std::is_copy_constructible<P>::value, "");
- static_assert(!std::is_trivially_copy_constructible<P>::value, "");
- static_assert(!std::is_trivially_copyable<P>::value, "");
+ static_assert(HasNonTrivialABI<P>::value, "");
}
#if TEST_STD_VER >= 11
{
+ typedef std::pair<int, short> P;
+ static_assert(std::is_move_constructible<P>::value, "");
+ static_assert(HasNonTrivialABI<P>::value, "");
+ }
+ {
+ using P = std::pair<NonTrivialDtor, int>;
+ static_assert(!std::is_trivially_destructible<P>::value, "");
+ static_assert(std::is_copy_constructible<P>::value, "");
+ static_assert(!std::is_trivially_copy_constructible<P>::value, "");
static_assert(std::is_move_constructible<P>::value, "");
static_assert(!std::is_trivially_move_constructible<P>::value, "");
- static_assert(!std::is_trivially_copyable<P>::value, "");
+ static_assert(HasNonTrivialABI<P>::value, "");
}
{
- using P1 = std::pair<Dummy, int>;
- // These lines fail because the non-trivial constructors do not provide
- // SFINAE.
- // static_assert(!std::is_copy_constructible<P1>::value, "");
- // static_assert(!std::is_trivially_copy_constructible<P1>::value, "");
- static_assert(std::is_move_constructible<P1>::value, "");
- static_assert(!std::is_trivially_move_constructible<P1>::value, "");
- static_assert(!std::is_trivially_copyable<P>::value, "");
+ using P = std::pair<NonTrivialCopy, int>;
+ static_assert(std::is_copy_constructible<P>::value, "");
+ static_assert(!std::is_trivially_copy_constructible<P>::value, "");
+ static_assert(std::is_move_constructible<P>::value, "");
+ static_assert(!std::is_trivially_move_constructible<P>::value, "");
+ static_assert(HasNonTrivialABI<P>::value, "");
+ }
+ {
+ using P = std::pair<NonTrivialMove, int>;
+ static_assert(std::is_copy_constructible<P>::value, "");
+ static_assert(!std::is_trivially_copy_constructible<P>::value, "");
+ static_assert(std::is_move_constructible<P>::value, "");
+ static_assert(!std::is_trivially_move_constructible<P>::value, "");
+ static_assert(HasNonTrivialABI<P>::value, "");
+ }
+ {
+ using P = std::pair<DeletedCopy, int>;
+ static_assert(!std::is_copy_constructible<P>::value, "");
+ static_assert(!std::is_trivially_copy_constructible<P>::value, "");
+ static_assert(std::is_move_constructible<P>::value, "");
+ static_assert(!std::is_trivially_move_constructible<P>::value, "");
+ static_assert(HasNonTrivialABI<P>::value, "");
+ }
+ {
+ using P = std::pair<Trivial, int>;
+ static_assert(std::is_copy_constructible<P>::value, "");
+ static_assert(!std::is_trivially_copy_constructible<P>::value, "");
+ static_assert(std::is_move_constructible<P>::value, "");
+ static_assert(!std::is_trivially_move_constructible<P>::value, "");
+ static_assert(HasNonTrivialABI<P>::value, "");
+ }
+ {
+ using P = std::pair<TrivialMove, int>;
+ static_assert(!std::is_copy_constructible<P>::value, "");
+ static_assert(!std::is_trivially_copy_constructible<P>::value, "");
+ static_assert(std::is_move_constructible<P>::value, "");
+ static_assert(!std::is_trivially_move_constructible<P>::value, "");
+ static_assert(HasNonTrivialABI<P>::value, "");
}
#endif
}
diff --git a/test/libcxx/utilities/variant/variant.variant/variant.assign/copy.pass.cpp b/test/libcxx/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
new file mode 100644
index 000000000000..a94aa2f78299
--- /dev/null
+++ b/test/libcxx/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
@@ -0,0 +1,208 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// Clang 3.8 doesn't generate constexpr special members correctly.
+// XFAIL: clang-3.8, apple-clang-7, apple-clang-8
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant& operator=(variant const&);
+
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NTCopyAssign {
+ constexpr NTCopyAssign(int v) : value(v) {}
+ NTCopyAssign(const NTCopyAssign &) = default;
+ NTCopyAssign(NTCopyAssign &&) = default;
+ NTCopyAssign &operator=(const NTCopyAssign &that) {
+ value = that.value;
+ return *this;
+ };
+ NTCopyAssign &operator=(NTCopyAssign &&) = delete;
+ int value;
+};
+
+static_assert(!std::is_trivially_copy_assignable<NTCopyAssign>::value, "");
+static_assert(std::is_copy_assignable<NTCopyAssign>::value, "");
+
+struct TCopyAssign {
+ constexpr TCopyAssign(int v) : value(v) {}
+ TCopyAssign(const TCopyAssign &) = default;
+ TCopyAssign(TCopyAssign &&) = default;
+ TCopyAssign &operator=(const TCopyAssign &) = default;
+ TCopyAssign &operator=(TCopyAssign &&) = delete;
+ int value;
+};
+
+static_assert(std::is_trivially_copy_assignable<TCopyAssign>::value, "");
+
+struct TCopyAssignNTMoveAssign {
+ constexpr TCopyAssignNTMoveAssign(int v) : value(v) {}
+ TCopyAssignNTMoveAssign(const TCopyAssignNTMoveAssign &) = default;
+ TCopyAssignNTMoveAssign(TCopyAssignNTMoveAssign &&) = default;
+ TCopyAssignNTMoveAssign &operator=(const TCopyAssignNTMoveAssign &) = default;
+ TCopyAssignNTMoveAssign &operator=(TCopyAssignNTMoveAssign &&that) {
+ value = that.value;
+ that.value = -1;
+ return *this;
+ }
+ int value;
+};
+
+static_assert(std::is_trivially_copy_assignable_v<TCopyAssignNTMoveAssign>);
+
+void test_copy_assignment_sfinae() {
+ {
+ using V = std::variant<int, long>;
+ static_assert(std::is_trivially_copy_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, NTCopyAssign>;
+ static_assert(!std::is_trivially_copy_assignable<V>::value, "");
+ static_assert(std::is_copy_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, TCopyAssign>;
+ static_assert(std::is_trivially_copy_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, TCopyAssignNTMoveAssign>;
+ static_assert(std::is_trivially_copy_assignable<V>::value, "");
+ }
+}
+
+template <typename T> struct Result { size_t index; T value; };
+
+void test_copy_assignment_same_index() {
+ {
+ struct {
+ constexpr Result<int> operator()() const {
+ using V = std::variant<int>;
+ V v(43);
+ V v2(42);
+ v = v2;
+ return {v.index(), std::get<0>(v)};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 0);
+ static_assert(result.value == 42);
+ }
+ {
+ struct {
+ constexpr Result<long> operator()() const {
+ using V = std::variant<int, long, unsigned>;
+ V v(43l);
+ V v2(42l);
+ v = v2;
+ return {v.index(), std::get<1>(v)};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value == 42l);
+ }
+ {
+ struct {
+ constexpr Result<int> operator()() const {
+ using V = std::variant<int, TCopyAssign, unsigned>;
+ V v(std::in_place_type<TCopyAssign>, 43);
+ V v2(std::in_place_type<TCopyAssign>, 42);
+ v = v2;
+ return {v.index(), std::get<1>(v).value};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value == 42);
+ }
+ {
+ struct {
+ constexpr Result<int> operator()() const {
+ using V = std::variant<int, TCopyAssignNTMoveAssign, unsigned>;
+ V v(std::in_place_type<TCopyAssignNTMoveAssign>, 43);
+ V v2(std::in_place_type<TCopyAssignNTMoveAssign>, 42);
+ v = v2;
+ return {v.index(), std::get<1>(v).value};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value == 42);
+ }
+}
+
+void test_copy_assignment_different_index() {
+ {
+ struct {
+ constexpr Result<long> operator()() const {
+ using V = std::variant<int, long, unsigned>;
+ V v(43);
+ V v2(42l);
+ v = v2;
+ return {v.index(), std::get<1>(v)};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value == 42l);
+ }
+ {
+ struct {
+ constexpr Result<int> operator()() const {
+ using V = std::variant<int, TCopyAssign, unsigned>;
+ V v(std::in_place_type<unsigned>, 43);
+ V v2(std::in_place_type<TCopyAssign>, 42);
+ v = v2;
+ return {v.index(), std::get<1>(v).value};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value == 42);
+ }
+}
+
+template <size_t NewIdx, class ValueType>
+constexpr bool test_constexpr_assign_extension_imp(
+ std::variant<long, void*, int>&& v, ValueType&& new_value)
+{
+ const std::variant<long, void*, int> cp(
+ std::forward<ValueType>(new_value));
+ v = cp;
+ return v.index() == NewIdx &&
+ std::get<NewIdx>(v) == std::get<NewIdx>(cp);
+}
+
+void test_constexpr_copy_assignment_extension() {
+#ifdef _LIBCPP_VERSION
+ using V = std::variant<long, void*, int>;
+ static_assert(std::is_trivially_copyable<V>::value, "");
+ static_assert(std::is_trivially_copy_assignable<V>::value, "");
+ static_assert(test_constexpr_assign_extension_imp<0>(V(42l), 101l), "");
+ static_assert(test_constexpr_assign_extension_imp<0>(V(nullptr), 101l), "");
+ static_assert(test_constexpr_assign_extension_imp<1>(V(42l), nullptr), "");
+ static_assert(test_constexpr_assign_extension_imp<2>(V(42l), 101), "");
+#endif
+}
+
+int main() {
+ test_copy_assignment_same_index();
+ test_copy_assignment_different_index();
+ test_copy_assignment_sfinae();
+ test_constexpr_copy_assignment_extension();
+}
diff --git a/test/libcxx/utilities/variant/variant.variant/variant.assign/move.pass.cpp b/test/libcxx/utilities/variant/variant.variant/variant.assign/move.pass.cpp
new file mode 100644
index 000000000000..a3d92472dd5e
--- /dev/null
+++ b/test/libcxx/utilities/variant/variant.variant/variant.assign/move.pass.cpp
@@ -0,0 +1,197 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// Clang 3.8 doesn't generate constexpr special members correctly.
+// XFAIL: clang-3.8, apple-clang-7, apple-clang-8
+
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant& operator=(variant&&) noexcept(see below);
+
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NTMoveAssign {
+ constexpr NTMoveAssign(int v) : value(v) {}
+ NTMoveAssign(const NTMoveAssign &) = default;
+ NTMoveAssign(NTMoveAssign &&) = default;
+ NTMoveAssign &operator=(const NTMoveAssign &that) = default;
+ NTMoveAssign &operator=(NTMoveAssign &&that) {
+ value = that.value;
+ that.value = -1;
+ return *this;
+ };
+ int value;
+};
+
+static_assert(!std::is_trivially_move_assignable<NTMoveAssign>::value, "");
+static_assert(std::is_move_assignable<NTMoveAssign>::value, "");
+
+struct TMoveAssign {
+ constexpr TMoveAssign(int v) : value(v) {}
+ TMoveAssign(const TMoveAssign &) = delete;
+ TMoveAssign(TMoveAssign &&) = default;
+ TMoveAssign &operator=(const TMoveAssign &) = delete;
+ TMoveAssign &operator=(TMoveAssign &&) = default;
+ int value;
+};
+
+static_assert(std::is_trivially_move_assignable<TMoveAssign>::value, "");
+
+struct TMoveAssignNTCopyAssign {
+ constexpr TMoveAssignNTCopyAssign(int v) : value(v) {}
+ TMoveAssignNTCopyAssign(const TMoveAssignNTCopyAssign &) = default;
+ TMoveAssignNTCopyAssign(TMoveAssignNTCopyAssign &&) = default;
+ TMoveAssignNTCopyAssign &operator=(const TMoveAssignNTCopyAssign &that) {
+ value = that.value;
+ return *this;
+ }
+ TMoveAssignNTCopyAssign &operator=(TMoveAssignNTCopyAssign &&) = default;
+ int value;
+};
+
+static_assert(std::is_trivially_move_assignable_v<TMoveAssignNTCopyAssign>);
+
+void test_move_assignment_sfinae() {
+ {
+ using V = std::variant<int, long>;
+ static_assert(std::is_trivially_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, NTMoveAssign>;
+ static_assert(!std::is_trivially_move_assignable<V>::value, "");
+ static_assert(std::is_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, TMoveAssign>;
+ static_assert(std::is_trivially_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, TMoveAssignNTCopyAssign>;
+ static_assert(std::is_trivially_move_assignable<V>::value, "");
+ }
+}
+
+template <typename T> struct Result { size_t index; T value; };
+
+void test_move_assignment_same_index() {
+ {
+ struct {
+ constexpr Result<int> operator()() const {
+ using V = std::variant<int>;
+ V v(43);
+ V v2(42);
+ v = std::move(v2);
+ return {v.index(), std::get<0>(v)};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 0);
+ static_assert(result.value == 42);
+ }
+ {
+ struct {
+ constexpr Result<long> operator()() const {
+ using V = std::variant<int, long, unsigned>;
+ V v(43l);
+ V v2(42l);
+ v = std::move(v2);
+ return {v.index(), std::get<1>(v)};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value == 42l);
+ }
+ {
+ struct {
+ constexpr Result<int> operator()() const {
+ using V = std::variant<int, TMoveAssign, unsigned>;
+ V v(std::in_place_type<TMoveAssign>, 43);
+ V v2(std::in_place_type<TMoveAssign>, 42);
+ v = std::move(v2);
+ return {v.index(), std::get<1>(v).value};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value == 42);
+ }
+}
+
+void test_move_assignment_different_index() {
+ {
+ struct {
+ constexpr Result<long> operator()() const {
+ using V = std::variant<int, long, unsigned>;
+ V v(43);
+ V v2(42l);
+ v = std::move(v2);
+ return {v.index(), std::get<1>(v)};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value == 42l);
+ }
+ {
+ struct {
+ constexpr Result<long> operator()() const {
+ using V = std::variant<int, TMoveAssign, unsigned>;
+ V v(std::in_place_type<unsigned>, 43);
+ V v2(std::in_place_type<TMoveAssign>, 42);
+ v = std::move(v2);
+ return {v.index(), std::get<1>(v).value};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value == 42);
+ }
+}
+
+
+template <size_t NewIdx, class ValueType>
+constexpr bool test_constexpr_assign_extension_imp(
+ std::variant<long, void*, int>&& v, ValueType&& new_value)
+{
+ std::variant<long, void*, int> v2(
+ std::forward<ValueType>(new_value));
+ const auto cp = v2;
+ v = std::move(v2);
+ return v.index() == NewIdx &&
+ std::get<NewIdx>(v) == std::get<NewIdx>(cp);
+}
+
+void test_constexpr_move_assignment_extension() {
+#ifdef _LIBCPP_VERSION
+ using V = std::variant<long, void*, int>;
+ static_assert(std::is_trivially_copyable<V>::value, "");
+ static_assert(std::is_trivially_move_assignable<V>::value, "");
+ static_assert(test_constexpr_assign_extension_imp<0>(V(42l), 101l), "");
+ static_assert(test_constexpr_assign_extension_imp<0>(V(nullptr), 101l), "");
+ static_assert(test_constexpr_assign_extension_imp<1>(V(42l), nullptr), "");
+ static_assert(test_constexpr_assign_extension_imp<2>(V(42l), 101), "");
+#endif
+}
+
+int main() {
+ test_move_assignment_same_index();
+ test_move_assignment_different_index();
+ test_move_assignment_sfinae();
+ test_constexpr_move_assignment_extension();
+}
diff --git a/test/libcxx/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp b/test/libcxx/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
new file mode 100644
index 000000000000..59c433050590
--- /dev/null
+++ b/test/libcxx/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant(variant const&);
+
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NTCopy {
+ constexpr NTCopy(int v) : value(v) {}
+ NTCopy(const NTCopy &that) : value(that.value) {}
+ NTCopy(NTCopy &&) = delete;
+ int value;
+};
+
+static_assert(!std::is_trivially_copy_constructible<NTCopy>::value, "");
+static_assert(std::is_copy_constructible<NTCopy>::value, "");
+
+struct TCopy {
+ constexpr TCopy(int v) : value(v) {}
+ TCopy(TCopy const &) = default;
+ TCopy(TCopy &&) = delete;
+ int value;
+};
+
+static_assert(std::is_trivially_copy_constructible<TCopy>::value, "");
+
+struct TCopyNTMove {
+ constexpr TCopyNTMove(int v) : value(v) {}
+ TCopyNTMove(const TCopyNTMove&) = default;
+ TCopyNTMove(TCopyNTMove&& that) : value(that.value) { that.value = -1; }
+ int value;
+};
+
+static_assert(std::is_trivially_copy_constructible<TCopyNTMove>::value, "");
+
+void test_copy_ctor_sfinae() {
+ {
+ using V = std::variant<int, long>;
+ static_assert(std::is_trivially_copy_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, NTCopy>;
+ static_assert(!std::is_trivially_copy_constructible<V>::value, "");
+ static_assert(std::is_copy_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, TCopy>;
+ static_assert(std::is_trivially_copy_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, TCopyNTMove>;
+ static_assert(std::is_trivially_copy_constructible<V>::value, "");
+ }
+}
+
+void test_copy_ctor_basic() {
+ {
+ constexpr std::variant<int> v(std::in_place_index<0>, 42);
+ static_assert(v.index() == 0);
+ constexpr std::variant<int> v2 = v;
+ static_assert(v2.index() == 0);
+ static_assert(std::get<0>(v2) == 42);
+ }
+ {
+ constexpr std::variant<int, long> v(std::in_place_index<1>, 42);
+ static_assert(v.index() == 1);
+ constexpr std::variant<int, long> v2 = v;
+ static_assert(v2.index() == 1);
+ static_assert(std::get<1>(v2) == 42);
+ }
+ {
+ constexpr std::variant<TCopy> v(std::in_place_index<0>, 42);
+ static_assert(v.index() == 0);
+ constexpr std::variant<TCopy> v2(v);
+ static_assert(v2.index() == 0);
+ static_assert(std::get<0>(v2).value == 42);
+ }
+ {
+ constexpr std::variant<int, TCopy> v(std::in_place_index<1>, 42);
+ static_assert(v.index() == 1);
+ constexpr std::variant<int, TCopy> v2(v);
+ static_assert(v2.index() == 1);
+ static_assert(std::get<1>(v2).value == 42);
+ }
+ {
+ constexpr std::variant<TCopyNTMove> v(std::in_place_index<0>, 42);
+ static_assert(v.index() == 0);
+ constexpr std::variant<TCopyNTMove> v2(v);
+ static_assert(v2.index() == 0);
+ static_assert(std::get<0>(v2).value == 42);
+ }
+ {
+ constexpr std::variant<int, TCopyNTMove> v(std::in_place_index<1>, 42);
+ static_assert(v.index() == 1);
+ constexpr std::variant<int, TCopyNTMove> v2(v);
+ static_assert(v2.index() == 1);
+ static_assert(std::get<1>(v2).value == 42);
+ }
+}
+
+int main() {
+ test_copy_ctor_basic();
+ test_copy_ctor_sfinae();
+}
diff --git a/test/libcxx/utilities/variant/variant.variant/variant.ctor/move.pass.cpp b/test/libcxx/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
new file mode 100644
index 000000000000..e67a495d9799
--- /dev/null
+++ b/test/libcxx/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
@@ -0,0 +1,153 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant(variant&&) noexcept(see below);
+
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NTMove {
+ constexpr NTMove(int v) : value(v) {}
+ NTMove(const NTMove &) = delete;
+ NTMove(NTMove &&that) : value(that.value) { that.value = -1; }
+ int value;
+};
+
+static_assert(!std::is_trivially_move_constructible<NTMove>::value, "");
+static_assert(std::is_move_constructible<NTMove>::value, "");
+
+struct TMove {
+ constexpr TMove(int v) : value(v) {}
+ TMove(const TMove &) = delete;
+ TMove(TMove &&) = default;
+ int value;
+};
+
+static_assert(std::is_trivially_move_constructible<TMove>::value, "");
+
+struct TMoveNTCopy {
+ constexpr TMoveNTCopy(int v) : value(v) {}
+ TMoveNTCopy(const TMoveNTCopy& that) : value(that.value) {}
+ TMoveNTCopy(TMoveNTCopy&&) = default;
+ int value;
+};
+
+static_assert(std::is_trivially_move_constructible<TMoveNTCopy>::value, "");
+
+void test_move_ctor_sfinae() {
+ {
+ using V = std::variant<int, long>;
+ static_assert(std::is_trivially_move_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, NTMove>;
+ static_assert(!std::is_trivially_move_constructible<V>::value, "");
+ static_assert(std::is_move_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, TMove>;
+ static_assert(std::is_trivially_move_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, TMoveNTCopy>;
+ static_assert(std::is_trivially_move_constructible<V>::value, "");
+ }
+}
+
+template <typename T>
+struct Result { size_t index; T value; };
+
+void test_move_ctor_basic() {
+ {
+ struct {
+ constexpr Result<int> operator()() const {
+ std::variant<int> v(std::in_place_index<0>, 42);
+ std::variant<int> v2 = std::move(v);
+ return {v2.index(), std::get<0>(std::move(v2))};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 0);
+ static_assert(result.value == 42);
+ }
+ {
+ struct {
+ constexpr Result<long> operator()() const {
+ std::variant<int, long> v(std::in_place_index<1>, 42);
+ std::variant<int, long> v2 = std::move(v);
+ return {v2.index(), std::get<1>(std::move(v2))};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value == 42);
+ }
+ {
+ struct {
+ constexpr Result<TMove> operator()() const {
+ std::variant<TMove> v(std::in_place_index<0>, 42);
+ std::variant<TMove> v2(std::move(v));
+ return {v2.index(), std::get<0>(std::move(v2))};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 0);
+ static_assert(result.value.value == 42);
+ }
+ {
+ struct {
+ constexpr Result<TMove> operator()() const {
+ std::variant<int, TMove> v(std::in_place_index<1>, 42);
+ std::variant<int, TMove> v2(std::move(v));
+ return {v2.index(), std::get<1>(std::move(v2))};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value.value == 42);
+ }
+ {
+ struct {
+ constexpr Result<TMoveNTCopy> operator()() const {
+ std::variant<TMoveNTCopy> v(std::in_place_index<0>, 42);
+ std::variant<TMoveNTCopy> v2(std::move(v));
+ return {v2.index(), std::get<0>(std::move(v2))};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 0);
+ static_assert(result.value.value == 42);
+ }
+ {
+ struct {
+ constexpr Result<TMoveNTCopy> operator()() const {
+ std::variant<int, TMoveNTCopy> v(std::in_place_index<1>, 42);
+ std::variant<int, TMoveNTCopy> v2(std::move(v));
+ return {v2.index(), std::get<1>(std::move(v2))};
+ }
+ } test;
+ constexpr auto result = test();
+ static_assert(result.index == 1);
+ static_assert(result.value.value == 42);
+ }
+}
+
+int main() {
+ test_move_ctor_basic();
+ test_move_ctor_sfinae();
+}
diff --git a/test/libcxx/utilities/variant/version.pass.cpp b/test/libcxx/utilities/variant/version.pass.cpp
new file mode 100644
index 000000000000..1db93e0e9392
--- /dev/null
+++ b/test/libcxx/utilities/variant/version.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <variant>
+
+#include <variant>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
diff --git a/test/lit.cfg b/test/lit.cfg
index f7fa6144f08f..eee17fdaa1c8 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -20,14 +20,17 @@ config.suffixes = ['.pass.cpp', '.fail.cpp', '.sh.cpp']
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
+loaded_site_cfg = getattr(config, 'loaded_site_config', False)
+if not loaded_site_cfg:
+ import libcxx.test.config
+ libcxx.test.config.loadSiteConfig(lit_config, config, 'libcxx_site_config',
+ 'LIBCXX_SITE_CONFIG')
+
# Infer the test_exec_root from the libcxx_object root.
obj_root = getattr(config, 'libcxx_obj_root', None)
# Check that the test exec root is known.
if obj_root is None:
- import libcxx.test.config
- libcxx.test.config.loadSiteConfig(lit_config, config, 'libcxx_site_config',
- 'LIBCXX_SITE_CONFIG')
obj_root = getattr(config, 'libcxx_obj_root', None)
if obj_root is None:
import tempfile
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index a1ae90cb479e..741e9c89ac44 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -15,7 +15,9 @@ config.use_sanitizer = "@LLVM_USE_SANITIZER@"
config.sanitizer_library = "@LIBCXX_SANITIZER_LIBRARY@"
config.abi_library_path = "@LIBCXX_CXX_ABI_LIBRARY_PATH@"
config.configuration_variant = "@LIBCXX_LIT_VARIANT@"
-config.target_triple = "@LIBCXX_TARGET_TRIPLE@"
+config.host_triple = "@LLVM_HOST_TRIPLE@"
+config.target_triple = "@TARGET_TRIPLE@"
+config.use_target = len("@LIBCXX_TARGET_TRIPLE@") > 0
config.sysroot = "@LIBCXX_SYSROOT@"
config.gcc_toolchain = "@LIBCXX_GCC_TOOLCHAIN@"
config.generate_coverage = "@LIBCXX_GENERATE_COVERAGE@"
@@ -26,6 +28,8 @@ config.has_libatomic = "@LIBCXX_HAS_ATOMIC_LIB@"
config.use_libatomic = "@LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB@"
config.libcxxabi_shared = "@LIBCXXABI_ENABLE_SHARED@"
+config.libcxx_external_thread_api = "@LIBCXX_HAS_EXTERNAL_THREAD_API@"
# Let the main config do the real work.
+config.loaded_site_config = True
lit_config.load_config(config, "@LIBCXX_SOURCE_DIR@/test/lit.cfg")
diff --git a/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
index b56d31b9d0db..f39436048aef 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp
@@ -81,7 +81,7 @@ test_int_array_struct_source()
struct test1 {
test1() : c(0) { }
- test1(char c) : c(c + 1) { }
+ test1(char xc) : c(xc + 1) { }
char c;
};
diff --git a/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
index 43234be5d3b8..9a954d934c4e 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
@@ -53,7 +53,7 @@ test1()
OutIter r = std::move(InIter(ia), InIter(ia+N), OutIter(ib));
assert(base(r) == ib+N);
for (unsigned i = 0; i < N; ++i)
- assert(*ib[i] == i);
+ assert(*ib[i] == static_cast<int>(i));
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
index 02b6b16eca0c..c5f9d3ac7b6b 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
@@ -53,7 +53,7 @@ test1()
OutIter r = std::move_backward(InIter(ia), InIter(ia+N), OutIter(ib+N));
assert(base(r) == ib);
for (unsigned i = 0; i < N; ++i)
- assert(*ib[i] == i);
+ assert(*ib[i] == static_cast<int>(i));
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
index aa23d19a8a3b..8597b08da8cf 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp
@@ -14,64 +14,70 @@
// is_partitioned(InputIterator first, InputIterator last, Predicate pred);
#include <algorithm>
+#include <functional>
+#include <cstddef>
#include <cassert>
#include "test_iterators.h"
#include "counting_predicates.hpp"
-struct is_odd
-{
- bool operator()(const int& i) const {return i & 1;}
+struct is_odd {
+ bool operator()(const int &i) const { return i & 1; }
};
-int main()
-{
- {
- const int ia[] = {1, 2, 3, 4, 5, 6};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert(!std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::end(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::end(ia)));
- }
- {
- const int ia[] = {1, 3, 5, 2, 4, 6};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert( std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::end(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::end(ia)));
- }
- {
- const int ia[] = {2, 4, 6, 1, 3, 5};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert(!std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::end(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::end(ia)));
- }
- {
- const int ia[] = {1, 3, 5, 2, 4, 6, 7};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert(!std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::end(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::end(ia)));
- }
- {
- const int ia[] = {1, 3, 5, 2, 4, 6, 7};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert( std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::begin(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::begin(ia)));
- }
- {
- const int ia[] = {1, 3, 5, 7, 9, 11, 2};
- unary_counting_predicate<is_odd, int> pred((is_odd()));
- assert( std::is_partitioned(input_iterator<const int*>(std::begin(ia)),
- input_iterator<const int*>(std::end(ia)),
- std::ref(pred)));
- assert(pred.count() <= std::distance(std::begin(ia), std::end(ia)));
- }
+int main() {
+ {
+ const int ia[] = {1, 2, 3, 4, 5, 6};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(!std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::end(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::end(ia)));
+ }
+ {
+ const int ia[] = {1, 3, 5, 2, 4, 6};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::end(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::end(ia)));
+ }
+ {
+ const int ia[] = {2, 4, 6, 1, 3, 5};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(!std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::end(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::end(ia)));
+ }
+ {
+ const int ia[] = {1, 3, 5, 2, 4, 6, 7};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(!std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::end(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::end(ia)));
+ }
+ {
+ const int ia[] = {1, 3, 5, 2, 4, 6, 7};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::begin(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::begin(ia)));
+ }
+ {
+ const int ia[] = {1, 3, 5, 7, 9, 11, 2};
+ unary_counting_predicate<is_odd, int> pred((is_odd()));
+ assert(std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
+ input_iterator<const int *>(std::end(ia)),
+ std::ref(pred)));
+ assert(static_cast<std::ptrdiff_t>(pred.count()) <=
+ std::distance(std::begin(ia), std::end(ia)));
+ }
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.fail.cpp b/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.fail.cpp
new file mode 100644
index 000000000000..d769ad850c31
--- /dev/null
+++ b/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.fail.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <algorithm>
+
+// template <class PopulationIterator, class SampleIterator, class Distance,
+// class UniformRandomNumberGenerator>
+// SampleIterator sample(PopulationIterator first, PopulationIterator last,
+// SampleIterator out, Distance n,
+// UniformRandomNumberGenerator &&g);
+
+#include <algorithm>
+#include <random>
+#include <cassert>
+
+#include "test_iterators.h"
+
+template <class PopulationIterator, class SampleIterator> void test() {
+ int ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+ const unsigned is = sizeof(ia) / sizeof(ia[0]);
+ const unsigned os = 4;
+ int oa[os];
+ std::minstd_rand g;
+ std::sample(PopulationIterator(ia), PopulationIterator(ia + is),
+ SampleIterator(oa), os, g);
+}
+
+int main() {
+ // expected-error@algorithm:* {{static_assert failed "SampleIterator must meet the requirements of RandomAccessIterator"}}
+ // expected-error@algorithm:* 2 {{does not provide a subscript operator}}
+ // expected-error@algorithm:* {{invalid operands}}
+ test<input_iterator<int *>, output_iterator<int *> >();
+}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.pass.cpp
new file mode 100644
index 000000000000..0a14c6695b06
--- /dev/null
+++ b/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.pass.cpp
@@ -0,0 +1,160 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <algorithm>
+
+// template <class PopulationIterator, class SampleIterator, class Distance,
+// class UniformRandomNumberGenerator>
+// SampleIterator sample(PopulationIterator first, PopulationIterator last,
+// SampleIterator out, Distance n,
+// UniformRandomNumberGenerator &&g);
+
+#include <algorithm>
+#include <random>
+#include <type_traits>
+#include <cassert>
+#include <cstddef>
+
+#include "test_iterators.h"
+#include "test_macros.h"
+
+struct ReservoirSampleExpectations {
+ enum { os = 4 };
+ static int oa1[os];
+ static int oa2[os];
+};
+
+int ReservoirSampleExpectations::oa1[] = {10, 5, 9, 4};
+int ReservoirSampleExpectations::oa2[] = {5, 2, 10, 4};
+
+struct SelectionSampleExpectations {
+ enum { os = 4 };
+ static int oa1[os];
+ static int oa2[os];
+};
+
+int SelectionSampleExpectations::oa1[] = {1, 4, 6, 7};
+int SelectionSampleExpectations::oa2[] = {1, 2, 6, 8};
+
+template <class IteratorCategory> struct TestExpectations
+ : public SelectionSampleExpectations {};
+
+template <>
+struct TestExpectations<std::input_iterator_tag>
+ : public ReservoirSampleExpectations {};
+
+template <template<class...> class PopulationIteratorType, class PopulationItem,
+ template<class...> class SampleIteratorType, class SampleItem>
+void test() {
+ typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
+ typedef SampleIteratorType<SampleItem *> SampleIterator;
+ PopulationItem ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+ const unsigned is = sizeof(ia) / sizeof(ia[0]);
+ typedef TestExpectations<typename std::iterator_traits<
+ PopulationIterator>::iterator_category> Expectations;
+ const unsigned os = Expectations::os;
+ SampleItem oa[os];
+ const int *oa1 = Expectations::oa1;
+ ((void)oa1); // Prevent unused warning
+ const int *oa2 = Expectations::oa2;
+ ((void)oa2); // Prevent unused warning
+ std::minstd_rand g;
+ SampleIterator end;
+ end = std::sample(PopulationIterator(ia),
+ PopulationIterator(ia + is),
+ SampleIterator(oa), os, g);
+ assert(static_cast<std::size_t>(end.base() - oa) == std::min(os, is));
+ // sample() is deterministic but non-reproducible;
+ // its results can vary between implementations.
+ LIBCPP_ASSERT(std::equal(oa, oa + os, oa1));
+ end = std::sample(PopulationIterator(ia),
+ PopulationIterator(ia + is),
+ SampleIterator(oa), os, std::move(g));
+ assert(static_cast<std::size_t>(end.base() - oa) == std::min(os, is));
+ LIBCPP_ASSERT(std::equal(oa, oa + os, oa2));
+}
+
+template <template<class...> class PopulationIteratorType, class PopulationItem,
+ template<class...> class SampleIteratorType, class SampleItem>
+void test_empty_population() {
+ typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
+ typedef SampleIteratorType<SampleItem *> SampleIterator;
+ PopulationItem ia[] = {42};
+ const unsigned os = 4;
+ SampleItem oa[os];
+ std::minstd_rand g;
+ SampleIterator end =
+ std::sample(PopulationIterator(ia), PopulationIterator(ia),
+ SampleIterator(oa), os, g);
+ assert(end.base() == oa);
+}
+
+template <template<class...> class PopulationIteratorType, class PopulationItem,
+ template<class...> class SampleIteratorType, class SampleItem>
+void test_empty_sample() {
+ typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
+ typedef SampleIteratorType<SampleItem *> SampleIterator;
+ PopulationItem ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+ const unsigned is = sizeof(ia) / sizeof(ia[0]);
+ SampleItem oa[1];
+ std::minstd_rand g;
+ SampleIterator end =
+ std::sample(PopulationIterator(ia), PopulationIterator(ia + is),
+ SampleIterator(oa), 0, g);
+ assert(end.base() == oa);
+}
+
+template <template<class...> class PopulationIteratorType, class PopulationItem,
+ template<class...> class SampleIteratorType, class SampleItem>
+void test_small_population() {
+ // The population size is less than the sample size.
+ typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
+ typedef SampleIteratorType<SampleItem *> SampleIterator;
+ PopulationItem ia[] = {1, 2, 3, 4, 5};
+ const unsigned is = sizeof(ia) / sizeof(ia[0]);
+ const unsigned os = 8;
+ SampleItem oa[os];
+ const SampleItem oa1[] = {1, 2, 3, 4, 5};
+ std::minstd_rand g;
+ SampleIterator end;
+ end = std::sample(PopulationIterator(ia),
+ PopulationIterator(ia + is),
+ SampleIterator(oa), os, g);
+ assert(static_cast<std::size_t>(end.base() - oa) == std::min(os, is));
+ typedef typename std::iterator_traits<PopulationIterator>::iterator_category PopulationCategory;
+ if (std::is_base_of<std::forward_iterator_tag, PopulationCategory>::value) {
+ assert(std::equal(oa, end.base(), oa1));
+ } else {
+ assert(std::is_permutation(oa, end.base(), oa1));
+ }
+}
+
+int main() {
+ test<input_iterator, int, random_access_iterator, int>();
+ test<forward_iterator, int, output_iterator, int>();
+ test<forward_iterator, int, random_access_iterator, int>();
+
+ test<input_iterator, int, random_access_iterator, double>();
+ test<forward_iterator, int, output_iterator, double>();
+ test<forward_iterator, int, random_access_iterator, double>();
+
+ test_empty_population<input_iterator, int, random_access_iterator, int>();
+ test_empty_population<forward_iterator, int, output_iterator, int>();
+ test_empty_population<forward_iterator, int, random_access_iterator, int>();
+
+ test_empty_sample<input_iterator, int, random_access_iterator, int>();
+ test_empty_sample<forward_iterator, int, output_iterator, int>();
+ test_empty_sample<forward_iterator, int, random_access_iterator, int>();
+
+ test_small_population<input_iterator, int, random_access_iterator, int>();
+ test_small_population<forward_iterator, int, output_iterator, int>();
+ test_small_population<forward_iterator, int, random_access_iterator, int>();
+}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.stable.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.stable.pass.cpp
new file mode 100644
index 000000000000..db484238c95f
--- /dev/null
+++ b/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.stable.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <algorithm>
+
+// template <class PopulationIterator, class SampleIterator, class Distance,
+// class UniformRandomNumberGenerator>
+// SampleIterator sample(PopulationIterator first, PopulationIterator last,
+// SampleIterator out, Distance n,
+// UniformRandomNumberGenerator &&g);
+
+#include <algorithm>
+#include <random>
+#include <cassert>
+
+#include "test_iterators.h"
+
+// Stable if and only if PopulationIterator meets the requirements of a
+// ForwardIterator type.
+template <class PopulationIterator, class SampleIterator>
+void test_stability(bool expect_stable) {
+ const unsigned kPopulationSize = 100;
+ int ia[kPopulationSize];
+ for (unsigned i = 0; i < kPopulationSize; ++i)
+ ia[i] = i;
+ PopulationIterator first(ia);
+ PopulationIterator last(ia + kPopulationSize);
+
+ const unsigned kSampleSize = 20;
+ int oa[kPopulationSize];
+ SampleIterator out(oa);
+
+ std::minstd_rand g;
+
+ const int kIterations = 1000;
+ bool unstable = false;
+ for (int i = 0; i < kIterations; ++i) {
+ std::sample(first, last, out, kSampleSize, g);
+ unstable |= !std::is_sorted(oa, oa + kSampleSize);
+ }
+ assert(expect_stable == !unstable);
+}
+
+int main() {
+ test_stability<forward_iterator<int *>, output_iterator<int *> >(true);
+ test_stability<input_iterator<int *>, random_access_iterator<int *> >(false);
+}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
index a14ccf9e5e6c..e24598a9bc12 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
@@ -17,6 +17,8 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
int ia[] = {1, 2, 3, 4};
@@ -24,7 +26,9 @@ int main()
int ia2[] = {4, 1, 2, 3};
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
std::random_shuffle(ia, ia+sa);
- assert(std::equal(ia, ia+sa, ia1));
+ LIBCPP_ASSERT(std::equal(ia, ia+sa, ia1));
+ assert(std::is_permutation(ia, ia+sa, ia1));
std::random_shuffle(ia, ia+sa);
- assert(std::equal(ia, ia+sa, ia2));
+ LIBCPP_ASSERT(std::equal(ia, ia+sa, ia2));
+ assert(std::is_permutation(ia, ia+sa, ia2));
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp
index b944c89e3519..c923d847f11e 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp
@@ -17,10 +17,13 @@
#include <algorithm>
#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
struct gen
{
- int operator()(int n)
+ std::ptrdiff_t operator()(std::ptrdiff_t n)
{
return n-1;
}
@@ -33,5 +36,6 @@ int main()
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
gen r;
std::random_shuffle(ia, ia+sa, r);
- assert(std::equal(ia, ia+sa, ia1));
+ LIBCPP_ASSERT(std::equal(ia, ia+sa, ia1));
+ assert(std::is_permutation(ia, ia+sa, ia1));
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp
index 343ae90101ff..512acc392de8 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp
@@ -17,6 +17,8 @@
#include <random>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
int ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
@@ -25,7 +27,9 @@ int main()
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
std::minstd_rand g;
std::shuffle(ia, ia+sa, g);
- assert(std::equal(ia, ia+sa, ia1));
- std::shuffle(ia, ia+sa, g);
- assert(std::equal(ia, ia+sa, ia2));
+ LIBCPP_ASSERT(std::equal(ia, ia+sa, ia1));
+ assert(std::is_permutation(ia, ia+sa, ia1));
+ std::shuffle(ia, ia+sa, std::move(g));
+ LIBCPP_ASSERT(std::equal(ia, ia+sa, ia2));
+ assert(std::is_permutation(ia, ia+sa, ia2));
}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp
index b7da7354ca25..515c79761ee8 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp
@@ -15,10 +15,9 @@
#include <algorithm>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -26,7 +25,7 @@ void
test()
{
int ia[] = {0};
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ const int sa = static_cast<int>(sizeof(ia)/sizeof(ia[0]));
Iter r = std::rotate(Iter(ia), Iter(ia), Iter(ia));
assert(base(r) == ia);
assert(ia[0] == 0);
@@ -38,7 +37,7 @@ test()
assert(ia[0] == 0);
int ib[] = {0, 1};
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ const int sb = static_cast<int>(sizeof(ib)/sizeof(ib[0]));
r = std::rotate(Iter(ib), Iter(ib), Iter(ib+sb));
assert(base(r) == ib+sb);
assert(ib[0] == 0);
@@ -53,7 +52,7 @@ test()
assert(ib[1] == 0);
int ic[] = {0, 1, 2};
- const unsigned sc = sizeof(ic)/sizeof(ic[0]);
+ const int sc = static_cast<int>(sizeof(ic)/sizeof(ic[0]));
r = std::rotate(Iter(ic), Iter(ic), Iter(ic+sc));
assert(base(r) == ic+sc);
assert(ic[0] == 0);
@@ -76,7 +75,7 @@ test()
assert(ic[2] == 2);
int id[] = {0, 1, 2, 3};
- const unsigned sd = sizeof(id)/sizeof(id[0]);
+ const int sd = static_cast<int>(sizeof(id)/sizeof(id[0]));
r = std::rotate(Iter(id), Iter(id), Iter(id+sd));
assert(base(r) == id+sd);
assert(id[0] == 0);
@@ -109,7 +108,7 @@ test()
assert(id[3] == 1);
int ie[] = {0, 1, 2, 3, 4};
- const unsigned se = sizeof(ie)/sizeof(ie[0]);
+ const int se = static_cast<int>(sizeof(ie)/sizeof(ie[0]));
r = std::rotate(Iter(ie), Iter(ie), Iter(ie+se));
assert(base(r) == ie+se);
assert(ie[0] == 0);
@@ -154,7 +153,7 @@ test()
assert(ie[4] == 4);
int ig[] = {0, 1, 2, 3, 4, 5};
- const unsigned sg = sizeof(ig)/sizeof(ig[0]);
+ const int sg = static_cast<int>(sizeof(ig)/sizeof(ig[0]));
r = std::rotate(Iter(ig), Iter(ig), Iter(ig+sg));
assert(base(r) == ig+sg);
assert(ig[0] == 0);
@@ -213,14 +212,14 @@ test()
assert(ig[5] == 2);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
template <class Iter>
void
test1()
{
std::unique_ptr<int> ia[1];
- const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+ const int sa = static_cast<int>(sizeof(ia)/sizeof(ia[0]));
for (int i = 0; i < sa; ++i)
ia[i].reset(new int(i));
Iter r = std::rotate(Iter(ia), Iter(ia), Iter(ia));
@@ -234,7 +233,7 @@ test1()
assert(*ia[0] == 0);
std::unique_ptr<int> ib[2];
- const unsigned sb = sizeof(ib)/sizeof(ib[0]);
+ const int sb = static_cast<int>(sizeof(ib)/sizeof(ib[0]));
for (int i = 0; i < sb; ++i)
ib[i].reset(new int(i));
r = std::rotate(Iter(ib), Iter(ib), Iter(ib+sb));
@@ -251,7 +250,7 @@ test1()
assert(*ib[1] == 0);
std::unique_ptr<int> ic[3];
- const unsigned sc = sizeof(ic)/sizeof(ic[0]);
+ const int sc = static_cast<int>(sizeof(ic)/sizeof(ic[0]));
for (int i = 0; i < sc; ++i)
ic[i].reset(new int(i));
r = std::rotate(Iter(ic), Iter(ic), Iter(ic+sc));
@@ -276,7 +275,7 @@ test1()
assert(*ic[2] == 2);
std::unique_ptr<int> id[4];
- const unsigned sd = sizeof(id)/sizeof(id[0]);
+ const int sd = static_cast<int>(sizeof(id)/sizeof(id[0]));
for (int i = 0; i < sd; ++i)
id[i].reset(new int(i));
r = std::rotate(Iter(id), Iter(id), Iter(id+sd));
@@ -311,7 +310,7 @@ test1()
assert(*id[3] == 1);
std::unique_ptr<int> ie[5];
- const unsigned se = sizeof(ie)/sizeof(ie[0]);
+ const int se = static_cast<int>(sizeof(ie)/sizeof(ie[0]));
for (int i = 0; i < se; ++i)
ie[i].reset(new int(i));
r = std::rotate(Iter(ie), Iter(ie), Iter(ie+se));
@@ -358,7 +357,7 @@ test1()
assert(*ie[4] == 4);
std::unique_ptr<int> ig[6];
- const unsigned sg = sizeof(ig)/sizeof(ig[0]);
+ const int sg = static_cast<int>(sizeof(ig)/sizeof(ig[0]));
for (int i = 0; i < sg; ++i)
ig[i].reset(new int(i));
r = std::rotate(Iter(ig), Iter(ig), Iter(ig+sg));
@@ -419,7 +418,7 @@ test1()
assert(*ig[5] == 2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
int main()
{
@@ -428,12 +427,12 @@ int main()
test<random_access_iterator<int*> >();
test<int*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test1<forward_iterator<std::unique_ptr<int>*> >();
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
test1<random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*>();
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
index 449753fc263a..e867b86b8312 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
@@ -17,11 +17,9 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
-#if _LIBCPP_STD_VER > 11
-#define HAS_FOUR_ITERATOR_VERSION
-#endif
int main()
{
@@ -31,7 +29,7 @@ int main()
assert(std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ia)));
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ia),
@@ -44,7 +42,7 @@ int main()
assert(!std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ib)));
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(!std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ib),
diff --git a/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp
index 047f72062ebd..d57e365a9192 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp
@@ -19,12 +19,9 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
-#if _LIBCPP_STD_VER > 11
-#define HAS_FOUR_ITERATOR_VERSION
-#endif
-
int comparison_count = 0;
template <typename T>
bool counting_equals ( const T &a, const T &b ) {
@@ -41,7 +38,7 @@ int main()
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ia),
std::equal_to<int>()));
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ia),
@@ -72,7 +69,7 @@ int main()
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ib),
std::equal_to<int>()));
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(!std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ib),
diff --git a/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp
index bf80c2c6edd4..d6fdd18968d1 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp
@@ -35,5 +35,5 @@ int main()
for_each_test(0));
assert(f.count == s);
for (unsigned i = 0; i < s; ++i)
- assert(ia[i] == i+1);
+ assert(ia[i] == static_cast<int>(i+1));
}
diff --git a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp
index 028aec5e7f29..e3f7c3cd87db 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp
@@ -19,9 +19,7 @@
#include "test_iterators.h"
-#if _LIBCPP_STD_VER > 11
-#define HAS_FOUR_ITERATOR_VERSION
-#endif
+#include "test_macros.h"
int main()
{
@@ -32,7 +30,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + 0),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + 0),
forward_iterator<const int*>(ib),
@@ -41,7 +39,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -59,7 +57,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -74,7 +72,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -92,7 +90,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -106,7 +104,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -120,7 +118,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -134,7 +132,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -148,7 +146,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -166,7 +164,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -180,7 +178,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -194,7 +192,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -208,7 +206,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -222,7 +220,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -236,7 +234,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -250,7 +248,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -264,7 +262,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -278,7 +276,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -292,7 +290,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -307,7 +305,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -321,7 +319,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -335,7 +333,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -349,7 +347,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -363,7 +361,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -377,7 +375,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -391,7 +389,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -405,7 +403,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -419,7 +417,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -433,7 +431,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -451,7 +449,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -465,7 +463,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -483,7 +481,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -501,7 +499,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -519,7 +517,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -537,7 +535,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -551,7 +549,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -573,7 +571,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -595,7 +593,7 @@ int main()
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib)) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
diff --git a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp
index ceb897da5148..6e9cdaabd308 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp
@@ -18,12 +18,9 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
-#if _LIBCPP_STD_VER > 11
-#define HAS_FOUR_ITERATOR_VERSION
-#endif
-
int comparison_count = 0;
template <typename T>
bool counting_equals ( const T &a, const T &b ) {
@@ -46,7 +43,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -67,7 +64,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -84,7 +81,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -105,7 +102,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -121,7 +118,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -137,7 +134,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -153,7 +150,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -169,7 +166,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -190,7 +187,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -211,7 +208,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -227,7 +224,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -243,7 +240,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -264,7 +261,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -285,7 +282,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -301,7 +298,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -317,7 +314,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -333,7 +330,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -349,7 +346,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -371,7 +368,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -387,7 +384,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -403,7 +400,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -419,7 +416,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -435,7 +432,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -451,7 +448,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -467,7 +464,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -483,7 +480,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -499,7 +496,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -515,7 +512,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -536,7 +533,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -552,7 +549,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -573,7 +570,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -594,7 +591,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -615,7 +612,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -636,7 +633,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -652,7 +649,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -678,7 +675,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@@ -718,7 +715,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
diff --git a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp
index 054bc656cdb1..d78809b48524 100644
--- a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp
@@ -49,7 +49,7 @@ int main()
assert(bcp.count() > 0 && bcp.count() < sa);
bcp.reset();
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::mismatch(II(ia), II(ia + sa), II(ib), II(ib + sb), EQ())
== (std::pair<II, II>(II(ia+3), II(ib+3))));
assert(std::mismatch(RAI(ia), RAI(ia + sa), RAI(ib), RAI(ib + sb), EQ())
@@ -63,7 +63,7 @@ int main()
assert(std::mismatch(ia, ia + sa, ib, EQ()) ==
(std::pair<int*,int*>(ia+3,ib+3)));
-#ifdef HAS_FOUR_ITERATOR_VERSION
+#if TEST_STD_VER >= 14
assert(std::mismatch(ia, ia + sa, ib, ib + sb, EQ()) ==
(std::pair<int*,int*>(ia+3,ib+3)));
assert(std::mismatch(ia, ia + sa, ib, ib + 2, EQ()) ==
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
index 253e0e38690b..d4d31cb3088f 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
@@ -18,6 +18,7 @@
#include <algorithm>
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
@@ -33,10 +34,10 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
- for (int i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
{
v[i] = x;
if (++x == M)
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp
index 1d2840921e83..e0b148499ca8 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp
@@ -19,6 +19,7 @@
#include <vector>
#include <functional>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
@@ -34,10 +35,10 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
- for (int i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
{
v[i] = x;
if (++x == M)
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp
index ce659c1b50f5..bc968f5b2aab 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp
@@ -18,6 +18,7 @@
#include <algorithm>
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
@@ -41,10 +42,10 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
- for (int i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
{
v[i] = x;
if (++x == M)
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp
index 2b29e2c84353..de0bbf25613e 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp
@@ -19,6 +19,7 @@
#include <functional>
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
@@ -42,10 +43,10 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
- for (int i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
{
v[i] = x;
if (++x == M)
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp
index ce4f7ced5e63..1fff1d7f5b63 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp
@@ -17,6 +17,7 @@
#include <algorithm>
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
@@ -36,10 +37,10 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
- for (int i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
{
v[i] = x;
if (++x == M)
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp
index ae65c59e3159..4ec5f6c000d6 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp
@@ -18,6 +18,7 @@
#include <functional>
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
@@ -37,10 +38,10 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
- for (int i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
{
v[i] = x;
if (++x == M)
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp
index 3659e08fb28e..710edb61c9b6 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp
@@ -17,6 +17,7 @@
#include <algorithm>
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
@@ -36,10 +37,10 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
- for (int i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
{
v[i] = x;
if (++x == M)
diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp
index dd5fcfc28523..3268075b1b0b 100644
--- a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp
@@ -18,6 +18,7 @@
#include <functional>
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
@@ -37,10 +38,10 @@ void
test()
{
const unsigned N = 1000;
- const unsigned M = 10;
+ const int M = 10;
std::vector<int> v(N);
int x = 0;
- for (int i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
{
v[i] = x;
if (++x == M)
diff --git a/test/std/algorithms/alg.sorting/alg.clamp/clamp.comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.clamp/clamp.comp.pass.cpp
index 3fec12b6b53d..50bcff9c90e5 100644
--- a/test/std/algorithms/alg.sorting/alg.clamp/clamp.comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.clamp/clamp.comp.pass.cpp
@@ -22,11 +22,11 @@ struct Tag {
Tag() : val(0), tag("Default") {}
Tag(int a, const char *b) : val(a), tag(b) {}
~Tag() {}
-
+
int val;
const char *tag;
};
-
+
bool eq(const Tag& rhs, const Tag& lhs) { return rhs.val == lhs.val && rhs.tag == lhs.tag; }
// bool operator==(const Tag& rhs, const Tag& lhs) { return rhs.val == lhs.val; }
bool comp (const Tag& rhs, const Tag& lhs) { return rhs.val < lhs.val; }
diff --git a/test/std/algorithms/alg.sorting/alg.clamp/clamp.pass.cpp b/test/std/algorithms/alg.sorting/alg.clamp/clamp.pass.cpp
index 779c41827c92..1e18720bfbb3 100644
--- a/test/std/algorithms/alg.sorting/alg.clamp/clamp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.clamp/clamp.pass.cpp
@@ -21,11 +21,11 @@ struct Tag {
Tag() : val(0), tag("Default") {}
Tag(int a, const char *b) : val(a), tag(b) {}
~Tag() {}
-
+
int val;
const char *tag;
};
-
+
bool eq(const Tag& rhs, const Tag& lhs) { return rhs.val == lhs.val && rhs.tag == lhs.tag; }
// bool operator==(const Tag& rhs, const Tag& lhs) { return rhs.val == lhs.val; }
bool operator< (const Tag& rhs, const Tag& lhs) { return rhs.val < lhs.val; }
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap.pass.cpp
index 51b912768f35..9da9356b0be1 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap.pass.cpp
@@ -17,7 +17,7 @@
#include <algorithm>
#include <cassert>
-void test(unsigned N)
+void test(int N)
{
int* ia = new int [N];
for (int i = 0; i < N; ++i)
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp
index 0e16d9bd17c7..9d0545f0d9c5 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp
@@ -16,13 +16,12 @@
#include <algorithm>
#include <functional>
+#include <memory>
#include <cassert>
+#include "test_macros.h"
#include "counting_predicates.hpp"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#include <memory>
-
struct indirect_less
{
template <class P>
@@ -30,9 +29,8 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-void test(unsigned N)
+void test(int N)
{
int* ia = new int [N];
{
@@ -49,7 +47,7 @@ void test(unsigned N)
for (int i = 0; i < N; ++i)
ia[i] = i;
std::make_heap(ia, ia+N, std::ref(pred));
- assert(pred.count() <= 3*N);
+ assert(pred.count() <= 3u*N);
assert(std::is_heap(ia, ia+N, pred));
}
@@ -59,7 +57,7 @@ void test(unsigned N)
for (int i = 0; i < N; ++i)
ia[N-1-i] = i;
std::make_heap(ia, ia+N, std::ref(pred));
- assert(pred.count() <= 3*N);
+ assert(pred.count() <= 3u*N);
assert(std::is_heap(ia, ia+N, pred));
}
@@ -68,7 +66,7 @@ void test(unsigned N)
binary_counting_predicate<std::greater<int>, int, int> pred ((std::greater<int>()));
std::random_shuffle(ia, ia+N);
std::make_heap(ia, ia+N, std::ref(pred));
- assert(pred.count() <= 3*N);
+ assert(pred.count() <= 3u*N);
assert(std::is_heap(ia, ia+N, pred));
}
@@ -86,7 +84,7 @@ int main()
test(10000);
test(100000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
const int N = 1000;
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -97,5 +95,5 @@ int main()
assert(std::is_heap(ia, ia+N, indirect_less()));
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap.pass.cpp
index 823985df6ca0..252fc758cb1f 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap.pass.cpp
@@ -17,7 +17,7 @@
#include <algorithm>
#include <cassert>
-void test(unsigned N)
+void test(int N)
{
int* ia = new int [N];
for (int i = 0; i < N; ++i)
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
index 1db4428a1c1f..0bfad61961ed 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
@@ -29,7 +29,7 @@ struct indirect_less
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-void test(unsigned N)
+void test(int N)
{
int* ia = new int [N];
for (int i = 0; i < N; ++i)
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap.pass.cpp
index 0fc50a81207e..d82896d6a916 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap.pass.cpp
@@ -18,7 +18,7 @@
#include <algorithm>
#include <cassert>
-void test(unsigned N)
+void test(int N)
{
int* ia = new int [N];
for (int i = 0; i < N; ++i)
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
index 217217b38ee3..5d2985cc07fa 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
@@ -30,7 +30,7 @@ struct indirect_less
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-void test(unsigned N)
+void test(int N)
{
int* ia = new int [N];
for (int i = 0; i < N; ++i)
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp
index 4a08f111e6dd..c6eaa8ccec86 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp
@@ -17,7 +17,7 @@
#include <algorithm>
#include <cassert>
-void test(unsigned N)
+void test(int N)
{
int* ia = new int [N];
for (int i = 0; i < N; ++i)
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
index 7d3e2d570158..1c072c5a12ca 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
@@ -29,7 +29,7 @@ struct indirect_less
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-void test(unsigned N)
+void test(int N)
{
int* ia = new int [N];
for (int i = 0; i < N; ++i)
diff --git a/test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp b/test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp
index 9c411730196c..33a42a2f62a1 100644
--- a/test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp
@@ -58,7 +58,7 @@ test_one(unsigned N, unsigned M)
if(N > 0)
{
assert(ia[0] == 0);
- assert(ia[N-1] == N-1);
+ assert(ia[N-1] == static_cast<value_type>(N-1));
assert(std::is_sorted(ia, ia+N));
}
delete [] ia;
diff --git a/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp
index b4d25a93e50e..fd9e5f13c26a 100644
--- a/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp
@@ -74,7 +74,7 @@ test_one(unsigned N, unsigned M)
std::inplace_merge(Iter(ia), Iter(ia+M), Iter(ia+N), std::ref(pred));
if(N > 0)
{
- assert(ia[0] == N-1);
+ assert(ia[0] == static_cast<int>(N)-1);
assert(ia[N-1] == 0);
assert(std::is_sorted(ia, ia+N, std::greater<value_type>()));
assert(pred.count() <= (N-1));
@@ -125,10 +125,10 @@ int main()
test<S*>();
{
- unsigned N = 100;
+ int N = 100;
unsigned M = 50;
std::unique_ptr<int>* ia = new std::unique_ptr<int>[N];
- for (unsigned i = 0; i < N; ++i)
+ for (int i = 0; i < N; ++i)
ia[i].reset(new int(i));
std::random_shuffle(ia, ia+N);
std::sort(ia, ia+M, indirect_less());
diff --git a/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp b/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp
index de96c419c4ea..2a20cac0b79b 100644
--- a/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp
@@ -40,7 +40,7 @@ test()
InIter2(ib), InIter2(ib+N), OutIter(ic));
assert(base(r) == ic+2*N);
assert(ic[0] == 0);
- assert(ic[2*N-1] == 2*N-1);
+ assert(ic[2*N-1] == static_cast<int>(2*N-1));
assert(std::is_sorted(ic, ic+2*N));
delete [] ic;
delete [] ib;
@@ -62,7 +62,7 @@ test()
InIter2(ib), InIter2(ib+N), OutIter(ic));
assert(base(r) == ic+2*N);
assert(ic[0] == 0);
- assert(ic[2*N-1] == 2*N-1);
+ assert(ic[2*N-1] == static_cast<int>(2*N-1));
assert(std::is_sorted(ic, ic+2*N));
delete [] ic;
delete [] ib;
diff --git a/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp
index bd38d7de6894..152c552381b9 100644
--- a/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp
@@ -46,7 +46,7 @@ test()
OutIter r = std::merge(InIter1(ia), InIter1(ia+N),
InIter2(ib), InIter2(ib+N), OutIter(ic), pred);
assert(base(r) == ic+2*N);
- assert(ic[0] == 2*N-1);
+ assert(ic[0] == static_cast<int>(2*N-1));
assert(ic[2*N-1] == 0);
assert(std::is_sorted(ic, ic+2*N, std::greater<int>()));
assert(pred.count() <= (N + N - 1));
@@ -70,7 +70,7 @@ test()
OutIter r = std::merge(InIter1(ia), InIter1(ia+N),
InIter2(ib), InIter2(ib+N), OutIter(ic), pred);
assert(base(r) == ic+2*N);
- assert(ic[0] == 2*N-1);
+ assert(ic[0] == static_cast<int>(2*N-1));
assert(ic[2*N-1] == 0);
assert(std::is_sorted(ic, ic+2*N, std::greater<int>()));
assert(pred.count() <= (N + N - 1));
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp
index c560c22f2d72..f453a234d2e1 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp
@@ -16,6 +16,8 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test(const T& a, const T& b, const T& x)
@@ -43,7 +45,7 @@ int main()
test(x, y, x);
test(y, x, x);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
constexpr int x = 1;
constexpr int y = 0;
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp
index 95241af50063..6c185c2a8036 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp
@@ -18,6 +18,8 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
template <class T, class C>
void
test(const T& a, const T& b, C c, const T& x)
@@ -45,7 +47,7 @@ int main()
test(x, y, std::greater<int>(), y);
test(y, x, std::greater<int>(), y);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
constexpr int x = 1;
constexpr int y = 0;
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp
index 3ecc250a9c8f..e9cd086ab13d 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp
@@ -35,7 +35,7 @@ test(Iter first, Iter last)
template <class Iter>
void
-test(unsigned N)
+test(int N)
{
int* a = new int[N];
for (int i = 0; i < N; ++i)
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp
index fc88268aa84b..e60e156455f3 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/max_element_comp.pass.cpp
@@ -18,6 +18,7 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -36,7 +37,7 @@ test(Iter first, Iter last)
template <class Iter>
void
-test(unsigned N)
+test(int N)
{
int* a = new int[N];
for (int i = 0; i < N; ++i)
@@ -66,7 +67,7 @@ void test_eq0(Iter first, Iter last, Pred p)
void test_eq()
{
- const size_t N = 10;
+ const int N = 10;
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = 10; // all the same
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp
index 0438412d236e..e003acaa5aa8 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <algorithm>
// template <class T>
@@ -16,9 +18,10 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int i = std::max({2, 3, 1});
assert(i == 3);
i = std::max({2, 1, 3});
@@ -31,12 +34,11 @@ int main()
assert(i == 3);
i = std::max({1, 3, 2});
assert(i == 3);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
static_assert(std::max({1, 3, 2}) == 3, "");
static_assert(std::max({2, 1, 3}) == 3, "");
static_assert(std::max({3, 2, 1}) == 3, "");
}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp
index 4dd47a73ef3b..6b3c72b1de9e 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <algorithm>
// template<class T, class Compare>
@@ -17,9 +19,10 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int i = std::max({2, 3, 1}, std::greater<int>());
assert(i == 1);
i = std::max({2, 1, 3}, std::greater<int>());
@@ -32,12 +35,11 @@ int main()
assert(i == 1);
i = std::max({1, 3, 2}, std::greater<int>());
assert(i == 1);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
static_assert(std::max({1, 3, 2}, std::greater<int>()) == 1, "");
static_assert(std::max({2, 1, 3}, std::greater<int>()) == 1, "");
static_assert(std::max({3, 2, 1}, std::greater<int>()) == 1, "");
}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp
index bbbd97bc5a4a..3d0241f80dbe 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp
@@ -16,6 +16,8 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test(const T& a, const T& b, const T& x)
@@ -43,7 +45,7 @@ int main()
test(x, y, y);
test(y, x, y);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
constexpr int x = 1;
constexpr int y = 0;
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp
index 4ef705e77718..9dc74380261b 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp
@@ -18,6 +18,8 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
template <class T, class C>
void
test(const T& a, const T& b, C c, const T& x)
@@ -45,7 +47,7 @@ int main()
test(x, y, std::greater<int>(), x);
test(y, x, std::greater<int>(), x);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
constexpr int x = 1;
constexpr int y = 0;
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp
index 45dd54b1ee40..c41884220857 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp
@@ -35,7 +35,7 @@ test(Iter first, Iter last)
template <class Iter>
void
-test(unsigned N)
+test(int N)
{
int* a = new int[N];
for (int i = 0; i < N; ++i)
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp
index 94ef482ddbde..c4c6e31eb6dd 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp
@@ -18,6 +18,7 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -36,7 +37,7 @@ test(Iter first, Iter last)
template <class Iter>
void
-test(unsigned N)
+test(int N)
{
int* a = new int[N];
for (int i = 0; i < N; ++i)
@@ -66,7 +67,7 @@ void test_eq0(Iter first, Iter last, Pred p)
void test_eq()
{
- const size_t N = 10;
+ const int N = 10;
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = 10; // all the same
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp
index eed4ebd45756..d212bf6cfe88 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <algorithm>
// template<class T>
@@ -16,9 +18,10 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int i = std::min({2, 3, 1});
assert(i == 1);
i = std::min({2, 1, 3});
@@ -31,12 +34,11 @@ int main()
assert(i == 1);
i = std::min({1, 3, 2});
assert(i == 1);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
static_assert(std::min({1, 3, 2}) == 1, "");
static_assert(std::min({2, 1, 3}) == 1, "");
static_assert(std::min({3, 2, 1}) == 1, "");
}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/min_init_list_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/min_init_list_comp.pass.cpp
index 5e0301b657b9..7435da1661ad 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/min_init_list_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/min_init_list_comp.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <algorithm>
// template<class T, class Compare>
@@ -17,9 +19,10 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int i = std::min({2, 3, 1}, std::greater<int>());
assert(i == 3);
i = std::min({2, 1, 3}, std::greater<int>());
@@ -32,12 +35,11 @@ int main()
assert(i == 3);
i = std::min({1, 3, 2}, std::greater<int>());
assert(i == 3);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
static_assert(std::min({1, 3, 2}, std::greater<int>()) == 3, "");
static_assert(std::min({2, 1, 3}, std::greater<int>()) == 3, "");
static_assert(std::min({3, 2, 1}, std::greater<int>()) == 3, "");
}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp
index 8276c3a5dfd5..6ef4d06467bf 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp
@@ -16,6 +16,8 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test(const T& a, const T& b, const T& x, const T& y)
@@ -45,7 +47,7 @@ int main()
test(x, y, y, x);
test(y, x, y, x);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
// Note that you can't take a reference to a local var, since
// its address is not a compile-time constant.
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp
index 3289f8a7582c..a2027d440c46 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp
@@ -18,6 +18,8 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
template <class T, class C>
void
test(const T& a, const T& b, C c, const T& x, const T& y)
@@ -48,7 +50,7 @@ int main()
test(x, y, std::greater<int>(), x, y);
test(y, x, std::greater<int>(), x, y);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
// Note that you can't take a reference to a local var, since
// its address is not a compile-time constant.
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
index ef5474091db5..c2805a656137 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp
@@ -41,7 +41,7 @@ test(Iter first, Iter last)
template <class Iter>
void
-test(unsigned N)
+test(int N)
{
int* a = new int[N];
for (int i = 0; i < N; ++i)
@@ -62,7 +62,7 @@ test()
test<Iter>(10);
test<Iter>(1000);
{
- const unsigned N = 100;
+ const int N = 100;
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = 5;
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp
index 3a0c2dbbba1b..7840638f742c 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element_comp.pass.cpp
@@ -18,6 +18,7 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -44,7 +45,7 @@ test(Iter first, Iter last)
template <class Iter>
void
-test(unsigned N)
+test(int N)
{
int* a = new int[N];
for (int i = 0; i < N; ++i)
@@ -65,7 +66,7 @@ test()
test<Iter>(10);
test<Iter>(1000);
{
- const unsigned N = 100;
+ const int N = 100;
int* a = new int[N];
for (int i = 0; i < N; ++i)
a[i] = 5;
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp
index 0196d10dcd96..dd62dfd78a8d 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <algorithm>
// template<class T>
@@ -16,16 +18,17 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
assert((std::minmax({1, 2, 3}) == std::pair<int, int>(1, 3)));
assert((std::minmax({1, 3, 2}) == std::pair<int, int>(1, 3)));
assert((std::minmax({2, 1, 3}) == std::pair<int, int>(1, 3)));
assert((std::minmax({2, 3, 1}) == std::pair<int, int>(1, 3)));
assert((std::minmax({3, 1, 2}) == std::pair<int, int>(1, 3)));
assert((std::minmax({3, 2, 1}) == std::pair<int, int>(1, 3)));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
static_assert((std::minmax({1, 2, 3}) == std::pair<int, int>(1, 3)), "");
static_assert((std::minmax({1, 3, 2}) == std::pair<int, int>(1, 3)), "");
@@ -35,5 +38,4 @@ int main()
static_assert((std::minmax({3, 2, 1}) == std::pair<int, int>(1, 3)), "");
}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp
index 789ccef0fca4..ab20b2a0461b 100644
--- a/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <algorithm>
// template<class T, class Compare>
@@ -19,11 +21,11 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "counting_predicates.hpp"
bool all_equal(int, int) { return false; } // everything is equal
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
void test_all_equal(std::initializer_list<int> il)
{
binary_counting_predicate<bool(*)(int, int), int, int> pred (all_equal);
@@ -33,11 +35,9 @@ void test_all_equal(std::initializer_list<int> il)
assert(p.second == *--ptr);
assert(pred.count() <= ((3 * il.size()) / 2));
}
-#endif
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
assert((std::minmax({1, 2, 3}, std::greater<int>()) == std::pair<int, int>(3, 1)));
assert((std::minmax({1, 3, 2}, std::greater<int>()) == std::pair<int, int>(3, 1)));
assert((std::minmax({2, 1, 3}, std::greater<int>()) == std::pair<int, int>(3, 1)));
@@ -63,7 +63,7 @@ int main()
test_all_equal({0,1,2,3,4,5,6,7,8,9,10});
test_all_equal({0,1,2,3,4,5,6,7,8,9,10,11});
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
static_assert((std::minmax({1, 2, 3}, std::greater<int>()) == std::pair<int, int>(3, 1)), "");
static_assert((std::minmax({1, 3, 2}, std::greater<int>()) == std::pair<int, int>(3, 1)), "");
@@ -73,5 +73,4 @@ int main()
static_assert((std::minmax({3, 2, 1}, std::greater<int>()) == std::pair<int, int>(3, 1)), "");
}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/algorithms/alg.sorting/alg.nth.element/nth_element.pass.cpp b/test/std/algorithms/alg.sorting/alg.nth.element/nth_element.pass.cpp
index dc5564eb3fc9..560bc902b482 100644
--- a/test/std/algorithms/alg.sorting/alg.nth.element/nth_element.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.nth.element/nth_element.pass.cpp
@@ -19,7 +19,7 @@
#include <cassert>
void
-test_one(unsigned N, unsigned M)
+test_one(int N, int M)
{
assert(N != 0);
assert(M < N);
@@ -34,7 +34,7 @@ test_one(unsigned N, unsigned M)
}
void
-test(unsigned N)
+test(int N)
{
test_one(N, 0);
test_one(N, 1);
diff --git a/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
index cf8659038f14..f2c962724f09 100644
--- a/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
@@ -19,6 +19,7 @@
#include <functional>
#include <vector>
#include <cassert>
+#include <cstddef>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
@@ -32,7 +33,7 @@ struct indirect_less
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void
-test_one(unsigned N, unsigned M)
+test_one(int N, int M)
{
assert(N != 0);
assert(M < N);
@@ -47,7 +48,7 @@ test_one(unsigned N, unsigned M)
}
void
-test(unsigned N)
+test(int N)
{
test_one(N, 0);
test_one(N, 1);
@@ -77,10 +78,10 @@ int main()
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<std::unique_ptr<int> > v(1000);
- for (int i = 0; i < v.size(); ++i)
+ for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
v[i].reset(new int(i));
std::nth_element(v.begin(), v.begin() + v.size()/2, v.end(), indirect_less());
- assert(*v[v.size()/2] == v.size()/2);
+ assert(static_cast<std::size_t>(*v[v.size()/2]) == v.size()/2);
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy.pass.cpp
index 5f298fde7b34..1d4ca9925a86 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy.pass.cpp
@@ -24,7 +24,7 @@
template <class Iter>
void
-test_larger_sorts(unsigned N, unsigned M)
+test_larger_sorts(int N, int M)
{
int* input = new int[N];
int* output = new int[M];
@@ -43,7 +43,7 @@ test_larger_sorts(unsigned N, unsigned M)
template <class Iter>
void
-test_larger_sorts(unsigned N)
+test_larger_sorts(int N)
{
test_larger_sorts<Iter>(N, 0);
test_larger_sorts<Iter>(N, 1);
diff --git a/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy_comp.pass.cpp
index df8fb9eacacd..460ea4c08275 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy_comp.pass.cpp
@@ -27,7 +27,7 @@
template <class Iter>
void
-test_larger_sorts(unsigned N, unsigned M)
+test_larger_sorts(int N, int M)
{
int* input = new int[N];
int* output = new int[M];
@@ -47,7 +47,7 @@ test_larger_sorts(unsigned N, unsigned M)
template <class Iter>
void
-test_larger_sorts(unsigned N)
+test_larger_sorts(int N)
{
test_larger_sorts<Iter>(N, 0);
test_larger_sorts<Iter>(N, 1);
diff --git a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp
index 62458eca9302..0d32ba898b8f 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp
@@ -19,7 +19,7 @@
#include <cassert>
void
-test_larger_sorts(unsigned N, unsigned M)
+test_larger_sorts(int N, int M)
{
assert(N != 0);
assert(N >= M);
@@ -37,7 +37,7 @@ test_larger_sorts(unsigned N, unsigned M)
}
void
-test_larger_sorts(unsigned N)
+test_larger_sorts(int N)
{
test_larger_sorts(N, 0);
test_larger_sorts(N, 1);
diff --git a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
index 0289cf8391f9..a4fe1cc5e7ca 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
@@ -19,6 +19,7 @@
#include <vector>
#include <functional>
#include <cassert>
+#include <cstddef>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
@@ -32,7 +33,7 @@ struct indirect_less
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void
-test_larger_sorts(unsigned N, unsigned M)
+test_larger_sorts(int N, int M)
{
assert(N != 0);
assert(N >= M);
@@ -50,7 +51,7 @@ test_larger_sorts(unsigned N, unsigned M)
}
void
-test_larger_sorts(unsigned N)
+test_larger_sorts(int N)
{
test_larger_sorts(N, 0);
test_larger_sorts(N, 1);
@@ -83,10 +84,10 @@ int main()
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<std::unique_ptr<int> > v(1000);
- for (int i = 0; i < v.size(); ++i)
+ for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
v[i].reset(new int(i));
std::partial_sort(v.begin(), v.begin() + v.size()/2, v.end(), indirect_less());
- for (int i = 0; i < v.size()/2; ++i)
+ for (int i = 0; static_cast<std::size_t>(i) < v.size()/2; ++i)
assert(*v[i] == i);
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp
index 2ea697a63b2a..689433f9e45b 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp
@@ -16,6 +16,7 @@
// sort(Iter first, Iter last);
#include <algorithm>
+#include <iterator>
#include <cassert>
template <class RI>
@@ -23,9 +24,11 @@ void
test_sort_helper(RI f, RI l)
{
typedef typename std::iterator_traits<RI>::value_type value_type;
+ typedef typename std::iterator_traits<RI>::difference_type difference_type;
+
if (f != l)
{
- long len = l - f;
+ difference_type len = l - f;
value_type* save(new value_type[len]);
do
{
@@ -60,7 +63,7 @@ test_sort_driver(RI f, RI l, int start)
test_sort_driver_driver(f, l, start, l);
}
-template <unsigned sa>
+template <int sa>
void
test_sort_()
{
@@ -72,7 +75,7 @@ test_sort_()
}
void
-test_larger_sorts(unsigned N, unsigned M)
+test_larger_sorts(int N, int M)
{
assert(N != 0);
assert(M != 0);
@@ -112,7 +115,7 @@ test_larger_sorts(unsigned N, unsigned M)
}
void
-test_larger_sorts(unsigned N)
+test_larger_sorts(int N)
{
test_larger_sorts(N, 1);
test_larger_sorts(N, 2);
diff --git a/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
index d6c4f0467844..c77015993c8c 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
@@ -19,6 +19,7 @@
#include <functional>
#include <vector>
#include <cassert>
+#include <cstddef>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
@@ -35,7 +36,7 @@ int main()
{
{
std::vector<int> v(1000);
- for (int i = 0; i < v.size(); ++i)
+ for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
v[i] = i;
std::sort(v.begin(), v.end(), std::greater<int>());
std::reverse(v.begin(), v.end());
@@ -45,7 +46,7 @@ int main()
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<std::unique_ptr<int> > v(1000);
- for (int i = 0; i < v.size(); ++i)
+ for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
v[i].reset(new int(i));
std::sort(v.begin(), v.end(), indirect_less());
assert(std::is_sorted(v.begin(), v.end(), indirect_less()));
diff --git a/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp
index 5faa1682135d..336fcd0b3dde 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp
@@ -16,6 +16,7 @@
// stable_sort(Iter first, Iter last);
#include <algorithm>
+#include <iterator>
#include <cassert>
template <class RI>
@@ -23,9 +24,11 @@ void
test_sort_helper(RI f, RI l)
{
typedef typename std::iterator_traits<RI>::value_type value_type;
+ typedef typename std::iterator_traits<RI>::difference_type difference_type;
+
if (f != l)
{
- long len = l - f;
+ difference_type len = l - f;
value_type* save(new value_type[len]);
do
{
@@ -60,7 +63,7 @@ test_sort_driver(RI f, RI l, int start)
test_sort_driver_driver(f, l, start, l);
}
-template <unsigned sa>
+template <int sa>
void
test_sort_()
{
@@ -72,7 +75,7 @@ test_sort_()
}
void
-test_larger_sorts(unsigned N, unsigned M)
+test_larger_sorts(int N, int M)
{
assert(N != 0);
assert(M != 0);
@@ -112,7 +115,7 @@ test_larger_sorts(unsigned N, unsigned M)
}
void
-test_larger_sorts(unsigned N)
+test_larger_sorts(int N)
{
test_larger_sorts(N, 1);
test_larger_sorts(N, 2);
diff --git a/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
index 68e817ebeb3b..49f7122cdb31 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
@@ -19,6 +19,7 @@
#include <functional>
#include <vector>
#include <cassert>
+#include <cstddef>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
@@ -71,7 +72,7 @@ int main()
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<std::unique_ptr<int> > v(1000);
- for (int i = 0; i < v.size(); ++i)
+ for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
v[i].reset(new int(i));
std::stable_sort(v.begin(), v.end(), indirect_less());
assert(std::is_sorted(v.begin(), v.end(), indirect_less()));
diff --git a/test/std/atomics/atomics.flag/default.pass.cpp b/test/std/atomics/atomics.flag/default.pass.cpp
index 11c08f50266a..b4c2b9c80833 100644
--- a/test/std/atomics/atomics.flag/default.pass.cpp
+++ b/test/std/atomics/atomics.flag/default.pass.cpp
@@ -19,6 +19,8 @@
#include <new>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
std::atomic_flag f;
@@ -26,7 +28,7 @@ int main()
assert(f.test_and_set() == 0);
{
typedef std::atomic_flag A;
- _ALIGNAS_TYPE(A) char storage[sizeof(A)] = {1};
+ TEST_ALIGNAS_TYPE(A) char storage[sizeof(A)] = {1};
A& zero = *new (storage) A();
assert(!zero.test_and_set());
zero.~A();
diff --git a/test/std/atomics/atomics.types.generic/address.pass.cpp b/test/std/atomics/atomics.types.generic/address.pass.cpp
index 137e46b6a155..c31a99c9b9ad 100644
--- a/test/std/atomics/atomics.types.generic/address.pass.cpp
+++ b/test/std/atomics/atomics.types.generic/address.pass.cpp
@@ -75,6 +75,8 @@
#include <cmpxchg_loop.h>
+#include "test_macros.h"
+
template <class A, class T>
void
do_test()
@@ -121,7 +123,7 @@ do_test()
assert(obj == T(2*sizeof(X)));
{
- _ALIGNAS_TYPE(A) char storage[sizeof(A)] = {23};
+ TEST_ALIGNAS_TYPE(A) char storage[sizeof(A)] = {23};
A& zero = *new (storage) A();
assert(zero == T(0));
zero.~A();
diff --git a/test/std/atomics/atomics.types.generic/bool.pass.cpp b/test/std/atomics/atomics.types.generic/bool.pass.cpp
index e85893d12b8d..ba38154ed46b 100644
--- a/test/std/atomics/atomics.types.generic/bool.pass.cpp
+++ b/test/std/atomics/atomics.types.generic/bool.pass.cpp
@@ -57,6 +57,8 @@
#include <cmpxchg_loop.h>
+#include "test_macros.h"
+
int main()
{
{
@@ -226,7 +228,7 @@ int main()
}
{
typedef std::atomic<bool> A;
- _ALIGNAS_TYPE(A) char storage[sizeof(A)] = {1};
+ TEST_ALIGNAS_TYPE(A) char storage[sizeof(A)] = {1};
A& zero = *new (storage) A();
assert(zero == false);
zero.~A();
diff --git a/test/std/atomics/atomics.types.generic/integral.pass.cpp b/test/std/atomics/atomics.types.generic/integral.pass.cpp
index a449dc6d5f57..63cc02befb7e 100644
--- a/test/std/atomics/atomics.types.generic/integral.pass.cpp
+++ b/test/std/atomics/atomics.types.generic/integral.pass.cpp
@@ -92,6 +92,8 @@
#include <cmpxchg_loop.h>
+#include "test_macros.h"
+
template <class A, class T>
void
do_test()
@@ -151,7 +153,7 @@ do_test()
assert(obj == T(8));
{
- _ALIGNAS_TYPE(A) char storage[sizeof(A)] = {23};
+ TEST_ALIGNAS_TYPE(A) char storage[sizeof(A)] = {23};
A& zero = *new (storage) A();
assert(zero == 0);
zero.~A();
@@ -193,7 +195,7 @@ int main()
test<std::atomic_uint32_t, uint32_t>();
test<std::atomic_int64_t, int64_t>();
test<std::atomic_uint64_t, uint64_t>();
-
+
test<volatile std::atomic_char, char>();
test<volatile std::atomic_schar, signed char>();
test<volatile std::atomic_uchar, unsigned char>();
diff --git a/test/std/containers/associative/map/map.access/at.pass.cpp b/test/std/containers/associative/map/map.access/at.pass.cpp
index c5f77bf5f0fb..6d3e98e9e78b 100644
--- a/test/std/containers/associative/map/map.access/at.pass.cpp
+++ b/test/std/containers/associative/map/map.access/at.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <map>
// class map
@@ -19,6 +18,7 @@
#include <cassert>
#include "min_allocator.h"
+#include "test_macros.h"
int main()
{
@@ -43,6 +43,7 @@ int main()
assert(m.at(3) == 3.5);
assert(m.at(4) == 4.5);
assert(m.at(5) == 5.5);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
m.at(6);
@@ -51,6 +52,7 @@ int main()
catch (std::out_of_range&)
{
}
+#endif
assert(m.at(7) == 7.5);
assert(m.at(8) == 8.5);
assert(m.size() == 7);
@@ -74,6 +76,7 @@ int main()
assert(m.at(3) == 3.5);
assert(m.at(4) == 4.5);
assert(m.at(5) == 5.5);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
m.at(6);
@@ -82,6 +85,7 @@ int main()
catch (std::out_of_range&)
{
}
+#endif
assert(m.at(7) == 7.5);
assert(m.at(8) == 8.5);
assert(m.size() == 7);
@@ -108,6 +112,7 @@ int main()
assert(m.at(3) == 3.5);
assert(m.at(4) == 4.5);
assert(m.at(5) == 5.5);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
m.at(6);
@@ -116,6 +121,7 @@ int main()
catch (std::out_of_range&)
{
}
+#endif
assert(m.at(7) == 7.5);
assert(m.at(8) == 8.5);
assert(m.size() == 7);
@@ -139,6 +145,7 @@ int main()
assert(m.at(3) == 3.5);
assert(m.at(4) == 4.5);
assert(m.at(5) == 5.5);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
m.at(6);
@@ -147,6 +154,7 @@ int main()
catch (std::out_of_range&)
{
}
+#endif
assert(m.at(7) == 7.5);
assert(m.at(8) == 8.5);
assert(m.size() == 7);
diff --git a/test/std/containers/associative/map/map.access/iterator.pass.cpp b/test/std/containers/associative/map/map.access/iterator.pass.cpp
index 4f66eb6a8e31..27fe3511c474 100644
--- a/test/std/containers/associative/map/map.access/iterator.pass.cpp
+++ b/test/std/containers/associative/map/map.access/iterator.pass.cpp
@@ -28,7 +28,9 @@
#include <map>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -63,13 +65,13 @@ int main()
V(8, 2)
};
std::map<int, double> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
std::map<int, double>::iterator i;
i = m.begin();
std::map<int, double>::const_iterator k = i;
assert(i == k);
- for (int j = 1; j <= m.size(); ++j, ++i)
+ for (int j = 1; static_cast<std::size_t>(j) <= m.size(); ++j, ++i)
{
assert(i->first == j);
assert(i->second == 1);
@@ -107,13 +109,13 @@ int main()
V(8, 2)
};
const std::map<int, double> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.cbegin(), m.cend()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
- assert(std::distance(m.crbegin(), m.crend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.cbegin(), m.cend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.crbegin(), m.crend())) == m.size());
std::map<int, double>::const_iterator i;
i = m.begin();
- for (int j = 1; j <= m.size(); ++j, ++i)
+ for (int j = 1; static_cast<std::size_t>(j) <= m.size(); ++j, ++i)
{
assert(i->first == j);
assert(i->second == 1);
@@ -150,13 +152,13 @@ int main()
V(8, 2)
};
std::map<int, double, std::less<int>, min_allocator<V>> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
std::map<int, double, std::less<int>, min_allocator<V>>::iterator i;
i = m.begin();
std::map<int, double, std::less<int>, min_allocator<V>>::const_iterator k = i;
assert(i == k);
- for (int j = 1; j <= m.size(); ++j, ++i)
+ for (int j = 1; static_cast<std::size_t>(j) <= m.size(); ++j, ++i)
{
assert(i->first == j);
assert(i->second == 1);
@@ -194,20 +196,20 @@ int main()
V(8, 2)
};
const std::map<int, double, std::less<int>, min_allocator<V>> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.cbegin(), m.cend()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
- assert(std::distance(m.crbegin(), m.crend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.cbegin(), m.cend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.crbegin(), m.crend())) == m.size());
std::map<int, double, std::less<int>, min_allocator<V>>::const_iterator i;
i = m.begin();
- for (int j = 1; j <= m.size(); ++j, ++i)
+ for (int j = 1; static_cast<std::size_t>(j) <= m.size(); ++j, ++i)
{
assert(i->first == j);
assert(i->second == 1);
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::map<int, double> C;
C::iterator ii1{}, ii2{};
diff --git a/test/std/containers/associative/map/map.access/max_size.pass.cpp b/test/std/containers/associative/map/map.access/max_size.pass.cpp
index c67d8b1f674d..82a817a1f4ae 100644
--- a/test/std/containers/associative/map/map.access/max_size.pass.cpp
+++ b/test/std/containers/associative/map/map.access/max_size.pass.cpp
@@ -13,23 +13,39 @@
// size_type max_size() const;
-#include <map>
#include <cassert>
+#include <limits>
+#include <map>
+#include <type_traits>
-#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
int main()
{
- {
- typedef std::map<int, double> M;
- M m;
- assert(m.max_size() != 0);
+ typedef std::pair<const int, int> KV;
+ {
+ typedef limited_allocator<KV, 10> A;
+ typedef std::map<int, int, std::less<int>, A> C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<KV, (size_t)-1> A;
+ typedef std::map<int, int, std::less<int>, A> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
}
-#if TEST_STD_VER >= 11
{
- typedef std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> M;
- M m;
- assert(m.max_size() != 0);
+ typedef std::map<char, int> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
}
-#endif
}
diff --git a/test/std/containers/associative/map/map.cons/compare_copy_constructible.fail.cpp b/test/std/containers/associative/map/map.cons/compare_copy_constructible.fail.cpp
index 81ccba3bbc96..210c27050a60 100644
--- a/test/std/containers/associative/map/map.cons/compare_copy_constructible.fail.cpp
+++ b/test/std/containers/associative/map/map.cons/compare_copy_constructible.fail.cpp
@@ -9,7 +9,7 @@
// <map>
-// Check that std::map fails to instantiate if the comparison predicate is
+// Check that std::map fails to instantiate if the comparison predicate is
// not copy-constructible. This is LWG issue 2436
#include <map>
diff --git a/test/std/containers/associative/map/map.cons/copy.pass.cpp b/test/std/containers/associative/map/map.cons/copy.pass.cpp
index a1de1b13aed2..081c8f7c0a82 100644
--- a/test/std/containers/associative/map/map.cons/copy.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/copy.pass.cpp
@@ -16,6 +16,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -56,7 +57,7 @@ int main()
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
typedef std::pair<const int, double> V;
V ar[] =
@@ -91,8 +92,6 @@ int main()
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if TEST_STD_VER >= 11
{
typedef std::pair<const int, double> V;
V ar[] =
diff --git a/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp b/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
index cc5d0d5d2f8b..0a4f70e59d95 100644
--- a/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
@@ -17,6 +17,7 @@
#include <cassert>
#include <vector>
#include <algorithm>
+#include <iterator>
#include <iostream>
@@ -35,7 +36,7 @@ public:
int foo{0};
counting_allocatorT(int f) noexcept : foo(f) {}
- using propagate_on_container_copy_assignment = std::true_type;
+ using propagate_on_container_copy_assignment = std::true_type;
template <class U> counting_allocatorT(const counting_allocatorT<U>& other) noexcept {foo = other.foo;}
template <class U> bool operator==(const counting_allocatorT<U>& other) const noexcept { return foo == other.foo; }
template <class U> bool operator!=(const counting_allocatorT<U>& other) const noexcept { return foo != other.foo; }
@@ -58,7 +59,7 @@ public:
int foo{0};
counting_allocatorF(int f) noexcept : foo(f) {}
- using propagate_on_container_copy_assignment = std::false_type;
+ using propagate_on_container_copy_assignment = std::false_type;
template <class U> counting_allocatorF(const counting_allocatorF<U>& other) noexcept {foo = other.foo;}
template <class U> bool operator==(const counting_allocatorF<U>& other) const noexcept { return foo == other.foo; }
template <class U> bool operator!=(const counting_allocatorF<U>& other) const noexcept { return foo != other.foo; }
@@ -76,7 +77,7 @@ public:
bool balanced_allocs() {
std::vector<int> temp1, temp2;
-
+
std::cout << "Allocations = " << ca_allocs.size() << ", deallocatons = " << ca_deallocs.size() << std::endl;
if (ca_allocs.size() != ca_deallocs.size())
return false;
@@ -86,13 +87,13 @@ bool balanced_allocs() {
temp2.clear();
std::unique_copy(temp1.begin(), temp1.end(), std::back_inserter<std::vector<int>>(temp2));
std::cout << "There were " << temp2.size() << " different allocators\n";
-
+
for (std::vector<int>::const_iterator it = temp2.begin(); it != temp2.end(); ++it ) {
std::cout << *it << ": " << std::count(ca_allocs.begin(), ca_allocs.end(), *it) << " vs " << std::count(ca_deallocs.begin(), ca_deallocs.end(), *it) << std::endl;
if ( std::count(ca_allocs.begin(), ca_allocs.end(), *it) != std::count(ca_deallocs.begin(), ca_deallocs.end(), *it))
return false;
}
-
+
temp1 = ca_allocs;
std::sort(temp1.begin(), temp1.end());
temp2.clear();
@@ -103,7 +104,7 @@ bool balanced_allocs() {
if ( std::count(ca_allocs.begin(), ca_allocs.end(), *it) != std::count(ca_deallocs.begin(), ca_deallocs.end(), *it))
return false;
}
-
+
return true;
}
#endif
diff --git a/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp b/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
index efdf5a2ed184..a0cf689ed909 100644
--- a/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -44,6 +45,6 @@ int main()
}
{
typedef std::map<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp b/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp
index 6bad75d66f1d..705fb580487b 100644
--- a/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp
@@ -18,6 +18,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -75,7 +76,7 @@ int main()
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
V ar[] =
diff --git a/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp b/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
index 95ddf6dcb82f..84f115f1958e 100644
--- a/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
@@ -22,6 +22,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -46,7 +47,7 @@ int main()
}
{
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::map<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
diff --git a/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp b/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
index 1c2a242edf43..b5301418e85a 100644
--- a/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
@@ -20,6 +20,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -36,15 +37,15 @@ int main()
typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::map<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
diff --git a/test/std/containers/associative/map/map.ops/count.pass.cpp b/test/std/containers/associative/map/map.ops/count.pass.cpp
index f3df31951c79..c35ad3f0a00e 100644
--- a/test/std/containers/associative/map/map.ops/count.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/count.pass.cpp
@@ -16,6 +16,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
@@ -98,7 +99,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::map<int, double, std::less <>> M;
diff --git a/test/std/containers/associative/map/map.ops/count1.fail.cpp b/test/std/containers/associative/map/map.ops/count1.fail.cpp
index 075a5ba2e0ab..bd0bf2ec4a04 100644
--- a/test/std/containers/associative/map/map.ops/count1.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/count1.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().count(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/map/map.ops/count2.fail.cpp b/test/std/containers/associative/map/map.ops/count2.fail.cpp
index de1899021805..ff4bed8cb60c 100644
--- a/test/std/containers/associative/map/map.ops/count2.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/count2.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().count(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/map/map.ops/count3.fail.cpp b/test/std/containers/associative/map/map.ops/count3.fail.cpp
index b139689fec74..55a463ed38a6 100644
--- a/test/std/containers/associative/map/map.ops/count3.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/count3.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().count(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/map/map.ops/equal_range.pass.cpp b/test/std/containers/associative/map/map.ops/equal_range.pass.cpp
index 8beeb8b30f58..28747063a306 100644
--- a/test/std/containers/associative/map/map.ops/equal_range.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/equal_range.pass.cpp
@@ -17,6 +17,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
@@ -297,7 +298,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::map<int, double, std::less<>> M;
diff --git a/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp
index c66c2c512142..a92ad96921c1 100644
--- a/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().equal_range(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp
index 85083d4f4796..23357e26897a 100644
--- a/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().equal_range(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp
index c9f1126e5baf..3ffa3f22a619 100644
--- a/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().equal_range(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/map/map.ops/find.pass.cpp b/test/std/containers/associative/map/map.ops/find.pass.cpp
index 225f0f406042..b23d303df55a 100644
--- a/test/std/containers/associative/map/map.ops/find.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/find.pass.cpp
@@ -17,6 +17,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
@@ -165,7 +166,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::map<int, double, std::less<>> M;
diff --git a/test/std/containers/associative/map/map.ops/find1.fail.cpp b/test/std/containers/associative/map/map.ops/find1.fail.cpp
index 4fe61117613c..5346821b42af 100644
--- a/test/std/containers/associative/map/map.ops/find1.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/find1.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().find(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/map/map.ops/find2.fail.cpp b/test/std/containers/associative/map/map.ops/find2.fail.cpp
index 3532dc8765b3..1dfb7fa44b06 100644
--- a/test/std/containers/associative/map/map.ops/find2.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/find2.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().find(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/map/map.ops/find3.fail.cpp b/test/std/containers/associative/map/map.ops/find3.fail.cpp
index be77330a29c8..f5e92b8264b7 100644
--- a/test/std/containers/associative/map/map.ops/find3.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/find3.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().find(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp b/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp
index e4359fa548b9..9c63dc7ab3ac 100644
--- a/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/lower_bound.pass.cpp
@@ -17,6 +17,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
@@ -229,7 +230,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::map<int, double, std::less <>> M;
diff --git a/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp
index 97bbf553205f..6a3ed96a4fc5 100644
--- a/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp
index eeae8e657387..87fffe7afcce 100644
--- a/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
index ba27ae3c5172..fbccd3ab221b 100644
--- a/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/map/map.ops/upper_bound.pass.cpp b/test/std/containers/associative/map/map.ops/upper_bound.pass.cpp
index 8c721947a2c3..7276b74b1931 100644
--- a/test/std/containers/associative/map/map.ops/upper_bound.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/upper_bound.pass.cpp
@@ -17,6 +17,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -228,7 +229,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::map<int, double, std::less<>> M;
diff --git a/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp
index 6568e04bfad4..cb23588e2b97 100644
--- a/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp
index bbb857e6f25a..1fa4cbc70012 100644
--- a/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp
index ed9a41e4f03f..0f3cea238295 100644
--- a/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/map/map.special/non_member_swap.pass.cpp b/test/std/containers/associative/map/map.special/non_member_swap.pass.cpp
index 103a57b17e07..7e36797d092b 100644
--- a/test/std/containers/associative/map/map.special/non_member_swap.pass.cpp
+++ b/test/std/containers/associative/map/map.special/non_member_swap.pass.cpp
@@ -121,17 +121,17 @@ int main()
V(11, 11),
V(12, 12)
};
- M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1));
- M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(2));
+ M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1, 1));
+ M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(1, 2));
M m1_save = m1;
M m2_save = m2;
swap(m1, m2);
assert(m1 == m2_save);
assert(m2 == m1_save);
assert(m1.key_comp() == C(2));
- assert(m1.get_allocator() == A(1));
+ assert(m1.get_allocator().get_id() == 1); // not swapped
assert(m2.key_comp() == C(1));
- assert(m2.get_allocator() == A(2));
+ assert(m2.get_allocator().get_id() == 2);
}
{
typedef other_allocator<V> A;
diff --git a/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp b/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
index cbbf4577ce62..84907945a90e 100644
--- a/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
@@ -22,6 +22,7 @@
// This tests a conforming extension
#include <map>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -96,51 +97,42 @@ int main()
typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::map<MoveOnly, MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::map<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for comp
typedef std::map<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc <V>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for comp
typedef std::map<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc2<V>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for comp
typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc <V>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for comp
typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc2<V>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // NOT always equal allocator, nothrow swap for comp
typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<V>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
diff --git a/test/std/containers/associative/multimap/iterator.pass.cpp b/test/std/containers/associative/multimap/iterator.pass.cpp
index ef7c5ef18af1..d79dae9e77dc 100644
--- a/test/std/containers/associative/multimap/iterator.pass.cpp
+++ b/test/std/containers/associative/multimap/iterator.pass.cpp
@@ -28,7 +28,9 @@
#include <map>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -63,8 +65,8 @@ int main()
V(8, 2)
};
std::multimap<int, double> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
std::multimap<int, double>::iterator i;
i = m.begin();
std::multimap<int, double>::const_iterator k = i;
@@ -108,10 +110,10 @@ int main()
V(8, 2)
};
const std::multimap<int, double> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.cbegin(), m.cend()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
- assert(std::distance(m.crbegin(), m.crend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.cbegin(), m.cend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.crbegin(), m.crend())) == m.size());
std::multimap<int, double>::const_iterator i;
i = m.begin();
for (int j = 1; j <= 8; ++j)
@@ -152,8 +154,8 @@ int main()
V(8, 2)
};
std::multimap<int, double, std::less<int>, min_allocator<V>> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
std::multimap<int, double, std::less<int>, min_allocator<V>>::iterator i;
i = m.begin();
std::multimap<int, double, std::less<int>, min_allocator<V>>::const_iterator k = i;
@@ -197,10 +199,10 @@ int main()
V(8, 2)
};
const std::multimap<int, double, std::less<int>, min_allocator<V>> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.cbegin(), m.cend()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
- assert(std::distance(m.crbegin(), m.crend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.cbegin(), m.cend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.crbegin(), m.crend())) == m.size());
std::multimap<int, double, std::less<int>, min_allocator<V>>::const_iterator i;
i = m.begin();
for (int j = 1; j <= 8; ++j)
@@ -211,7 +213,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::multimap<int, double> C;
C::iterator ii1{}, ii2{};
diff --git a/test/std/containers/associative/multimap/max_size.pass.cpp b/test/std/containers/associative/multimap/max_size.pass.cpp
index b7cf226d8f13..8d5ec1148a22 100644
--- a/test/std/containers/associative/multimap/max_size.pass.cpp
+++ b/test/std/containers/associative/multimap/max_size.pass.cpp
@@ -13,23 +13,39 @@
// size_type max_size() const;
-#include <map>
#include <cassert>
+#include <limits>
+#include <map>
+#include <type_traits>
-#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
int main()
{
- {
- typedef std::multimap<int, double> M;
- M m;
- assert(m.max_size() != 0);
+ typedef std::pair<const int, int> KV;
+ {
+ typedef limited_allocator<KV, 10> A;
+ typedef std::multimap<int, int, std::less<int>, A> C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<KV, (size_t)-1> A;
+ typedef std::multimap<int, int, std::less<int>, A> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
}
-#if TEST_STD_VER >= 11
{
- typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> M;
- M m;
- assert(m.max_size() != 0);
+ typedef std::multimap<char, int> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
}
-#endif
}
diff --git a/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp b/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp
index e6f6c3efee5b..3d33f721a56d 100644
--- a/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp
@@ -9,7 +9,7 @@
// <map>
-// Check that std::multimap fails to instantiate if the comparison predicate is
+// Check that std::multimap fails to instantiate if the comparison predicate is
// not copy-constructible. This is LWG issue 2436
#include <map>
diff --git a/test/std/containers/associative/multimap/multimap.cons/copy.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/copy.pass.cpp
index 97dcf39e10c9..b7f5c66ad93d 100644
--- a/test/std/containers/associative/multimap/multimap.cons/copy.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/copy.pass.cpp
@@ -16,6 +16,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -47,7 +48,7 @@ int main()
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
typedef std::pair<const int, double> V;
V ar[] =
@@ -73,8 +74,6 @@ int main()
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if TEST_STD_VER >= 11
{
typedef std::pair<const int, double> V;
V ar[] =
diff --git a/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
index 3a240cd48af3..669d23db57cd 100644
--- a/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -44,6 +45,6 @@ int main()
}
{
typedef std::multimap<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/associative/multimap/multimap.cons/iter_iter.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/iter_iter.pass.cpp
index 46c56aa0b3ff..de6d97dbc728 100644
--- a/test/std/containers/associative/multimap/multimap.cons/iter_iter.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/iter_iter.pass.cpp
@@ -17,6 +17,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -76,7 +77,7 @@ int main()
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
V ar[] =
diff --git a/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
index 890cac867f9e..7637885c81e1 100644
--- a/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
@@ -22,6 +22,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -46,7 +47,7 @@ int main()
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
diff --git a/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
index 8932b4f83d48..e42251527eb3 100644
--- a/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
@@ -20,6 +20,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -36,15 +37,15 @@ int main()
typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
diff --git a/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp
index 92f90f551d44..7fb2a90a5f9f 100644
--- a/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/count.pass.cpp
@@ -16,6 +16,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
@@ -92,7 +93,7 @@ int main()
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::multimap<int, double, std::less<>> M;
typedef M::size_type R;
diff --git a/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
index d0f3f1c0fdb7..70464b12c741 100644
--- a/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -34,4 +35,4 @@ int main()
M().count(C2Int{5});
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
index 86d492f7f5e0..ad15ff441d74 100644
--- a/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -34,4 +35,4 @@ int main()
M().count(C2Int{5});
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
index 55095efb3d6a..5e6c9ab6f967 100644
--- a/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -34,4 +35,4 @@ int main()
M().count(C2Int{5});
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
index 31eac26816ac..df46d376e028 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
@@ -17,6 +17,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
@@ -180,7 +181,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
index f793bf8859ba..a339467f7390 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -34,4 +35,4 @@ int main()
M().equal_range(C2Int{5});
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp
index d099a8c81a1b..633e0615bef0 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().equal_range(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp
index e53fff942793..34b1b4b77fbe 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().equal_range(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
index 2fd8c05b5f5e..f5295e52d192 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
@@ -17,6 +17,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
@@ -144,7 +145,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
diff --git a/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp
index 2759af46be14..bc3593292be2 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().find(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp
index c67f3b39dabd..254f524afd5b 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().find(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp
index e53fc4d55887..2805f47598f6 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
@@ -36,4 +37,4 @@ int main()
M().find(C2Int{5});
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
index 5c0315f956a8..8a650fa55975 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
@@ -17,6 +17,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
@@ -152,7 +153,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp
index 9b39573a5f42..4b0db47872af 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp
index 68710bd1bc38..300364cffa25 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp
index f254ef4785a1..09963096fdfa 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
index 012354cef7bb..05760dc0e751 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
@@ -17,6 +17,7 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
@@ -152,7 +153,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp
index d47d7bfc89f4..10e59c5e580e 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp
index a3da9d82c95c..81ebbb832c06 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp
index 6ffdb206cc30..fe41315247ea 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp
@@ -22,9 +22,10 @@
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
diff --git a/test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp b/test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp
index a075919bba9a..cef658bab549 100644
--- a/test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.special/non_member_swap.pass.cpp
@@ -121,17 +121,17 @@ int main()
V(11, 11),
V(12, 12)
};
- M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1));
- M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(2));
+ M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1, 1));
+ M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(1, 2));
M m1_save = m1;
M m2_save = m2;
swap(m1, m2);
assert(m1 == m2_save);
assert(m2 == m1_save);
assert(m1.key_comp() == C(2));
- assert(m1.get_allocator() == A(1));
+ assert(m1.get_allocator().get_id() == 1);
assert(m2.key_comp() == C(1));
- assert(m2.get_allocator() == A(2));
+ assert(m2.get_allocator().get_id() == 2);
}
{
typedef other_allocator<V> A;
diff --git a/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp b/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
index ffc71b0eeb92..ecc9c7ef5fd4 100644
--- a/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
@@ -22,6 +22,7 @@
// This tests a conforming extension
#include <map>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -96,51 +97,42 @@ int main()
typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::multimap<MoveOnly, MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for comp
typedef std::multimap<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc <V>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for comp
typedef std::multimap<MoveOnly, MoveOnly, some_comp <MoveOnly>, some_alloc2<V>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for comp
typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc <V>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for comp
typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc2<V>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // NOT always equal allocator, nothrow swap for comp
- typedef std::map<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<V>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ typedef std::multimap<MoveOnly, MoveOnly, some_comp2<MoveOnly>, some_alloc3<V>> C;
+ LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
}
diff --git a/test/std/containers/associative/multiset/count.pass.cpp b/test/std/containers/associative/multiset/count.pass.cpp
index 997a949388cf..863da792a2f0 100644
--- a/test/std/containers/associative/multiset/count.pass.cpp
+++ b/test/std/containers/associative/multiset/count.pass.cpp
@@ -16,6 +16,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -91,7 +92,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::multiset<int, std::less<>> M;
diff --git a/test/std/containers/associative/multiset/equal_range.pass.cpp b/test/std/containers/associative/multiset/equal_range.pass.cpp
index 7ab95cfb8f67..1a3beebcf66b 100644
--- a/test/std/containers/associative/multiset/equal_range.pass.cpp
+++ b/test/std/containers/associative/multiset/equal_range.pass.cpp
@@ -17,6 +17,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -180,7 +181,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::multiset<V, std::less<>> M;
diff --git a/test/std/containers/associative/multiset/find.pass.cpp b/test/std/containers/associative/multiset/find.pass.cpp
index 3b7d96fe9110..e20f4f8cedf9 100644
--- a/test/std/containers/associative/multiset/find.pass.cpp
+++ b/test/std/containers/associative/multiset/find.pass.cpp
@@ -17,6 +17,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -164,7 +165,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::multiset<V, std::less<>> M;
diff --git a/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp b/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp
index 7b82cea5fbea..590c66801f99 100644
--- a/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp
+++ b/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp
@@ -15,6 +15,7 @@
#include <set>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -27,7 +28,7 @@ int main()
C m = {10, 8};
m.insert({1, 2, 3, 4, 5, 6});
assert(m.size() == 8);
- assert(distance(m.begin(), m.end()) == m.size());
+ assert(static_cast<std::size_t>(distance(m.begin(), m.end())) == m.size());
C::const_iterator i = m.cbegin();
assert(*i == V(1));
assert(*++i == V(2));
@@ -46,7 +47,7 @@ int main()
C m = {10, 8};
m.insert({1, 2, 3, 4, 5, 6});
assert(m.size() == 8);
- assert(distance(m.begin(), m.end()) == m.size());
+ assert(static_cast<std::size_t>(distance(m.begin(), m.end())) == m.size());
C::const_iterator i = m.cbegin();
assert(*i == V(1));
assert(*++i == V(2));
diff --git a/test/std/containers/associative/multiset/iterator.pass.cpp b/test/std/containers/associative/multiset/iterator.pass.cpp
index c152a4398196..ec17689f29b4 100644
--- a/test/std/containers/associative/multiset/iterator.pass.cpp
+++ b/test/std/containers/associative/multiset/iterator.pass.cpp
@@ -28,7 +28,9 @@
#include <set>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -63,8 +65,8 @@ int main()
8
};
std::multiset<int> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
std::multiset<int>::iterator i;
i = m.begin();
std::multiset<int>::const_iterator k = i;
@@ -103,10 +105,10 @@ int main()
8
};
const std::multiset<int> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.cbegin(), m.cend()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
- assert(std::distance(m.crbegin(), m.crend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.cbegin(), m.cend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.crbegin(), m.crend())) == m.size());
std::multiset<int>::const_iterator i;
i = m.begin();
for (int j = 1; j <= 8; ++j)
@@ -144,8 +146,8 @@ int main()
8
};
std::multiset<int, std::less<int>, min_allocator<int>> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
std::multiset<int, std::less<int>, min_allocator<int>>::iterator i;
i = m.begin();
std::multiset<int, std::less<int>, min_allocator<int>>::const_iterator k = i;
@@ -184,10 +186,10 @@ int main()
8
};
const std::multiset<int, std::less<int>, min_allocator<int>> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.cbegin(), m.cend()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
- assert(std::distance(m.crbegin(), m.crend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.cbegin(), m.cend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.crbegin(), m.crend())) == m.size());
std::multiset<int, std::less<int>, min_allocator<int>>::const_iterator i;
i = m.begin();
for (int j = 1; j <= 8; ++j)
@@ -195,7 +197,7 @@ int main()
assert(*i == j);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::multiset<int> C;
C::iterator ii1{}, ii2{};
diff --git a/test/std/containers/associative/multiset/lower_bound.pass.cpp b/test/std/containers/associative/multiset/lower_bound.pass.cpp
index ae8cfe6eff4d..f5ce8e533f17 100644
--- a/test/std/containers/associative/multiset/lower_bound.pass.cpp
+++ b/test/std/containers/associative/multiset/lower_bound.pass.cpp
@@ -17,6 +17,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -152,7 +153,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::multiset<V, std::less<>> M;
diff --git a/test/std/containers/associative/multiset/max_size.pass.cpp b/test/std/containers/associative/multiset/max_size.pass.cpp
index 79492c9b1c40..8ca34ba82739 100644
--- a/test/std/containers/associative/multiset/max_size.pass.cpp
+++ b/test/std/containers/associative/multiset/max_size.pass.cpp
@@ -13,23 +13,38 @@
// size_type max_size() const;
-#include <set>
#include <cassert>
+#include <limits>
+#include <set>
+#include <type_traits>
-#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
int main()
{
{
- typedef std::multiset<int> M;
- M m;
- assert(m.max_size() != 0);
+ typedef limited_allocator<int, 10> A;
+ typedef std::multiset<int, std::less<int>, A> C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<int, (size_t)-1> A;
+ typedef std::multiset<int, std::less<int>, A> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
}
-#if TEST_STD_VER >= 11
{
- typedef std::multiset<int, std::less<int>, min_allocator<int>> M;
- M m;
- assert(m.max_size() != 0);
+ typedef std::multiset<char> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
}
-#endif
}
diff --git a/test/std/containers/associative/multiset/multiset.cons/compare_copy_constructible.fail.cpp b/test/std/containers/associative/multiset/multiset.cons/compare_copy_constructible.fail.cpp
index 2eade5299d6f..9287a035becb 100644
--- a/test/std/containers/associative/multiset/multiset.cons/compare_copy_constructible.fail.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/compare_copy_constructible.fail.cpp
@@ -9,7 +9,7 @@
// <set>
-// Check that std::multiset fails to instantiate if the comparison predicate is
+// Check that std::multiset fails to instantiate if the comparison predicate is
// not copy-constructible. This is LWG issue 2436
#include <set>
diff --git a/test/std/containers/associative/multiset/multiset.cons/copy.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/copy.pass.cpp
index dde362872109..6349dde1e81a 100644
--- a/test/std/containers/associative/multiset/multiset.cons/copy.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/copy.pass.cpp
@@ -16,6 +16,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
@@ -67,7 +68,7 @@ int main()
assert(*next(mo.begin(), 7) == 3);
assert(*next(mo.begin(), 8) == 3);
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
typedef int V;
V ar[] =
@@ -114,5 +115,5 @@ int main()
assert(*next(mo.begin(), 7) == 3);
assert(*next(mo.begin(), 8) == 3);
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif
}
diff --git a/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
index f4e868ebbc8f..b4b9d067704b 100644
--- a/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,6 +44,6 @@ int main()
}
{
typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp
index 7327bf62646b..b3d6066ebeb3 100644
--- a/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp
@@ -16,6 +16,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -51,7 +52,7 @@ int main()
assert(*++i == V(5));
assert(*++i == V(6));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
typedef C::value_type V;
diff --git a/test/std/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp
index 4313f46a03d7..8a6cf4541e2e 100644
--- a/test/std/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp
@@ -18,6 +18,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
@@ -57,7 +58,7 @@ int main()
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
V ar[] =
diff --git a/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp
index 57388637e97a..bae97cf4e48a 100644
--- a/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp
@@ -22,6 +22,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -45,7 +46,7 @@ int main()
}
{
typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;
diff --git a/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp
index e3a7beedb92b..69759e03a28a 100644
--- a/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp
@@ -20,6 +20,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -35,15 +36,15 @@ int main()
{
{
typedef std::multiset<MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;
diff --git a/test/std/containers/associative/multiset/multiset.special/non_member_swap.pass.cpp b/test/std/containers/associative/multiset/multiset.special/non_member_swap.pass.cpp
index 91ec4ce93a27..faa0818cfb0e 100644
--- a/test/std/containers/associative/multiset/multiset.special/non_member_swap.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.special/non_member_swap.pass.cpp
@@ -118,17 +118,17 @@ int main()
11,
12
};
- M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1));
- M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(2));
+ M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1, 1));
+ M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(1, 2));
M m1_save = m1;
M m2_save = m2;
swap(m1, m2);
assert(m1 == m2_save);
assert(m2 == m1_save);
assert(m1.key_comp() == C(2));
- assert(m1.get_allocator() == A(1));
+ assert(m1.get_allocator().get_id() == 1);
assert(m2.key_comp() == C(1));
- assert(m2.get_allocator() == A(2));
+ assert(m2.get_allocator().get_id() == 2);
}
{
typedef other_allocator<V> A;
diff --git a/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp b/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
index 87639943a0b5..89fabef0a3a0 100644
--- a/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
@@ -22,6 +22,7 @@
// This tests a conforming extension
#include <set>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -95,51 +96,42 @@ int main()
{
{
typedef std::multiset<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for comp
typedef std::multiset<MoveOnly, some_comp <MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for comp
typedef std::multiset<MoveOnly, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for comp
typedef std::multiset<MoveOnly, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for comp
typedef std::multiset<MoveOnly, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // NOT always equal allocator, nothrow swap for comp
typedef std::multiset<MoveOnly, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
}
diff --git a/test/std/containers/associative/multiset/upper_bound.pass.cpp b/test/std/containers/associative/multiset/upper_bound.pass.cpp
index 7bb0c3cb41f3..8bd00e2f3705 100644
--- a/test/std/containers/associative/multiset/upper_bound.pass.cpp
+++ b/test/std/containers/associative/multiset/upper_bound.pass.cpp
@@ -17,6 +17,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -152,7 +153,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::multiset<V, std::less<>> M;
diff --git a/test/std/containers/associative/set/count.pass.cpp b/test/std/containers/associative/set/count.pass.cpp
index ddc913910b5e..115b4fbc27fd 100644
--- a/test/std/containers/associative/set/count.pass.cpp
+++ b/test/std/containers/associative/set/count.pass.cpp
@@ -16,6 +16,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -93,7 +94,7 @@ int main()
assert(r == 0);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::set<int, std::less<>> M;
@@ -144,23 +145,25 @@ int main()
m.insert ( V::make ( 11 ));
m.insert ( V::make ( 12 ));
- R r = m.count(5);
+ const M& mc = m;
+
+ R r = mc.count(5);
assert(r == 1);
- r = m.count(6);
+ r = mc.count(6);
assert(r == 1);
- r = m.count(7);
+ r = mc.count(7);
assert(r == 1);
- r = m.count(8);
+ r = mc.count(8);
assert(r == 1);
- r = m.count(9);
+ r = mc.count(9);
assert(r == 1);
- r = m.count(10);
+ r = mc.count(10);
assert(r == 1);
- r = m.count(11);
+ r = mc.count(11);
assert(r == 1);
- r = m.count(12);
+ r = mc.count(12);
assert(r == 1);
- r = m.count(4);
+ r = mc.count(4);
assert(r == 0);
}
#endif
diff --git a/test/std/containers/associative/set/equal_range.pass.cpp b/test/std/containers/associative/set/equal_range.pass.cpp
index ed41f691a459..53fe895bdc73 100644
--- a/test/std/containers/associative/set/equal_range.pass.cpp
+++ b/test/std/containers/associative/set/equal_range.pass.cpp
@@ -17,6 +17,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -228,7 +229,7 @@ int main()
assert(r.second == next(m.begin(), 8));
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::set<V, std::less<>> M;
diff --git a/test/std/containers/associative/set/find.pass.cpp b/test/std/containers/associative/set/find.pass.cpp
index 60f16fcd65d4..fa1e547404bc 100644
--- a/test/std/containers/associative/set/find.pass.cpp
+++ b/test/std/containers/associative/set/find.pass.cpp
@@ -17,6 +17,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -164,7 +165,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::set<V, std::less<>> M;
diff --git a/test/std/containers/associative/set/insert_initializer_list.pass.cpp b/test/std/containers/associative/set/insert_initializer_list.pass.cpp
index 60a6e754e17e..490d75905adc 100644
--- a/test/std/containers/associative/set/insert_initializer_list.pass.cpp
+++ b/test/std/containers/associative/set/insert_initializer_list.pass.cpp
@@ -15,6 +15,7 @@
#include <set>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -27,7 +28,7 @@ int main()
C m = {10, 8};
m.insert({1, 2, 3, 4, 5, 6});
assert(m.size() == 8);
- assert(distance(m.begin(), m.end()) == m.size());
+ assert(static_cast<std::size_t>(distance(m.begin(), m.end())) == m.size());
C::const_iterator i = m.cbegin();
assert(*i == V(1));
assert(*++i == V(2));
@@ -45,7 +46,7 @@ int main()
C m = {10, 8};
m.insert({1, 2, 3, 4, 5, 6});
assert(m.size() == 8);
- assert(distance(m.begin(), m.end()) == m.size());
+ assert(static_cast<std::size_t>(distance(m.begin(), m.end())) == m.size());
C::const_iterator i = m.cbegin();
assert(*i == V(1));
assert(*++i == V(2));
diff --git a/test/std/containers/associative/set/iterator.pass.cpp b/test/std/containers/associative/set/iterator.pass.cpp
index c318341ce859..be0a1578d2c5 100644
--- a/test/std/containers/associative/set/iterator.pass.cpp
+++ b/test/std/containers/associative/set/iterator.pass.cpp
@@ -28,7 +28,9 @@
#include <set>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -63,13 +65,13 @@ int main()
8
};
std::set<int> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
std::set<int>::iterator i;
i = m.begin();
std::set<int>::const_iterator k = i;
assert(i == k);
- for (int j = 1; j <= m.size(); ++j, ++i)
+ for (int j = 1; static_cast<std::size_t>(j) <= m.size(); ++j, ++i)
assert(*i == j);
}
{
@@ -102,13 +104,13 @@ int main()
8
};
const std::set<int> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.cbegin(), m.cend()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
- assert(std::distance(m.crbegin(), m.crend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.cbegin(), m.cend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.crbegin(), m.crend())) == m.size());
std::set<int>::const_iterator i;
i = m.begin();
- for (int j = 1; j <= m.size(); ++j, ++i)
+ for (int j = 1; static_cast<std::size_t>(j) <= m.size(); ++j, ++i)
assert(*i == j);
}
#if TEST_STD_VER >= 11
@@ -142,13 +144,13 @@ int main()
8
};
std::set<int, std::less<int>, min_allocator<int>> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
std::set<int, std::less<int>, min_allocator<int>>::iterator i;
i = m.begin();
std::set<int, std::less<int>, min_allocator<int>>::const_iterator k = i;
assert(i == k);
- for (int j = 1; j <= m.size(); ++j, ++i)
+ for (int j = 1; static_cast<std::size_t>(j) <= m.size(); ++j, ++i)
assert(*i == j);
}
{
@@ -181,17 +183,17 @@ int main()
8
};
const std::set<int, std::less<int>, min_allocator<int>> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.cbegin(), m.cend()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
- assert(std::distance(m.crbegin(), m.crend()) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.cbegin(), m.cend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.rbegin(), m.rend())) == m.size());
+ assert(static_cast<std::size_t>(std::distance(m.crbegin(), m.crend())) == m.size());
std::set<int, std::less<int>, min_allocator<int>>::const_iterator i;
i = m.begin();
- for (int j = 1; j <= m.size(); ++j, ++i)
+ for (int j = 1; static_cast<std::size_t>(j) <= m.size(); ++j, ++i)
assert(*i == j);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::set<int> C;
C::iterator ii1{}, ii2{};
diff --git a/test/std/containers/associative/set/lower_bound.pass.cpp b/test/std/containers/associative/set/lower_bound.pass.cpp
index 55d49a097ef6..8dfe537b2f70 100644
--- a/test/std/containers/associative/set/lower_bound.pass.cpp
+++ b/test/std/containers/associative/set/lower_bound.pass.cpp
@@ -17,6 +17,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -228,7 +229,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::set<V, std::less<>> M;
diff --git a/test/std/containers/associative/set/max_size.pass.cpp b/test/std/containers/associative/set/max_size.pass.cpp
index 9df6a4157e11..c894eb51b1ee 100644
--- a/test/std/containers/associative/set/max_size.pass.cpp
+++ b/test/std/containers/associative/set/max_size.pass.cpp
@@ -13,23 +13,38 @@
// size_type max_size() const;
-#include <set>
#include <cassert>
+#include <limits>
+#include <set>
+#include <type_traits>
-#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
int main()
{
{
- typedef std::set<int> M;
- M m;
- assert(m.max_size() != 0);
+ typedef limited_allocator<int, 10> A;
+ typedef std::set<int, std::less<int>, A> C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<int, (size_t)-1> A;
+ typedef std::set<int, std::less<int>, A> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
}
-#if TEST_STD_VER >= 11
{
- typedef std::set<int, std::less<int>, min_allocator<int>> M;
- M m;
- assert(m.max_size() != 0);
+ typedef std::set<char> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
}
-#endif
}
diff --git a/test/std/containers/associative/set/set.cons/compare_copy_constructible.fail.cpp b/test/std/containers/associative/set/set.cons/compare_copy_constructible.fail.cpp
index dcf23effc443..858ee4161f03 100644
--- a/test/std/containers/associative/set/set.cons/compare_copy_constructible.fail.cpp
+++ b/test/std/containers/associative/set/set.cons/compare_copy_constructible.fail.cpp
@@ -9,7 +9,7 @@
// <set>
-// Check that std::set fails to instantiate if the comparison predicate is
+// Check that std::set fails to instantiate if the comparison predicate is
// not copy-constructible. This is LWG issue 2436
#include <set>
diff --git a/test/std/containers/associative/set/set.cons/copy.pass.cpp b/test/std/containers/associative/set/set.cons/copy.pass.cpp
index a0e34e48de43..7bd6342fcc6c 100644
--- a/test/std/containers/associative/set/set.cons/copy.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/copy.pass.cpp
@@ -16,6 +16,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
@@ -55,7 +56,7 @@ int main()
assert(*next(mo.begin()) == 2);
assert(*next(mo.begin(), 2) == 3);
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
typedef int V;
V ar[] =
@@ -90,5 +91,5 @@ int main()
assert(*next(mo.begin()) == 2);
assert(*next(mo.begin(), 2) == 3);
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif
}
diff --git a/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp b/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
index 60d1d42c3d9c..041f599c1f76 100644
--- a/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,6 +44,6 @@ int main()
}
{
typedef std::set<MoveOnly, some_comp<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp b/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp
index 821820a1e0ce..80d41b0b5df7 100644
--- a/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp
@@ -16,6 +16,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
@@ -40,7 +41,7 @@ int main()
assert(m.key_comp() == Cmp(10));
assert(m.get_allocator() == A(4));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef test_compare<std::less<int> > Cmp;
typedef test_allocator<int> A;
diff --git a/test/std/containers/associative/set/set.cons/iter_iter_alloc.pass.cpp b/test/std/containers/associative/set/set.cons/iter_iter_alloc.pass.cpp
index 077a749caaca..13eccbe2a1c3 100644
--- a/test/std/containers/associative/set/set.cons/iter_iter_alloc.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/iter_iter_alloc.pass.cpp
@@ -22,6 +22,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
@@ -55,7 +56,7 @@ int main()
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
V ar[] =
diff --git a/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp b/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp
index 3f7d783b7630..ce44b69fe336 100644
--- a/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp
@@ -22,6 +22,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -45,7 +46,7 @@ int main()
}
{
typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::set<MoveOnly, some_comp<MoveOnly>> C;
diff --git a/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp b/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp
index 72c2f7530a9e..9a7538ca31bd 100644
--- a/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp
@@ -20,6 +20,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -35,15 +36,15 @@ int main()
{
{
typedef std::set<MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::set<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::set<MoveOnly, some_comp<MoveOnly>> C;
diff --git a/test/std/containers/associative/set/set.special/non_member_swap.pass.cpp b/test/std/containers/associative/set/set.special/non_member_swap.pass.cpp
index 3d2d7d7d3bbc..0af481870503 100644
--- a/test/std/containers/associative/set/set.special/non_member_swap.pass.cpp
+++ b/test/std/containers/associative/set/set.special/non_member_swap.pass.cpp
@@ -118,17 +118,17 @@ int main()
11,
12
};
- M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1));
- M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(2));
+ M m1(ar1, ar1+sizeof(ar1)/sizeof(ar1[0]), C(1), A(1, 1));
+ M m2(ar2, ar2+sizeof(ar2)/sizeof(ar2[0]), C(2), A(1, 2));
M m1_save = m1;
M m2_save = m2;
swap(m1, m2);
assert(m1 == m2_save);
assert(m2 == m1_save);
assert(m1.key_comp() == C(2));
- assert(m1.get_allocator() == A(1));
+ assert(m1.get_allocator().get_id() == 1);
assert(m2.key_comp() == C(1));
- assert(m2.get_allocator() == A(2));
+ assert(m2.get_allocator().get_id() == 2);
}
{
typedef other_allocator<V> A;
diff --git a/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp b/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp
index 0eb7d871b8b4..b3edd31f749b 100644
--- a/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp
@@ -22,6 +22,7 @@
// This tests a conforming extension
#include <set>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -95,51 +96,42 @@ int main()
{
{
typedef std::set<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::set<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::set<MoveOnly, some_comp<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for comp
typedef std::set<MoveOnly, some_comp <MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for comp
typedef std::set<MoveOnly, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for comp
typedef std::set<MoveOnly, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for comp
typedef std::set<MoveOnly, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // NOT always equal allocator, nothrow swap for comp
typedef std::set<MoveOnly, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
diff --git a/test/std/containers/associative/set/upper_bound.pass.cpp b/test/std/containers/associative/set/upper_bound.pass.cpp
index 9d4ab2805d0d..bafb4377f714 100644
--- a/test/std/containers/associative/set/upper_bound.pass.cpp
+++ b/test/std/containers/associative/set/upper_bound.pass.cpp
@@ -17,6 +17,7 @@
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
@@ -228,7 +229,7 @@ int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::set<V, std::less<>> M;
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp.pass.cpp
index f543b6379f15..f435ac3066f4 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp.pass.cpp
@@ -14,11 +14,11 @@
#include <queue>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
int main()
{
- std::priority_queue<int, std::vector<int, stack_allocator<int, 10> > > q((std::less<int>()));
+ std::priority_queue<int, std::vector<int, limited_allocator<int, 10> > > q((std::less<int>()));
assert(q.size() == 0);
q.push(1);
q.push(2);
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_default.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_default.pass.cpp
index 2bffe80ae11b..5125a433652c 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_default.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_default.pass.cpp
@@ -14,11 +14,11 @@
#include <queue>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
int main()
{
- std::priority_queue<int, std::vector<int, stack_allocator<int, 10> > > q;
+ std::priority_queue<int, std::vector<int, limited_allocator<int, 10> > > q;
assert(q.size() == 0);
q.push(1);
q.push(2);
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter.pass.cpp
index 1aaa8a3c6593..b3cd33549d7a 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter.pass.cpp
@@ -14,12 +14,13 @@
#include <queue>
#include <cassert>
+#include <cstddef>
int main()
{
int a[] = {3, 5, 2, 0, 6, 8, 1};
int* an = a + sizeof(a)/sizeof(a[0]);
std::priority_queue<int> q(a, an);
- assert(q.size() == an - a);
+ assert(q.size() == static_cast<std::size_t>(an - a));
assert(q.top() == 8);
}
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp.pass.cpp
index 17a698c15dff..360f66393e89 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp.pass.cpp
@@ -15,6 +15,7 @@
#include <queue>
#include <cassert>
#include <functional>
+#include <cstddef>
int main()
{
@@ -22,6 +23,6 @@ int main()
int* an = a + sizeof(a)/sizeof(a[0]);
std::priority_queue<int, std::vector<int>, std::greater<int> >
q(a, an, std::greater<int>());
- assert(q.size() == an - a);
+ assert(q.size() == static_cast<std::size_t>(an - a));
assert(q.top() == 0);
}
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp
index bfff607590fe..845ca758769d 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.special/swap_noexcept.pass.cpp
@@ -18,6 +18,7 @@
// UNSUPPORTED: c++98, c++03
#include <queue>
+#include <utility>
#include <cassert>
#include "MoveOnly.h"
@@ -26,7 +27,6 @@ int main()
{
{
typedef std::priority_queue<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
}
diff --git a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
index 16ba1747dd8a..e4fff91f07c7 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
@@ -14,6 +14,7 @@
#include <queue>
#include <cassert>
+#include <cstddef>
#include "test_allocator.h"
@@ -49,7 +50,7 @@ int main()
test q(d, test_allocator<int>(4));
assert(q.get_allocator() == test_allocator<int>(4));
assert(q.size() == 5);
- for (int i = 0; i < d.size(); ++i)
+ for (C::size_type i = 0; i < d.size(); ++i)
{
assert(q.front() == d[i]);
q.pop();
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/ctor_container.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/ctor_container.pass.cpp
index c4ab955c311b..6832a5f8b84a 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/ctor_container.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/ctor_container.pass.cpp
@@ -13,6 +13,7 @@
#include <queue>
#include <cassert>
+#include <cstddef>
template <class C>
C
@@ -29,7 +30,7 @@ int main()
std::deque<int> d = make<std::deque<int> >(5);
std::queue<int> q(d);
assert(q.size() == 5);
- for (int i = 0; i < d.size(); ++i)
+ for (std::size_t i = 0; i < d.size(); ++i)
{
assert(q.front() == d[i]);
q.pop();
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/ctor_default.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/ctor_default.pass.cpp
index e6aadd39dd9b..f4b69223695e 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/ctor_default.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/ctor_default.pass.cpp
@@ -14,11 +14,11 @@
#include <queue>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
int main()
{
- std::queue<int, std::vector<int, stack_allocator<int, 10> > > q;
+ std::queue<int, std::vector<int, limited_allocator<int, 10> > > q;
assert(q.size() == 0);
q.push(1);
q.push(2);
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
index 1c13b622c0a5..c8becb3ca98a 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
@@ -19,12 +19,13 @@
#include <queue>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
int main()
{
{
typedef std::queue<MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
}
diff --git a/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp b/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp
index 1d9c08b156b7..77d822a0794d 100644
--- a/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp
@@ -7,9 +7,11 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <queue>
-// template <class... Args> void emplace(Args&&... args);
+// template <class... Args> reference emplace(Args&&... args);
#include <queue>
#include <cassert>
@@ -18,13 +20,17 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ typedef Emplaceable T;
std::queue<Emplaceable> q;
- q.emplace(1, 2.5);
- q.emplace(2, 3.5);
- q.emplace(3, 4.5);
+ T& r1 = q.emplace(1, 2.5);
+ assert(&r1 == &q.back());
+ T& r2 = q.emplace(2, 3.5);
+ assert(&r2 == &q.back());
+ T& r3 = q.emplace(3, 4.5);
+ assert(&r3 == &q.back());
assert(q.size() == 3);
assert(q.front() == Emplaceable(1, 2.5));
assert(q.back() == Emplaceable(3, 4.5));
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ assert(&r3 == &q.back());
+ assert(&r1 == &q.front());
}
diff --git a/test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp
index e18f80a91198..542b4901173c 100644
--- a/test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.special/swap_noexcept.pass.cpp
@@ -17,6 +17,7 @@
// UNSUPPORTED: c++98, c++03
#include <queue>
+#include <utility>
#include <cassert>
#include "MoveOnly.h"
@@ -25,7 +26,6 @@ int main()
{
{
typedef std::queue<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
}
diff --git a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
index fe8622751c95..b3cf39207203 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
@@ -14,6 +14,7 @@
#include <stack>
#include <cassert>
+#include <cstddef>
#include "test_allocator.h"
@@ -49,7 +50,7 @@ int main()
test q(d, test_allocator<int>(4));
assert(q.get_allocator() == test_allocator<int>(4));
assert(q.size() == 5);
- for (int i = 0; i < d.size(); ++i)
+ for (C::size_type i = 0; i < d.size(); ++i)
{
assert(q.top() == d[d.size() - i - 1]);
q.pop();
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/ctor_container.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/ctor_container.pass.cpp
index 9dc05013e3dd..7ae12dd709d9 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/ctor_container.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/ctor_container.pass.cpp
@@ -13,6 +13,7 @@
#include <stack>
#include <cassert>
+#include <cstddef>
template <class C>
C
@@ -29,7 +30,7 @@ int main()
std::deque<int> d = make<std::deque<int> >(5);
std::stack<int> q(d);
assert(q.size() == 5);
- for (int i = 0; i < d.size(); ++i)
+ for (std::size_t i = 0; i < d.size(); ++i)
{
assert(q.top() == d[d.size() - i - 1]);
q.pop();
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/ctor_default.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/ctor_default.pass.cpp
index 523cd6811893..82e459a4bc84 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/ctor_default.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/ctor_default.pass.cpp
@@ -15,11 +15,11 @@
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
int main()
{
- std::stack<int, std::vector<int, stack_allocator<int, 10> > > q;
+ std::stack<int, std::vector<int, limited_allocator<int, 10> > > q;
assert(q.size() == 0);
q.push(1);
q.push(2);
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
index 7eb563c76835..c34b7e07000e 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
@@ -19,12 +19,13 @@
#include <stack>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
int main()
{
{
typedef std::stack<MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
}
diff --git a/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp b/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp
index 3573c220ece9..71fe903b74a8 100644
--- a/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp
@@ -7,9 +7,11 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <stack>
-// template <class... Args> void emplace(Args&&... args);
+// template <class... Args> reference emplace(Args&&... args);
#include <stack>
#include <cassert>
@@ -18,12 +20,14 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ typedef Emplaceable T;
std::stack<Emplaceable> q;
- q.emplace(1, 2.5);
- q.emplace(2, 3.5);
- q.emplace(3, 4.5);
+ T& r1 = q.emplace(1, 2.5);
+ assert(&r1 == &q.top());
+ T& r2 = q.emplace(2, 3.5);
+ assert(&r2 == &q.top());
+ T& r3 = q.emplace(3, 4.5);
+ assert(&r3 == &q.top());
assert(q.size() == 3);
assert(q.top() == Emplaceable(3, 4.5));
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp
index 976e362a0483..12150055394e 100644
--- a/test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.special/swap_noexcept.pass.cpp
@@ -17,6 +17,7 @@
// UNSUPPORTED: c++98, c++03
#include <stack>
+#include <utility>
#include <cassert>
#include "MoveOnly.h"
@@ -25,7 +26,6 @@ int main()
{
{
typedef std::stack<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
}
diff --git a/test/std/containers/sequences/array/array.tuple/get.fail.cpp b/test/std/containers/sequences/array/array.tuple/get.fail.cpp
index 13323dd8e519..45e1d2b46b0f 100644
--- a/test/std/containers/sequences/array/array.tuple/get.fail.cpp
+++ b/test/std/containers/sequences/array/array.tuple/get.fail.cpp
@@ -19,7 +19,6 @@
#include <array>
#include <cassert>
-#include "test_macros.h"
// std::array is explicitly allowed to be initialized with A a = { init-list };.
// Disable the missing braces warning for this reason.
@@ -32,10 +31,6 @@ int main()
typedef std::array<T, 3> C;
C c = {1, 2, 3.5};
std::get<3>(c) = 5.5; // expected-note {{requested here}}
-#if TEST_STD_VER >= 11
// expected-error@array:* {{static_assert failed "Index out of bounds in std::get<> (std::array)"}}
-#else
- // expected-error@array:* {{implicit instantiation of undefined template '__static_assert_test<false>'}}
-#endif
}
}
diff --git a/test/std/containers/sequences/array/at.pass.cpp b/test/std/containers/sequences/array/at.pass.cpp
index 9707beeb3946..29483153d4ab 100644
--- a/test/std/containers/sequences/array/at.pass.cpp
+++ b/test/std/containers/sequences/array/at.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <array>
// reference operator[] (size_type)
@@ -40,8 +39,14 @@ int main()
r2 = 7.5;
assert(c.back() == 7.5);
- try { (void) c.at(3); }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try
+ {
+ (void) c.at(3);
+ assert(false);
+ }
catch (const std::out_of_range &) {}
+#endif
}
{
typedef double T;
@@ -53,8 +58,14 @@ int main()
C::const_reference r2 = c.at(2);
assert(r2 == 3.5);
- try { (void) c.at(3); }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try
+ {
+ (void) c.at(3);
+ assert(false);
+ }
catch (const std::out_of_range &) {}
+#endif
}
#if TEST_STD_VER > 11
diff --git a/test/std/containers/sequences/array/iterators.pass.cpp b/test/std/containers/sequences/array/iterators.pass.cpp
index 233e9328c4ed..1f9904e1fa71 100644
--- a/test/std/containers/sequences/array/iterators.pass.cpp
+++ b/test/std/containers/sequences/array/iterators.pass.cpp
@@ -15,6 +15,8 @@
#include <iterator>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -36,7 +38,7 @@ int main()
assert(i == j);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
{
typedef std::array<int, 5> C;
diff --git a/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp b/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
index a6a8e7424b25..6f3458a63d19 100644
--- a/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
@@ -52,18 +52,18 @@ int main()
{
{
std::deque<int> c = make<std::deque<int> >(10);
- for (unsigned i = 0; i < 10; ++i)
+ for (int i = 0; i < 10; ++i)
assert(c[i] == i);
- for (unsigned i = 0; i < 10; ++i)
+ for (int i = 0; i < 10; ++i)
assert(c.at(i) == i);
assert(c.front() == 0);
assert(c.back() == 9);
}
{
const std::deque<int> c = make<std::deque<int> >(10);
- for (unsigned i = 0; i < 10; ++i)
+ for (int i = 0; i < 10; ++i)
assert(c[i] == i);
- for (unsigned i = 0; i < 10; ++i)
+ for (int i = 0; i < 10; ++i)
assert(c.at(i) == i);
assert(c.front() == 0);
assert(c.back() == 9);
@@ -71,18 +71,18 @@ int main()
#if TEST_STD_VER >= 11
{
std::deque<int, min_allocator<int>> c = make<std::deque<int, min_allocator<int>> >(10);
- for (unsigned i = 0; i < 10; ++i)
+ for (int i = 0; i < 10; ++i)
assert(c[i] == i);
- for (unsigned i = 0; i < 10; ++i)
+ for (int i = 0; i < 10; ++i)
assert(c.at(i) == i);
assert(c.front() == 0);
assert(c.back() == 9);
}
{
const std::deque<int, min_allocator<int>> c = make<std::deque<int, min_allocator<int>> >(10);
- for (unsigned i = 0; i < 10; ++i)
+ for (int i = 0; i < 10; ++i)
assert(c[i] == i);
- for (unsigned i = 0; i < 10; ++i)
+ for (int i = 0; i < 10; ++i)
assert(c.at(i) == i);
assert(c.front() == 0);
assert(c.back() == 9);
diff --git a/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp b/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
new file mode 100644
index 000000000000..11ce9d2f6899
--- /dev/null
+++ b/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <deque>
+
+// size_type max_size() const;
+
+#include <cassert>
+#include <deque>
+#include <limits>
+#include <type_traits>
+
+#include "test_allocator.h"
+#include "test_macros.h"
+
+int main() {
+ {
+ typedef limited_allocator<int, 10> A;
+ typedef std::deque<int, A> C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<int, (size_t)-1> A;
+ typedef std::deque<int, A> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
+ }
+ {
+ typedef std::deque<char> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
+ }
+}
diff --git a/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp b/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp
index 53c6bd3380a2..330fd40b7229 100644
--- a/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp
@@ -15,6 +15,7 @@
#include <algorithm>
#include <iterator>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "min_allocator.h"
@@ -48,12 +49,12 @@ test(C& c1, int size)
typedef typename C::const_iterator CI;
typename C::size_type c1_osize = c1.size();
c1.resize(size);
- assert(c1.size() == size);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(c1.size() == static_cast<std::size_t>(size));
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
CI i = c1.begin();
- for (int j = 0; j < std::min(c1_osize, c1.size()); ++j, ++i)
+ for (int j = 0; static_cast<std::size_t>(j) < std::min(c1_osize, c1.size()); ++j, ++i)
assert(*i == j);
- for (int j = c1_osize; j < c1.size(); ++j, ++i)
+ for (std::size_t j = c1_osize; j < c1.size(); ++j, ++i)
assert(*i == 0);
}
diff --git a/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp b/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp
index 12af64386bd8..3737e727c7b7 100644
--- a/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp
@@ -15,6 +15,7 @@
#include <algorithm>
#include <iterator>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "min_allocator.h"
@@ -48,12 +49,12 @@ test(C& c1, int size, int x)
typedef typename C::const_iterator CI;
typename C::size_type c1_osize = c1.size();
c1.resize(size, x);
- assert(c1.size() == size);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(c1.size() == static_cast<std::size_t>(size));
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
CI i = c1.begin();
- for (int j = 0; j < std::min(c1_osize, c1.size()); ++j, ++i)
+ for (int j = 0; static_cast<std::size_t>(j) < std::min(c1_osize, c1.size()); ++j, ++i)
assert(*i == j);
- for (int j = c1_osize; j < c1.size(); ++j, ++i)
+ for (std::size_t j = c1_osize; j < c1.size(); ++j, ++i)
assert(*i == x);
}
diff --git a/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp
index 6507f58e1194..f06067786cfd 100644
--- a/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp
@@ -14,6 +14,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
@@ -46,7 +47,7 @@ void
test(C& c1, const C& c2)
{
c1.assign(c2.begin(), c2.end());
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
assert(c1 == c2);
}
@@ -66,7 +67,7 @@ testI(C& c1, const C& c2)
typedef typename C::const_iterator CI;
typedef input_iterator<CI> ICI;
c1.assign(ICI(c2.begin()), ICI(c2.end()));
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
assert(c1 == c2);
}
diff --git a/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp b/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp
index e00e0442d22e..08325b73008c 100644
--- a/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp
@@ -13,6 +13,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
@@ -46,8 +47,8 @@ test(C& c1, int size, int v)
{
typedef typename C::const_iterator CI;
c1.assign(size, v);
- assert(c1.size() == size);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(c1.size() == static_cast<std::size_t>(size));
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
for (CI i = c1.begin(); i != c1.end(); ++i)
assert(*i == v);
}
diff --git a/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp b/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp
index ec73555b9c4f..1840545680d1 100644
--- a/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp
@@ -13,6 +13,8 @@
#include <deque>
#include <cassert>
+
+#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -37,15 +39,13 @@ int main()
assert(v2 == v);
assert(v2.get_allocator() == v.get_allocator());
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
std::deque<int, other_allocator<int> > v(3, 2, other_allocator<int>(5));
std::deque<int, other_allocator<int> > v2 = v;
assert(v2 == v);
assert(v2.get_allocator() == other_allocator<int>(-2));
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if TEST_STD_VER >= 11
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
diff --git a/test/std/containers/sequences/deque/deque.cons/default.pass.cpp b/test/std/containers/sequences/deque/deque.cons/default.pass.cpp
index 7c42d9e7786e..127b08609464 100644
--- a/test/std/containers/sequences/deque/deque.cons/default.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/default.pass.cpp
@@ -14,7 +14,7 @@
#include <deque>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "../../../NotConstructible.h"
#include "min_allocator.h"
@@ -33,7 +33,7 @@ test()
int main()
{
test<int, std::allocator<int> >();
- test<NotConstructible, stack_allocator<NotConstructible, 1> >();
+ test<NotConstructible, limited_allocator<NotConstructible, 1> >();
#if TEST_STD_VER >= 11
test<int, min_allocator<int> >();
test<NotConstructible, min_allocator<NotConstructible> >();
diff --git a/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
index 503e1237e9eb..59955157421d 100644
--- a/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,6 +44,6 @@ int main()
}
{
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp
index 12a7faf686db..87445c5b2b67 100644
--- a/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp
@@ -13,8 +13,9 @@
#include <deque>
#include <cassert>
+#include <cstddef>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "test_iterators.h"
#include "min_allocator.h"
@@ -27,8 +28,8 @@ test(InputIterator f, InputIterator l)
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
C d(f, l);
- assert(d.size() == std::distance(f, l));
- assert(distance(d.begin(), d.end()) == d.size());
+ assert(d.size() == static_cast<std::size_t>(std::distance(f, l)));
+ assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i, ++f)
assert(*i == *f);
}
@@ -41,8 +42,8 @@ test(InputIterator f, InputIterator l)
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
C d(f, l);
- assert(d.size() == std::distance(f, l));
- assert(distance(d.begin(), d.end()) == d.size());
+ assert(d.size() == static_cast<std::size_t>(std::distance(f, l)));
+ assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i, ++f)
assert(*i == *f);
}
@@ -55,7 +56,7 @@ int main()
test(forward_iterator<const int*>(ab), forward_iterator<const int*>(an));
test(bidirectional_iterator<const int*>(ab), bidirectional_iterator<const int*>(an));
test(random_access_iterator<const int*>(ab), random_access_iterator<const int*>(an));
- test<stack_allocator<int, 4096> >(ab, an);
+ test<limited_allocator<int, 4096> >(ab, an);
#if TEST_STD_VER >= 11
test<min_allocator<int> >(ab, an);
#endif
diff --git a/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp
index c8f7759a19d6..54227ebc12d8 100644
--- a/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp
@@ -14,6 +14,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
#include "test_allocator.h"
@@ -28,8 +29,8 @@ test(InputIterator f, InputIterator l, const Allocator& a)
typedef typename C::const_iterator const_iterator;
C d(f, l, a);
assert(d.get_allocator() == a);
- assert(d.size() == std::distance(f, l));
- assert(distance(d.begin(), d.end()) == d.size());
+ assert(d.size() == static_cast<std::size_t>(std::distance(f, l)));
+ assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i, ++f)
assert(*i == *f);
}
diff --git a/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
index cebf76a15a4a..9b813ce342a3 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
@@ -21,6 +21,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,10 +44,10 @@ int main()
}
{
typedef std::deque<MoveOnly, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
- static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_move_assignable<C>::value, "");
}
}
diff --git a/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
index f53e1ba6c807..e0669dc70ca9 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
@@ -19,6 +19,7 @@
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -33,15 +34,15 @@ int main()
{
{
typedef std::deque<MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::deque<MoveOnly, test_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::deque<MoveOnly, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
diff --git a/test/std/containers/sequences/deque/deque.cons/size.pass.cpp b/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
index b3fccf6671c9..64b3d811fdc9 100644
--- a/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
@@ -13,8 +13,10 @@
#include <deque>
#include <cassert>
+#include <cstddef>
-#include "../../../stack_allocator.h"
+#include "test_macros.h"
+#include "test_allocator.h"
#include "DefaultOnly.h"
#include "min_allocator.h"
@@ -22,21 +24,21 @@ template <class T, class Allocator>
void
test2(unsigned n)
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
assert(DefaultOnly::count == 0);
{
C d(n, Allocator());
- assert(DefaultOnly::count == n);
+ assert(static_cast<unsigned>(DefaultOnly::count) == n);
assert(d.size() == n);
- assert(distance(d.begin(), d.end()) == d.size());
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
assert(*i == T());
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
assert(DefaultOnly::count == 0);
+#else
+ ((void)n);
#endif
}
@@ -49,13 +51,13 @@ test1(unsigned n)
assert(DefaultOnly::count == 0);
{
C d(n);
- assert(DefaultOnly::count == n);
+ assert(static_cast<unsigned>(DefaultOnly::count) == n);
assert(d.size() == n);
- assert(distance(d.begin(), d.end()) == d.size());
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
+#if TEST_STD_VER >= 11
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
assert(*i == T());
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
assert(DefaultOnly::count == 0);
}
@@ -64,7 +66,7 @@ template <class T, class Allocator>
void
test3(unsigned n, Allocator const &alloc = Allocator())
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
{
@@ -72,6 +74,9 @@ test3(unsigned n, Allocator const &alloc = Allocator())
assert(d.size() == n);
assert(d.get_allocator() == alloc);
}
+#else
+ ((void)n);
+ ((void)alloc);
#endif
}
@@ -98,13 +103,13 @@ int main()
test<DefaultOnly, std::allocator<DefaultOnly> >(4096);
test<DefaultOnly, std::allocator<DefaultOnly> >(4097);
- test1<DefaultOnly, stack_allocator<DefaultOnly, 4096> >(4095);
+ LIBCPP_ONLY(test1<DefaultOnly, limited_allocator<DefaultOnly, 4096> >(4095));
#if TEST_STD_VER >= 11
test<DefaultOnly, min_allocator<DefaultOnly> >(4095);
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
test3<DefaultOnly, std::allocator<DefaultOnly>> (1023);
test3<int, std::allocator<int>>(1);
test3<int, min_allocator<int>> (3);
diff --git a/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp b/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp
index aeda168d19d4..2c8eee7cbe5f 100644
--- a/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp
@@ -13,8 +13,9 @@
#include <deque>
#include <cassert>
+#include <cstddef>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
template <class T, class Allocator>
@@ -25,7 +26,7 @@ test(unsigned n, const T& x)
typedef typename C::const_iterator const_iterator;
C d(n, x);
assert(d.size() == n);
- assert(distance(d.begin(), d.end()) == d.size());
+ assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
assert(*i == x);
}
@@ -44,7 +45,7 @@ int main()
test<int, std::allocator<int> >(4095, 78);
test<int, std::allocator<int> >(4096, 1165);
test<int, std::allocator<int> >(4097, 157);
- test<int, stack_allocator<int, 4096> >(4095, 90);
+ LIBCPP_ONLY(test<int, limited_allocator<int, 4096> >(4095, 90));
#if TEST_STD_VER >= 11
test<int, min_allocator<int> >(4095, 90);
#endif
diff --git a/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp
index ed8a7e13baa5..6706411c2537 100644
--- a/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp
@@ -13,6 +13,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -25,7 +26,7 @@ test(unsigned n, const T& x, const Allocator& a)
C d(n, x, a);
assert(d.get_allocator() == a);
assert(d.size() == n);
- assert(distance(d.begin(), d.end()) == d.size());
+ assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
assert(*i == x);
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp
index 713f2159e598..33a0b6df364d 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp
@@ -15,6 +15,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "../../../Emplaceable.h"
#include "min_allocator.h"
@@ -51,7 +52,7 @@ test(int P, C& c1)
CI i = c1.emplace(c1.begin() + P, Emplaceable(1, 2.5));
assert(i == c1.begin() + P);
assert(c1.size() == c1_osize + 1);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
assert(*i == Emplaceable(1, 2.5));
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp
index 784b3a38553a..e3a35362b186 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp
@@ -7,19 +7,21 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
-// template <class... Args> void emplace_back(Args&&... args);
+// template <class... Args> reference emplace_back(Args&&... args);
#include <deque>
+#include <cstddef>
#include <cassert>
+#include "test_macros.h"
#include "../../../Emplaceable.h"
#include "min_allocator.h"
#include "test_allocator.h"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class C>
C
make(int size, int start = 0 )
@@ -47,12 +49,15 @@ void
test(C& c1)
{
typedef typename C::iterator I;
+ typedef typename C::reference Ref;
std::size_t c1_osize = c1.size();
- c1.emplace_back(Emplaceable(1, 2.5));
+ Ref ref = c1.emplace_back(Emplaceable(1, 2.5));
assert(c1.size() == c1_osize + 1);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(distance(c1.begin(), c1.end())
+ == static_cast<std::ptrdiff_t>(c1.size()));
I i = c1.end();
assert(*--i == Emplaceable(1, 2.5));
+ assert(&(*i) == &ref);
}
template <class C>
@@ -63,11 +68,8 @@ testN(int start, int N)
test(c1);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng)/sizeof(rng[0]);
@@ -75,7 +77,6 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<Emplaceable> >(rng[i], rng[j]);
}
-#if TEST_STD_VER >= 11
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng)/sizeof(rng[0]);
@@ -94,6 +95,4 @@ int main()
c.emplace_front(1, 2, 3);
assert(c.size() == 4);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp
index afc0e4972e38..26c700de7253 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp
@@ -7,18 +7,20 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
-// template <class... Args> void emplace_front(Args&&... args);
+// template <class... Args> reference emplace_front(Args&&... args);
#include <deque>
+#include <cstddef>
#include <cassert>
+#include "test_macros.h"
#include "../../../Emplaceable.h"
#include "min_allocator.h"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class C>
C
make(int size, int start = 0 )
@@ -46,12 +48,15 @@ void
test(C& c1)
{
typedef typename C::iterator I;
+ typedef typename C::reference Ref;
std::size_t c1_osize = c1.size();
- c1.emplace_front(Emplaceable(1, 2.5));
+ Ref res_ref = c1.emplace_front(Emplaceable(1, 2.5));
assert(c1.size() == c1_osize + 1);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(distance(c1.begin(), c1.end())
+ == static_cast<std::ptrdiff_t>(c1.size()));
I i = c1.begin();
assert(*i == Emplaceable(1, 2.5));
+ assert(&res_ref == &(*i));
}
template <class C>
@@ -62,11 +67,9 @@ testN(int start, int N)
test(c1);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng)/sizeof(rng[0]);
@@ -74,7 +77,6 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<Emplaceable> >(rng[i], rng[j]);
}
-#if TEST_STD_VER >= 11
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng)/sizeof(rng[0]);
@@ -82,6 +84,4 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<Emplaceable, min_allocator<Emplaceable>> >(rng[i], rng[j]);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp
index 116ed9aa4b5a..def032c2705a 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp
@@ -15,6 +15,7 @@
#include <algorithm>
#include <iterator>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -45,17 +46,17 @@ void
test(int P, C& c1)
{
typedef typename C::iterator I;
- assert(P < c1.size());
+ assert(static_cast<std::size_t>(P) < c1.size());
std::size_t c1_osize = c1.size();
I i = c1.erase(c1.cbegin() + P);
assert(i == c1.begin() + P);
assert(c1.size() == c1_osize - 1);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
i = c1.begin();
int j = 0;
for (; j < P; ++j, ++i)
assert(*i == j);
- for (++j; j < c1_osize; ++j, ++i)
+ for (++j; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == j);
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp
index a53abaf85d33..338c66d81f97 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp
@@ -17,6 +17,7 @@
#include <algorithm>
#include <iterator>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -47,17 +48,17 @@ void
test(int P, C& c1, int size)
{
typedef typename C::iterator I;
- assert(P + size <= c1.size());
+ assert(static_cast<std::size_t>(P + size) <= c1.size());
std::size_t c1_osize = c1.size();
I i = c1.erase(c1.cbegin() + P, c1.cbegin() + (P + size));
assert(i == c1.begin() + P);
assert(c1.size() == c1_osize - size);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
i = c1.begin();
int j = 0;
for (; j < P; ++j, ++i)
assert(*i == j);
- for (j += size; j < c1_osize; ++j, ++i)
+ for (j += size; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == j);
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp
index fbe3cb69ccdd..f843ff3a5da4 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp
@@ -16,11 +16,12 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
#include "MoveOnly.h"
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
template <class C>
@@ -57,13 +58,13 @@ test(int P, const C& c0, const C& c2)
CI i = c1.insert(c1.begin() + P, BCI(c2.begin()), BCI(c2.end()));
assert(i == c1.begin() + P);
assert(c1.size() == c1_osize + c2.size());
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
i = c1.begin();
for (int j = 0; j < P; ++j, ++i)
assert(*i == j);
- for (int j = 0; j < c2.size(); ++j, ++i)
+ for (int j = 0; static_cast<std::size_t>(j) < c2.size(); ++j, ++i)
assert(*i == j);
- for (int j = P; j < c1_osize; ++j, ++i)
+ for (int j = P; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == j);
}
{
@@ -74,13 +75,13 @@ test(int P, const C& c0, const C& c2)
CI i = c1.insert(c1.begin() + P, BCI(c2.begin()), BCI(c2.end()));
assert(i == c1.begin() + P);
assert(c1.size() == c1_osize + c2.size());
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
i = c1.begin();
for (int j = 0; j < P; ++j, ++i)
assert(*i == j);
- for (int j = 0; j < c2.size(); ++j, ++i)
+ for (int j = 0; static_cast<std::size_t>(j) < c2.size(); ++j, ++i)
assert(*i == j);
- for (int j = P; j < c1_osize; ++j, ++i)
+ for (int j = P; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == j);
}
{
@@ -91,13 +92,13 @@ test(int P, const C& c0, const C& c2)
CI i = c1.insert(c1.begin() + P, BCI(c2.begin()), BCI(c2.end()));
assert(i == c1.begin() + P);
assert(c1.size() == c1_osize + c2.size());
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
i = c1.begin();
for (int j = 0; j < P; ++j, ++i)
assert(*i == j);
- for (int j = 0; j < c2.size(); ++j, ++i)
+ for (int j = 0; static_cast<std::size_t>(j) < c2.size(); ++j, ++i)
assert(*i == j);
- for (int j = P; j < c1_osize; ++j, ++i)
+ for (int j = P; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == j);
}
}
@@ -172,13 +173,13 @@ testI(int P, C& c1, const C& c2)
CI i = c1.insert(c1.begin() + P, ICI(c2.begin()), ICI(c2.end()));
assert(i == c1.begin() + P);
assert(c1.size() == c1_osize + c2.size());
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
i = c1.begin();
for (int j = 0; j < P; ++j, ++i)
assert(*i == j);
- for (int j = 0; j < c2.size(); ++j, ++i)
+ for (int j = 0; static_cast<std::size_t>(j) < c2.size(); ++j, ++i)
assert(*i == j);
- for (int j = P; j < c1_osize; ++j, ++i)
+ for (int j = P; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == j);
}
@@ -270,7 +271,7 @@ int main()
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
testNI<std::deque<int> >(1500, 2000, 1000);
#if TEST_STD_VER >= 11
- test_move<std::deque<MoveOnly, stack_allocator<MoveOnly, 2000> > >();
+ test_move<std::deque<MoveOnly, limited_allocator<MoveOnly, 2000> > >();
#endif
}
#if TEST_STD_VER >= 11
diff --git a/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp
index 3c7b0fef28b4..4ce8bbdd57d3 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp
@@ -15,6 +15,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "MoveOnly.h"
#include "min_allocator.h"
@@ -51,13 +52,13 @@ test(int P, C& c1, int x)
CI i = c1.insert(c1.begin() + P, MoveOnly(x));
assert(i == c1.begin() + P);
assert(c1.size() == c1_osize + 1);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
i = c1.begin();
for (int j = 0; j < P; ++j, ++i)
assert(*i == MoveOnly(j));
assert(*i == MoveOnly(x));
++i;
- for (int j = P; j < c1_osize; ++j, ++i)
+ for (int j = P; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == MoveOnly(j));
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp
index 0efe3b44c604..779b9464e07a 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/insert_size_value.pass.cpp
@@ -15,6 +15,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "min_allocator.h"
@@ -50,13 +51,13 @@ test(int P, C& c1, int size, int x)
CI i = c1.insert(c1.begin() + P, size, x);
assert(i == c1.begin() + P);
assert(c1.size() == c1_osize + size);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
i = c1.begin();
for (int j = 0; j < P; ++j, ++i)
assert(*i == j);
for (int j = 0; j < size; ++j, ++i)
assert(*i == x);
- for (int j = P; j < c1_osize; ++j, ++i)
+ for (int j = P; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == j);
}
@@ -120,7 +121,7 @@ self_reference_test()
CI jt = c.cbegin() + j;
c.insert(it, 5, *jt);
assert(c.size() == 25);
- assert(distance(c.begin(), c.end()) == c.size());
+ assert(static_cast<std::size_t>(distance(c.begin(), c.end())) == c.size());
it = c.cbegin();
for (int k = 0; k < i; ++k, ++it)
assert(*it == k);
diff --git a/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp
index 04c4ca4f7b26..e0c2d0129ef0 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/insert_value.pass.cpp
@@ -13,6 +13,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "min_allocator.h"
@@ -48,13 +49,13 @@ test(int P, C& c1, int x)
CI i = c1.insert(c1.begin() + P, x);
assert(i == c1.begin() + P);
assert(c1.size() == c1_osize + 1);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
i = c1.begin();
for (int j = 0; j < P; ++j, ++i)
assert(*i == j);
assert(*i == x);
++i;
- for (int j = P; j < c1_osize; ++j, ++i)
+ for (int j = P; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == j);
}
@@ -102,7 +103,7 @@ self_reference_test()
CI jt = c.cbegin() + j;
c.insert(it, *jt);
assert(c.size() == 21);
- assert(distance(c.begin(), c.end()) == c.size());
+ assert(static_cast<std::size_t>(distance(c.begin(), c.end())) == c.size());
it = c.cbegin();
for (int k = 0; k < i; ++k, ++it)
assert(*it == k);
diff --git a/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp
index aeb62c9d996a..2336b81d4fcd 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/pop_back.pass.cpp
@@ -13,6 +13,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -46,9 +47,9 @@ test(C& c1)
std::size_t c1_osize = c1.size();
c1.pop_back();
assert(c1.size() == c1_osize - 1);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
I i = c1.begin();
- for (int j = 0; j < c1.size(); ++j, ++i)
+ for (int j = 0; static_cast<std::size_t>(j) < c1.size(); ++j, ++i)
assert(*i == j);
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp
index c7a3a625eab6..3de5586ab920 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/pop_front.pass.cpp
@@ -13,6 +13,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -46,9 +47,9 @@ test(C& c1)
std::size_t c1_osize = c1.size();
c1.pop_front();
assert(c1.size() == c1_osize - 1);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
I i = c1.begin();
- for (int j = 1; j < c1.size(); ++j, ++i)
+ for (int j = 1; static_cast<std::size_t>(j) < c1.size(); ++j, ++i)
assert(*i == j);
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp
index 1fe1da102f37..db22086fd4c9 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_back_exception_safety.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <deque>
// void push_back(const value_type& x);
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp
index ee4f3d7f9ed7..ef9839721a2e 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_front.pass.cpp
@@ -13,6 +13,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -46,11 +47,11 @@ test(C& c1, int x)
std::size_t c1_osize = c1.size();
c1.push_front(x);
assert(c1.size() == c1_osize + 1);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
I i = c1.begin();
assert(*i == x);
++i;
- for (int j = 0; j < c1_osize; ++j, ++i)
+ for (int j = 0; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == j);
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp
index 7464870f07e1..7a90c8a75962 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_front_exception_safety.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <deque>
// void push_front(const value_type& x);
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
index ab15ca3326bf..8e734a639344 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
@@ -13,6 +13,7 @@
#include <deque>
#include <cassert>
+#include <cstddef>
#include "MoveOnly.h"
#include "min_allocator.h"
@@ -49,11 +50,11 @@ test(C& c1, int x)
std::size_t c1_osize = c1.size();
c1.push_front(MoveOnly(x));
assert(c1.size() == c1_osize + 1);
- assert(distance(c1.begin(), c1.end()) == c1.size());
+ assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
I i = c1.begin();
assert(*i == MoveOnly(x));
++i;
- for (int j = 0; j < c1_osize; ++j, ++i)
+ for (int j = 0; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
assert(*i == MoveOnly(j));
}
diff --git a/test/std/containers/sequences/deque/deque.special/swap.pass.cpp b/test/std/containers/sequences/deque/deque.special/swap.pass.cpp
index ab21f434937e..05bbf878ae0d 100644
--- a/test/std/containers/sequences/deque/deque.special/swap.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.special/swap.pass.cpp
@@ -65,13 +65,13 @@ int main()
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
typedef test_allocator<int> A;
- std::deque<int, A> c1(a1, a1+sizeof(a1)/sizeof(a1[0]), A(1));
- std::deque<int, A> c2(a2, a2+sizeof(a2)/sizeof(a2[0]), A(2));
+ std::deque<int, A> c1(a1, a1+sizeof(a1)/sizeof(a1[0]), A(1, 1));
+ std::deque<int, A> c2(a2, a2+sizeof(a2)/sizeof(a2[0]), A(1, 2));
swap(c1, c2);
assert((c1 == std::deque<int, A>(a2, a2+sizeof(a2)/sizeof(a2[0]))));
- assert(c1.get_allocator() == A(1));
+ assert(c1.get_allocator().get_id() == 1);
assert((c2 == std::deque<int, A>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator().get_id() == 2);
}
{
int a1[] = {1, 3, 7, 9, 10};
diff --git a/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
index 2f999e9a7a5d..c0af762fb277 100644
--- a/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
@@ -21,6 +21,7 @@
// This tests a conforming extension
#include <deque>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -56,35 +57,30 @@ int main()
{
{
typedef std::deque<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::deque<MoveOnly, test_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::deque<MoveOnly, other_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
- C c1, c2;
#if TEST_STD_VER >= 14
// In c++14, if POCS is set, swapping the allocator is required not to throw
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#else
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#endif
}
#if TEST_STD_VER >= 14
{
typedef std::deque<MoveOnly, some_alloc2<MoveOnly>> C;
- C c1, c2;
// if the allocators are always equal, then the swap can be noexcept
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
diff --git a/test/std/containers/sequences/deque/iterators.pass.cpp b/test/std/containers/sequences/deque/iterators.pass.cpp
index 19d7996f824f..5c7ae01e60e9 100644
--- a/test/std/containers/sequences/deque/iterators.pass.cpp
+++ b/test/std/containers/sequences/deque/iterators.pass.cpp
@@ -20,6 +20,7 @@
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -44,7 +45,7 @@ int main()
assert(i == j);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
std::deque<int>::iterator ii1{}, ii2{};
std::deque<int>::iterator ii4 = ii1;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/copy.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/copy.pass.cpp
index 5240afa82b80..65ab7abe23ba 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/copy.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/copy.pass.cpp
@@ -15,6 +15,7 @@
#include <cassert>
#include <iterator>
+#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -27,14 +28,14 @@ int main()
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c0(std::begin(t), std::end(t), A(10));
C c = c0;
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
assert(c == c0);
assert(c.get_allocator() == A(10));
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
typedef int T;
typedef other_allocator<int> A;
@@ -42,15 +43,13 @@ int main()
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c0(std::begin(t), std::end(t), A(10));
C c = c0;
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
assert(c == c0);
assert(c.get_allocator() == A(-2));
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if TEST_STD_VER >= 11
{
typedef int T;
typedef min_allocator<int> A;
@@ -58,7 +57,7 @@ int main()
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c0(std::begin(t), std::end(t), A());
C c = c0;
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/copy_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/copy_alloc.pass.cpp
index e4b73bb54e9b..744bba419f37 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/copy_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/copy_alloc.pass.cpp
@@ -27,7 +27,7 @@ int main()
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c0(std::begin(t), std::end(t), A(10));
C c(c0, A(9));
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
@@ -41,7 +41,7 @@ int main()
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c0(std::begin(t), std::end(t), A(10));
C c(c0, A(9));
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
@@ -56,7 +56,7 @@ int main()
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c0(std::begin(t), std::end(t), A());
C c(c0, A());
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
index 85d929b4e32e..f70119e3c2af 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <forward_list>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,6 +44,6 @@ int main()
}
{
typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
index c783f60ff4c9..ac73d142a67e 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
@@ -23,7 +23,7 @@ int main()
typedef int T;
typedef std::forward_list<T> C;
C c = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == 10);
@@ -33,7 +33,7 @@ int main()
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
C c = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == 10);
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
index ba9984f969b5..844be20015dd 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
@@ -25,7 +25,7 @@ int main()
typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
C c({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, A(14));
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == 10);
@@ -37,7 +37,7 @@ int main()
typedef min_allocator<T> A;
typedef std::forward_list<T, A> C;
C c({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, A());
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == 10);
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
index a3e204ec28da..a5948b9ef799 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
@@ -30,7 +30,7 @@ int main()
typedef std::move_iterator<T*> I;
C c0(I(std::begin(t)), I(std::end(t)), A(10));
C c = std::move(c0);
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
@@ -45,7 +45,7 @@ int main()
typedef std::move_iterator<T*> I;
C c0(I(std::begin(t)), I(std::end(t)), A(10));
C c = std::move(c0);
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
@@ -61,7 +61,7 @@ int main()
typedef std::move_iterator<T*> I;
C c0(I(std::begin(t)), I(std::end(t)), A());
C c = std::move(c0);
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
index b9a6ef7ab8a8..5f278e31c0de 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
@@ -21,6 +21,7 @@
#include <forward_list>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,10 +44,10 @@ int main()
}
{
typedef std::forward_list<MoveOnly, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
- static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_move_assignable<C>::value, "");
}
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
index 0359133afc9b..089f6d6807cb 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
@@ -19,6 +19,7 @@
#include <forward_list>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -33,15 +34,15 @@ int main()
{
{
typedef std::forward_list<MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::forward_list<MoveOnly, test_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::forward_list<MoveOnly, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/range.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/range.pass.cpp
index 3c0f2b8403ca..5a7137463caf 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/range.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/range.pass.cpp
@@ -27,7 +27,7 @@ int main()
typedef input_iterator<const T*> I;
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c(I(std::begin(t)), I(std::end(t)));
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
@@ -39,7 +39,7 @@ int main()
typedef input_iterator<const T*> I;
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c(I(std::begin(t)), I(std::end(t)));
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/range_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/range_alloc.pass.cpp
index 96a29d24e89c..03d1c4530c53 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/range_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/range_alloc.pass.cpp
@@ -30,7 +30,7 @@ int main()
typedef input_iterator<const T*> I;
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c(I(std::begin(t)), I(std::end(t)), A(13));
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
@@ -44,7 +44,7 @@ int main()
typedef input_iterator<const T*> I;
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c(I(std::begin(t)), I(std::end(t)), A());
- unsigned n = 0;
+ int n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
index 736d59936aa3..b536ccf4910e 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
@@ -14,18 +14,23 @@
#include <forward_list>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "DefaultOnly.h"
#include "min_allocator.h"
template <class T, class Allocator>
void check_allocator(unsigned n, Allocator const &alloc = Allocator())
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::forward_list<T, Allocator> C;
C d(n, alloc);
assert(d.get_allocator() == alloc);
- assert(std::distance(d.begin(), d.end()) == n);
+ assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == n);
+#else
+ ((void)n);
+ ((void)alloc);
#endif
}
@@ -37,12 +42,14 @@ int main()
unsigned N = 10;
C c(N);
unsigned n = 0;
- for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+ for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n) {
+#if TEST_STD_VER >= 11
assert(*i == T());
#else
- ;
+ ((void)0);
#endif
+ }
assert(n == N);
}
#if TEST_STD_VER >= 11
@@ -53,11 +60,7 @@ int main()
C c(N);
unsigned n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(*i == T());
-#else
- ;
-#endif
assert(n == N);
check_allocator<T, min_allocator<T>> ( 0 );
check_allocator<T, min_allocator<T>> ( 3 );
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.iter/iterators.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.iter/iterators.pass.cpp
index 925cca4d5e8d..d9daf87fb1a6 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.iter/iterators.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.iter/iterators.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <iterator>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -120,7 +121,7 @@ int main()
C::const_iterator j;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
std::forward_list<int>::iterator ii1{}, ii2{};
std::forward_list<int>::iterator ii4 = ii1;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp
index 18ed69d33f0b..589e71894b8c 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp
@@ -7,9 +7,11 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
-// template <class... Args> void emplace_front(Args&&... args);
+// template <class... Args> reference emplace_front(Args&&... args);
#include <forward_list>
#include <cassert>
@@ -19,32 +21,32 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef Emplaceable T;
typedef std::forward_list<T> C;
C c;
- c.emplace_front();
+ T& r1 = c.emplace_front();
assert(c.front() == Emplaceable());
+ assert(&r1 == &c.front());
assert(distance(c.begin(), c.end()) == 1);
- c.emplace_front(1, 2.5);
+ T& r2 = c.emplace_front(1, 2.5);
assert(c.front() == Emplaceable(1, 2.5));
+ assert(&r2 == &c.front());
assert(*next(c.begin()) == Emplaceable());
assert(distance(c.begin(), c.end()) == 2);
}
-#if TEST_STD_VER >= 11
{
typedef Emplaceable T;
typedef std::forward_list<T, min_allocator<T>> C;
C c;
- c.emplace_front();
+ T& r1 = c.emplace_front();
assert(c.front() == Emplaceable());
+ assert(&r1 == &c.front());
assert(distance(c.begin(), c.end()) == 1);
- c.emplace_front(1, 2.5);
+ T& r2 = c.emplace_front(1, 2.5);
assert(c.front() == Emplaceable(1, 2.5));
+ assert(&r2 == &c.front());
assert(*next(c.begin()) == Emplaceable());
assert(distance(c.begin(), c.end()) == 2);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp
index b501347e7893..bff550a0e07c 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_exception_safety.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <forward_list>
// void push_front(const value_type& x);
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
index ef6f6a0f1887..4c41f53fa94c 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/remove_if.pass.cpp
@@ -14,6 +14,7 @@
#include <forward_list>
#include <iterator>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
#include "counting_predicates.hpp"
@@ -37,7 +38,7 @@ int main()
Predicate cp(g);
c1.remove_if(std::ref(cp));
assert(c1 == c2);
- assert(cp.count() == std::distance(std::begin(t1), std::end(t1)));
+ assert(cp.count() == static_cast<std::size_t>(std::distance(std::begin(t1), std::end(t1))));
}
{
typedef int T;
@@ -49,7 +50,7 @@ int main()
Predicate cp(g);
c1.remove_if(std::ref(cp));
assert(c1 == c2);
- assert(cp.count() == std::distance(std::begin(t1), std::end(t1)));
+ assert(cp.count() == static_cast<std::size_t>(std::distance(std::begin(t1), std::end(t1))));
}
{
typedef int T;
@@ -62,7 +63,7 @@ int main()
Predicate cp(g);
c1.remove_if(std::ref(cp));
assert(c1 == c2);
- assert(cp.count() == std::distance(std::begin(t1), std::end(t1)));
+ assert(cp.count() == static_cast<std::size_t>(std::distance(std::begin(t1), std::end(t1))));
}
{
typedef int T;
@@ -86,7 +87,7 @@ int main()
Predicate cp(g);
c1.remove_if(std::ref(cp));
assert(c1 == c2);
- assert(cp.count() == std::distance(std::begin(t1), std::end(t1)));
+ assert(cp.count() == static_cast<std::size_t>(std::distance(std::begin(t1), std::end(t1))));
}
#if TEST_STD_VER >= 11
{
@@ -100,7 +101,7 @@ int main()
Predicate cp(g);
c1.remove_if(std::ref(cp));
assert(c1 == c2);
- assert(cp.count() == std::distance(std::begin(t1), std::end(t1)));
+ assert(cp.count() == static_cast<std::size_t>(std::distance(std::begin(t1), std::end(t1))));
}
{
typedef int T;
@@ -112,7 +113,7 @@ int main()
Predicate cp(g);
c1.remove_if(std::ref(cp));
assert(c1 == c2);
- assert(cp.count() == std::distance(std::begin(t1), std::end(t1)));
+ assert(cp.count() == static_cast<std::size_t>(std::distance(std::begin(t1), std::end(t1))));
}
{
typedef int T;
@@ -125,7 +126,7 @@ int main()
Predicate cp(g);
c1.remove_if(std::ref(cp));
assert(c1 == c2);
- assert(cp.count() == std::distance(std::begin(t1), std::end(t1)));
+ assert(cp.count() == static_cast<std::size_t>(std::distance(std::begin(t1), std::end(t1))));
}
{
typedef int T;
@@ -149,7 +150,7 @@ int main()
Predicate cp(g);
c1.remove_if(std::ref(cp));
assert(c1 == c2);
- assert(cp.count() == std::distance(std::begin(t1), std::end(t1)));
+ assert(cp.count() == static_cast<std::size_t>(std::distance(std::begin(t1), std::end(t1))));
}
#endif
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp
index c8d4e2d34f1e..eec9e42636a2 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp
@@ -14,14 +14,15 @@
#include <forward_list>
#include <cassert>
#include <iterator>
+#include <cstddef>
#include "min_allocator.h"
typedef int T;
const T t1[] = {0, 1, 2, 3, 4, 5, 6, 7};
const T t2[] = {10, 11, 12, 13, 14, 15};
-const int size_t1 = std::end(t1) - std::begin(t1);
-const int size_t2 = std::end(t2) - std::begin(t2);
+const std::ptrdiff_t size_t1 = std::end(t1) - std::begin(t1);
+const std::ptrdiff_t size_t2 = std::end(t2) - std::begin(t2);
template <class C>
void
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_one.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_one.pass.cpp
index 349a3872d754..cc86c9625671 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_one.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_one.pass.cpp
@@ -14,6 +14,7 @@
#include <forward_list>
#include <cassert>
#include <iterator>
+#include <cstddef>
#include "test_macros.h"
#include "min_allocator.h"
@@ -21,8 +22,8 @@
typedef int T;
const T t1[] = {0, 1, 2, 3, 4, 5, 6, 7};
const T t2[] = {10, 11, 12};
-const int size_t1 = std::end(t1) - std::begin(t1);
-const int size_t2 = std::end(t2) - std::begin(t2);
+const std::ptrdiff_t size_t1 = std::end(t1) - std::begin(t1);
+const std::ptrdiff_t size_t2 = std::end(t2) - std::begin(t2);
template <class C>
void
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
index e7a8d048f6f6..242a00bd8608 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.spec/member_swap.pass.cpp
@@ -24,16 +24,16 @@ int main()
typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
const T t1[] = {0, 1, 2, 3, 4, 5};
- C c1(std::begin(t1), std::end(t1), A(1));
+ C c1(std::begin(t1), std::end(t1), A(1, 1));
const T t2[] = {10, 11, 12};
- C c2(std::begin(t2), std::end(t2), A(2));
+ C c2(std::begin(t2), std::end(t2), A(1, 2));
c1.swap(c2);
assert(distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
- assert(c1.get_allocator() == A(1));
+ assert(c1.get_allocator().get_id() == 1);
assert(distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
@@ -42,19 +42,19 @@ int main()
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator().get_id() == 2);
}
{
typedef int T;
typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
const T t1[] = {0, 1, 2, 3, 4, 5};
- C c1(std::begin(t1), std::end(t1), A(1));
- C c2(A(2));
+ C c1(std::begin(t1), std::end(t1), A(1, 1));
+ C c2(A(1, 2));
c1.swap(c2);
assert(distance(c1.begin(), c1.end()) == 0);
- assert(c1.get_allocator() == A(1));
+ assert(c1.get_allocator().get_id() == 1);
assert(distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
@@ -63,39 +63,39 @@ int main()
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator().get_id() == 2);
}
{
typedef int T;
typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
- C c1(A(1));
+ C c1(A(1, 1));
const T t2[] = {10, 11, 12};
- C c2(std::begin(t2), std::end(t2), A(2));
+ C c2(std::begin(t2), std::end(t2), A(1, 2));
c1.swap(c2);
assert(distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
- assert(c1.get_allocator() == A(1));
+ assert(c1.get_allocator().get_id() == 1);
assert(distance(c2.begin(), c2.end()) == 0);
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator().get_id() == 2);
}
{
typedef int T;
typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
- C c1(A(1));
- C c2(A(2));
+ C c1(A(1, 1));
+ C c2(A(1, 2));
c1.swap(c2);
assert(distance(c1.begin(), c1.end()) == 0);
- assert(c1.get_allocator() == A(1));
+ assert(c1.get_allocator().get_id() == 1);
assert(distance(c2.begin(), c2.end()) == 0);
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator().get_id() == 2);
}
{
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
index 983d8140571b..44820d9d304e 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.spec/non_member_swap.pass.cpp
@@ -25,16 +25,16 @@ int main()
typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
const T t1[] = {0, 1, 2, 3, 4, 5};
- C c1(std::begin(t1), std::end(t1), A(1));
+ C c1(std::begin(t1), std::end(t1), A(1, 1));
const T t2[] = {10, 11, 12};
- C c2(std::begin(t2), std::end(t2), A(2));
+ C c2(std::begin(t2), std::end(t2), A(1, 2));
swap(c1, c2);
assert(distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
- assert(c1.get_allocator() == A(1));
+ assert(c1.get_allocator().get_id() == 1);
assert(distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
@@ -43,19 +43,19 @@ int main()
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator().get_id() == 2);
}
{
typedef int T;
typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
const T t1[] = {0, 1, 2, 3, 4, 5};
- C c1(std::begin(t1), std::end(t1), A(1));
- C c2(A(2));
+ C c1(std::begin(t1), std::end(t1), A(1, 1));
+ C c2(A(1, 2));
swap(c1, c2);
assert(distance(c1.begin(), c1.end()) == 0);
- assert(c1.get_allocator() == A(1));
+ assert(c1.get_allocator().get_id() == 1);
assert(distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
@@ -64,39 +64,39 @@ int main()
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator().get_id() == 2);
}
{
typedef int T;
typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
- C c1(A(1));
+ C c1(A(1, 1));
const T t2[] = {10, 11, 12};
- C c2(std::begin(t2), std::end(t2), A(2));
+ C c2(std::begin(t2), std::end(t2), A(1, 2));
swap(c1, c2);
assert(distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
- assert(c1.get_allocator() == A(1));
+ assert(c1.get_allocator().get_id() == 1);
assert(distance(c2.begin(), c2.end()) == 0);
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator().get_id() == 2);
}
{
typedef int T;
typedef test_allocator<T> A;
typedef std::forward_list<T, A> C;
- C c1(A(1));
- C c2(A(2));
+ C c1(A(1, 1));
+ C c2(A(1, 2));
swap(c1, c2);
assert(distance(c1.begin(), c1.end()) == 0);
- assert(c1.get_allocator() == A(1));
+ assert(c1.get_allocator().get_id() == 1);
assert(distance(c2.begin(), c2.end()) == 0);
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator().get_id() == 2);
}
{
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
index 5f8cf95aa737..c63194f7ee64 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
@@ -21,6 +21,7 @@
// This tests a conforming extension
#include <forward_list>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -56,35 +57,30 @@ int main()
{
{
typedef std::forward_list<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::forward_list<MoveOnly, test_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::forward_list<MoveOnly, other_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
- C c1, c2;
#if TEST_STD_VER >= 14
// In c++14, if POCS is set, swapping the allocator is required not to throw
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#else
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#endif
}
#if TEST_STD_VER >= 14
{
typedef std::forward_list<MoveOnly, some_alloc2<MoveOnly>> C;
- C c1, c2;
// if the allocators are always equal, then the swap can be noexcept
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
}
diff --git a/test/std/containers/sequences/forwardlist/max_size.pass.cpp b/test/std/containers/sequences/forwardlist/max_size.pass.cpp
index a7f39bf90fb8..916d12a9f67c 100644
--- a/test/std/containers/sequences/forwardlist/max_size.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/max_size.pass.cpp
@@ -11,25 +11,38 @@
// size_type max_size() const;
-#include <forward_list>
#include <cassert>
+#include <forward_list>
+#include <limits>
+#include <type_traits>
-#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
int main()
{
{
- typedef int T;
- typedef std::forward_list<T> C;
- C c;
- assert(c.max_size() > 0);
+ typedef limited_allocator<int, 10> A;
+ typedef std::forward_list<int, A> C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<int, (size_t)-1> A;
+ typedef std::forward_list<int, A> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
}
-#if TEST_STD_VER >= 11
{
- typedef int T;
- typedef std::forward_list<T, min_allocator<T>> C;
- C c;
- assert(c.max_size() > 0);
+ typedef std::forward_list<char> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
}
-#endif
}
diff --git a/test/std/containers/sequences/list/iterators.pass.cpp b/test/std/containers/sequences/list/iterators.pass.cpp
index fe0ac0799687..8103b2435462 100644
--- a/test/std/containers/sequences/list/iterators.pass.cpp
+++ b/test/std/containers/sequences/list/iterators.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <iterator>
+#include "test_macros.h"
#include "min_allocator.h"
struct A
@@ -135,9 +136,8 @@ int main()
assert(j->first == 3);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
- std::list<int> c;
std::list<int>::iterator ii1{}, ii2{};
std::list<int>::iterator ii4 = ii1;
std::list<int>::const_iterator cii{};
@@ -150,9 +150,6 @@ int main()
assert ( (cii == ii1 ));
assert (!(ii1 != cii ));
assert (!(cii != ii1 ));
-
- assert ( ii1 != c.cbegin());
- assert ( cii != c.begin());
}
#endif
diff --git a/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp b/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
new file mode 100644
index 000000000000..bd1b65e63d70
--- /dev/null
+++ b/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// size_type max_size() const noexcept
+
+#include <cassert>
+#include <limits>
+#include <list>
+#include <type_traits>
+
+#include "test_allocator.h"
+#include "test_macros.h"
+
+int main() {
+ {
+ typedef limited_allocator<int, 10> A;
+ typedef std::list<int, A> C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<int, (size_t)-1> A;
+ typedef std::list<int, A> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
+ }
+ {
+ typedef std::list<char> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
+ }
+}
diff --git a/test/std/containers/sequences/list/list.cons/copy.pass.cpp b/test/std/containers/sequences/list/list.cons/copy.pass.cpp
index a6abd1f3c30b..fb583a5dd85d 100644
--- a/test/std/containers/sequences/list/list.cons/copy.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/copy.pass.cpp
@@ -13,6 +13,8 @@
#include <list>
#include <cassert>
+
+#include "test_macros.h"
#include "DefaultOnly.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -30,15 +32,13 @@ int main()
assert(l2 == l);
assert(l2.get_allocator() == l.get_allocator());
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
std::list<int, other_allocator<int> > l(3, 2, other_allocator<int>(5));
std::list<int, other_allocator<int> > l2 = l;
assert(l2 == l);
assert(l2.get_allocator() == other_allocator<int>(-2));
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l(3, 2);
std::list<int, min_allocator<int>> l2 = l;
diff --git a/test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp
index 4b88580e12ca..a5ff2b0c215b 100644
--- a/test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp
@@ -13,7 +13,7 @@
#include <list>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
int main()
@@ -29,7 +29,7 @@ int main()
assert(std::distance(l.begin(), l.end()) == 0);
}
{
- std::list<int, stack_allocator<int, 4> > l;
+ std::list<int, limited_allocator<int, 4> > l;
assert(l.size() == 0);
assert(std::distance(l.begin(), l.end()) == 0);
}
diff --git a/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
index 3d11f13358b5..66e40a30d1f1 100644
--- a/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,6 +44,6 @@ int main()
}
{
typedef std::list<MoveOnly, some_alloc<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
index 72add79f6670..6040c648e547 100644
--- a/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
@@ -24,7 +24,7 @@ int main()
std::list<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
assert(d.get_allocator() == test_allocator<int>(3));
assert(d.size() == 4);
- std::list<int>::iterator i = d.begin();
+ std::list<int, test_allocator<int>>::iterator i = d.begin();
assert(*i++ == 3);
assert(*i++ == 4);
assert(*i++ == 5);
diff --git a/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp b/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp
index 0dd71d70f85b..3b3c2f7ef1ab 100644
--- a/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp
@@ -15,7 +15,7 @@
#include <list>
#include <cassert>
#include "test_iterators.h"
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
int main()
@@ -43,7 +43,8 @@ int main()
}
{
int a[] = {0, 1, 2, 3};
- std::list<int, stack_allocator<int, sizeof(a)/sizeof(a[0])> > l(input_iterator<const int*>(a),
+ // Add 2 for implementations that dynamically allocate a sentinel node and container proxy.
+ std::list<int, limited_allocator<int, sizeof(a)/sizeof(a[0]) + 2> > l(input_iterator<const int*>(a),
input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])));
assert(l.size() == sizeof(a)/sizeof(a[0]));
assert(std::distance(l.begin(), l.end()) == sizeof(a)/sizeof(a[0]));
diff --git a/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
index d4f8fde2c8ff..81f78116af2e 100644
--- a/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
@@ -21,6 +21,7 @@
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,10 +44,10 @@ int main()
}
{
typedef std::list<MoveOnly, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::list<MoveOnly, some_alloc<MoveOnly>> C;
- static_assert(!std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_move_assignable<C>::value, "");
}
}
diff --git a/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
index da2b6a36cef5..b40cb718a3f1 100644
--- a/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
@@ -19,6 +19,7 @@
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -33,15 +34,15 @@ int main()
{
{
typedef std::list<MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::list<MoveOnly, test_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::list<MoveOnly, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::list<MoveOnly, some_alloc<MoveOnly>> C;
diff --git a/test/std/containers/sequences/list/list.cons/size_type.pass.cpp b/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
index 07b4f14dc3a2..95cdeb0c8539 100644
--- a/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
@@ -13,23 +13,28 @@
#include <list>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "DefaultOnly.h"
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
template <class T, class Allocator>
void
test3(unsigned n, Allocator const &alloc = Allocator())
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::list<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
{
C d(n, alloc);
assert(d.size() == n);
- assert(std::distance(d.begin(), d.end()) == n);
+ assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == n);
assert(d.get_allocator() == alloc);
}
+#else
+ ((void)n);
+ ((void)alloc);
#endif
}
@@ -48,7 +53,8 @@ int main()
assert(*i == 0);
}
{
- std::list<int, stack_allocator<int, 3> > l(3);
+ // Add 2 for implementations that dynamically allocate a sentinel node and container proxy.
+ std::list<int, limited_allocator<int, 3 + 2> > l(3);
assert(l.size() == 3);
assert(std::distance(l.begin(), l.end()) == 3);
std::list<int>::const_iterator i = l.begin();
@@ -58,7 +64,7 @@ int main()
++i;
assert(*i == 0);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::list<int, min_allocator<int> > C;
C l(3, min_allocator<int> ());
@@ -73,14 +79,12 @@ int main()
test3<int, min_allocator<int>> (3);
}
#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::list<DefaultOnly> l(3);
assert(l.size() == 3);
assert(std::distance(l.begin(), l.end()) == 3);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l(3);
assert(l.size() == 3);
@@ -92,12 +96,10 @@ int main()
++i;
assert(*i == 0);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<DefaultOnly, min_allocator<DefaultOnly>> l(3);
assert(l.size() == 3);
assert(std::distance(l.begin(), l.end()) == 3);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#endif
}
diff --git a/test/std/containers/sequences/list/list.cons/size_value_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/size_value_alloc.pass.cpp
index ac7b18ea4990..d590626d50f9 100644
--- a/test/std/containers/sequences/list/list.cons/size_value_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/size_value_alloc.pass.cpp
@@ -14,7 +14,7 @@
#include <list>
#include <cassert>
#include "DefaultOnly.h"
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
int main()
@@ -42,7 +42,8 @@ int main()
assert(*i == 2);
}
{
- std::list<int, stack_allocator<int, 3> > l(3, 2);
+ // Add 2 for implementations that dynamically allocate a sentinel node and container proxy.
+ std::list<int, limited_allocator<int, 3 + 2> > l(3, 2);
assert(l.size() == 3);
assert(std::distance(l.begin(), l.end()) == 3);
std::list<int>::const_iterator i = l.begin();
diff --git a/test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp b/test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp
index 2ff01f1676f2..2aae2b9b09eb 100644
--- a/test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp
@@ -7,9 +7,11 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
-// template <class... Args> void emplace_back(Args&&... args);
+// template <class... Args> reference emplace_back(Args&&... args);
#include <list>
#include <cassert>
@@ -33,34 +35,34 @@ public:
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<A> c;
- c.emplace_back(2, 3.5);
+ A& r1 = c.emplace_back(2, 3.5);
assert(c.size() == 1);
+ assert(&r1 == &c.back());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
- c.emplace_back(3, 4.5);
+ A& r2 = c.emplace_back(3, 4.5);
assert(c.size() == 2);
+ assert(&r2 == &c.back());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
}
-#if TEST_STD_VER >= 11
{
std::list<A, min_allocator<A>> c;
- c.emplace_back(2, 3.5);
+ A& r1 = c.emplace_back(2, 3.5);
assert(c.size() == 1);
+ assert(&r1 == &c.back());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
- c.emplace_back(3, 4.5);
+ A& r2 = c.emplace_back(3, 4.5);
assert(c.size() == 2);
+ assert(&r2 == &c.back());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp b/test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp
index 8a3df46a31e2..994dac258f8c 100644
--- a/test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp
@@ -7,9 +7,11 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
-// template <class... Args> void emplace_front(Args&&... args);
+// template <class... Args> reference emplace_front(Args&&... args);
#include <list>
#include <cassert>
@@ -33,34 +35,34 @@ public:
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<A> c;
- c.emplace_front(2, 3.5);
+ A& r1 = c.emplace_front(2, 3.5);
assert(c.size() == 1);
+ assert(&r1 == &c.front());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
- c.emplace_front(3, 4.5);
+ A& r2 = c.emplace_front(3, 4.5);
assert(c.size() == 2);
+ assert(&r2 == &c.front());
assert(c.front().geti() == 3);
assert(c.front().getd() == 4.5);
assert(c.back().geti() == 2);
assert(c.back().getd() == 3.5);
}
-#if TEST_STD_VER >= 11
{
std::list<A, min_allocator<A>> c;
- c.emplace_front(2, 3.5);
+ A& r1 = c.emplace_front(2, 3.5);
assert(c.size() == 1);
+ assert(&r1 == &c.front());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
- c.emplace_front(3, 4.5);
+ A& r2 = c.emplace_front(3, 4.5);
assert(c.size() == 2);
+ assert(&r2 == &c.front());
assert(c.front().geti() == 3);
assert(c.front().getd() == 4.5);
assert(c.back().geti() == 2);
assert(c.back().getd() == 3.5);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/list/list.modifiers/insert_iter_size_value.pass.cpp b/test/std/containers/sequences/list/list.modifiers/insert_iter_size_value.pass.cpp
index d85c1f4b9987..9b923696592f 100644
--- a/test/std/containers/sequences/list/list.modifiers/insert_iter_size_value.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/insert_iter_size_value.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <list>
// iterator insert(const_iterator position, size_type n, const value_type& x);
@@ -20,6 +19,7 @@
#include "min_allocator.h"
#include "count_new.hpp"
+#include "test_macros.h"
template <class List>
void test() {
@@ -29,6 +29,7 @@ void test() {
typename List::iterator i = l1.insert(next(l1.cbegin()), 5, 4);
assert(i == next(l1.begin()));
assert(l1 == List(a2, a2+8));
+#ifndef TEST_HAS_NO_EXCEPTIONS
globalMemCounter.throw_after = 4;
int save_count = globalMemCounter.outstanding_new;
try
@@ -41,6 +42,7 @@ void test() {
}
assert(globalMemCounter.checkOutstandingNewEq(save_count));
assert(l1 == List(a2, a2+8));
+#endif
}
int main()
diff --git a/test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp b/test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp
index 8d16142defc0..a644955c8236 100644
--- a/test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/push_back_exception_safety.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <list>
// void push_back(const value_type& x);
diff --git a/test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp b/test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp
index aafcceecd471..14379b66913f 100644
--- a/test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/push_front_exception_safety.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <list>
// void push_front(const value_type& x);
diff --git a/test/std/containers/sequences/list/list.ops/remove.pass.cpp b/test/std/containers/sequences/list/list.ops/remove.pass.cpp
index fed28e442e12..425070ce29d6 100644
--- a/test/std/containers/sequences/list/list.ops/remove.pass.cpp
+++ b/test/std/containers/sequences/list/list.ops/remove.pass.cpp
@@ -14,56 +14,70 @@
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
struct S {
- S(int i) : i_(new int(i)) {}
- S(const S &rhs) : i_(new int(*rhs.i_)) {}
- S& operator = (const S &rhs) { *i_ = *rhs.i_; return *this; }
- ~S () { delete i_; i_ = NULL; }
- bool operator == (const S &rhs) const { return *i_ == *rhs.i_; }
- int get () const { return *i_; }
- int *i_;
- };
+ S(int i) : i_(new int(i)) {}
+ S(const S &rhs) : i_(new int(*rhs.i_)) {}
+ S &operator=(const S &rhs) {
+ *i_ = *rhs.i_;
+ return *this;
+ }
+ ~S() {
+ delete i_;
+ i_ = NULL;
+ }
+ bool operator==(const S &rhs) const { return *i_ == *rhs.i_; }
+ int get() const { return *i_; }
+ int *i_;
+};
-
-int main()
-{
- {
+int main() {
+ {
int a1[] = {1, 2, 3, 4};
int a2[] = {1, 2, 4};
- std::list<int> c(a1, a1+4);
+ std::list<int> c(a1, a1 + 4);
c.remove(3);
- assert(c == std::list<int>(a2, a2+3));
- }
- { // LWG issue #526
+ assert(c == std::list<int>(a2, a2 + 3));
+ }
+ { // LWG issue #526
int a1[] = {1, 2, 1, 3, 5, 8, 11};
- int a2[] = { 2, 3, 5, 8, 11};
- std::list<int> c(a1, a1+7);
+ int a2[] = {2, 3, 5, 8, 11};
+ std::list<int> c(a1, a1 + 7);
c.remove(c.front());
- assert(c == std::list<int>(a2, a2+5));
- }
- {
+ assert(c == std::list<int>(a2, a2 + 5));
+ }
+ {
int a1[] = {1, 2, 1, 3, 5, 8, 11, 1};
- int a2[] = { 2, 3, 5, 8, 11 };
+ int a2[] = {2, 3, 5, 8, 11};
std::list<S> c;
- for(int *ip = a1; ip < a1+8; ++ip)
- c.push_back(S(*ip));
+ for (int *ip = a1; ip < a1 + 8; ++ip)
+ c.push_back(S(*ip));
c.remove(c.front());
std::list<S>::const_iterator it = c.begin();
- for(int *ip = a2; ip < a2+5; ++ip, ++it) {
- assert ( it != c.end());
- assert ( *ip == it->get());
- }
- assert ( it == c.end ());
+ for (int *ip = a2; ip < a2 + 5; ++ip, ++it) {
+ assert(it != c.end());
+ assert(*ip == it->get());
}
+ assert(it == c.end());
+ }
+ {
+ typedef no_default_allocator<int> Alloc;
+ typedef std::list<int, Alloc> List;
+ int a1[] = {1, 2, 3, 4};
+ int a2[] = {1, 2, 4};
+ List c(a1, a1 + 4, Alloc::create());
+ c.remove(3);
+ assert(c == List(a2, a2 + 3, Alloc::create()));
+ }
#if TEST_STD_VER >= 11
- {
+ {
int a1[] = {1, 2, 3, 4};
int a2[] = {1, 2, 4};
- std::list<int, min_allocator<int>> c(a1, a1+4);
+ std::list<int, min_allocator<int>> c(a1, a1 + 4);
c.remove(3);
- assert((c == std::list<int, min_allocator<int>>(a2, a2+3)));
- }
+ assert((c == std::list<int, min_allocator<int>>(a2, a2 + 3)));
+ }
#endif
}
diff --git a/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
index 820da4c78f81..512635359c5d 100644
--- a/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
@@ -21,6 +21,7 @@
// This tests a conforming extension
#include <list>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -56,35 +57,30 @@ int main()
{
{
typedef std::list<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::list<MoveOnly, test_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::list<MoveOnly, other_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::list<MoveOnly, some_alloc<MoveOnly>> C;
- C c1, c2;
#if TEST_STD_VER >= 14
// In c++14, if POCS is set, swapping the allocator is required not to throw
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#else
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#endif
}
#if TEST_STD_VER >= 14
{
typedef std::list<MoveOnly, some_alloc2<MoveOnly>> C;
- C c1, c2;
// if the allocators are always equal, then the swap can be noexcept
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
diff --git a/test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp b/test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp
index 3d11239702c9..bad80c279d4d 100644
--- a/test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp
@@ -14,6 +14,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
@@ -25,7 +26,7 @@ test(Iterator first, Iterator last)
{
C c(first, last);
LIBCPP_ASSERT(c.__invariants());
- assert(c.size() == std::distance(first, last));
+ assert(c.size() == static_cast<std::size_t>(std::distance(first, last)));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i, ++first)
assert(*i == *first);
}
diff --git a/test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp
index 196694d73998..dd4a5c757cb5 100644
--- a/test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp
@@ -15,6 +15,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
@@ -26,7 +27,7 @@ test(Iterator first, Iterator last, const typename C::allocator_type& a)
{
C c(first, last, a);
LIBCPP_ASSERT(c.__invariants());
- assert(c.size() == std::distance(first, last));
+ assert(c.size() == static_cast<std::size_t>(std::distance(first, last)));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i, ++first)
assert(*i == *first);
}
diff --git a/test/std/containers/sequences/vector.bool/construct_size.pass.cpp b/test/std/containers/sequences/vector.bool/construct_size.pass.cpp
index 271e4ee33aa4..1fb86a24ab57 100644
--- a/test/std/containers/sequences/vector.bool/construct_size.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/construct_size.pass.cpp
@@ -31,6 +31,9 @@ test2(typename C::size_type n,
assert(c.get_allocator() == a);
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
assert(*i == typename C::value_type());
+#else
+ ((void)n);
+ ((void)a);
#endif
}
diff --git a/test/std/containers/sequences/vector.bool/copy.pass.cpp b/test/std/containers/sequences/vector.bool/copy.pass.cpp
index b3cf9b551f96..7e2efad51894 100644
--- a/test/std/containers/sequences/vector.bool/copy.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/copy.pass.cpp
@@ -23,7 +23,7 @@ template <class C>
void
test(const C& x)
{
- unsigned s = x.size();
+ typename C::size_type s = x.size();
C c(x);
LIBCPP_ASSERT(c.__invariants());
assert(c.size() == s);
diff --git a/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp
index aa8646a9b819..56ffb7d52dd7 100644
--- a/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp
@@ -22,7 +22,7 @@ template <class C>
void
test(const C& x, const typename C::allocator_type& a)
{
- unsigned s = x.size();
+ typename C::size_type s = x.size();
C c(x, a);
LIBCPP_ASSERT(c.__invariants());
assert(c.size() == s);
diff --git a/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
index bd2534ad3de7..b8ff33c5d2e8 100644
--- a/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
template <class T>
@@ -42,6 +43,6 @@ int main()
}
{
typedef std::vector<bool, some_alloc<bool>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp b/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
index 2950ee3882f1..24005bec82df 100644
--- a/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
@@ -11,42 +11,57 @@
// <vector>
// vector.bool
-// template <class... Args> void emplace_back(Args&&... args);
+// template <class... Args> reference emplace_back(Args&&... args);
#include <vector>
#include <cassert>
#include "min_allocator.h"
-
int main()
{
{
typedef std::vector<bool> C;
+ typedef C::reference Ref;
C c;
- c.emplace_back();
+ Ref r1 = c.emplace_back();
assert(c.size() == 1);
assert(c.front() == false);
- c.emplace_back(true);
+ r1 = true;
+ assert(c.front() == true);
+ r1 = false;
+ Ref r2 = c.emplace_back(true);
assert(c.size() == 2);
assert(c.front() == false);
assert(c.back() == true);
- c.emplace_back(1 == 1);
+ r2 = false;
+ assert(c.back() == false);
+ r2 = true;
+ Ref r3 = c.emplace_back(1 == 1);
assert(c.size() == 3);
assert(c.front() == false);
assert(c[1] == true);
assert(c.back() == true);
+ r3 = false;
+ assert(c.back() == false);
}
{
typedef std::vector<bool, min_allocator<bool>> C;
+ typedef C::reference Ref;
C c;
- c.emplace_back();
+ Ref r1 = c.emplace_back();
assert(c.size() == 1);
assert(c.front() == false);
- c.emplace_back(true);
+ r1 = true;
+ assert(c.front() == true);
+ r1 = false;
+ Ref r2 = c.emplace_back(true);
assert(c.size() == 2);
assert(c.front() == false);
assert(c.back() == true);
+ r2 = false;
+ assert(c.back() == false);
+ r2 = true;
c.emplace_back(1 == 1);
assert(c.size() == 3);
assert(c.front() == false);
diff --git a/test/std/containers/sequences/vector.bool/find.pass.cpp b/test/std/containers/sequences/vector.bool/find.pass.cpp
index a4b5537d2949..ffe844e0079c 100644
--- a/test/std/containers/sequences/vector.bool/find.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/find.pass.cpp
@@ -17,6 +17,7 @@
#include <vector>
#include <algorithm>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -25,7 +26,7 @@ int main()
{
std::vector<bool> b(i,true);
std::vector<bool>::iterator j = std::find(b.begin()+1, b.end(), false);
- assert(j-b.begin() == i);
+ assert(static_cast<std::size_t>(j-b.begin()) == i);
assert(b.end() == j);
}
}
@@ -34,7 +35,7 @@ int main()
{
std::vector<bool> b(i,false);
std::vector<bool>::iterator j = std::find(b.begin()+1, b.end(), true);
- assert(j-b.begin() == i);
+ assert(static_cast<std::size_t>(j-b.begin()) == i);
assert(b.end() == j);
}
}
diff --git a/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp b/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
index 89fe7a76d409..dc4fe44d5a39 100644
--- a/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
@@ -15,6 +15,9 @@
#include <vector>
#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
#include "test_iterators.h"
#include "min_allocator.h"
@@ -28,10 +31,10 @@ int main()
input_iterator<const bool*>(a+N));
assert(v.size() == 100 + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < v.size(); ++j)
assert(v[j] == 0);
@@ -47,7 +50,7 @@ int main()
int j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < 105; ++j)
assert(v[j] == 0);
@@ -62,10 +65,10 @@ int main()
forward_iterator<const bool*>(a+N));
assert(v.size() == sz + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < v.size(); ++j)
assert(v[j] == 0);
@@ -81,10 +84,10 @@ int main()
forward_iterator<const bool*>(a+N));
assert(v.size() == sz + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < v.size(); ++j)
assert(v[j] == 0);
@@ -98,10 +101,10 @@ int main()
input_iterator<const bool*>(a+N));
assert(v.size() == 100 + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < v.size(); ++j)
assert(v[j] == 0);
@@ -114,10 +117,10 @@ int main()
forward_iterator<const bool*>(a+N));
assert(v.size() == 100 + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < v.size(); ++j)
assert(v[j] == 0);
diff --git a/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp b/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
index 35c57cbd8e42..3ec8952ff150 100644
--- a/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
@@ -14,6 +14,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -24,7 +25,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == 105);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
@@ -39,7 +40,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == sz + 5);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
@@ -55,7 +56,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == sz + 5);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
@@ -69,7 +70,7 @@ int main()
std::vector<bool, min_allocator<bool>>::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == 105);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
diff --git a/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp b/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
index 78ffe7ba73cd..6a4a6d4bcb70 100644
--- a/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
@@ -14,6 +14,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -24,7 +25,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == 101);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
@@ -38,7 +39,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == sz + 1);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
@@ -53,7 +54,7 @@ int main()
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == sz + 1);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
@@ -66,7 +67,7 @@ int main()
std::vector<bool, min_allocator<bool>>::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == 101);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
diff --git a/test/std/containers/sequences/vector.bool/iterators.pass.cpp b/test/std/containers/sequences/vector.bool/iterators.pass.cpp
index 882ac9be4a5d..10b96480a51b 100644
--- a/test/std/containers/sequences/vector.bool/iterators.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/iterators.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <iterator>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -94,7 +95,7 @@ int main()
C::const_iterator j;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
std::vector<bool>::iterator ii1{}, ii2{};
std::vector<bool>::iterator ii4 = ii1;
diff --git a/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
index fe53fbfc17e0..dd4bf9e01ea9 100644
--- a/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
@@ -21,6 +21,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
template <class T>
@@ -60,7 +61,7 @@ int main()
{
{
typedef std::vector<bool> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::vector<bool, test_allocator<bool>> C;
@@ -68,12 +69,12 @@ int main()
}
{
typedef std::vector<bool, other_allocator<bool>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::vector<bool, some_alloc<bool>> C;
#if TEST_STD_VER > 14
- static_assert( std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT( std::is_nothrow_move_assignable<C>::value, "");
#else
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
#endif
@@ -81,7 +82,7 @@ int main()
#if TEST_STD_VER > 14
{ // POCMA false, is_always_equal true
typedef std::vector<bool, some_alloc2<bool>> C;
- static_assert( std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT( std::is_nothrow_move_assignable<C>::value, "");
}
{ // POCMA false, is_always_equal false
typedef std::vector<bool, some_alloc3<bool>> C;
diff --git a/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
index 2153c7956bfc..3305d95e1ab8 100644
--- a/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
@@ -19,6 +19,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
template <class T>
@@ -32,21 +33,21 @@ int main()
{
{
typedef std::vector<bool> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::vector<bool, test_allocator<bool>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::vector<bool, other_allocator<bool>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::vector<bool, some_alloc<bool>> C;
// In C++17, move constructors for allocators are not allowed to throw
#if TEST_STD_VER > 14
- static_assert( std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT( std::is_nothrow_move_constructible<C>::value, "");
#else
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
#endif
diff --git a/test/std/containers/sequences/vector.bool/push_back.pass.cpp b/test/std/containers/sequences/vector.bool/push_back.pass.cpp
index 3897a438b445..c482f49454be 100644
--- a/test/std/containers/sequences/vector.bool/push_back.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/push_back.pass.cpp
@@ -14,6 +14,7 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -27,7 +28,7 @@ int main()
{
c.push_back(a[i]);
assert(c.size() == i+1);
- for (int j = 0; j < c.size(); ++j)
+ for (std::size_t j = 0; j < c.size(); ++j)
assert(c[j] == a[j]);
}
}
@@ -40,7 +41,7 @@ int main()
{
c.push_back(a[i]);
assert(c.size() == i+1);
- for (int j = 0; j < c.size(); ++j)
+ for (std::size_t j = 0; j < c.size(); ++j)
assert(c[j] == a[j]);
}
}
diff --git a/test/std/containers/sequences/vector.bool/swap.pass.cpp b/test/std/containers/sequences/vector.bool/swap.pass.cpp
index 81af528f2a9a..60b612ae4f90 100644
--- a/test/std/containers/sequences/vector.bool/swap.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/swap.pass.cpp
@@ -30,15 +30,15 @@ int main()
}
{
typedef test_allocator<bool> A;
- std::vector<bool, A> v1(100, true, A(1));
- std::vector<bool, A> v2(200, false, A(2));
+ std::vector<bool, A> v1(100, true, A(1, 1));
+ std::vector<bool, A> v2(200, false, A(1, 2));
swap(v1, v2);
assert(v1.size() == 200);
assert(v1.capacity() >= 200);
assert(v2.size() == 100);
assert(v2.capacity() >= 100);
- assert(v1.get_allocator() == A(1));
- assert(v2.get_allocator() == A(2));
+ assert(v1.get_allocator().get_id() == 1);
+ assert(v2.get_allocator().get_id() == 2);
}
{
typedef other_allocator<bool> A;
diff --git a/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
index 7ba44453b371..1b68eda2757b 100644
--- a/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
@@ -22,6 +22,7 @@
// This tests a conforming extension
#include <vector>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -56,35 +57,30 @@ int main()
{
{
typedef std::vector<bool> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::vector<bool, test_allocator<bool>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::vector<bool, other_allocator<bool>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::vector<bool, some_alloc<bool>> C;
- C c1, c2;
#if TEST_STD_VER >= 14
// In c++14, if POCS is set, swapping the allocator is required not to throw
- static_assert( noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#else
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#endif
}
#if TEST_STD_VER >= 14
{
typedef std::vector<bool, some_alloc2<bool>> C;
- C c1, c2;
// if the allocators are always equal, then the swap can be noexcept
- static_assert( noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
}
diff --git a/test/std/containers/sequences/vector/contiguous.pass.cpp b/test/std/containers/sequences/vector/contiguous.pass.cpp
index 70084246eae9..9dfcf7a63e49 100644
--- a/test/std/containers/sequences/vector/contiguous.pass.cpp
+++ b/test/std/containers/sequences/vector/contiguous.pass.cpp
@@ -21,7 +21,7 @@ template <class C>
void test_contiguous ( const C &c )
{
for ( size_t i = 0; i < c.size(); ++i )
- assert ( *(c.begin() + i) == *(std::addressof(*c.begin()) + i));
+ assert ( *(c.begin() + static_cast<typename C::difference_type>(i)) == *(std::addressof(*c.begin()) + i));
}
int main()
diff --git a/test/std/containers/sequences/vector/iterators.pass.cpp b/test/std/containers/sequences/vector/iterators.pass.cpp
index 8dc14977f282..a1ce2be32718 100644
--- a/test/std/containers/sequences/vector/iterators.pass.cpp
+++ b/test/std/containers/sequences/vector/iterators.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <iterator>
+#include "test_macros.h"
#include "min_allocator.h"
struct A
@@ -135,7 +136,7 @@ int main()
assert(j->first == 3);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::vector<int> C;
C::iterator ii1{}, ii2{};
diff --git a/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
new file mode 100644
index 000000000000..5f7a6268d55c
--- /dev/null
+++ b/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// size_type max_size() const;
+
+#include <cassert>
+#include <limits>
+#include <type_traits>
+#include <vector>
+
+#include "test_allocator.h"
+#include "test_macros.h"
+
+
+int main() {
+ {
+ typedef limited_allocator<int, 10> A;
+ typedef std::vector<int, A> C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<int, (size_t)-1> A;
+ typedef std::vector<int, A> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
+ }
+ {
+ typedef std::vector<char> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
+ }
+}
diff --git a/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
index d04e43db508d..abaa709d4ea2 100644
--- a/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
@@ -13,7 +13,7 @@
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -37,7 +37,8 @@ int main()
assert(is_contiguous_container_asan_correct(v));
}
{
- std::vector<int, stack_allocator<int, 250> > v(100);
+ // Add 1 for implementations that dynamically allocate a container proxy.
+ std::vector<int, limited_allocator<int, 250 + 1> > v(100);
assert(v.capacity() == 100);
v.reserve(50);
assert(v.size() == 100);
diff --git a/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
index ce74cf9b7c23..6409acaf65c1 100644
--- a/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
@@ -13,7 +13,7 @@
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "MoveOnly.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -33,7 +33,8 @@ int main()
assert(is_contiguous_container_asan_correct(v));
}
{
- std::vector<MoveOnly, stack_allocator<MoveOnly, 300> > v(100);
+ // Add 1 for implementations that dynamically allocate a container proxy.
+ std::vector<MoveOnly, limited_allocator<MoveOnly, 300 + 1> > v(100);
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
@@ -56,7 +57,8 @@ int main()
assert(is_contiguous_container_asan_correct(v));
}
{
- std::vector<int, stack_allocator<int, 300> > v(100);
+ // Add 1 for implementations that dynamically allocate a container proxy.
+ std::vector<int, limited_allocator<int, 300 + 1> > v(100);
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
diff --git a/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp
index 3e7df312731f..0bb909710bc9 100644
--- a/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp
@@ -13,7 +13,7 @@
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -35,7 +35,8 @@ int main()
assert(v[i] == 1);
}
{
- std::vector<int, stack_allocator<int, 300> > v(100);
+ // Add 1 for implementations that dynamically allocate a container proxy.
+ std::vector<int, limited_allocator<int, 300 + 1> > v(100);
v.resize(50, 1);
assert(v.size() == 50);
assert(v.capacity() == 100);
diff --git a/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
index 10ce33f43bd2..daf9b092f493 100644
--- a/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
@@ -13,7 +13,7 @@
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -29,7 +29,7 @@ int main()
assert(is_contiguous_container_asan_correct(v));
}
{
- std::vector<int, stack_allocator<int, 401> > v(100);
+ std::vector<int, limited_allocator<int, 401> > v(100);
v.push_back(1);
assert(is_contiguous_container_asan_correct(v));
v.shrink_to_fit();
@@ -39,7 +39,7 @@ int main()
}
#ifndef _LIBCPP_NO_EXCEPTIONS
{
- std::vector<int, stack_allocator<int, 400> > v(100);
+ std::vector<int, limited_allocator<int, 400> > v(100);
v.push_back(1);
assert(is_contiguous_container_asan_correct(v));
v.shrink_to_fit();
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp
index 4e6eb00cebb8..edeae04d7bd7 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp
@@ -18,7 +18,7 @@
#include "test_macros.h"
#include "test_allocator.h"
#include "../../../NotConstructible.h"
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -71,7 +71,7 @@ int main()
(test_allocator<NotConstructible>(5));
}
{
- std::vector<int, stack_allocator<int, 10> > v;
+ std::vector<int, limited_allocator<int, 10> > v;
assert(v.empty());
}
#if TEST_STD_VER >= 11
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
index 5542e91059d6..ec4944d1ad1c 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
@@ -13,10 +13,11 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -26,7 +27,7 @@ test(Iterator first, Iterator last)
{
C c(first, last);
LIBCPP_ASSERT(c.__invariants());
- assert(c.size() == std::distance(first, last));
+ assert(c.size() == static_cast<std::size_t>(std::distance(first, last)));
LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i, ++first)
assert(*i == *first);
@@ -42,11 +43,12 @@ int main()
test<std::vector<int> >(random_access_iterator<const int*>(a), random_access_iterator<const int*>(an));
test<std::vector<int> >(a, an);
- test<std::vector<int, stack_allocator<int, 63> > >(input_iterator<const int*>(a), input_iterator<const int*>(an));
- test<std::vector<int, stack_allocator<int, 18> > >(forward_iterator<const int*>(a), forward_iterator<const int*>(an));
- test<std::vector<int, stack_allocator<int, 18> > >(bidirectional_iterator<const int*>(a), bidirectional_iterator<const int*>(an));
- test<std::vector<int, stack_allocator<int, 18> > >(random_access_iterator<const int*>(a), random_access_iterator<const int*>(an));
- test<std::vector<int, stack_allocator<int, 18> > >(a, an);
+ test<std::vector<int, limited_allocator<int, 63> > >(input_iterator<const int*>(a), input_iterator<const int*>(an));
+ // Add 1 for implementations that dynamically allocate a container proxy.
+ test<std::vector<int, limited_allocator<int, 18 + 1> > >(forward_iterator<const int*>(a), forward_iterator<const int*>(an));
+ test<std::vector<int, limited_allocator<int, 18 + 1> > >(bidirectional_iterator<const int*>(a), bidirectional_iterator<const int*>(an));
+ test<std::vector<int, limited_allocator<int, 18 + 1> > >(random_access_iterator<const int*>(a), random_access_iterator<const int*>(an));
+ test<std::vector<int, limited_allocator<int, 18 + 1> > >(a, an);
#if TEST_STD_VER >= 11
test<std::vector<int, min_allocator<int>> >(input_iterator<const int*>(a), input_iterator<const int*>(an));
test<std::vector<int, min_allocator<int>> >(forward_iterator<const int*>(a), forward_iterator<const int*>(an));
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
index f40088ea3e86..b4482ddb2727 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
@@ -14,10 +14,11 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -27,7 +28,7 @@ test(Iterator first, Iterator last, const A& a)
{
C c(first, last, a);
LIBCPP_ASSERT(c.__invariants());
- assert(c.size() == std::distance(first, last));
+ assert(c.size() == static_cast<std::size_t>(std::distance(first, last)));
LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i, ++first)
assert(*i == *first);
@@ -40,6 +41,9 @@ struct implicit_conv_allocator : min_allocator<T>
{
implicit_conv_allocator(void*) {}
implicit_conv_allocator(const implicit_conv_allocator&) = default;
+
+ template <class U>
+ implicit_conv_allocator(implicit_conv_allocator<U>) {}
};
#endif
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
index 46e5ecdc9a56..7416a6ac9d7b 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
@@ -32,6 +32,9 @@ test2(typename C::size_type n, typename C::allocator_type const& a = typename C:
LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
assert(*i == typename C::value_type());
+#else
+ ((void)n);
+ ((void)a);
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
index d3774d1a6595..dcaaa2cd4a30 100644
--- a/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
@@ -15,7 +15,7 @@
#include <cassert>
#include "test_macros.h"
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -34,7 +34,8 @@ test(typename C::size_type n, const typename C::value_type& x)
int main()
{
test<std::vector<int> >(50, 3);
- test<std::vector<int, stack_allocator<int, 50> > >(50, 5);
+ // Add 1 for implementations that dynamically allocate a container proxy.
+ test<std::vector<int, limited_allocator<int, 50 + 1> > >(50, 5);
#if TEST_STD_VER >= 11
test<std::vector<int, min_allocator<int>> >(50, 3);
#endif
diff --git a/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp b/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
index 105217bbf15c..887444c81959 100644
--- a/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
@@ -23,7 +23,7 @@ template <class C>
void
test(const C& x)
{
- unsigned s = x.size();
+ typename C::size_type s = x.size();
C c(x);
LIBCPP_ASSERT(c.__invariants());
assert(c.size() == s);
diff --git a/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
index 47259c747332..bf910df05c2a 100644
--- a/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
@@ -23,7 +23,7 @@ template <class C>
void
test(const C& x, const typename C::allocator_type& a)
{
- unsigned s = x.size();
+ typename C::size_type s = x.size();
C c(x, a);
LIBCPP_ASSERT(c.__invariants());
assert(c.size() == s);
diff --git a/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
index bd538120442d..10a381f9c8cc 100644
--- a/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,6 +44,6 @@ int main()
}
{
typedef std::vector<MoveOnly, some_alloc<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/sequences/vector/vector.data/data.pass.cpp b/test/std/containers/sequences/vector/vector.data/data.pass.cpp
index f6c0575d958c..b7ea3a286f32 100644
--- a/test/std/containers/sequences/vector/vector.data/data.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.data/data.pass.cpp
@@ -21,7 +21,7 @@ struct Nasty {
Nasty() : i_(0) {}
Nasty(int i) : i_(i) {}
~Nasty() {}
-
+
Nasty * operator&() const { assert(false); return nullptr; }
int i_;
};
diff --git a/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp b/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp
index c97ad29708b8..3c013c1ae8af 100644
--- a/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp
@@ -21,7 +21,7 @@ struct Nasty {
Nasty() : i_(0) {}
Nasty(int i) : i_(i) {}
~Nasty() {}
-
+
Nasty * operator&() const { assert(false); return nullptr; }
int i_;
};
diff --git a/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
index 8bcc23979668..d08f4e3c4e23 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
@@ -7,22 +7,20 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// template <class... Args> iterator emplace(const_iterator pos, Args&&... args);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+
+#include "test_macros.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
class A
{
int i_;
@@ -55,11 +53,8 @@ public:
double getd() const {return d_;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<A> c;
std::vector<A>::iterator i = c.emplace(c.cbegin(), 2, 3.5);
@@ -88,8 +83,8 @@ int main()
assert(is_contiguous_container_asan_correct(c));
}
{
- std::vector<A, stack_allocator<A, 7> > c;
- std::vector<A, stack_allocator<A, 7> >::iterator i = c.emplace(c.cbegin(), 2, 3.5);
+ std::vector<A, limited_allocator<A, 7> > c;
+ std::vector<A, limited_allocator<A, 7> >::iterator i = c.emplace(c.cbegin(), 2, 3.5);
assert(i == c.begin());
assert(c.size() == 1);
assert(c.front().geti() == 2);
@@ -114,15 +109,6 @@ int main()
assert(c.back().getd() == 4.5);
assert(is_contiguous_container_asan_correct(c));
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::vector<A> c1;
- std::vector<A> c2;
- std::vector<A>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5);
- assert(false);
- }
-#endif
-#if TEST_STD_VER >= 11
{
std::vector<A, min_allocator<A>> c;
std::vector<A, min_allocator<A>>::iterator i = c.emplace(c.cbegin(), 2, 3.5);
@@ -147,14 +133,4 @@ int main()
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::vector<A, min_allocator<A>> c1;
- std::vector<A, min_allocator<A>> c2;
- std::vector<A, min_allocator<A>>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5);
- assert(false);
- }
-#endif
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
index 61ccade76b02..2fece8c78c78 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
@@ -7,19 +7,19 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
-// template <class... Args> void emplace_back(Args&&... args);
+// template <class... Args> reference emplace_back(Args&&... args);
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "test_allocator.h"
#include "asan_testing.h"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
class A
{
int i_;
@@ -52,20 +52,19 @@ public:
double getd() const {return d_;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<A> c;
- c.emplace_back(2, 3.5);
+ A& r1 = c.emplace_back(2, 3.5);
assert(c.size() == 1);
+ assert(&r1 == &c.back());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(is_contiguous_container_asan_correct(c));
- c.emplace_back(3, 4.5);
+ A& r2 = c.emplace_back(3, 4.5);
assert(c.size() == 2);
+ assert(&r2 == &c.back());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(c.back().geti() == 3);
@@ -73,30 +72,33 @@ int main()
assert(is_contiguous_container_asan_correct(c));
}
{
- std::vector<A, stack_allocator<A, 4> > c;
- c.emplace_back(2, 3.5);
+ std::vector<A, limited_allocator<A, 4> > c;
+ A& r1 = c.emplace_back(2, 3.5);
assert(c.size() == 1);
+ assert(&r1 == &c.back());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(is_contiguous_container_asan_correct(c));
- c.emplace_back(3, 4.5);
+ A& r2 = c.emplace_back(3, 4.5);
assert(c.size() == 2);
+ assert(&r2 == &c.back());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
assert(is_contiguous_container_asan_correct(c));
}
-#if TEST_STD_VER >= 11
{
std::vector<A, min_allocator<A>> c;
- c.emplace_back(2, 3.5);
+ A& r1 = c.emplace_back(2, 3.5);
assert(c.size() == 1);
+ assert(&r1 == &c.back());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(is_contiguous_container_asan_correct(c));
- c.emplace_back(3, 4.5);
+ A& r2 = c.emplace_back(3, 4.5);
assert(c.size() == 2);
+ assert(&r2 == &c.back());
assert(c.front().geti() == 2);
assert(c.front().getd() == 3.5);
assert(c.back().geti() == 3);
@@ -111,6 +113,4 @@ int main()
assert(c.size() == 2);
assert(is_contiguous_container_asan_correct(c));
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp
deleted file mode 100644
index b2c22d6ae696..000000000000
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db1.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call erase(const_iterator position) with end()
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <cstdlib>
-#include <exception>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::vector<int> l1(a1, a1+3);
- std::vector<int>::const_iterator i = l1.end();
- l1.erase(i);
- assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- int a1[] = {1, 2, 3};
- std::vector<int, min_allocator<int>> l1(a1, a1+3);
- std::vector<int, min_allocator<int>>::const_iterator i = l1.end();
- l1.erase(i);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp
deleted file mode 100644
index da0b6d4a059b..000000000000
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_db2.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call erase(const_iterator position) with iterator from another container
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <cstdlib>
-#include <exception>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::vector<int> l1(a1, a1+3);
- std::vector<int> l2(a1, a1+3);
- std::vector<int>::const_iterator i = l2.begin();
- l1.erase(i);
- assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- int a1[] = {1, 2, 3};
- std::vector<int, min_allocator<int>> l1(a1, a1+3);
- std::vector<int, min_allocator<int>> l2(a1, a1+3);
- std::vector<int, min_allocator<int>>::const_iterator i = l2.begin();
- l1.erase(i);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp
deleted file mode 100644
index 14d3ca803ca3..000000000000
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db1.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call erase(const_iterator first, const_iterator last); with first iterator from another container
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::vector<int> l1(a1, a1+3);
- std::vector<int> l2(a1, a1+3);
- std::vector<int>::iterator i = l1.erase(l2.cbegin(), l1.cbegin()+1);
- assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- int a1[] = {1, 2, 3};
- std::vector<int, min_allocator<int>> l1(a1, a1+3);
- std::vector<int, min_allocator<int>> l2(a1, a1+3);
- std::vector<int, min_allocator<int>>::iterator i = l1.erase(l2.cbegin(), l1.cbegin()+1);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp
deleted file mode 100644
index 04c040a8f797..000000000000
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db2.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call erase(const_iterator first, const_iterator last); with second iterator from another container
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::vector<int> l1(a1, a1+3);
- std::vector<int> l2(a1, a1+3);
- std::vector<int>::iterator i = l1.erase(l1.cbegin(), l2.cbegin()+1);
- assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- int a1[] = {1, 2, 3};
- std::vector<int, min_allocator<int>> l1(a1, a1+3);
- std::vector<int, min_allocator<int>> l2(a1, a1+3);
- std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), l2.cbegin()+1);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp
deleted file mode 100644
index ba183a83f0b1..000000000000
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db3.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call erase(const_iterator first, const_iterator last); with both iterators from another container
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::vector<int> l1(a1, a1+3);
- std::vector<int> l2(a1, a1+3);
- std::vector<int>::iterator i = l1.erase(l2.cbegin(), l2.cbegin()+1);
- assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- int a1[] = {1, 2, 3};
- std::vector<int, min_allocator<int>> l1(a1, a1+3);
- std::vector<int, min_allocator<int>> l2(a1, a1+3);
- std::vector<int, min_allocator<int>>::iterator i = l1.erase(l2.cbegin(), l2.cbegin()+1);
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp
deleted file mode 100644
index 0fb8071fc679..000000000000
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter_db4.pass.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call erase(const_iterator first, const_iterator last); with a bad range
-
-#if _LIBCPP_DEBUG >= 1
-
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <vector>
-#include <cassert>
-#include <exception>
-#include <cstdlib>
-
-#include "min_allocator.h"
-
-int main()
-{
- {
- int a1[] = {1, 2, 3};
- std::vector<int> l1(a1, a1+3);
- std::vector<int>::iterator i = l1.erase(l1.cbegin()+1, l1.cbegin());
- assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- int a1[] = {1, 2, 3};
- std::vector<int, min_allocator<int>> l1(a1, a1+3);
- std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin()+1, l1.cbegin());
- assert(false);
- }
-#endif
-}
-
-#else
-
-int main()
-{
-}
-
-#endif
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
index b8953021187f..258b9d9f7517 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
@@ -12,13 +12,12 @@
// template <class Iter>
// iterator insert(const_iterator position, Iter first, Iter last);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include <cstddef>
+
+#include "test_macros.h"
+#include "test_allocator.h"
#include "test_iterators.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -37,7 +36,7 @@ int main()
int j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < 105; ++j)
assert(v[j] == 0);
@@ -54,7 +53,7 @@ int main()
int j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < 105; ++j)
assert(v[j] == 0);
@@ -69,10 +68,10 @@ int main()
forward_iterator<const int*>(a+N));
assert(v.size() == sz + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < v.size(); ++j)
assert(v[j] == 0);
@@ -87,16 +86,16 @@ int main()
forward_iterator<const int*>(a+N));
assert(v.size() == sz + N);
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < v.size(); ++j)
assert(v[j] == 0);
}
{
- std::vector<int, stack_allocator<int, 308> > v(100);
+ std::vector<int, limited_allocator<int, 308> > v(100);
int a[] = {1, 2, 3, 4, 5};
const int N = sizeof(a)/sizeof(a[0]);
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, input_iterator<const int*>(a),
@@ -107,13 +106,13 @@ int main()
int j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < 105; ++j)
assert(v[j] == 0);
}
{
- std::vector<int, stack_allocator<int, 300> > v(100);
+ std::vector<int, limited_allocator<int, 300> > v(100);
int a[] = {1, 2, 3, 4, 5};
const int N = sizeof(a)/sizeof(a[0]);
std::vector<int>::iterator i = v.insert(v.cbegin() + 10, forward_iterator<const int*>(a),
@@ -124,22 +123,11 @@ int main()
int j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < 105; ++j)
assert(v[j] == 0);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::vector<int> v(100);
- std::vector<int> v2(100);
- int a[] = {1, 2, 3, 4, 5};
- const int N = sizeof(a)/sizeof(a[0]);
- std::vector<int>::iterator i = v.insert(v2.cbegin() + 10, input_iterator<const int*>(a),
- input_iterator<const int*>(a+N));
- assert(false);
- }
-#endif
#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v(100);
@@ -153,7 +141,7 @@ int main()
int j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < 105; ++j)
assert(v[j] == 0);
@@ -170,21 +158,10 @@ int main()
int j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
- for (int k = 0; k < N; ++j, ++k)
+ for (std::size_t k = 0; k < N; ++j, ++k)
assert(v[j] == a[k]);
for (; j < 105; ++j)
assert(v[j] == 0);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::vector<int, min_allocator<int>> v(100);
- std::vector<int, min_allocator<int>> v2(100);
- int a[] = {1, 2, 3, 4, 5};
- const int N = sizeof(a)/sizeof(a[0]);
- std::vector<int, min_allocator<int>>::iterator i = v.insert(v2.cbegin() + 10, input_iterator<const int*>(a),
- input_iterator<const int*>(a+N));
- assert(false);
- }
-#endif
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
index e1ad6be054e5..8794d924588b 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
@@ -7,24 +7,23 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// iterator insert(const_iterator position, value_type&& x);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+
+#include "test_macros.h"
+#include "test_allocator.h"
#include "MoveOnly.h"
#include "min_allocator.h"
#include "asan_testing.h"
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<MoveOnly> v(100);
std::vector<MoveOnly>::iterator i = v.insert(v.cbegin() + 10, MoveOnly(3));
@@ -39,8 +38,8 @@ int main()
assert(v[j] == MoveOnly());
}
{
- std::vector<MoveOnly, stack_allocator<MoveOnly, 300> > v(100);
- std::vector<MoveOnly, stack_allocator<MoveOnly, 300> >::iterator i = v.insert(v.cbegin() + 10, MoveOnly(3));
+ std::vector<MoveOnly, limited_allocator<MoveOnly, 300> > v(100);
+ std::vector<MoveOnly, limited_allocator<MoveOnly, 300> >::iterator i = v.insert(v.cbegin() + 10, MoveOnly(3));
assert(v.size() == 101);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
@@ -51,15 +50,6 @@ int main()
for (++j; j < 101; ++j)
assert(v[j] == MoveOnly());
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::vector<int> v1(3);
- std::vector<int> v2(3);
- v1.insert(v2.begin(), 4);
- assert(false);
- }
-#endif
-#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly>> v(100);
std::vector<MoveOnly, min_allocator<MoveOnly>>::iterator i = v.insert(v.cbegin() + 10, MoveOnly(3));
@@ -73,14 +63,4 @@ int main()
for (++j; j < 101; ++j)
assert(v[j] == MoveOnly());
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::vector<int, min_allocator<int>> v1(3);
- std::vector<int, min_allocator<int>> v2(3);
- v1.insert(v2.begin(), 4);
- assert(false);
- }
-#endif
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
index ed4d6c976e9c..b6fc9ac73ea1 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
@@ -11,13 +11,12 @@
// iterator insert(const_iterator position, size_type n, const value_type& x);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include <cstddef>
+
+#include "test_macros.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -45,7 +44,7 @@ int main()
assert(v.size() == sz + 5);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
@@ -61,7 +60,7 @@ int main()
assert(v.size() == sz + 5);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
for (; j < 15; ++j)
@@ -70,8 +69,8 @@ int main()
assert(v[j] == 0);
}
{
- std::vector<int, stack_allocator<int, 300> > v(100);
- std::vector<int, stack_allocator<int, 300> >::iterator i = v.insert(v.cbegin() + 10, 5, 1);
+ std::vector<int, limited_allocator<int, 300> > v(100);
+ std::vector<int, limited_allocator<int, 300> >::iterator i = v.insert(v.cbegin() + 10, 5, 1);
assert(v.size() == 105);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
@@ -83,14 +82,6 @@ int main()
for (++j; j < 105; ++j)
assert(v[j] == 0);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::vector<int> c1(100);
- std::vector<int> c2;
- std::vector<int>::iterator i = c1.insert(c2.cbegin() + 10, 5, 1);
- assert(false);
- }
-#endif
#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v(100);
@@ -120,13 +111,5 @@ int main()
for (++j; j < 105; ++j)
assert(v[j] == 0);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::vector<int, min_allocator<int>> c1(100);
- std::vector<int, min_allocator<int>> c2;
- std::vector<int, min_allocator<int>>::iterator i = c1.insert(c2.cbegin() + 10, 5, 1);
- assert(false);
- }
-#endif
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
index ba030e9e3fb7..5010f89493f0 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
@@ -11,13 +11,12 @@
// iterator insert(const_iterator position, const value_type& x);
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include <cstddef>
+
+#include "test_macros.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -44,7 +43,7 @@ int main()
assert(v.size() == sz + 1);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
@@ -60,7 +59,7 @@ int main()
assert(v.size() == sz + 1);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
- int j;
+ std::size_t j;
for (j = 0; j < 10; ++j)
assert(v[j] == 0);
assert(v[j] == 1);
@@ -68,8 +67,8 @@ int main()
assert(v[j] == 0);
}
{
- std::vector<int, stack_allocator<int, 300> > v(100);
- std::vector<int, stack_allocator<int, 300> >::iterator i = v.insert(v.cbegin() + 10, 1);
+ std::vector<int, limited_allocator<int, 300> > v(100);
+ std::vector<int, limited_allocator<int, 300> >::iterator i = v.insert(v.cbegin() + 10, 1);
assert(v.size() == 101);
assert(is_contiguous_container_asan_correct(v));
assert(i == v.begin() + 10);
@@ -80,15 +79,6 @@ int main()
for (++j; j < 101; ++j)
assert(v[j] == 0);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::vector<int> v1(3);
- std::vector<int> v2(3);
- int i = 4;
- v1.insert(v2.begin(), i);
- assert(false);
- }
-#endif
#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v(100);
@@ -103,14 +93,5 @@ int main()
for (++j; j < 101; ++j)
assert(v[j] == 0);
}
-#if _LIBCPP_DEBUG >= 1
- {
- std::vector<int, min_allocator<int>> v1(3);
- std::vector<int, min_allocator<int>> v2(3);
- int i = 4;
- v1.insert(v2.begin(), i);
- assert(false);
- }
-#endif
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp
index c81e41904fc8..c44023827ea5 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/pop_back.pass.cpp
@@ -11,20 +11,13 @@
// void pop_back();
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
-#include "min_allocator.h"
-#if _LIBCPP_DEBUG >= 1
-#include <cstdlib>
-#include <exception>
+#include "test_macros.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
-#endif
int main()
{
@@ -34,10 +27,7 @@ int main()
assert(c.size() == 1);
c.pop_back();
assert(c.size() == 0);
-#if _LIBCPP_DEBUG >= 1
- c.pop_back();
- assert(false);
-#endif
+
}
#if TEST_STD_VER >= 11
{
@@ -46,10 +36,6 @@ int main()
assert(c.size() == 1);
c.pop_back();
assert(c.size() == 0);
-#if _LIBCPP_DEBUG >= 1
- c.pop_back();
- assert(false);
-#endif
}
#endif
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp
index bef3b9c8d17d..3b568b7e06d0 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp
@@ -13,7 +13,8 @@
#include <vector>
#include <cassert>
-#include "../../../stack_allocator.h"
+#include <cstddef>
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -24,55 +25,58 @@ int main()
c.push_back(0);
assert(c.size() == 1);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(1);
assert(c.size() == 2);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(2);
assert(c.size() == 3);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(3);
assert(c.size() == 4);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(4);
assert(c.size() == 5);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
}
{
- std::vector<int, stack_allocator<int, 15> > c;
+ // libc++ needs 15 because it grows by 2x (1 + 2 + 4 + 8).
+ // Use 17 for implementations that dynamically allocate a container proxy
+ // and grow by 1.5x (1 for proxy + 1 + 2 + 3 + 4 + 6).
+ std::vector<int, limited_allocator<int, 17> > c;
c.push_back(0);
assert(c.size() == 1);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(1);
assert(c.size() == 2);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(2);
assert(c.size() == 3);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(3);
assert(c.size() == 4);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(4);
assert(c.size() == 5);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
}
#if TEST_STD_VER >= 11
@@ -81,27 +85,27 @@ int main()
c.push_back(0);
assert(c.size() == 1);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(1);
assert(c.size() == 2);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(2);
assert(c.size() == 3);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(3);
assert(c.size() == 4);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
c.push_back(4);
assert(c.size() == 5);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == j);
}
#endif
diff --git a/test/std/containers/sequences/vector/vector.modifiers/push_back_exception_safety.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/push_back_exception_safety.pass.cpp
index 5fa93aab89c7..eabe029a3a77 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/push_back_exception_safety.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/push_back_exception_safety.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <vector>
// void push_back(const value_type& x);
@@ -16,10 +15,10 @@
#include <cassert>
#include "asan_testing.h"
+#include "test_macros.h"
// Flag that makes the copy constructor for CMyClass throw an exception
-static bool gCopyConstructorShouldThow = false;
-
+static bool gCopyConstructorShouldThrow = false;
class CMyClass {
public: CMyClass(int tag);
@@ -52,8 +51,8 @@ CMyClass::CMyClass(const CMyClass& iOther) :
fMagicValue(kStartedConstructionMagicValue), fTag(iOther.fTag)
{
// If requested, throw an exception _before_ setting fMagicValue to kFinishedConstructionMagicValue
- if (gCopyConstructorShouldThow) {
- throw std::exception();
+ if (gCopyConstructorShouldThrow) {
+ TEST_THROW(std::exception());
}
// Signal that the constructor has finished running
fMagicValue = kFinishedConstructionMagicValue;
@@ -76,12 +75,15 @@ int main()
assert(is_contiguous_container_asan_correct(vec));
assert(is_contiguous_container_asan_correct(vec2));
- gCopyConstructorShouldThow = true;
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ gCopyConstructorShouldThrow = true;
try {
vec.push_back(instance);
+ assert(false);
}
catch (...) {
assert(vec==vec2);
assert(is_contiguous_container_asan_correct(vec));
}
+#endif
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
index 64762eb374e8..f4a1f5d5f519 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
@@ -13,8 +13,9 @@
#include <vector>
#include <cassert>
+#include <cstddef>
#include "MoveOnly.h"
-#include "../../../stack_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -26,55 +27,58 @@ int main()
c.push_back(MoveOnly(0));
assert(c.size() == 1);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(1));
assert(c.size() == 2);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(2));
assert(c.size() == 3);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(3));
assert(c.size() == 4);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(4));
assert(c.size() == 5);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
}
{
- std::vector<MoveOnly, stack_allocator<MoveOnly, 15> > c;
+ // libc++ needs 15 because it grows by 2x (1 + 2 + 4 + 8).
+ // Use 17 for implementations that dynamically allocate a container proxy
+ // and grow by 1.5x (1 for proxy + 1 + 2 + 3 + 4 + 6).
+ std::vector<MoveOnly, limited_allocator<MoveOnly, 17> > c;
c.push_back(MoveOnly(0));
assert(c.size() == 1);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(1));
assert(c.size() == 2);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(2));
assert(c.size() == 3);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(3));
assert(c.size() == 4);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(4));
assert(c.size() == 5);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
}
#if TEST_STD_VER >= 11
@@ -83,27 +87,27 @@ int main()
c.push_back(MoveOnly(0));
assert(c.size() == 1);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(1));
assert(c.size() == 2);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(2));
assert(c.size() == 3);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(3));
assert(c.size() == 4);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
c.push_back(MoveOnly(4));
assert(c.size() == 5);
assert(is_contiguous_container_asan_correct(c));
- for (int j = 0; j < c.size(); ++j)
+ for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
}
#endif
diff --git a/test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp b/test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp
deleted file mode 100644
index 1bb761181422..000000000000
--- a/test/std/containers/sequences/vector/vector.special/db_swap_1.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// template <class T, class Alloc>
-// void swap(vector<T,Alloc>& x, vector<T,Alloc>& y);
-
-#if _LIBCPP_DEBUG >= 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#endif
-
-#include <vector>
-#include <cassert>
-
-#include "min_allocator.h"
-
-int main()
-{
-#if _LIBCPP_DEBUG >= 1
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::vector<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::vector<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- std::vector<int>::iterator i1 = c1.begin();
- std::vector<int>::iterator i2 = c2.begin();
- swap(c1, c2);
- c1.erase(i2);
- c2.erase(i1);
- c1.erase(i1);
- assert(false);
- }
-#if TEST_STD_VER >= 11
- {
- int a1[] = {1, 3, 7, 9, 10};
- int a2[] = {0, 2, 4, 5, 6, 8, 11};
- std::vector<int, min_allocator<int>> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
- std::vector<int, min_allocator<int>> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
- std::vector<int, min_allocator<int>>::iterator i1 = c1.begin();
- std::vector<int, min_allocator<int>>::iterator i2 = c2.begin();
- swap(c1, c2);
- c1.erase(i2);
- c2.erase(i1);
- c1.erase(i1);
- assert(false);
- }
-#endif
-#endif
-}
diff --git a/test/std/containers/sequences/vector/vector.special/swap.pass.cpp b/test/std/containers/sequences/vector/vector.special/swap.pass.cpp
index 3d01129fa008..0f42d891a587 100644
--- a/test/std/containers/sequences/vector/vector.special/swap.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.special/swap.pass.cpp
@@ -77,21 +77,18 @@ int main()
assert(is_contiguous_container_asan_correct(c1));
assert(is_contiguous_container_asan_correct(c2));
}
-#ifndef _LIBCPP_DEBUG_LEVEL
-// This test known to result in undefined behavior detected by _LIBCPP_DEBUG_LEVEL >= 1
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
typedef test_allocator<int> A;
- std::vector<int, A> c1(a1, a1+sizeof(a1)/sizeof(a1[0]), A(1));
- std::vector<int, A> c2(a2, a2+sizeof(a2)/sizeof(a2[0]), A(2));
+ std::vector<int, A> c1(a1, a1+sizeof(a1)/sizeof(a1[0]), A(1, 1));
+ std::vector<int, A> c2(a2, a2+sizeof(a2)/sizeof(a2[0]), A(1, 2));
swap(c1, c2);
assert((c1 == std::vector<int, A>(a2, a2+sizeof(a2)/sizeof(a2[0]))));
- assert(c1.get_allocator() == A(1));
+ assert(c1.get_allocator().get_id() == 1);
assert((c2 == std::vector<int, A>(a1, a1+sizeof(a1)/sizeof(a1[0]))));
- assert(c2.get_allocator() == A(2));
+ assert(c2.get_allocator().get_id() == 2);
}
-#endif
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
@@ -165,8 +162,6 @@ int main()
assert(is_contiguous_container_asan_correct(c1));
assert(is_contiguous_container_asan_correct(c2));
}
-#ifndef _LIBCPP_DEBUG_LEVEL
-// This test known to result in undefined behavior detected by _LIBCPP_DEBUG_LEVEL >= 1
{
int a1[] = {1, 3, 7, 9, 10};
int a2[] = {0, 2, 4, 5, 6, 8, 11};
@@ -184,5 +179,4 @@ int main()
assert(is_contiguous_container_asan_correct(c2));
}
#endif
-#endif
}
diff --git a/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
index 89fa301ad9bd..214f9a577571 100644
--- a/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
@@ -22,6 +22,7 @@
// This tests a conforming extension
#include <vector>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -57,35 +58,30 @@ int main()
{
{
typedef std::vector<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::vector<MoveOnly, test_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::vector<MoveOnly, other_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::vector<MoveOnly, some_alloc<MoveOnly>> C;
- C c1, c2;
#if TEST_STD_VER >= 14
// In c++14, if POCS is set, swapping the allocator is required not to throw
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#else
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#endif
}
#if TEST_STD_VER >= 14
{
typedef std::vector<MoveOnly, some_alloc2<MoveOnly>> C;
- C c1, c2;
// if the allocators are always equal, then the swap can be noexcept
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
}
diff --git a/test/std/containers/stack_allocator.h b/test/std/containers/stack_allocator.h
deleted file mode 100644
index d5fab025c9d0..000000000000
--- a/test/std/containers/stack_allocator.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef STACK_ALLOCATOR_H
-#define STACK_ALLOCATOR_H
-
-#include <cstddef>
-#include <new>
-
-template <class T, std::size_t N>
-class stack_allocator
-{
- char buf_[sizeof(T)*N];
- char* ptr_;
-public:
- typedef T value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
-
- template <class U> struct rebind {typedef stack_allocator<U, N> other;};
-
- stack_allocator() : ptr_(buf_) {}
-
-private:
- stack_allocator(const stack_allocator&);// = delete;
- stack_allocator& operator=(const stack_allocator&);// = delete;
-
-public:
- pointer allocate(size_type n, const void* = 0)
- {
- if (n > N - (ptr_ - buf_) / sizeof(value_type)) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw std::bad_alloc();
-#else
- std::terminate();
-#endif
- }
- pointer r = (T*)ptr_;
- ptr_ += n * sizeof(T);
- return r;
- }
- void deallocate(pointer p, size_type n)
- {
- if ((char*)(p + n) == ptr_)
- ptr_ = (char*)p;
- }
-
- size_type max_size() const {return N;}
-};
-
-template <class T, std::size_t N>
-inline
-void
-swap(stack_allocator<T, N>& x, stack_allocator<T, N>& y) {}
-
-#endif // STACK_ALLOCATOR_H
diff --git a/test/std/containers/unord/unord.map/bucket.pass.cpp b/test/std/containers/unord/unord.map/bucket.pass.cpp
index 1abb58070afd..8931fdf642ff 100644
--- a/test/std/containers/unord/unord.map/bucket.pass.cpp
+++ b/test/std/containers/unord/unord.map/bucket.pass.cpp
@@ -23,6 +23,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -43,7 +44,7 @@ int main()
size_t bc = c.bucket_count();
assert(bc >= 5);
for (size_t i = 0; i < 13; ++i)
- assert(c.bucket(i) == i % bc);
+ LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#if TEST_STD_VER >= 11
{
@@ -63,7 +64,7 @@ int main()
size_t bc = c.bucket_count();
assert(bc >= 5);
for (size_t i = 0; i < 13; ++i)
- assert(c.bucket(i) == i % bc);
+ LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1
diff --git a/test/std/containers/unord/unord.map/bucket_count.pass.cpp b/test/std/containers/unord/unord.map/bucket_count.pass.cpp
index bc3733742600..9ab8bfd19382 100644
--- a/test/std/containers/unord/unord.map/bucket_count.pass.cpp
+++ b/test/std/containers/unord/unord.map/bucket_count.pass.cpp
@@ -27,7 +27,7 @@ int main()
{
typedef std::unordered_map<int, std::string> C;
const C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
}
{
typedef std::unordered_map<int, std::string> C;
@@ -44,14 +44,14 @@ int main()
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#if TEST_STD_VER >= 11
{
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
min_allocator<std::pair<const int, std::string>>> C;
const C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
}
{
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
@@ -69,7 +69,7 @@ int main()
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#endif
}
diff --git a/test/std/containers/unord/unord.map/bucket_size.pass.cpp b/test/std/containers/unord/unord.map/bucket_size.pass.cpp
index 4344508b7334..af25de4db769 100644
--- a/test/std/containers/unord/unord.map/bucket_size.pass.cpp
+++ b/test/std/containers/unord/unord.map/bucket_size.pass.cpp
@@ -23,6 +23,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -41,11 +42,11 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 5);
- assert(c.bucket_size(0) == 0);
- assert(c.bucket_size(1) == 1);
- assert(c.bucket_size(2) == 1);
- assert(c.bucket_size(3) == 1);
- assert(c.bucket_size(4) == 1);
+ LIBCPP_ASSERT(c.bucket_size(0) == 0);
+ LIBCPP_ASSERT(c.bucket_size(1) == 1);
+ LIBCPP_ASSERT(c.bucket_size(2) == 1);
+ LIBCPP_ASSERT(c.bucket_size(3) == 1);
+ LIBCPP_ASSERT(c.bucket_size(4) == 1);
}
#if TEST_STD_VER >= 11
{
@@ -63,11 +64,11 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 5);
- assert(c.bucket_size(0) == 0);
- assert(c.bucket_size(1) == 1);
- assert(c.bucket_size(2) == 1);
- assert(c.bucket_size(3) == 1);
- assert(c.bucket_size(4) == 1);
+ LIBCPP_ASSERT(c.bucket_size(0) == 0);
+ LIBCPP_ASSERT(c.bucket_size(1) == 1);
+ LIBCPP_ASSERT(c.bucket_size(2) == 1);
+ LIBCPP_ASSERT(c.bucket_size(3) == 1);
+ LIBCPP_ASSERT(c.bucket_size(4) == 1);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1
diff --git a/test/std/containers/unord/unord.map/iterators.pass.cpp b/test/std/containers/unord/unord.map/iterators.pass.cpp
index 31f4254ea3f8..f99adb52b3f2 100644
--- a/test/std/containers/unord/unord.map/iterators.pass.cpp
+++ b/test/std/containers/unord/unord.map/iterators.pass.cpp
@@ -23,7 +23,9 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -43,8 +45,8 @@ int main()
C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 5);
assert(c.size() == 4);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::iterator i;
}
{
@@ -62,8 +64,8 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 5);
assert(c.size() == 4);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::const_iterator i;
}
#if TEST_STD_VER >= 11
@@ -83,8 +85,8 @@ int main()
C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 5);
assert(c.size() == 4);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::iterator i;
}
{
@@ -103,12 +105,12 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 5);
assert(c.size() == 4);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::const_iterator i;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::unordered_map<int,double> C;
C::iterator ii1{}, ii2{};
diff --git a/test/std/containers/unord/unord.map/max_size.pass.cpp b/test/std/containers/unord/unord.map/max_size.pass.cpp
index 9c1ca18c3054..152741981461 100644
--- a/test/std/containers/unord/unord.map/max_size.pass.cpp
+++ b/test/std/containers/unord/unord.map/max_size.pass.cpp
@@ -9,28 +9,45 @@
// <unordered_map>
-// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
-// class Alloc = allocator<pair<const Key, T>>>
// class unordered_map
// size_type max_size() const;
-#include <unordered_map>
#include <cassert>
+#include <limits>
+#include <type_traits>
+#include <unordered_map>
-#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
int main()
{
- {
- std::unordered_map<int, int> u;
- assert(u.max_size() > 0);
+ typedef std::pair<const int, int> KV;
+ {
+ typedef limited_allocator<KV, 10> A;
+ typedef std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, A>
+ C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<KV, (size_t)-1> A;
+ typedef std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, A>
+ C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
}
-#if TEST_STD_VER >= 11
{
- std::unordered_map<int, int, std::hash<int>, std::equal_to<int>,
- min_allocator<std::pair<const int, int>>> u;
- assert(u.max_size() > 0);
+ typedef std::unordered_map<char, int> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
}
-#endif
}
diff --git a/test/std/containers/unord/unord.map/rehash.pass.cpp b/test/std/containers/unord/unord.map/rehash.pass.cpp
index fce751593a5e..58222b7f924d 100644
--- a/test/std/containers/unord/unord.map/rehash.pass.cpp
+++ b/test/std/containers/unord/unord.map/rehash.pass.cpp
@@ -19,6 +19,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -56,16 +57,16 @@ int main()
assert(c.bucket_count() >= 5);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 5);
+ LIBCPP_ASSERT(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.rehash(31);
rehash_postcondition(c, 31);
- assert(c.bucket_count() == 31);
+ LIBCPP_ASSERT(c.bucket_count() == 31);
test(c);
}
#if TEST_STD_VER >= 11
@@ -87,16 +88,16 @@ int main()
assert(c.bucket_count() >= 5);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 5);
+ LIBCPP_ASSERT(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.rehash(31);
rehash_postcondition(c, 31);
- assert(c.bucket_count() == 31);
+ LIBCPP_ASSERT(c.bucket_count() == 31);
test(c);
}
#endif
diff --git a/test/std/containers/unord/unord.map/reserve.pass.cpp b/test/std/containers/unord/unord.map/reserve.pass.cpp
index 5999801a3923..1836c2a41da1 100644
--- a/test/std/containers/unord/unord.map/reserve.pass.cpp
+++ b/test/std/containers/unord/unord.map/reserve.pass.cpp
@@ -19,6 +19,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -64,7 +65,7 @@ int main()
test(c);
assert(c.bucket_count() >= 5);
c.reserve(3);
- assert(c.bucket_count() == 5);
+ LIBCPP_ASSERT(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.reserve(3);
@@ -92,7 +93,7 @@ int main()
test(c);
assert(c.bucket_count() >= 5);
c.reserve(3);
- assert(c.bucket_count() == 5);
+ LIBCPP_ASSERT(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.reserve(3);
diff --git a/test/std/containers/unord/unord.map/swap_member.pass.cpp b/test/std/containers/unord/unord.map/swap_member.pass.cpp
index 0f98b66aa401..86a068cd357b 100644
--- a/test/std/containers/unord/unord.map/swap_member.pass.cpp
+++ b/test/std/containers/unord/unord.map/swap_member.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
#include "../../test_compare.h"
#include "../../test_hash.h"
@@ -32,27 +33,27 @@ int main()
typedef test_compare<std::equal_to<int> > Compare;
typedef test_allocator<std::pair<const int, std::string> > Alloc;
typedef std::unordered_map<int, std::string, Hash, Compare, Alloc> C;
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -72,12 +73,12 @@ int main()
P(70, "seventy"),
P(80, "eighty"),
};
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -89,18 +90,18 @@ int main()
assert(c1.at(80) == "eighty");
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -118,21 +119,21 @@ int main()
P(1, "four"),
P(2, "four"),
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -140,9 +141,9 @@ int main()
assert(c2.at(4) == "four");
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -171,12 +172,12 @@ int main()
P(70, "seventy"),
P(80, "eighty"),
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -188,12 +189,12 @@ int main()
assert(c1.at(80) == "eighty");
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -201,9 +202,9 @@ int main()
assert(c2.at(4) == "four");
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
@@ -217,22 +218,22 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -257,7 +258,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -270,17 +271,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -303,16 +304,16 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -321,8 +322,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -356,7 +357,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -369,11 +370,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -382,8 +383,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#if TEST_STD_VER >= 11
@@ -397,22 +398,22 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -437,7 +438,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -450,17 +451,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -483,16 +484,16 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -501,8 +502,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -536,7 +537,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -549,11 +550,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -562,8 +563,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#endif
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp
index 232f2fd4fd59..6caa59728cef 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -34,7 +35,7 @@ int main()
NotConstructible> >
> C;
C c(test_allocator<std::pair<const NotConstructible, NotConstructible> >(10));
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -54,7 +55,7 @@ int main()
NotConstructible> >
> C;
C c(min_allocator<std::pair<const NotConstructible, NotConstructible> >{});
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -93,7 +94,7 @@ int main()
A a(10);
C c(2, a);
- assert(c.bucket_count() == 2);
+ LIBCPP_ASSERT(c.bucket_count() == 2);
assert(c.hash_function() == HF());
assert(c.key_eq() == Comp());
assert(c.get_allocator() == a);
@@ -113,7 +114,7 @@ int main()
A a(10);
HF hf(12);
C c(2, hf, a);
- assert(c.bucket_count() == 2);
+ LIBCPP_ASSERT(c.bucket_count() == 2);
assert(c.hash_function() == hf);
assert(!(c.hash_function() == HF()));
assert(c.key_eq() == Comp());
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp
index ee85750f5c36..b793f0934355 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp
@@ -19,7 +19,9 @@
#include <string>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -57,7 +59,7 @@ int main()
A(4)
);
c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -67,8 +69,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(4));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -130,8 +132,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -166,7 +168,7 @@ int main()
A()
);
c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -176,8 +178,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp
index e4da30bb4efd..4d92b3d4c2c5 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp
@@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
+#include <cstddef>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -54,8 +55,8 @@ int main()
assert(c.at(2) == "two");
assert(c.at(3) == "three");
assert(c.at(4) == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -87,8 +88,8 @@ int main()
assert(c.at(2) == "two");
assert(c.at(3) == "three");
assert(c.at(4) == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp
index fe3eaee4642b..e86d35b0ac8b 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp
@@ -19,7 +19,9 @@
#include <string>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -58,7 +60,7 @@ int main()
A(4)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -68,8 +70,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(4));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -103,7 +105,7 @@ int main()
A(10)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -113,8 +115,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c0.size() == 0);
@@ -149,7 +151,7 @@ int main()
A(4)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -159,8 +161,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c0.size() == 0);
@@ -196,7 +198,7 @@ int main()
A()
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -206,8 +208,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c0.size() == 0);
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/compare_copy_constructible.fail.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/compare_copy_constructible.fail.cpp
index 417120b9eb0e..7f62a4fedf83 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/compare_copy_constructible.fail.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/compare_copy_constructible.fail.cpp
@@ -12,7 +12,7 @@
// <unordered_map>
-// Check that std::unordered_map fails to instantiate if the comparison predicate is
+// Check that std::unordered_map fails to instantiate if the comparison predicate is
// not copy-constructible. This is LWG issue 2436
#include <unordered_map>
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/copy.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/copy.pass.cpp
index 0590d12818b3..0b1d460ef74b 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/copy.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/copy.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -51,7 +53,7 @@ int main()
test_allocator<std::pair<const int, std::string> >(10)
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -62,12 +64,12 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >(10)));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
typedef std::unordered_map<int, std::string,
test_hash<std::hash<int> >,
@@ -91,7 +93,7 @@ int main()
other_allocator<std::pair<const int, std::string> >(10)
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -102,13 +104,11 @@ int main()
assert(c.get_allocator() ==
(other_allocator<std::pair<const int, std::string> >(-2)));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if TEST_STD_VER >= 11
{
typedef std::unordered_map<int, std::string,
test_hash<std::hash<int> >,
@@ -132,7 +132,7 @@ int main()
min_allocator<std::pair<const int, std::string> >()
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -143,8 +143,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/copy_alloc.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/copy_alloc.pass.cpp
index 3c0be631386c..cf83074ae170 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/copy_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/copy_alloc.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -51,7 +53,7 @@ int main()
test_allocator<std::pair<const int, std::string> >(10)
);
C c(c0, test_allocator<std::pair<const int, std::string> >(5));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -62,8 +64,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >(5)));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -91,7 +93,7 @@ int main()
min_allocator<std::pair<const int, std::string> >()
);
C c(c0, min_allocator<std::pair<const int, std::string> >());
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -102,8 +104,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -141,8 +143,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A{});
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/default.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/default.pass.cpp
index ad7f3a914dcb..04d172e4ddfe 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/default.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/default.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -34,7 +35,7 @@ int main()
NotConstructible> >
> C;
C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -54,7 +55,7 @@ int main()
NotConstructible> >
> C;
C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -100,7 +101,7 @@ int main()
}
{
std::unordered_map<int, int> c = {};
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.size() == 0);
assert(c.empty());
assert(std::distance(c.begin(), c.end()) == 0);
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp
index 3585fe7b881a..4fb10afd4e59 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -54,11 +55,11 @@ int main()
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
some_comp<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/hash_copy_constructible.fail.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/hash_copy_constructible.fail.cpp
index 709b56de2453..2525c4444ffb 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/hash_copy_constructible.fail.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/hash_copy_constructible.fail.cpp
@@ -12,7 +12,7 @@
// <unordered_map>
-// Check that std::unordered_map fails to instantiate if the hash function is
+// Check that std::unordered_map fails to instantiate if the hash function is
// not copy-constructible. This is mentioned in LWG issue 2436
#include <unordered_map>
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp
index e980b68b57c1..bebab0375d86 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp
@@ -19,7 +19,9 @@
#include <string>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -54,8 +56,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -86,12 +88,12 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<int, std::string> P;
typedef test_allocator<std::pair<const int, std::string>> A;
@@ -118,8 +120,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == a);
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -151,8 +153,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == a);
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp
index 07e77e33504f..9055e3dcd166 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -46,7 +48,7 @@ int main()
},
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -57,8 +59,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -80,7 +82,7 @@ int main()
},
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -91,8 +93,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp
index 01aca134a604..db0010b3401c 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -47,7 +49,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -58,8 +60,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -82,7 +84,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -93,8 +95,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp
index 08efdbd3591f..c76ce3968ad3 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -49,7 +51,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -60,8 +62,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -85,7 +87,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -96,8 +98,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp
index e629c7f0782a..6cb57d4ff210 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -50,7 +52,7 @@ int main()
test_compare<std::equal_to<int> >(9),
test_allocator<std::pair<const int, std::string> >(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -61,8 +63,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >(10)));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -87,7 +89,7 @@ int main()
test_compare<std::equal_to<int> >(9),
min_allocator<std::pair<const int, std::string> >()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -98,8 +100,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -134,8 +136,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A{});
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/move.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/move.pass.cpp
index 0f40e349db67..808d8946a7ec 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/move.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/move.pass.cpp
@@ -22,7 +22,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -42,15 +44,15 @@ int main()
test_allocator<std::pair<const int, std::string> >(10)
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 0);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >(10)));
assert(c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
@@ -79,7 +81,7 @@ int main()
test_allocator<std::pair<const int, std::string> >(10)
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -90,8 +92,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >(10)));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
@@ -109,15 +111,15 @@ int main()
min_allocator<std::pair<const int, std::string> >()
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 0);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
@@ -146,7 +148,7 @@ int main()
min_allocator<std::pair<const int, std::string> >()
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -157,8 +159,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp
index 36a1fa55a3cb..681c0e95b937 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -63,8 +65,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(12));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
@@ -94,7 +96,7 @@ int main()
A(10)
);
C c(std::move(c0), A(10));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -104,8 +106,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
@@ -136,7 +138,7 @@ int main()
A()
);
C c(std::move(c0), A());
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -146,8 +148,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
@@ -187,8 +189,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A{});
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp
index 61c2969d9337..c0dc71da45d8 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp
@@ -22,6 +22,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -56,7 +57,7 @@ int main()
{
typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp
index 16dc3dc6d4fa..c40173ede750 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp
@@ -20,6 +20,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,17 +44,17 @@ int main()
{
{
typedef std::unordered_map<MoveOnly, MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/range.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/range.pass.cpp
index d2a18fa45f11..3dbcf4d15823 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/range.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/range.pass.cpp
@@ -20,7 +20,9 @@
#include <string>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
@@ -58,8 +60,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -92,12 +94,12 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<int, std::string> P;
typedef test_allocator<std::pair<const int, std::string>> A;
@@ -125,8 +127,8 @@ int main()
assert(c.key_eq() == Comp());
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -160,8 +162,8 @@ int main()
assert(c.key_eq() == Comp());
assert(c.get_allocator() == a);
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/range_size.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/range_size.pass.cpp
index 9af18ab61f41..426b5dac18ba 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/range_size.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/range_size.pass.cpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
@@ -50,7 +52,7 @@ int main()
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
10
);
- assert(c.bucket_count() == 11);
+ LIBCPP_ASSERT(c.bucket_count() == 11);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -61,8 +63,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -86,7 +88,7 @@ int main()
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
10
);
- assert(c.bucket_count() == 11);
+ LIBCPP_ASSERT(c.bucket_count() == 11);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -97,8 +99,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash.pass.cpp
index e23208dba991..ea058bdff1fc 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash.pass.cpp
@@ -22,7 +22,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
@@ -52,7 +54,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -63,8 +65,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -89,7 +91,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -100,8 +102,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash_equal.pass.cpp
index d296bab32741..1fdde2b12158 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash_equal.pass.cpp
@@ -22,7 +22,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
@@ -53,7 +55,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -64,8 +66,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -91,7 +93,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -102,8 +104,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash_equal_allocator.pass.cpp
index 3b0fd9829c95..f95efbe5f53c 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/range_size_hash_equal_allocator.pass.cpp
@@ -23,7 +23,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
@@ -55,7 +57,7 @@ int main()
test_compare<std::equal_to<int> >(9),
test_allocator<std::pair<const int, std::string> >(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -66,8 +68,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >(10)));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -94,7 +96,7 @@ int main()
test_compare<std::equal_to<int> >(9),
min_allocator<std::pair<const int, std::string> >()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
@@ -105,8 +107,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -143,8 +145,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A{});
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/size.fail.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/size.fail.cpp
index d2551861ec89..94833c23247d 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/size.fail.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/size.fail.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -34,7 +35,7 @@ int main()
NotConstructible> >
> C;
C c = 7;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -54,7 +55,7 @@ int main()
NotConstructible> >
> C;
C c = 7;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/size.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/size.pass.cpp
index 465dea21bce1..acf6b11fe9a2 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/size.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/size.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -34,7 +35,7 @@ int main()
NotConstructible> >
> C;
C c(7);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -54,7 +55,7 @@ int main()
NotConstructible> >
> C;
C c(7);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash.pass.cpp
index f70ad7a1e5bc..42a248cc1602 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -36,7 +37,7 @@ int main()
C c(7,
test_hash<std::hash<NotConstructible> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -58,7 +59,7 @@ int main()
C c(7,
test_hash<std::hash<NotConstructible> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal.pass.cpp
index 184d77d69d5f..820a3652ec9e 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -37,7 +38,7 @@ int main()
test_hash<std::hash<NotConstructible> >(8),
test_compare<std::equal_to<NotConstructible> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() ==
@@ -60,7 +61,7 @@ int main()
test_hash<std::hash<NotConstructible> >(8),
test_compare<std::equal_to<NotConstructible> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() ==
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal_allocator.pass.cpp
index ad4e6482c412..58c397c2b991 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal_allocator.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -38,7 +39,7 @@ int main()
test_compare<std::equal_to<NotConstructible> >(9),
test_allocator<std::pair<const NotConstructible, NotConstructible> >(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() ==
@@ -62,7 +63,7 @@ int main()
test_compare<std::equal_to<NotConstructible> >(9),
min_allocator<std::pair<const NotConstructible, NotConstructible> >()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() ==
diff --git a/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp b/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
index 5504d33f299b..8fbded4cd5fb 100644
--- a/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <unordered_map>
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -23,6 +22,7 @@
#include "MoveOnly.h"
#include "min_allocator.h"
+#include "test_macros.h"
int main()
{
@@ -42,6 +42,7 @@ int main()
assert(c.size() == 4);
c.at(1) = "ONE";
assert(c.at(1) == "ONE");
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
c.at(11) = "eleven";
@@ -51,6 +52,7 @@ int main()
{
}
assert(c.size() == 4);
+#endif
}
{
typedef std::unordered_map<int, std::string> C;
@@ -67,6 +69,7 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.size() == 4);
assert(c.at(1) == "one");
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
c.at(11);
@@ -76,6 +79,7 @@ int main()
{
}
assert(c.size() == 4);
+#endif
}
#if TEST_STD_VER >= 11
{
@@ -95,6 +99,7 @@ int main()
assert(c.size() == 4);
c.at(1) = "ONE";
assert(c.at(1) == "ONE");
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
c.at(11) = "eleven";
@@ -104,6 +109,7 @@ int main()
{
}
assert(c.size() == 4);
+#endif
}
{
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
@@ -121,6 +127,7 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.size() == 4);
assert(c.at(1) == "one");
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
c.at(11);
@@ -130,6 +137,7 @@ int main()
{
}
assert(c.size() == 4);
+#endif
}
#endif
}
diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_rvalue.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_rvalue.pass.cpp
index 04d01eb466e7..471040a3374e 100644
--- a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_rvalue.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_rvalue.pass.cpp
@@ -37,22 +37,22 @@ int main()
typedef std::pair<double, short> P;
C c;
C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5, 3));
+ R r = c.insert(e, P(3.5, static_cast<short>(3)));
assert(c.size() == 1);
assert(r->first == 3.5);
assert(r->second == 3);
- r = c.insert(c.end(), P(3.5, 4));
+ r = c.insert(c.end(), P(3.5, static_cast<short>(4)));
assert(c.size() == 1);
assert(r->first == 3.5);
assert(r->second == 3);
- r = c.insert(c.end(), P(4.5, 4));
+ r = c.insert(c.end(), P(4.5, static_cast<short>(4)));
assert(c.size() == 2);
assert(r->first == 4.5);
assert(r->second == 4);
- r = c.insert(c.end(), P(5.5, 4));
+ r = c.insert(c.end(), P(5.5, static_cast<short>(4)));
assert(c.size() == 3);
assert(r->first == 5.5);
assert(r->second == 4);
@@ -90,22 +90,22 @@ int main()
typedef std::pair<double, short> P;
C c;
C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5, 3));
+ R r = c.insert(e, P(3.5, static_cast<short>(3)));
assert(c.size() == 1);
assert(r->first == 3.5);
assert(r->second == 3);
- r = c.insert(c.end(), P(3.5, 4));
+ r = c.insert(c.end(), P(3.5, static_cast<short>(4)));
assert(c.size() == 1);
assert(r->first == 3.5);
assert(r->second == 3);
- r = c.insert(c.end(), P(4.5, 4));
+ r = c.insert(c.end(), P(4.5, static_cast<short>(4)));
assert(c.size() == 2);
assert(r->first == 4.5);
assert(r->second == 4);
- r = c.insert(c.end(), P(5.5, 4));
+ r = c.insert(c.end(), P(5.5, static_cast<short>(4)));
assert(c.size() == 3);
assert(r->first == 5.5);
assert(r->second == 4);
diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue.pass.cpp
index faf5b046b5d8..8c8551e7467a 100644
--- a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue.pass.cpp
@@ -32,25 +32,25 @@ int main()
typedef std::pair<C::iterator, bool> R;
typedef std::pair<double, short> P;
C c;
- R r = c.insert(P(3.5, 3));
+ R r = c.insert(P(3.5, static_cast<short>(3)));
assert(r.second);
assert(c.size() == 1);
assert(r.first->first == 3.5);
assert(r.first->second == 3);
- r = c.insert(P(3.5, 4));
+ r = c.insert(P(3.5, static_cast<short>(4)));
assert(!r.second);
assert(c.size() == 1);
assert(r.first->first == 3.5);
assert(r.first->second == 3);
- r = c.insert(P(4.5, 4));
+ r = c.insert(P(4.5, static_cast<short>(4)));
assert(r.second);
assert(c.size() == 2);
assert(r.first->first == 4.5);
assert(r.first->second == 4);
- r = c.insert(P(5.5, 4));
+ r = c.insert(P(5.5, static_cast<short>(4)));
assert(r.second);
assert(c.size() == 3);
assert(r.first->first == 5.5);
@@ -91,25 +91,25 @@ int main()
typedef std::pair<C::iterator, bool> R;
typedef std::pair<double, short> P;
C c;
- R r = c.insert(P(3.5, 3));
+ R r = c.insert(P(3.5, static_cast<short>(3)));
assert(r.second);
assert(c.size() == 1);
assert(r.first->first == 3.5);
assert(r.first->second == 3);
- r = c.insert(P(3.5, 4));
+ r = c.insert(P(3.5, static_cast<short>(4)));
assert(!r.second);
assert(c.size() == 1);
assert(r.first->first == 3.5);
assert(r.first->second == 3);
- r = c.insert(P(4.5, 4));
+ r = c.insert(P(4.5, static_cast<short>(4)));
assert(r.second);
assert(c.size() == 2);
assert(r.first->first == 4.5);
assert(r.first->second == 4);
- r = c.insert(P(5.5, 4));
+ r = c.insert(P(5.5, static_cast<short>(4)));
assert(r.second);
assert(c.size() == 3);
assert(r.first->first == 5.5);
diff --git a/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp b/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp
index f8f17ffec57a..fc286ceec8eb 100644
--- a/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp
@@ -26,6 +26,7 @@
// This tests a conforming extension
#include <unordered_map>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -122,79 +123,65 @@ int main()
typedef std::pair<const MoveOnly, MoveOnly> MapType;
{
typedef std::unordered_map<MoveOnly, MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<MapType>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<MapType>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
some_comp<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for hash, throwable swap for comp
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc <MapType>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for hash, throwable swap for comp
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc2<MapType>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, throwable swap for hash, nothrow swap for comp
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc <MapType>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for hash, nothrow swap for comp
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MapType>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for hash, throwable swap for comp
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc <MapType>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for hash, throwable swap for comp
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc2<MapType>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc <MapType>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MapType>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // NOT always equal allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_map<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc3<MapType>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
}
diff --git a/test/std/containers/unord/unord.map/unord.map.swap/swap_non_member.pass.cpp b/test/std/containers/unord/unord.map/unord.map.swap/swap_non_member.pass.cpp
index f3d51f6da275..2044f42cfc49 100644
--- a/test/std/containers/unord/unord.map/unord.map.swap/swap_non_member.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.swap/swap_non_member.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -32,27 +33,27 @@ int main()
typedef test_compare<std::equal_to<int> > Compare;
typedef test_allocator<std::pair<const int, std::string> > Alloc;
typedef std::unordered_map<int, std::string, Hash, Compare, Alloc> C;
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -72,12 +73,12 @@ int main()
P(70, "seventy"),
P(80, "eighty"),
};
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -89,18 +90,18 @@ int main()
assert(c1.at(80) == "eighty");
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -118,21 +119,21 @@ int main()
P(1, "four"),
P(2, "four"),
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -140,9 +141,9 @@ int main()
assert(c2.at(4) == "four");
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -171,12 +172,12 @@ int main()
P(70, "seventy"),
P(80, "eighty"),
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -188,12 +189,12 @@ int main()
assert(c1.at(80) == "eighty");
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -201,9 +202,9 @@ int main()
assert(c2.at(4) == "four");
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
@@ -217,22 +218,22 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -257,7 +258,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -270,17 +271,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -303,16 +304,16 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -321,8 +322,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -356,7 +357,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -369,11 +370,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -382,8 +383,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#if TEST_STD_VER >= 11
@@ -397,22 +398,22 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -437,7 +438,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -450,17 +451,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -483,16 +484,16 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -501,8 +502,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -536,7 +537,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.at(10) == "ten");
assert(c1.at(20) == "twenty");
@@ -549,11 +550,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.at(1) == "one");
assert(c2.at(2) == "two");
@@ -562,8 +563,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#endif
diff --git a/test/std/containers/unord/unord.multimap/bucket.pass.cpp b/test/std/containers/unord/unord.multimap/bucket.pass.cpp
index 415dce11c128..425c63f9df0a 100644
--- a/test/std/containers/unord/unord.multimap/bucket.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/bucket.pass.cpp
@@ -23,6 +23,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -43,7 +44,7 @@ int main()
size_t bc = c.bucket_count();
assert(bc >= 7);
for (size_t i = 0; i < 13; ++i)
- assert(c.bucket(i) == i % bc);
+ LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#if TEST_STD_VER >= 11
{
@@ -63,7 +64,7 @@ int main()
size_t bc = c.bucket_count();
assert(bc >= 7);
for (size_t i = 0; i < 13; ++i)
- assert(c.bucket(i) == i % bc);
+ LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1
diff --git a/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp b/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
index d44412fedf6d..4eea3d0f6fb5 100644
--- a/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
@@ -19,6 +19,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -26,7 +28,7 @@ int main()
typedef C::const_iterator I;
typedef std::pair<int, std::string> P;
const C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
}
{
typedef std::unordered_multimap<int, std::string> C;
@@ -44,6 +46,6 @@ int main()
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
}
diff --git a/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp b/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp
index 3bc3f5876fe6..30c0e5e3cd56 100644
--- a/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp
@@ -23,6 +23,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -41,13 +42,13 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 7);
- assert(c.bucket_size(0) == 0);
- assert(c.bucket_size(1) == 2);
- assert(c.bucket_size(2) == 2);
- assert(c.bucket_size(3) == 1);
- assert(c.bucket_size(4) == 1);
- assert(c.bucket_size(5) == 0);
- assert(c.bucket_size(6) == 0);
+ LIBCPP_ASSERT(c.bucket_size(0) == 0);
+ LIBCPP_ASSERT(c.bucket_size(1) == 2);
+ LIBCPP_ASSERT(c.bucket_size(2) == 2);
+ LIBCPP_ASSERT(c.bucket_size(3) == 1);
+ LIBCPP_ASSERT(c.bucket_size(4) == 1);
+ LIBCPP_ASSERT(c.bucket_size(5) == 0);
+ LIBCPP_ASSERT(c.bucket_size(6) == 0);
}
#if TEST_STD_VER >= 11
{
@@ -65,13 +66,13 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 7);
- assert(c.bucket_size(0) == 0);
- assert(c.bucket_size(1) == 2);
- assert(c.bucket_size(2) == 2);
- assert(c.bucket_size(3) == 1);
- assert(c.bucket_size(4) == 1);
- assert(c.bucket_size(5) == 0);
- assert(c.bucket_size(6) == 0);
+ LIBCPP_ASSERT(c.bucket_size(0) == 0);
+ LIBCPP_ASSERT(c.bucket_size(1) == 2);
+ LIBCPP_ASSERT(c.bucket_size(2) == 2);
+ LIBCPP_ASSERT(c.bucket_size(3) == 1);
+ LIBCPP_ASSERT(c.bucket_size(4) == 1);
+ LIBCPP_ASSERT(c.bucket_size(5) == 0);
+ LIBCPP_ASSERT(c.bucket_size(6) == 0);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1
diff --git a/test/std/containers/unord/unord.multimap/iterators.fail.cpp b/test/std/containers/unord/unord.multimap/iterators.fail.cpp
index d0adb2c25d5e..5ecaba4e500a 100644
--- a/test/std/containers/unord/unord.multimap/iterators.fail.cpp
+++ b/test/std/containers/unord/unord.multimap/iterators.fail.cpp
@@ -24,6 +24,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -39,7 +41,7 @@ int main()
P(2, "four"),
};
C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(std::distance(c.begin(), c.end()) == c.size());
assert(std::distance(c.cbegin(), c.cend()) == c.size());
@@ -61,7 +63,7 @@ int main()
P(2, "four"),
};
const C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(std::distance(c.begin(), c.end()) == c.size());
assert(std::distance(c.cbegin(), c.cend()) == c.size());
diff --git a/test/std/containers/unord/unord.multimap/iterators.pass.cpp b/test/std/containers/unord/unord.multimap/iterators.pass.cpp
index cc75bb10a811..22aa3a0c0516 100644
--- a/test/std/containers/unord/unord.multimap/iterators.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/iterators.pass.cpp
@@ -23,7 +23,9 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -43,8 +45,8 @@ int main()
C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 7);
assert(c.size() == 6);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::iterator i;
i = c.begin();
i->second = "ONE";
@@ -65,8 +67,8 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 7);
assert(c.size() == 6);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::const_iterator i;
}
#if TEST_STD_VER >= 11
@@ -86,8 +88,8 @@ int main()
C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 7);
assert(c.size() == 6);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::iterator i;
i = c.begin();
i->second = "ONE";
@@ -109,12 +111,12 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 7);
assert(c.size() == 6);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::const_iterator i;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::unordered_multimap<int,double> C;
C::iterator ii1{}, ii2{};
diff --git a/test/std/containers/unord/unord.multimap/local_iterators.fail.cpp b/test/std/containers/unord/unord.multimap/local_iterators.fail.cpp
index 5f66cfe287e3..064e1b1bd6e7 100644
--- a/test/std/containers/unord/unord.multimap/local_iterators.fail.cpp
+++ b/test/std/containers/unord/unord.multimap/local_iterators.fail.cpp
@@ -24,6 +24,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -40,7 +42,7 @@ int main()
P(2, "four"),
};
C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
C::size_type b = c.bucket(0);
I i = c.begin(b);
I j = c.end(b);
@@ -105,7 +107,7 @@ int main()
P(2, "four"),
};
const C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
C::size_type b = c.bucket(0);
I i = c.begin(b);
I j = c.end(b);
@@ -169,7 +171,7 @@ int main()
P(2, "four"),
};
C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
C::size_type b = c.bucket(0);
I i = c.cbegin(b);
I j = c.cend(b);
@@ -233,7 +235,7 @@ int main()
P(2, "four"),
};
const C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
C::size_type b = c.bucket(0);
I i = c.cbegin(b);
I j = c.cend(b);
diff --git a/test/std/containers/unord/unord.multimap/max_size.pass.cpp b/test/std/containers/unord/unord.multimap/max_size.pass.cpp
index 3bf1f1496f68..5b58bac385a4 100644
--- a/test/std/containers/unord/unord.multimap/max_size.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/max_size.pass.cpp
@@ -9,28 +9,47 @@
// <unordered_map>
-// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
-// class Alloc = allocator<pair<const Key, T>>>
// class unordered_multimap
// size_type max_size() const;
-#include <unordered_map>
#include <cassert>
+#include <limits>
+#include <type_traits>
+#include <unordered_map>
-#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
int main()
{
- {
- std::unordered_multimap<int, int> u;
- assert(u.max_size() > 0);
+ typedef std::pair<const int, int> KV;
+ {
+ typedef limited_allocator<KV, 10> A;
+ typedef std::unordered_multimap<int, int, std::hash<int>,
+ std::equal_to<int>, A>
+ C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<KV, (size_t)-1> A;
+ typedef std::unordered_multimap<int, int, std::hash<int>,
+ std::equal_to<int>, A>
+ C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
}
-#if TEST_STD_VER >= 11
{
- std::unordered_multimap<int, int, std::hash<int>, std::equal_to<int>,
- min_allocator<std::pair<const int, int>>> u;
- assert(u.max_size() > 0);
+ typedef std::unordered_multimap<char, int> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
}
-#endif
}
diff --git a/test/std/containers/unord/unord.multimap/rehash.pass.cpp b/test/std/containers/unord/unord.multimap/rehash.pass.cpp
index c099abe2ac05..3d3832a2fe3c 100644
--- a/test/std/containers/unord/unord.multimap/rehash.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/rehash.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -61,8 +63,8 @@ void test(const C& c)
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
}
@@ -85,16 +87,16 @@ int main()
assert(c.bucket_count() >= 7);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.rehash(31);
rehash_postcondition(c, 31);
- assert(c.bucket_count() == 31);
+ LIBCPP_ASSERT(c.bucket_count() == 31);
test(c);
}
#if TEST_STD_VER >= 11
@@ -116,16 +118,16 @@ int main()
assert(c.bucket_count() >= 7);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.rehash(31);
rehash_postcondition(c, 31);
- assert(c.bucket_count() == 31);
+ LIBCPP_ASSERT(c.bucket_count() == 31);
test(c);
}
#endif
diff --git a/test/std/containers/unord/unord.multimap/reserve.pass.cpp b/test/std/containers/unord/unord.multimap/reserve.pass.cpp
index 3f76da11e3d9..d86c69c88f25 100644
--- a/test/std/containers/unord/unord.multimap/reserve.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/reserve.pass.cpp
@@ -19,6 +19,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -66,11 +67,11 @@ int main()
test(c);
assert(c.bucket_count() >= 7);
c.reserve(3);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.reserve(3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.reserve(31);
assert(c.bucket_count() >= 16);
@@ -94,11 +95,11 @@ int main()
test(c);
assert(c.bucket_count() >= 7);
c.reserve(3);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.reserve(3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.reserve(31);
assert(c.bucket_count() >= 16);
diff --git a/test/std/containers/unord/unord.multimap/scary.pass.cpp b/test/std/containers/unord/unord.multimap/scary.pass.cpp
index e619a7a54294..ad32ff713f56 100644
--- a/test/std/containers/unord/unord.multimap/scary.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/scary.pass.cpp
@@ -21,4 +21,5 @@ int main()
typedef std::unordered_multimap<int, int> M2;
M2::iterator i;
M1::iterator j = i;
+ ((void)j);
}
diff --git a/test/std/containers/unord/unord.multimap/swap_member.pass.cpp b/test/std/containers/unord/unord.multimap/swap_member.pass.cpp
index 4653cc32ef36..0f898f1b73e0 100644
--- a/test/std/containers/unord/unord.multimap/swap_member.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/swap_member.pass.cpp
@@ -18,7 +18,9 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "../../test_compare.h"
#include "../../test_hash.h"
#include "test_allocator.h"
@@ -33,27 +35,27 @@ int main()
typedef test_allocator<std::pair<const int, std::string> > Alloc;
typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
typedef std::pair<int, std::string> P;
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -73,12 +75,12 @@ int main()
P(70, "seventy"),
P(80, "eighty"),
};
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -90,18 +92,18 @@ int main()
assert(c1.find(80)->second == "eighty");
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -119,21 +121,21 @@ int main()
P(1, "four"),
P(2, "four"),
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -143,9 +145,9 @@ int main()
assert(c2.find(4)->second == "four");
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -174,12 +176,12 @@ int main()
P(70, "seventy"),
P(80, "eighty"),
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -191,12 +193,12 @@ int main()
assert(c1.find(80)->second == "eighty");
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -206,9 +208,9 @@ int main()
assert(c2.find(4)->second == "four");
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
@@ -223,22 +225,22 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -263,7 +265,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -276,17 +278,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -309,16 +311,16 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -329,8 +331,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -364,7 +366,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -377,11 +379,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -392,8 +394,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#if TEST_STD_VER >= 11
@@ -408,22 +410,22 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -448,7 +450,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -461,17 +463,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -494,16 +496,16 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -514,8 +516,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -549,7 +551,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -562,11 +564,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -577,8 +579,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#endif
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/allocator.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/allocator.pass.cpp
index 392f375c4b6c..19877738aae7 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/allocator.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/allocator.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -34,7 +35,7 @@ int main()
NotConstructible> >
> C;
C c(test_allocator<std::pair<const NotConstructible, NotConstructible> >(10));
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -54,7 +55,7 @@ int main()
NotConstructible> >
> C;
C c(min_allocator<std::pair<const NotConstructible, NotConstructible> >{});
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -83,7 +84,7 @@ int main()
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef NotConstructible T;
typedef test_allocator<std::pair<const T, T>> A;
@@ -93,7 +94,7 @@ int main()
A a(10);
C c(2, a);
- assert(c.bucket_count() == 2);
+ LIBCPP_ASSERT(c.bucket_count() == 2);
assert(c.hash_function() == HF());
assert(c.key_eq() == Comp());
assert(c.get_allocator() == a);
@@ -113,7 +114,7 @@ int main()
A a(10);
HF hf(12);
C c(2, hf, a);
- assert(c.bucket_count() == 2);
+ LIBCPP_ASSERT(c.bucket_count() == 2);
assert(c.hash_function() == hf);
assert(!(c.hash_function() == HF()));
assert(c.key_eq() == Comp());
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.pass.cpp
index 5634a79eff33..62e756cda3b1 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.pass.cpp
@@ -19,7 +19,9 @@
#include <string>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -57,7 +59,7 @@ int main()
A(4)
);
c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(i->first == 1);
@@ -81,8 +83,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(4));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -158,8 +160,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -194,7 +196,7 @@ int main()
A()
);
c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(i->first == 1);
@@ -218,8 +220,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp
index 0d3b4453dd44..6d27dec98eaa 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp
@@ -19,6 +19,7 @@
#include <string>
#include <cassert>
#include <cfloat>
+#include <cstddef>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -79,8 +80,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -136,8 +137,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp
index ed8d792e8178..b9b8723452fe 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp
@@ -19,7 +19,9 @@
#include <string>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -58,7 +60,7 @@ int main()
A(4)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -88,8 +90,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -123,7 +125,7 @@ int main()
A(10)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -153,8 +155,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -188,7 +190,7 @@ int main()
A(4)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -218,8 +220,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -254,7 +256,7 @@ int main()
A()
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -284,8 +286,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/compare_copy_constructible.fail.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/compare_copy_constructible.fail.cpp
index d3e31484c8b7..1c46e7adeafa 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/compare_copy_constructible.fail.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/compare_copy_constructible.fail.cpp
@@ -12,7 +12,7 @@
// <unordered_map>
-// Check that std::unordered_multimap fails to instantiate if the comparison predicate is
+// Check that std::unordered_multimap fails to instantiate if the comparison predicate is
// not copy-constructible. This is LWG issue 2436
#include <unordered_map>
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy.pass.cpp
index 7b0adda182cb..5e314db06b8a 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -51,7 +53,7 @@ int main()
test_allocator<std::pair<const int, std::string> >(10)
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(i->first == 1);
@@ -76,12 +78,12 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >(10)));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
typedef std::unordered_multimap<int, std::string,
test_hash<std::hash<int> >,
@@ -105,7 +107,7 @@ int main()
other_allocator<std::pair<const int, std::string> >(10)
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(i->first == 1);
@@ -130,13 +132,11 @@ int main()
assert(c.get_allocator() ==
(other_allocator<std::pair<const int, std::string> >(-2)));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multimap<int, std::string,
test_hash<std::hash<int> >,
@@ -160,7 +160,7 @@ int main()
min_allocator<std::pair<const int, std::string> >()
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(i->first == 1);
@@ -185,8 +185,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy_alloc.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy_alloc.pass.cpp
index a208068111c1..cb221abd4150 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy_alloc.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -51,7 +53,7 @@ int main()
test_allocator<std::pair<const int, std::string> >(10)
);
C c(c0, test_allocator<std::pair<const int, std::string> >(5));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(i->first == 1);
@@ -76,8 +78,8 @@ int main()
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >(5)));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -105,7 +107,7 @@ int main()
min_allocator<std::pair<const int, std::string> >()
);
C c(c0, min_allocator<std::pair<const int, std::string> >());
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(i->first == 1);
@@ -130,8 +132,8 @@ int main()
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -183,8 +185,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A{});
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default.pass.cpp
index 915d2f3851a1..8418c885e975 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -34,7 +35,7 @@ int main()
NotConstructible> >
> C;
C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -54,7 +55,7 @@ int main()
NotConstructible> >
> C;
C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -100,7 +101,7 @@ int main()
}
{
std::unordered_multimap<int, int> c = {};
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.size() == 0);
assert(c.empty());
assert(std::distance(c.begin(), c.end()) == 0);
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp
index 2797f8dcfb04..b5f4403174b8 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -54,11 +55,11 @@ int main()
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
some_comp<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/hash_copy_constructible.fail.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/hash_copy_constructible.fail.cpp
index 4214f694a20f..71e1c9f6d4be 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/hash_copy_constructible.fail.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/hash_copy_constructible.fail.cpp
@@ -12,7 +12,7 @@
// <unordered_map>
-// Check that std::unordered_multimap fails to instantiate if the hash function is
+// Check that std::unordered_multimap fails to instantiate if the hash function is
// not copy-constructible. This is mentioned in LWG issue 2436
#include <unordered_map>
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp
index f6bc3a08cae9..445fd2d82bb2 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp
@@ -19,7 +19,9 @@
#include <string>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -73,8 +75,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >());
@@ -127,15 +129,15 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >());
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert((c.get_allocator() == min_allocator<std::pair<const int, std::string> >()));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<int, std::string> P;
typedef test_allocator<std::pair<const int, std::string>> A;
@@ -182,8 +184,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == HF());
@@ -238,8 +240,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == hf);
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp
index 5dc4323493e4..92a43b482bdf 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -46,7 +48,7 @@ int main()
},
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -76,8 +78,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >());
@@ -102,7 +104,7 @@ int main()
},
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -132,8 +134,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >());
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp
index 8bcbd0bdc352..d7afafcaec92 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -47,7 +49,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -77,8 +79,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -104,7 +106,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -134,8 +136,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp
index 8dda376db3f9..9842a4bbdaf9 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -49,7 +51,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -79,8 +81,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -107,7 +109,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -137,8 +139,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp
index 358cf41b0317..244c3f5c657c 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -50,7 +52,7 @@ int main()
test_compare<std::equal_to<int> >(9),
test_allocator<std::pair<const int, std::string> >(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -80,8 +82,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -109,7 +111,7 @@ int main()
test_compare<std::equal_to<int> >(9),
min_allocator<std::pair<const int, std::string> >()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -139,8 +141,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -198,8 +200,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp
index 58d1424d8b1e..df69b52878d3 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_map>
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -20,7 +22,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -28,38 +32,28 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_multimap<int, std::string,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
test_allocator<std::pair<const int, std::string> >
> C;
- typedef std::pair<int, std::string> P;
- P a[] =
- {
- P(1, "one"),
- P(2, "two"),
- P(3, "three"),
- P(4, "four"),
- P(1, "four"),
- P(2, "four"),
- };
+
C c0(7,
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9),
test_allocator<std::pair<const int, std::string> >(10)
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 0);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() ==
(test_allocator<std::pair<const int, std::string> >(10)));
assert(c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
@@ -88,7 +82,7 @@ int main()
test_allocator<std::pair<const int, std::string> >(10)
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -118,8 +112,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -128,38 +122,27 @@ int main()
assert(c0.empty());
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multimap<int, std::string,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
min_allocator<std::pair<const int, std::string> >
> C;
- typedef std::pair<int, std::string> P;
- P a[] =
- {
- P(1, "one"),
- P(2, "two"),
- P(3, "three"),
- P(4, "four"),
- P(1, "four"),
- P(2, "four"),
- };
C c0(7,
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9),
min_allocator<std::pair<const int, std::string> >()
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 0);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() ==
(min_allocator<std::pair<const int, std::string> >()));
assert(c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
@@ -188,7 +171,7 @@ int main()
min_allocator<std::pair<const int, std::string> >()
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -218,8 +201,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -228,7 +211,6 @@ int main()
assert(c0.empty());
}
-#endif
#if _LIBCPP_DEBUG >= 1
{
std::unordered_multimap<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
@@ -240,5 +222,4 @@ int main()
assert(s2.size() == 2);
}
#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp
index 3e82f4fa626b..878ef598f8cb 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp
@@ -22,7 +22,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -85,8 +87,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -119,7 +121,7 @@ int main()
A(10)
);
C c(std::move(c0), A(10));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -149,8 +151,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -184,7 +186,7 @@ int main()
A()
);
C c(std::move(c0), A());
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -214,8 +216,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -278,8 +280,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp
index eeda7b39e958..b621449f2b74 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp
@@ -22,6 +22,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -56,7 +57,7 @@ int main()
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp
index 965c46499a16..94067c3161e2 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp
@@ -20,6 +20,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,17 +44,17 @@ int main()
{
{
typedef std::unordered_multimap<MoveOnly, MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range.pass.cpp
index 96ad70a56e0f..11465edae3e5 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range.pass.cpp
@@ -20,7 +20,9 @@
#include <string>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
@@ -77,8 +79,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >());
@@ -133,15 +135,15 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >());
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert((c.get_allocator() == min_allocator<std::pair<const int, std::string> >()));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<int, std::string> P;
typedef test_allocator<std::pair<const int, std::string>> A;
@@ -190,8 +192,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == HF());
@@ -248,8 +250,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == hf);
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size.pass.cpp
index 15b31b519b74..bc16de5a2ab7 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size.pass.cpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
@@ -50,7 +52,7 @@ int main()
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
10
);
- assert(c.bucket_count() == 11);
+ LIBCPP_ASSERT(c.bucket_count() == 11);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -80,8 +82,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >());
@@ -108,7 +110,7 @@ int main()
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
10
);
- assert(c.bucket_count() == 11);
+ LIBCPP_ASSERT(c.bucket_count() == 11);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -138,8 +140,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >());
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash.pass.cpp
index f565f10c89b5..9ecfc5b7926e 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash.pass.cpp
@@ -22,7 +22,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
@@ -52,7 +54,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -82,8 +84,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -111,7 +113,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -141,8 +143,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal.pass.cpp
index 8f86befbe37f..7c4c535783d8 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal.pass.cpp
@@ -22,7 +22,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
@@ -53,7 +55,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -83,8 +85,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -113,7 +115,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -143,8 +145,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal_allocator.pass.cpp
index dd65a07e35f0..782105cb082b 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/range_size_hash_equal_allocator.pass.cpp
@@ -23,7 +23,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
@@ -55,7 +57,7 @@ int main()
test_compare<std::equal_to<int> >(9),
test_allocator<std::pair<const int, std::string> >(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -85,8 +87,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -116,7 +118,7 @@ int main()
test_compare<std::equal_to<int> >(9),
min_allocator<std::pair<const int, std::string> >()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
Eq eq = c.equal_range(1);
@@ -146,8 +148,8 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
@@ -207,13 +209,13 @@ int main()
i = eq.first;
assert(i->first == 4);
assert(i->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
- assert(c.get_allocator() == A{});;
+ assert(c.get_allocator() == A{});
}
#endif
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.fail.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.fail.cpp
index 38e6c60df52d..b76fbc0ba436 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.fail.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.fail.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -34,7 +35,7 @@ int main()
NotConstructible> >
> C;
C c = 7;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -54,7 +55,7 @@ int main()
NotConstructible> >
> C;
C c = 7;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.pass.cpp
index 8aad662610ab..ae3d4f816a7a 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -34,7 +35,7 @@ int main()
NotConstructible> >
> C;
C c(7);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -54,7 +55,7 @@ int main()
NotConstructible> >
> C;
C c(7);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash.pass.cpp
index 2cc6c0176e5e..742d4f29175e 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -36,7 +37,7 @@ int main()
C c(7,
test_hash<std::hash<NotConstructible> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
@@ -58,7 +59,7 @@ int main()
C c(7,
test_hash<std::hash<NotConstructible> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() ==
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal.pass.cpp
index ebfce9fec564..88cce517cfee 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -37,7 +38,7 @@ int main()
test_hash<std::hash<NotConstructible> >(8),
test_compare<std::equal_to<NotConstructible> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() ==
@@ -60,7 +61,7 @@ int main()
test_hash<std::hash<NotConstructible> >(8),
test_compare<std::equal_to<NotConstructible> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() ==
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal_allocator.pass.cpp
index bd37650a3a7c..2b3b0e2ab27b 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal_allocator.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -38,7 +39,7 @@ int main()
test_compare<std::equal_to<NotConstructible> >(9),
test_allocator<std::pair<const NotConstructible, NotConstructible> >(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() ==
@@ -62,7 +63,7 @@ int main()
test_compare<std::equal_to<NotConstructible> >(9),
min_allocator<std::pair<const NotConstructible, NotConstructible> >()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() ==
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
index 8bccd4013a29..a8095135c1c0 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
@@ -25,6 +25,7 @@
#include "../../../Emplaceable.h"
#include "min_allocator.h"
+#include "test_macros.h"
int main()
{
@@ -44,20 +45,20 @@ int main()
assert(c.size() == 2);
assert(r->first == 3);
assert(r->second == Emplaceable(5, 6));
- assert(r == next(c.begin()));
+ LIBCPP_ASSERT(r == next(c.begin()));
r = c.emplace_hint(r, std::piecewise_construct, std::forward_as_tuple(3),
std::forward_as_tuple(6, 7));
assert(c.size() == 3);
assert(r->first == 3);
assert(r->second == Emplaceable(6, 7));
- assert(r == next(c.begin()));
+ LIBCPP_ASSERT(r == next(c.begin()));
r = c.begin();
assert(r->first == 3);
- assert(r->second == Emplaceable());
+ LIBCPP_ASSERT(r->second == Emplaceable());
r = next(r, 2);
assert(r->first == 3);
- assert(r->second == Emplaceable(5, 6));
+ LIBCPP_ASSERT(r->second == Emplaceable(5, 6));
}
#if TEST_STD_VER >= 11
{
@@ -76,20 +77,20 @@ int main()
assert(c.size() == 2);
assert(r->first == 3);
assert(r->second == Emplaceable(5, 6));
- assert(r == next(c.begin()));
+ LIBCPP_ASSERT(r == next(c.begin()));
r = c.emplace_hint(r, std::piecewise_construct, std::forward_as_tuple(3),
std::forward_as_tuple(6, 7));
assert(c.size() == 3);
assert(r->first == 3);
assert(r->second == Emplaceable(6, 7));
- assert(r == next(c.begin()));
+ LIBCPP_ASSERT(r == next(c.begin()));
r = c.begin();
assert(r->first == 3);
- assert(r->second == Emplaceable());
+ LIBCPP_ASSERT(r->second == Emplaceable());
r = next(r, 2);
assert(r->first == 3);
- assert(r->second == Emplaceable(5, 6));
+ LIBCPP_ASSERT(r->second == Emplaceable(5, 6));
}
#endif
#if _LIBCPP_DEBUG >= 1
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp
index 9da1e71cba06..092f3dd91158 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_const_iter.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -46,7 +47,10 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
+ C::const_iterator i_next = i;
+ ++i_next;
C::iterator j = c.erase(i);
+ assert(j == i_next);
assert(c.size() == 5);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
@@ -73,8 +77,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
}
#if TEST_STD_VER >= 11
{
@@ -92,7 +96,10 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
+ C::const_iterator i_next = i;
+ ++i_next;
C::iterator j = c.erase(i);
+ assert(j == i_next);
assert(c.size() == 5);
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
@@ -119,8 +126,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
}
#endif
#if TEST_STD_VER >= 14
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_key.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_key.pass.cpp
index f061d858e3f7..0da6f8a564b8 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_key.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_key.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -81,8 +82,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(2) == 2);
assert(c.size() == 4);
@@ -104,8 +105,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(2) == 0);
assert(c.size() == 4);
@@ -127,8 +128,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(4) == 1);
assert(c.size() == 3);
@@ -145,8 +146,8 @@ int main()
k = eq.first;
assert(k->first == 3);
assert(k->second == "three");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(4) == 0);
assert(c.size() == 3);
@@ -163,8 +164,8 @@ int main()
k = eq.first;
assert(k->first == 3);
assert(k->second == "three");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(1) == 2);
assert(c.size() == 1);
@@ -173,8 +174,8 @@ int main()
k = eq.first;
assert(k->first == 3);
assert(k->second == "three");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(1) == 0);
assert(c.size() == 1);
@@ -183,22 +184,22 @@ int main()
k = eq.first;
assert(k->first == 3);
assert(k->second == "three");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(3) == 1);
assert(c.size() == 0);
eq = c.equal_range(3);
assert(std::distance(eq.first, eq.second) == 0);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(3) == 0);
assert(c.size() == 0);
eq = c.equal_range(3);
assert(std::distance(eq.first, eq.second) == 0);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
}
#if TEST_STD_VER >= 11
{
@@ -244,8 +245,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(2) == 2);
assert(c.size() == 4);
@@ -267,8 +268,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(2) == 0);
assert(c.size() == 4);
@@ -290,8 +291,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(4) == 1);
assert(c.size() == 3);
@@ -308,8 +309,8 @@ int main()
k = eq.first;
assert(k->first == 3);
assert(k->second == "three");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(4) == 0);
assert(c.size() == 3);
@@ -326,8 +327,8 @@ int main()
k = eq.first;
assert(k->first == 3);
assert(k->second == "three");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(1) == 2);
assert(c.size() == 1);
@@ -336,8 +337,8 @@ int main()
k = eq.first;
assert(k->first == 3);
assert(k->second == "three");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(1) == 0);
assert(c.size() == 1);
@@ -346,22 +347,22 @@ int main()
k = eq.first;
assert(k->first == 3);
assert(k->second == "three");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(3) == 1);
assert(c.size() == 0);
eq = c.equal_range(3);
assert(std::distance(eq.first, eq.second) == 0);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.erase(3) == 0);
assert(c.size() == 0);
eq = c.equal_range(3);
assert(std::distance(eq.first, eq.second) == 0);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
}
{
typedef std::unordered_multimap<int, int> C;
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp
index 110cc4542b42..f239af4af314 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/erase_range.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -68,8 +69,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
k = c.erase(i, j);
assert(c.size() == 4);
@@ -91,8 +92,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
k = c.erase(c.cbegin(), c.cend());
assert(c.size() == 0);
@@ -145,8 +146,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
k = c.erase(i, j);
assert(c.size() == 4);
@@ -168,8 +169,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
k = c.erase(c.cbegin(), c.cend());
assert(c.size() == 0);
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_rvalue.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_rvalue.pass.cpp
index d6c0dbdbed07..94faa8f7fe9f 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_rvalue.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_rvalue.pass.cpp
@@ -37,22 +37,22 @@ int main()
typedef std::pair<double, short> P;
C c;
C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5, 3));
+ R r = c.insert(e, P(3.5, static_cast<short>(3)));
assert(c.size() == 1);
assert(r->first == 3.5);
assert(r->second == 3);
- r = c.insert(r, P(3.5, 4));
+ r = c.insert(r, P(3.5, static_cast<short>(4)));
assert(c.size() == 2);
assert(r->first == 3.5);
assert(r->second == 4);
- r = c.insert(c.end(), P(4.5, 4));
+ r = c.insert(c.end(), P(4.5, static_cast<short>(4)));
assert(c.size() == 3);
assert(r->first == 4.5);
assert(r->second == 4);
- r = c.insert(c.end(), P(5.5, 4));
+ r = c.insert(c.end(), P(5.5, static_cast<short>(4)));
assert(c.size() == 4);
assert(r->first == 5.5);
assert(r->second == 4);
@@ -90,22 +90,22 @@ int main()
typedef std::pair<double, short> P;
C c;
C::const_iterator e = c.end();
- R r = c.insert(e, P(3.5, 3));
+ R r = c.insert(e, P(3.5, static_cast<short>(3)));
assert(c.size() == 1);
assert(r->first == 3.5);
assert(r->second == 3);
- r = c.insert(r, P(3.5, 4));
+ r = c.insert(r, P(3.5, static_cast<short>(4)));
assert(c.size() == 2);
assert(r->first == 3.5);
assert(r->second == 4);
- r = c.insert(c.end(), P(4.5, 4));
+ r = c.insert(c.end(), P(4.5, static_cast<short>(4)));
assert(c.size() == 3);
assert(r->first == 4.5);
assert(r->second == 4);
- r = c.insert(c.end(), P(5.5, 4));
+ r = c.insert(c.end(), P(5.5, static_cast<short>(4)));
assert(c.size() == 4);
assert(r->first == 5.5);
assert(r->second == 4);
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp
index 851b36e51ca4..e0b1c6941862 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
#include "min_allocator.h"
@@ -67,8 +68,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
}
#if TEST_STD_VER >= 11
{
@@ -114,8 +115,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
}
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp
index 967ad369da3f..483f22050553 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp
@@ -19,6 +19,7 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
#include "test_iterators.h"
#include "min_allocator.h"
@@ -67,8 +68,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
}
#if TEST_STD_VER >= 11
{
@@ -114,8 +115,8 @@ int main()
k = eq.first;
assert(k->first == 4);
assert(k->second == "four");
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
}
#endif
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_rvalue.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_rvalue.pass.cpp
index 6735b8af5a0a..0c8ffeb10ee6 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_rvalue.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_rvalue.pass.cpp
@@ -32,22 +32,22 @@ int main()
typedef C::iterator R;
typedef std::pair<double, short> P;
C c;
- R r = c.insert(P(3.5, 3));
+ R r = c.insert(P(3.5, static_cast<short>(3)));
assert(c.size() == 1);
assert(r->first == 3.5);
assert(r->second == 3);
- r = c.insert(P(3.5, 4));
+ r = c.insert(P(3.5, static_cast<short>(4)));
assert(c.size() == 2);
assert(r->first == 3.5);
assert(r->second == 4);
- r = c.insert(P(4.5, 4));
+ r = c.insert(P(4.5, static_cast<short>(4)));
assert(c.size() == 3);
assert(r->first == 4.5);
assert(r->second == 4);
- r = c.insert(P(5.5, 4));
+ r = c.insert(P(5.5, static_cast<short>(4)));
assert(c.size() == 4);
assert(r->first == 5.5);
assert(r->second == 4);
@@ -83,22 +83,22 @@ int main()
typedef C::iterator R;
typedef std::pair<double, short> P;
C c;
- R r = c.insert(P(3.5, 3));
+ R r = c.insert(P(3.5, static_cast<short>(3)));
assert(c.size() == 1);
assert(r->first == 3.5);
assert(r->second == 3);
- r = c.insert(P(3.5, 4));
+ r = c.insert(P(3.5, static_cast<short>(4)));
assert(c.size() == 2);
assert(r->first == 3.5);
assert(r->second == 4);
- r = c.insert(P(4.5, 4));
+ r = c.insert(P(4.5, static_cast<short>(4)));
assert(c.size() == 3);
assert(r->first == 4.5);
assert(r->second == 4);
- r = c.insert(P(5.5, 4));
+ r = c.insert(P(5.5, static_cast<short>(4)));
assert(c.size() == 4);
assert(r->first == 5.5);
assert(r->second == 4);
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp
index 553131182315..7a58709c9fc9 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp
@@ -26,6 +26,7 @@
// This tests a conforming extension
#include <unordered_map>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -121,78 +122,64 @@ int main()
typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::unordered_multimap<MoveOnly, MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<V>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<V>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
some_comp<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for hash, throwable swap for comp
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc <V>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for hash, throwable swap for comp
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc2<V>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, throwable swap for hash, nothrow swap for comp
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc <V>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for hash, nothrow swap for comp
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<V>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for hash, throwable swap for comp
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc <V>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for hash, throwable swap for comp
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc2<V>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc <V>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<V>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // NOT always equal allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc3<V>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
}
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
index 84911ba01ffb..06e6c65c991d 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
@@ -18,7 +18,9 @@
#include <unordered_map>
#include <string>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -32,27 +34,27 @@ int main()
typedef test_allocator<std::pair<const int, std::string> > Alloc;
typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C;
typedef std::pair<int, std::string> P;
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -72,12 +74,12 @@ int main()
P(70, "seventy"),
P(80, "eighty"),
};
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -89,18 +91,18 @@ int main()
assert(c1.find(80)->second == "eighty");
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -118,21 +120,21 @@ int main()
P(1, "four"),
P(2, "four"),
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -142,9 +144,9 @@ int main()
assert(c2.find(4)->second == "four");
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -173,12 +175,12 @@ int main()
P(70, "seventy"),
P(80, "eighty"),
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -190,12 +192,12 @@ int main()
assert(c1.find(80)->second == "eighty");
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -205,9 +207,9 @@ int main()
assert(c2.find(4)->second == "four");
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
@@ -222,22 +224,22 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -262,7 +264,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -275,17 +277,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -308,16 +310,16 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -328,8 +330,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -363,7 +365,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -376,11 +378,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -391,8 +393,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#if TEST_STD_VER >= 11
@@ -407,22 +409,22 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -447,7 +449,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -460,17 +462,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -493,16 +495,16 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -513,8 +515,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -548,7 +550,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(c1.find(10)->second == "ten");
assert(c1.find(20)->second == "twenty");
@@ -561,11 +563,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.find(1)->second == "one");
assert(next(c2.find(1))->second == "four");
@@ -576,8 +578,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#endif
diff --git a/test/std/containers/unord/unord.multiset/bucket.pass.cpp b/test/std/containers/unord/unord.multiset/bucket.pass.cpp
index 30858c79a048..b0fb9b334cc9 100644
--- a/test/std/containers/unord/unord.multiset/bucket.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/bucket.pass.cpp
@@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -42,7 +43,7 @@ int main()
size_t bc = c.bucket_count();
assert(bc >= 7);
for (size_t i = 0; i < 13; ++i)
- assert(c.bucket(i) == i % bc);
+ LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#if TEST_STD_VER >= 11
{
@@ -62,7 +63,7 @@ int main()
size_t bc = c.bucket_count();
assert(bc >= 7);
for (size_t i = 0; i < 13; ++i)
- assert(c.bucket(i) == i % bc);
+ LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1
diff --git a/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp b/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp
index adde647cb246..ec4d0e675501 100644
--- a/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -27,7 +28,7 @@ int main()
typedef C::const_iterator I;
typedef int P;
const C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
}
{
typedef std::unordered_multiset<int> C;
@@ -45,7 +46,7 @@ int main()
P(80)
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#if TEST_STD_VER >= 11
{
@@ -54,7 +55,7 @@ int main()
typedef C::const_iterator I;
typedef int P;
const C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
}
{
typedef std::unordered_multiset<int, std::hash<int>,
@@ -73,7 +74,7 @@ int main()
P(80)
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#endif
}
diff --git a/test/std/containers/unord/unord.multiset/bucket_size.pass.cpp b/test/std/containers/unord/unord.multiset/bucket_size.pass.cpp
index 7ca480556349..237b89036c88 100644
--- a/test/std/containers/unord/unord.multiset/bucket_size.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/bucket_size.pass.cpp
@@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -40,13 +41,13 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 7);
- assert(c.bucket_size(0) == 0);
- assert(c.bucket_size(1) == 2);
- assert(c.bucket_size(2) == 2);
- assert(c.bucket_size(3) == 1);
- assert(c.bucket_size(4) == 1);
- assert(c.bucket_size(5) == 0);
- assert(c.bucket_size(6) == 0);
+ LIBCPP_ASSERT(c.bucket_size(0) == 0);
+ LIBCPP_ASSERT(c.bucket_size(1) == 2);
+ LIBCPP_ASSERT(c.bucket_size(2) == 2);
+ LIBCPP_ASSERT(c.bucket_size(3) == 1);
+ LIBCPP_ASSERT(c.bucket_size(4) == 1);
+ LIBCPP_ASSERT(c.bucket_size(5) == 0);
+ LIBCPP_ASSERT(c.bucket_size(6) == 0);
}
#if TEST_STD_VER >= 11
{
@@ -64,13 +65,13 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 7);
- assert(c.bucket_size(0) == 0);
- assert(c.bucket_size(1) == 2);
- assert(c.bucket_size(2) == 2);
- assert(c.bucket_size(3) == 1);
- assert(c.bucket_size(4) == 1);
- assert(c.bucket_size(5) == 0);
- assert(c.bucket_size(6) == 0);
+ LIBCPP_ASSERT(c.bucket_size(0) == 0);
+ LIBCPP_ASSERT(c.bucket_size(1) == 2);
+ LIBCPP_ASSERT(c.bucket_size(2) == 2);
+ LIBCPP_ASSERT(c.bucket_size(3) == 1);
+ LIBCPP_ASSERT(c.bucket_size(4) == 1);
+ LIBCPP_ASSERT(c.bucket_size(5) == 0);
+ LIBCPP_ASSERT(c.bucket_size(6) == 0);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1
diff --git a/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp b/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
index 117e8e68efab..362697b2c8e3 100644
--- a/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/erase_const_iter.pass.cpp
@@ -45,7 +45,11 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
+ C::const_iterator i_next = i;
+ ++i_next;
C::iterator j = c.erase(i);
+ assert(j == i_next);
+
assert(c.size() == 5);
assert(c.count(1) == 2);
assert(c.count(2) == 1);
@@ -68,7 +72,10 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
+ C::const_iterator i_next = i;
+ ++i_next;
C::iterator j = c.erase(i);
+ assert(j == i_next);
assert(c.size() == 5);
assert(c.count(1) == 2);
assert(c.count(2) == 1);
diff --git a/test/std/containers/unord/unord.multiset/iterators.fail.cpp b/test/std/containers/unord/unord.multiset/iterators.fail.cpp
index f78bccbd423f..9f309a234003 100644
--- a/test/std/containers/unord/unord.multiset/iterators.fail.cpp
+++ b/test/std/containers/unord/unord.multiset/iterators.fail.cpp
@@ -23,6 +23,8 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -38,7 +40,7 @@ int main()
P(2)
};
C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(std::distance(c.begin(), c.end()) == c.size());
assert(std::distance(c.cbegin(), c.cend()) == c.size());
@@ -59,7 +61,7 @@ int main()
P(2)
};
const C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(std::distance(c.begin(), c.end()) == c.size());
assert(std::distance(c.cbegin(), c.cend()) == c.size());
diff --git a/test/std/containers/unord/unord.multiset/iterators.pass.cpp b/test/std/containers/unord/unord.multiset/iterators.pass.cpp
index bf42740c23fb..d87099cdaf8c 100644
--- a/test/std/containers/unord/unord.multiset/iterators.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/iterators.pass.cpp
@@ -22,7 +22,9 @@
#include <unordered_set>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -42,8 +44,8 @@ int main()
C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 7);
assert(c.size() == 6);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::iterator i;
}
{
@@ -61,8 +63,8 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 7);
assert(c.size() == 6);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::const_iterator i;
}
#if TEST_STD_VER >= 11
@@ -82,8 +84,8 @@ int main()
C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 7);
assert(c.size() == 6);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::iterator i;
}
{
@@ -102,12 +104,12 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 7);
assert(c.size() == 6);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::const_iterator i;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::unordered_multiset<int> C;
C::iterator ii1{}, ii2{};
diff --git a/test/std/containers/unord/unord.multiset/local_iterators.fail.cpp b/test/std/containers/unord/unord.multiset/local_iterators.fail.cpp
index 4118987c2ae0..a43e49357873 100644
--- a/test/std/containers/unord/unord.multiset/local_iterators.fail.cpp
+++ b/test/std/containers/unord/unord.multiset/local_iterators.fail.cpp
@@ -23,6 +23,8 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -39,7 +41,7 @@ int main()
P(2)
};
C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
C::size_type b = c.bucket(0);
I i = c.begin(b);
I j = c.end(b);
@@ -98,7 +100,7 @@ int main()
P(2)
};
const C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
C::size_type b = c.bucket(0);
I i = c.begin(b);
I j = c.end(b);
@@ -156,7 +158,7 @@ int main()
P(2)
};
C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
C::size_type b = c.bucket(0);
I i = c.cbegin(b);
I j = c.cend(b);
@@ -214,7 +216,7 @@ int main()
P(2)
};
const C c(a, a + sizeof(a)/sizeof(a[0]));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
C::size_type b = c.bucket(0);
I i = c.cbegin(b);
I j = c.cend(b);
diff --git a/test/std/containers/unord/unord.multiset/max_size.pass.cpp b/test/std/containers/unord/unord.multiset/max_size.pass.cpp
index b26ad73fed2b..eac4db8b0a91 100644
--- a/test/std/containers/unord/unord.multiset/max_size.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/max_size.pass.cpp
@@ -9,28 +9,46 @@
// <unordered_set>
-// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
-// class Alloc = allocator<Value>>
// class unordered_multiset
// size_type max_size() const;
-#include <unordered_set>
#include <cassert>
+#include <limits>
+#include <type_traits>
+#include <unordered_set>
-#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
int main()
{
{
- std::unordered_multiset<int> u;
- assert(u.max_size() > 0);
+ typedef limited_allocator<int, 10> A;
+ typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
+ A>
+ C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<int, (size_t)-1> A;
+ typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
+ A>
+ C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
}
-#if TEST_STD_VER >= 11
{
- std::unordered_multiset<int, std::hash<int>,
- std::equal_to<int>, min_allocator<int>> u;
- assert(u.max_size() > 0);
+ typedef std::unordered_multiset<char> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
}
-#endif
}
diff --git a/test/std/containers/unord/unord.multiset/rehash.pass.cpp b/test/std/containers/unord/unord.multiset/rehash.pass.cpp
index 3ad16a6bcbfe..2c5d509951a8 100644
--- a/test/std/containers/unord/unord.multiset/rehash.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/rehash.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -55,16 +56,16 @@ int main()
assert(c.bucket_count() >= 7);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.rehash(31);
rehash_postcondition(c, 31);
- assert(c.bucket_count() == 31);
+ LIBCPP_ASSERT(c.bucket_count() == 31);
test(c);
}
#if TEST_STD_VER >= 11
@@ -86,16 +87,16 @@ int main()
assert(c.bucket_count() >= 7);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.rehash(31);
rehash_postcondition(c, 31);
- assert(c.bucket_count() == 31);
+ LIBCPP_ASSERT(c.bucket_count() == 31);
test(c);
}
#endif
diff --git a/test/std/containers/unord/unord.multiset/reserve.pass.cpp b/test/std/containers/unord/unord.multiset/reserve.pass.cpp
index 52d51011fe36..28187e9cae2b 100644
--- a/test/std/containers/unord/unord.multiset/reserve.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/reserve.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -63,11 +64,11 @@ int main()
test(c);
assert(c.bucket_count() >= 7);
c.reserve(3);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.reserve(3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.reserve(31);
assert(c.bucket_count() >= 16);
@@ -91,11 +92,11 @@ int main()
test(c);
assert(c.bucket_count() >= 7);
c.reserve(3);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
test(c);
c.max_load_factor(2);
c.reserve(3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.reserve(31);
assert(c.bucket_count() >= 16);
diff --git a/test/std/containers/unord/unord.multiset/scary.pass.cpp b/test/std/containers/unord/unord.multiset/scary.pass.cpp
index dfd144bb3170..aec6950c48f1 100644
--- a/test/std/containers/unord/unord.multiset/scary.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/scary.pass.cpp
@@ -21,4 +21,5 @@ int main()
typedef std::unordered_multiset<int> M2;
M2::iterator i;
M1::iterator j = i;
+ ((void)j);
}
diff --git a/test/std/containers/unord/unord.multiset/swap_member.pass.cpp b/test/std/containers/unord/unord.multiset/swap_member.pass.cpp
index bc3314c867eb..c0c9e9021712 100644
--- a/test/std/containers/unord/unord.multiset/swap_member.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/swap_member.pass.cpp
@@ -17,7 +17,9 @@
#include <unordered_set>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "../../test_compare.h"
#include "../../test_hash.h"
#include "test_allocator.h"
@@ -31,27 +33,27 @@ int main()
typedef test_allocator<int> Alloc;
typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
typedef int P;
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -71,12 +73,12 @@ int main()
P(70),
P(80)
};
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -88,18 +90,18 @@ int main()
assert(*c1.find(80) == 80);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -117,21 +119,21 @@ int main()
P(1),
P(2)
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -139,9 +141,9 @@ int main()
assert(c2.count(4) == 1);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -170,12 +172,12 @@ int main()
P(70),
P(80)
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -187,12 +189,12 @@ int main()
assert(*c1.find(80) == 80);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -200,9 +202,9 @@ int main()
assert(c2.count(4) == 1);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
@@ -217,22 +219,22 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -257,7 +259,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -270,17 +272,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -303,16 +305,16 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -321,8 +323,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -356,7 +358,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -369,11 +371,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -382,8 +384,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#if TEST_STD_VER >= 11
@@ -398,22 +400,22 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -438,7 +440,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -451,17 +453,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -484,16 +486,16 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -502,8 +504,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -537,7 +539,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -550,11 +552,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -563,8 +565,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#endif
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/allocator.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/allocator.pass.cpp
index 8d020a52ac04..867ca93fb58a 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/allocator.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/allocator.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -33,7 +34,7 @@ int main()
test_allocator<NotConstructible>
> C;
C c(test_allocator<NotConstructible>(10));
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == test_allocator<NotConstructible>(10));
@@ -51,7 +52,7 @@ int main()
min_allocator<NotConstructible>
> C;
C c(min_allocator<NotConstructible>{});
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == min_allocator<NotConstructible>());
@@ -61,7 +62,7 @@ int main()
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef NotConstructible T;
typedef test_hash<std::hash<T>> HF;
@@ -71,7 +72,7 @@ int main()
A a(43);
C c(3, a);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
assert(c.hash_function() == HF());
assert(c.key_eq() == Comp ());
assert(c.get_allocator() == a);
@@ -92,7 +93,7 @@ int main()
HF hf(42);
A a(43);
C c(4, hf, a);
- assert(c.bucket_count() == 4);
+ LIBCPP_ASSERT(c.bucket_count() == 4);
assert(c.hash_function() == hf);
assert(!(c.hash_function() == HF()));
assert(c.key_eq() == Comp ());
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp
index f219073cffcb..b7557c437181 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp
@@ -18,7 +18,9 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -56,7 +58,7 @@ int main()
A(4)
);
c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(*i == 1);
@@ -74,8 +76,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(4));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -146,8 +148,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -182,7 +184,7 @@ int main()
A()
);
c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(*i == 1);
@@ -200,8 +202,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp
index 2835cd444c30..3e42305309fd 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
+#include <cstddef>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -54,8 +55,8 @@ int main()
assert(c.count(2) == 2);
assert(c.count(3) == 1);
assert(c.count(4) == 1);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -87,8 +88,8 @@ int main()
assert(c.count(2) == 2);
assert(c.count(3) == 1);
assert(c.count(4) == 1);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp
index 52d08f3e2293..658bb93e2b1a 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp
@@ -18,7 +18,9 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -57,7 +59,7 @@ int main()
A(4)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(*i == 1);
@@ -75,8 +77,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(4));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -110,7 +112,7 @@ int main()
A(10)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -120,8 +122,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -155,7 +157,7 @@ int main()
A(4)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -165,8 +167,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -201,26 +203,18 @@ int main()
A()
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
- C::const_iterator i = c.cbegin();
- assert(*i == 4);
- ++i;
- assert(*i == 3);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 1);
- ++i;
- assert(*i == 1);
+ assert(c.count(1) == 2);
+ assert(c.count(2) == 2);
+ assert(c.count(3) == 1);
+ assert(c.count(4) == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -254,7 +248,7 @@ int main()
A()
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -264,8 +258,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/compare_copy_constructible.fail.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/compare_copy_constructible.fail.cpp
index b38316c37689..1cda95be6eba 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/compare_copy_constructible.fail.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/compare_copy_constructible.fail.cpp
@@ -9,7 +9,7 @@
// <unordered_set>
-// Check that std::unordered_set fails to instantiate if the comparison predicate is
+// Check that std::unordered_set fails to instantiate if the comparison predicate is
// not copy-constructible. This is LWG issue 2436
#include <unordered_set>
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy.pass.cpp
index e6042b0d9123..3ba35d7a548d 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy.pass.cpp
@@ -19,7 +19,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -50,7 +52,7 @@ int main()
test_allocator<int>(10)
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(*i == 1);
@@ -68,12 +70,12 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
@@ -97,7 +99,7 @@ int main()
other_allocator<int>(10)
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(*i == 1);
@@ -115,13 +117,11 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == other_allocator<int>(-2));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
@@ -145,7 +145,7 @@ int main()
min_allocator<int>()
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(*i == 1);
@@ -163,8 +163,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy_alloc.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy_alloc.pass.cpp
index 5e24f7257252..2c018e07734e 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy_alloc.pass.cpp
@@ -19,7 +19,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -50,7 +52,7 @@ int main()
test_allocator<int>(10)
);
C c(c0, test_allocator<int>(5));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(*i == 1);
@@ -68,8 +70,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(5));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -97,7 +99,7 @@ int main()
min_allocator<int>()
);
C c(c0, min_allocator<int>());
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
C::const_iterator i = c.cbegin();
assert(*i == 1);
@@ -115,8 +117,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp
index 02aee58525ee..4b4487f00106 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -33,7 +34,7 @@ int main()
test_allocator<NotConstructible>
> C;
C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (test_allocator<NotConstructible>()));
@@ -51,7 +52,7 @@ int main()
min_allocator<NotConstructible>
> C;
C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
@@ -96,7 +97,7 @@ int main()
}
{
std::unordered_multiset<int> c = {};
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.size() == 0);
assert(c.empty());
assert(std::distance(c.begin(), c.end()) == 0);
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp
index 733484510ef1..62fe51e29903 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -54,11 +55,11 @@ int main()
}
{
typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
some_comp<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/hash_copy_constructible.fail.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/hash_copy_constructible.fail.cpp
index a43f94ca2af3..6fa52a794907 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/hash_copy_constructible.fail.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/hash_copy_constructible.fail.cpp
@@ -9,7 +9,7 @@
// <unordered_set>
-// Check that std::unordered_multiset fails to instantiate if the hash function is
+// Check that std::unordered_multiset fails to instantiate if the hash function is
// not copy-constructible. This is mentioned in LWG issue 2436
#include <unordered_set>
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp
index 53a9003b0173..ced52b5e6b46 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp
@@ -18,7 +18,9 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -52,8 +54,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -83,12 +85,12 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int T;
typedef test_hash<std::hash<T>> HF;
@@ -117,8 +119,8 @@ int main()
assert(c.get_allocator() == a);
assert(!(c.get_allocator() == A()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -152,8 +154,8 @@ int main()
assert(c.get_allocator() == a);
assert(!(c.get_allocator() == A()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp
index e5934acc8e7c..845139f98d9c 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp
@@ -19,7 +19,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -45,7 +47,7 @@ int main()
},
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -55,8 +57,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -78,7 +80,7 @@ int main()
},
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -88,8 +90,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp
index 86253214af9c..4dc78bd261cb 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -47,7 +49,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -57,8 +59,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -81,7 +83,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -91,8 +93,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp
index 47469c0c5b9b..f331208596b7 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -48,7 +50,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -58,8 +60,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -83,7 +85,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -93,8 +95,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp
index d72ee6f33f50..17f064f46280 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -49,7 +51,7 @@ int main()
test_compare<std::equal_to<int> >(9),
test_allocator<int>(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -59,8 +61,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -85,7 +87,7 @@ int main()
test_compare<std::equal_to<int> >(9),
min_allocator<int>()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -95,8 +97,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp
index defd90f408b0..9fbb773a463f 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -19,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -27,37 +31,26 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
test_allocator<int>
> C;
- typedef int P;
- P a[] =
- {
- P(1),
- P(2),
- P(3),
- P(4),
- P(1),
- P(2)
- };
C c0(7,
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9),
test_allocator<int>(10)
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 0);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(10));
assert(c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
@@ -86,7 +79,7 @@ int main()
test_allocator<int>(10)
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -96,44 +89,33 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c0.empty());
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_multiset<int,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
min_allocator<int>
> C;
- typedef int P;
- P a[] =
- {
- P(1),
- P(2),
- P(3),
- P(4),
- P(1),
- P(2)
- };
C c0(7,
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9),
min_allocator<int>()
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 0);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
@@ -162,7 +144,7 @@ int main()
min_allocator<int>()
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -172,14 +154,13 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c0.empty());
}
-#endif
#if _LIBCPP_DEBUG >= 1
{
std::unordered_multiset<int> s1 = {1, 2, 3};
@@ -191,5 +172,4 @@ int main()
assert(s2.size() == 2);
}
#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp
index 45b4c8b4f5d5..bc804b42e22d 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp
@@ -19,7 +19,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -70,8 +72,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(12));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
@@ -101,7 +103,7 @@ int main()
A(10)
);
C c(std::move(c0), A(10));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -111,8 +113,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
@@ -145,24 +147,16 @@ int main()
C c(std::move(c0), A());
assert(c.bucket_count() >= 7);
assert(c.size() == 6);
- C::const_iterator i = c.cbegin();
- assert(*i == 4);
- ++i;
- assert(*i == 3);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 1);
- ++i;
- assert(*i == 1);
+ assert(c.count(1) == 2);
+ assert(c.count(2) == 2);
+ assert(c.count(3) == 1);
+ assert(c.count(4) == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
@@ -192,7 +186,7 @@ int main()
A()
);
C c(std::move(c0), A());
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -202,8 +196,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp
index fbd6df14c052..ac0a10a4b0ea 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp
@@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -56,7 +57,7 @@ int main()
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C;
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp
index e84ffb7b2fde..e44be18fa3b4 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp
@@ -20,6 +20,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,17 +44,17 @@ int main()
{
{
typedef std::unordered_multiset<MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C;
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range.pass.cpp
index 12679ef3e13e..a2ee746791d3 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range.pass.cpp
@@ -19,7 +19,9 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -55,8 +57,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -88,12 +90,12 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int T;
typedef test_hash<std::hash<T>> HF;
@@ -122,8 +124,8 @@ int main()
assert(c.get_allocator() == a);
assert(!(c.get_allocator() == A()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -157,8 +159,8 @@ int main()
assert(c.get_allocator() == a);
assert(!(c.get_allocator() == A()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size.pass.cpp
index c9454cf630db..f09f9c860bd9 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -48,7 +50,7 @@ int main()
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -58,8 +60,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -83,7 +85,7 @@ int main()
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -93,8 +95,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash.pass.cpp
index 5ff61575d994..167216bf6be4 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash.pass.cpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -50,7 +52,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -60,8 +62,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -86,7 +88,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -96,8 +98,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal.pass.cpp
index ecf3176e90a4..8720f59a8fdf 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal.pass.cpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -51,7 +53,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -61,8 +63,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -88,7 +90,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -98,8 +100,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal_allocator.pass.cpp
index 18a092c83f6a..3373dd0d4c5e 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/range_size_hash_equal_allocator.pass.cpp
@@ -22,7 +22,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -53,7 +55,7 @@ int main()
test_compare<std::equal_to<int> >(9),
test_allocator<int>(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -63,8 +65,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -91,7 +93,7 @@ int main()
test_compare<std::equal_to<int> >(9),
min_allocator<int>()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
assert(c.count(1) == 2);
assert(c.count(2) == 2);
@@ -101,8 +103,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.fail.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.fail.cpp
index 215b31fef65f..c3056d2f90f5 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.fail.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.fail.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -33,7 +34,7 @@ int main()
test_allocator<NotConstructible>
> C;
C c = 7;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (test_allocator<NotConstructible>()));
@@ -51,7 +52,7 @@ int main()
min_allocator<NotConstructible>
> C;
C c = 7;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.pass.cpp
index 38211f958c43..c6f12e9ac8c1 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -33,7 +34,7 @@ int main()
test_allocator<NotConstructible>
> C;
C c(7);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (test_allocator<NotConstructible>()));
@@ -51,7 +52,7 @@ int main()
min_allocator<NotConstructible>
> C;
C c(7);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash.pass.cpp
index baeabd1b2d08..10d48b73e7e4 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -35,7 +36,7 @@ int main()
C c(7,
test_hash<std::hash<NotConstructible> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (test_allocator<NotConstructible>()));
@@ -55,7 +56,7 @@ int main()
C c(7,
test_hash<std::hash<NotConstructible> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal.pass.cpp
index 380f36df7bf2..6b545a1da3ba 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -36,7 +37,7 @@ int main()
test_hash<std::hash<NotConstructible> >(8),
test_compare<std::equal_to<NotConstructible> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() == (test_allocator<NotConstructible>()));
@@ -57,7 +58,7 @@ int main()
test_hash<std::hash<NotConstructible> >(8),
test_compare<std::equal_to<NotConstructible> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal_allocator.pass.cpp
index 149d045e07a9..5c87a3a20dd3 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal_allocator.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -37,7 +38,7 @@ int main()
test_compare<std::equal_to<NotConstructible> >(9),
test_allocator<std::pair<const NotConstructible, NotConstructible> >(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() == (test_allocator<NotConstructible>(10)));
@@ -59,7 +60,7 @@ int main()
test_compare<std::equal_to<NotConstructible> >(9),
min_allocator<std::pair<const NotConstructible, NotConstructible> >()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp
index df9f18b147e3..c221b6f2edb0 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp
@@ -26,6 +26,7 @@
// This tests a conforming extension
#include <unordered_set>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -122,79 +123,65 @@ int main()
{
{
typedef std::unordered_multiset<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
some_comp<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for hash, throwable swap for comp
typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for hash, throwable swap for comp
typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, throwable swap for hash, nothrow swap for comp
typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for hash, nothrow swap for comp
typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for hash, throwable swap for comp
typedef std::unordered_multiset<MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for hash, throwable swap for comp
typedef std::unordered_multiset<MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_multiset<MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_multiset<MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // NOT always equal allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_multiset<MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
}
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp
index 4b1c129508e1..d4efb6868026 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp
@@ -17,7 +17,9 @@
#include <unordered_set>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -31,27 +33,27 @@ int main()
typedef test_allocator<int> Alloc;
typedef std::unordered_multiset<int, Hash, Compare, Alloc> C;
typedef int P;
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -71,12 +73,12 @@ int main()
P(70),
P(80)
};
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -88,18 +90,18 @@ int main()
assert(*c1.find(80) == 80);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -117,21 +119,21 @@ int main()
P(1),
P(2)
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -139,9 +141,9 @@ int main()
assert(c2.count(4) == 1);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -170,12 +172,12 @@ int main()
P(70),
P(80)
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -187,12 +189,12 @@ int main()
assert(*c1.find(80) == 80);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -200,9 +202,9 @@ int main()
assert(c2.count(4) == 1);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
@@ -217,22 +219,22 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -257,7 +259,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -270,17 +272,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -303,16 +305,16 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -321,8 +323,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -356,7 +358,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -369,11 +371,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -382,8 +384,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#if TEST_STD_VER >= 11
@@ -398,22 +400,22 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -438,7 +440,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -451,17 +453,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -484,16 +486,16 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -502,8 +504,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -537,7 +539,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -550,11 +552,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 7);
+ assert(c2.bucket_count() >= 6);
assert(c2.size() == 6);
assert(c2.count(1) == 2);
assert(c2.count(2) == 2);
@@ -563,8 +565,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#endif
diff --git a/test/std/containers/unord/unord.set/bucket.pass.cpp b/test/std/containers/unord/unord.set/bucket.pass.cpp
index 9b704ccee0c0..3903d96c1967 100644
--- a/test/std/containers/unord/unord.set/bucket.pass.cpp
+++ b/test/std/containers/unord/unord.set/bucket.pass.cpp
@@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -42,7 +43,7 @@ int main()
size_t bc = c.bucket_count();
assert(bc >= 5);
for (size_t i = 0; i < 13; ++i)
- assert(c.bucket(i) == i % bc);
+ LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#if TEST_STD_VER >= 11
{
@@ -61,7 +62,7 @@ int main()
size_t bc = c.bucket_count();
assert(bc >= 5);
for (size_t i = 0; i < 13; ++i)
- assert(c.bucket(i) == i % bc);
+ LIBCPP_ASSERT(c.bucket(i) == i % bc);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1
diff --git a/test/std/containers/unord/unord.set/bucket_count.pass.cpp b/test/std/containers/unord/unord.set/bucket_count.pass.cpp
index e35e43615dd3..6f1f526abaf6 100644
--- a/test/std/containers/unord/unord.set/bucket_count.pass.cpp
+++ b/test/std/containers/unord/unord.set/bucket_count.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -27,7 +28,7 @@ int main()
typedef C::const_iterator I;
typedef int P;
const C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
}
{
typedef std::unordered_set<int> C;
@@ -45,7 +46,7 @@ int main()
P(80)
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#if TEST_STD_VER >= 11
{
@@ -53,7 +54,7 @@ int main()
typedef C::const_iterator I;
typedef int P;
const C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
}
{
typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C;
@@ -71,7 +72,7 @@ int main()
P(80)
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#endif
}
diff --git a/test/std/containers/unord/unord.set/bucket_size.pass.cpp b/test/std/containers/unord/unord.set/bucket_size.pass.cpp
index 2ae618c85e5b..10dc099ea2db 100644
--- a/test/std/containers/unord/unord.set/bucket_size.pass.cpp
+++ b/test/std/containers/unord/unord.set/bucket_size.pass.cpp
@@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -40,11 +41,11 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 5);
- assert(c.bucket_size(0) == 0);
- assert(c.bucket_size(1) == 1);
- assert(c.bucket_size(2) == 1);
- assert(c.bucket_size(3) == 1);
- assert(c.bucket_size(4) == 1);
+ LIBCPP_ASSERT(c.bucket_size(0) == 0);
+ LIBCPP_ASSERT(c.bucket_size(1) == 1);
+ LIBCPP_ASSERT(c.bucket_size(2) == 1);
+ LIBCPP_ASSERT(c.bucket_size(3) == 1);
+ LIBCPP_ASSERT(c.bucket_size(4) == 1);
}
#if TEST_STD_VER >= 11
{
@@ -61,11 +62,11 @@ int main()
};
const C c(std::begin(a), std::end(a));
assert(c.bucket_count() >= 5);
- assert(c.bucket_size(0) == 0);
- assert(c.bucket_size(1) == 1);
- assert(c.bucket_size(2) == 1);
- assert(c.bucket_size(3) == 1);
- assert(c.bucket_size(4) == 1);
+ LIBCPP_ASSERT(c.bucket_size(0) == 0);
+ LIBCPP_ASSERT(c.bucket_size(1) == 1);
+ LIBCPP_ASSERT(c.bucket_size(2) == 1);
+ LIBCPP_ASSERT(c.bucket_size(3) == 1);
+ LIBCPP_ASSERT(c.bucket_size(4) == 1);
}
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1
diff --git a/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp b/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
index c78eb138fd90..b584dbb2b300 100644
--- a/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
+++ b/test/std/containers/unord/unord.set/erase_const_iter.pass.cpp
@@ -45,7 +45,11 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
+ C::const_iterator i_next = i;
+ ++i_next;
C::iterator j = c.erase(i);
+ assert(j == i_next);
+
assert(c.size() == 3);
assert(c.count(1) == 1);
assert(c.count(3) == 1);
@@ -66,7 +70,11 @@ int main()
};
C c(a, a + sizeof(a)/sizeof(a[0]));
C::const_iterator i = c.find(2);
+ C::const_iterator i_next = i;
+ ++i_next;
C::iterator j = c.erase(i);
+ assert(j == i_next);
+
assert(c.size() == 3);
assert(c.count(1) == 1);
assert(c.count(3) == 1);
diff --git a/test/std/containers/unord/unord.set/iterators.pass.cpp b/test/std/containers/unord/unord.set/iterators.pass.cpp
index 494411854977..9c780e10980a 100644
--- a/test/std/containers/unord/unord.set/iterators.pass.cpp
+++ b/test/std/containers/unord/unord.set/iterators.pass.cpp
@@ -22,7 +22,9 @@
#include <unordered_set>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
@@ -42,8 +44,8 @@ int main()
C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 5);
assert(c.size() == 4);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::iterator i;
}
{
@@ -61,8 +63,8 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 5);
assert(c.size() == 4);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::const_iterator i;
}
#if TEST_STD_VER >= 11
@@ -82,8 +84,8 @@ int main()
C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 5);
assert(c.size() == 4);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::iterator i;
}
{
@@ -102,12 +104,12 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.bucket_count() >= 5);
assert(c.size() == 4);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
C::const_iterator i;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::unordered_set<int> C;
C::iterator ii1{}, ii2{};
diff --git a/test/std/containers/unord/unord.set/max_size.pass.cpp b/test/std/containers/unord/unord.set/max_size.pass.cpp
index 3135ad994737..1b902660d48f 100644
--- a/test/std/containers/unord/unord.set/max_size.pass.cpp
+++ b/test/std/containers/unord/unord.set/max_size.pass.cpp
@@ -9,28 +9,42 @@
// <unordered_set>
-// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
-// class Alloc = allocator<Value>>
// class unordered_set
// size_type max_size() const;
-#include <unordered_set>
#include <cassert>
+#include <limits>
+#include <type_traits>
+#include <unordered_set>
-#include "min_allocator.h"
+#include "test_allocator.h"
+#include "test_macros.h"
int main()
{
{
- std::unordered_set<int> u;
- assert(u.max_size() > 0);
+ typedef limited_allocator<int, 10> A;
+ typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, A> C;
+ C c;
+ assert(c.max_size() <= 10);
+ LIBCPP_ASSERT(c.max_size() == 10);
+ }
+ {
+ typedef limited_allocator<int, (size_t)-1> A;
+ typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, A> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ LIBCPP_ASSERT(c.max_size() == max_dist);
}
-#if TEST_STD_VER >= 11
{
- std::unordered_set<int, std::hash<int>,
- std::equal_to<int>, min_allocator<int>> u;
- assert(u.max_size() > 0);
+ typedef std::unordered_set<char> C;
+ const C::difference_type max_dist =
+ std::numeric_limits<C::difference_type>::max();
+ C c;
+ assert(c.max_size() <= max_dist);
+ assert(c.max_size() <= alloc_max_size(c.get_allocator()));
}
-#endif
}
diff --git a/test/std/containers/unord/unord.set/rehash.pass.cpp b/test/std/containers/unord/unord.set/rehash.pass.cpp
index a4d4d3fbf02c..fd689bfd9dfa 100644
--- a/test/std/containers/unord/unord.set/rehash.pass.cpp
+++ b/test/std/containers/unord/unord.set/rehash.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -55,16 +56,16 @@ int main()
assert(c.bucket_count() >= 5);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 5);
+ LIBCPP_ASSERT(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.rehash(31);
rehash_postcondition(c, 31);
- assert(c.bucket_count() == 31);
+ LIBCPP_ASSERT(c.bucket_count() == 31);
test(c);
}
#if TEST_STD_VER >= 11
@@ -86,16 +87,16 @@ int main()
assert(c.bucket_count() >= 5);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 5);
+ LIBCPP_ASSERT(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.rehash(3);
rehash_postcondition(c, 3);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
test(c);
c.rehash(31);
rehash_postcondition(c, 31);
- assert(c.bucket_count() == 31);
+ LIBCPP_ASSERT(c.bucket_count() == 31);
test(c);
}
#endif
diff --git a/test/std/containers/unord/unord.set/reserve.pass.cpp b/test/std/containers/unord/unord.set/reserve.pass.cpp
index 4bd5332f0796..c48a72560088 100644
--- a/test/std/containers/unord/unord.set/reserve.pass.cpp
+++ b/test/std/containers/unord/unord.set/reserve.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class C>
@@ -63,7 +64,7 @@ int main()
test(c);
assert(c.bucket_count() >= 5);
c.reserve(3);
- assert(c.bucket_count() == 5);
+ LIBCPP_ASSERT(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.reserve(3);
@@ -91,7 +92,7 @@ int main()
test(c);
assert(c.bucket_count() >= 5);
c.reserve(3);
- assert(c.bucket_count() == 5);
+ LIBCPP_ASSERT(c.bucket_count() == 5);
test(c);
c.max_load_factor(2);
c.reserve(3);
diff --git a/test/std/containers/unord/unord.set/swap_member.pass.cpp b/test/std/containers/unord/unord.set/swap_member.pass.cpp
index 5ddb2d00daef..ea88c53a526c 100644
--- a/test/std/containers/unord/unord.set/swap_member.pass.cpp
+++ b/test/std/containers/unord/unord.set/swap_member.pass.cpp
@@ -17,7 +17,9 @@
#include <unordered_set>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "../../test_compare.h"
#include "../../test_hash.h"
#include "test_allocator.h"
@@ -31,27 +33,27 @@ int main()
typedef test_allocator<int> Alloc;
typedef std::unordered_set<int, Hash, Compare, Alloc> C;
typedef int P;
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -71,12 +73,12 @@ int main()
P(70),
P(80)
};
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -88,18 +90,18 @@ int main()
assert(*c1.find(80) == 80);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -117,21 +119,21 @@ int main()
P(1),
P(2)
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -139,9 +141,9 @@ int main()
assert(c2.count(4) == 1);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -170,12 +172,12 @@ int main()
P(70),
P(80)
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -187,12 +189,12 @@ int main()
assert(*c1.find(80) == 80);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -200,9 +202,9 @@ int main()
assert(c2.count(4) == 1);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
@@ -217,22 +219,22 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -257,7 +259,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -270,17 +272,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -303,16 +305,16 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -321,8 +323,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -356,7 +358,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -369,11 +371,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -382,8 +384,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#if TEST_STD_VER >= 11
@@ -398,22 +400,22 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -438,7 +440,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -451,17 +453,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -484,16 +486,16 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -502,8 +504,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -537,7 +539,7 @@ int main()
c2.max_load_factor(2);
c1.swap(c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -550,11 +552,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -563,8 +565,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#endif
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/allocator.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/allocator.pass.cpp
index d0b03b2cd0b8..9cd03809d784 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/allocator.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/allocator.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -33,7 +34,7 @@ int main()
test_allocator<NotConstructible>
> C;
C c(test_allocator<NotConstructible>(10));
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == test_allocator<NotConstructible>(10));
@@ -51,7 +52,7 @@ int main()
min_allocator<NotConstructible>
> C;
C c(min_allocator<NotConstructible>{});
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == min_allocator<NotConstructible>());
@@ -61,7 +62,7 @@ int main()
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef NotConstructible T;
typedef test_hash<std::hash<T>> HF;
@@ -71,7 +72,7 @@ int main()
A a(43);
C c(3, a);
- assert(c.bucket_count() == 3);
+ LIBCPP_ASSERT(c.bucket_count() == 3);
assert(c.hash_function() == HF());
assert(c.key_eq() == Comp ());
assert(c.get_allocator() == a);
@@ -92,7 +93,7 @@ int main()
HF hf(42);
A a(43);
C c(4, hf, a);
- assert(c.bucket_count() == 4);
+ LIBCPP_ASSERT(c.bucket_count() == 4);
assert(c.hash_function() == hf);
assert(!(c.hash_function() == HF()));
assert(c.key_eq() == Comp ());
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp
index 05cb0525eb79..0859d8edc85e 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp
@@ -18,7 +18,9 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -56,7 +58,7 @@ int main()
A(4)
);
c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -66,8 +68,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(4));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -129,8 +131,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -165,7 +167,7 @@ int main()
A()
);
c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -175,8 +177,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp
index a99e74af5943..2db01a21eaac 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
+#include <cstddef>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -54,8 +55,8 @@ int main()
assert(c.count(2) == 1);
assert(c.count(3) == 1);
assert(c.count(4) == 1);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -87,8 +88,8 @@ int main()
assert(c.count(2) == 1);
assert(c.count(3) == 1);
assert(c.count(4) == 1);
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp
index d8732268b85f..78a376335c3f 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp
@@ -18,7 +18,9 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -57,7 +59,7 @@ int main()
A(4)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -67,8 +69,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(4));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -102,7 +104,7 @@ int main()
A(10)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -112,8 +114,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -147,7 +149,7 @@ int main()
A(4)
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -157,8 +159,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -193,7 +195,7 @@ int main()
A()
);
c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -203,8 +205,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/compare_copy_constructible.fail.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/compare_copy_constructible.fail.cpp
index 6b675f00f16b..79782550d0fe 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/compare_copy_constructible.fail.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/compare_copy_constructible.fail.cpp
@@ -9,7 +9,7 @@
// <unordered_set>
-// Check that std::unordered_set fails to instantiate if the comparison predicate is
+// Check that std::unordered_set fails to instantiate if the comparison predicate is
// not copy-constructible. This is LWG issue 2436
#include <unordered_set>
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/copy.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/copy.pass.cpp
index 07278be79e57..06dcc552db0f 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/copy.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/copy.pass.cpp
@@ -19,7 +19,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -50,7 +52,7 @@ int main()
test_allocator<int>(10)
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -60,12 +62,12 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
@@ -89,7 +91,7 @@ int main()
other_allocator<int>(10)
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -99,13 +101,11 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == other_allocator<int>(-2));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
@@ -129,7 +129,7 @@ int main()
min_allocator<int>()
);
C c = c0;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -139,8 +139,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/copy_alloc.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/copy_alloc.pass.cpp
index 59f4bfabd582..538e349602c4 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/copy_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/copy_alloc.pass.cpp
@@ -19,7 +19,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -50,7 +52,7 @@ int main()
test_allocator<int>(10)
);
C c(c0, test_allocator<int>(5));
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -60,8 +62,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(5));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -89,7 +91,7 @@ int main()
min_allocator<int>()
);
C c(c0, min_allocator<int>());
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -99,8 +101,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp
index 7684277195ad..81ad16b7244b 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -33,7 +34,7 @@ int main()
test_allocator<NotConstructible>
> C;
C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (test_allocator<NotConstructible>()));
@@ -51,7 +52,7 @@ int main()
min_allocator<NotConstructible>
> C;
C c;
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
@@ -96,7 +97,7 @@ int main()
}
{
std::unordered_set<int> c = {};
- assert(c.bucket_count() == 0);
+ LIBCPP_ASSERT(c.bucket_count() == 0);
assert(c.size() == 0);
assert(c.empty());
assert(std::distance(c.begin(), c.end()) == 0);
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp
index b6837ccaec8d..82e184b8d3ea 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -54,11 +55,11 @@ int main()
}
{
typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
some_comp<MoveOnly>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/hash_copy_constructible.fail.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/hash_copy_constructible.fail.cpp
index 066f160a2586..9e135e2c141e 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/hash_copy_constructible.fail.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/hash_copy_constructible.fail.cpp
@@ -9,7 +9,7 @@
// <unordered_map>
-// Check that std::unordered_set fails to instantiate if the hash function is
+// Check that std::unordered_set fails to instantiate if the hash function is
// not copy-constructible. This is mentioned in LWG issue 2436
#include <unordered_set>
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp
index 3fd0c3926c0b..eea61c7ab46c 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp
@@ -18,7 +18,9 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -52,8 +54,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -83,12 +85,12 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int T;
typedef test_hash<std::hash<T>> HF;
@@ -117,8 +119,8 @@ int main()
assert(c.get_allocator() == a);
assert(!(c.get_allocator() == A()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -152,8 +154,8 @@ int main()
assert(c.get_allocator() == a);
assert(!(c.get_allocator() == A()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp
index b7eed1e5b253..95baa3df2852 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp
@@ -19,7 +19,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -45,7 +47,7 @@ int main()
},
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -55,8 +57,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -78,7 +80,7 @@ int main()
},
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -88,8 +90,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp
index 735babd522b3..108d67b66b22 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -47,7 +49,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -57,8 +59,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -81,7 +83,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -91,8 +93,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp
index 643a57fa99ca..5cb4d499a937 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -48,7 +50,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -58,8 +60,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -83,7 +85,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -93,8 +95,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp
index 72b9ed2a1de0..7c1cbc8667de 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -49,7 +51,7 @@ int main()
test_compare<std::equal_to<int> >(9),
test_allocator<int>(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -59,8 +61,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -85,7 +87,7 @@ int main()
test_compare<std::equal_to<int> >(9),
min_allocator<int>()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -95,8 +97,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp
index e865986337c4..0910bf15f8e4 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <unordered_set>
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -19,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -27,37 +31,26 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
test_allocator<int>
> C;
- typedef int P;
- P a[] =
- {
- P(1),
- P(2),
- P(3),
- P(4),
- P(1),
- P(2)
- };
C c0(7,
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9),
test_allocator<int>(10)
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 0);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(10));
assert(c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
@@ -86,7 +79,7 @@ int main()
test_allocator<int>(10)
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -96,44 +89,33 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c0.empty());
}
-#if TEST_STD_VER >= 11
{
typedef std::unordered_set<int,
test_hash<std::hash<int> >,
test_compare<std::equal_to<int> >,
min_allocator<int>
> C;
- typedef int P;
- P a[] =
- {
- P(1),
- P(2),
- P(3),
- P(4),
- P(1),
- P(2)
- };
C c0(7,
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9),
min_allocator<int>()
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 0);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
@@ -162,7 +144,7 @@ int main()
min_allocator<int>()
);
C c = std::move(c0);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -172,14 +154,13 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
assert(c0.empty());
}
-#endif
#if _LIBCPP_DEBUG >= 1
{
std::unordered_set<int> s1 = {1, 2, 3};
@@ -191,5 +172,4 @@ int main()
assert(s2.size() == 2);
}
#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp
index 2342bbc130be..4d2830b3a808 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp
@@ -19,6 +19,7 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -62,8 +63,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(12));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
@@ -103,8 +104,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
@@ -145,8 +146,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp
index 45f18dbbcb5c..b89d68002477 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp
@@ -22,6 +22,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -56,7 +57,7 @@ int main()
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_assignable<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp
index b4046148bc79..7190a01208f0 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp
@@ -20,6 +20,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
#include "test_allocator.h"
@@ -43,17 +44,17 @@ int main()
{
{
typedef std::unordered_set<MoveOnly> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
- static_assert(std::is_nothrow_move_constructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/range.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/range.pass.cpp
index c978d8d5d8a4..5bcc288aacbd 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/range.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/range.pass.cpp
@@ -19,7 +19,9 @@
#include <unordered_set>
#include <cassert>
#include <cfloat>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -55,8 +57,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -88,12 +90,12 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int T;
typedef test_hash<std::hash<T>> HF;
@@ -122,8 +124,8 @@ int main()
assert(c.get_allocator() == a);
assert(!(c.get_allocator() == A()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -157,8 +159,8 @@ int main()
assert(c.get_allocator() == a);
assert(!(c.get_allocator() == A()));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/range_size.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/range_size.pass.cpp
index b87d5615e00e..8900cafc4852 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/range_size.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/range_size.pass.cpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -48,7 +50,7 @@ int main()
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -58,8 +60,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -83,7 +85,7 @@ int main()
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
7
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -93,8 +95,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash.pass.cpp
index 7234d8a80aec..315ded7a0df8 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash.pass.cpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -50,7 +52,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -60,8 +62,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -86,7 +88,7 @@ int main()
7,
test_hash<std::hash<int> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -96,8 +98,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal.pass.cpp
index bcf3058aa835..3f5c829f726e 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal.pass.cpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -51,7 +53,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -61,8 +63,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -88,7 +90,7 @@ int main()
test_hash<std::hash<int> >(8),
test_compare<std::equal_to<int> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -98,8 +100,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal_allocator.pass.cpp
index ad9b414d7f13..f0d063d2cca8 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/range_size_hash_equal_allocator.pass.cpp
@@ -22,7 +22,9 @@
#include <cassert>
#include <cfloat>
#include <cmath>
+#include <cstddef>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -53,7 +55,7 @@ int main()
test_compare<std::equal_to<int> >(9),
test_allocator<int>(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -63,8 +65,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == test_allocator<int>(10));
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
@@ -91,7 +93,7 @@ int main()
test_compare<std::equal_to<int> >(9),
min_allocator<int>()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 4);
assert(c.count(1) == 1);
assert(c.count(2) == 1);
@@ -101,8 +103,8 @@ int main()
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == min_allocator<int>());
assert(!c.empty());
- assert(std::distance(c.begin(), c.end()) == c.size());
- assert(std::distance(c.cbegin(), c.cend()) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
+ assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/size.fail.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/size.fail.cpp
index 389c54c58cde..b1ee87f8f7c0 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/size.fail.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/size.fail.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -32,7 +33,7 @@ int main()
test_allocator<NotConstructible>
> C;
C c = 7;
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (test_allocator<NotConstructible>()));
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/size.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/size.pass.cpp
index 88e499773bf3..5b5e861cde42 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/size.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/size.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -33,7 +34,7 @@ int main()
test_allocator<NotConstructible>
> C;
C c(7);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (test_allocator<NotConstructible>()));
@@ -51,7 +52,7 @@ int main()
min_allocator<NotConstructible>
> C;
C c(7);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash.pass.cpp
index eb98dcc7b7e4..5c77839ffa60 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -35,7 +36,7 @@ int main()
C c(7,
test_hash<std::hash<NotConstructible> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (test_allocator<NotConstructible>()));
@@ -55,7 +56,7 @@ int main()
C c(7,
test_hash<std::hash<NotConstructible> >(8)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal.pass.cpp
index 4ae012038ae5..db49bd0e7a9c 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -36,7 +37,7 @@ int main()
test_hash<std::hash<NotConstructible> >(8),
test_compare<std::equal_to<NotConstructible> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() == (test_allocator<NotConstructible>()));
@@ -57,7 +58,7 @@ int main()
test_hash<std::hash<NotConstructible> >(8),
test_compare<std::equal_to<NotConstructible> >(9)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal_allocator.pass.cpp
index b2ddbe94e741..3958ce4679c3 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal_allocator.pass.cpp
@@ -18,6 +18,7 @@
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
@@ -37,7 +38,7 @@ int main()
test_compare<std::equal_to<NotConstructible> >(9),
test_allocator<NotConstructible>(10)
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() == (test_allocator<NotConstructible>(10)));
@@ -59,7 +60,7 @@ int main()
test_compare<std::equal_to<NotConstructible> >(9),
min_allocator<NotConstructible>()
);
- assert(c.bucket_count() == 7);
+ LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >(8));
assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >(9));
assert(c.get_allocator() == (min_allocator<NotConstructible>()));
diff --git a/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp b/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp
index d35d79b31266..4a16ddd3f4ce 100644
--- a/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp
@@ -26,6 +26,7 @@
// This tests a conforming extension
#include <unordered_set>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -122,79 +123,65 @@ int main()
{
{
typedef std::unordered_set<MoveOnly> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
some_comp<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#if TEST_STD_VER >= 14
{ // POCS allocator, throwable swap for hash, throwable swap for comp
typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for hash, throwable swap for comp
typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, throwable swap for hash, nothrow swap for comp
typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, throwable swap for hash, nothrow swap for comp
typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for hash, throwable swap for comp
typedef std::unordered_set<MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for hash, throwable swap for comp
typedef std::unordered_set<MoveOnly, some_hash2<MoveOnly>, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // POCS allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_set<MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // always equal allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_set<MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{ // NOT always equal allocator, nothrow swap for hash, nothrow swap for comp
typedef std::unordered_set<MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C;
- C c1, c2;
- static_assert( noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
}
diff --git a/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp b/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp
index 2755b5285027..c2bd75960d5b 100644
--- a/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp
@@ -17,7 +17,9 @@
#include <unordered_set>
#include <cassert>
+#include <cstddef>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
@@ -31,27 +33,27 @@ int main()
typedef test_allocator<int> Alloc;
typedef std::unordered_set<int, Hash, Compare, Alloc> C;
typedef int P;
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -71,12 +73,12 @@ int main()
P(70),
P(80)
};
- C c1(0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -88,18 +90,18 @@ int main()
assert(*c1.find(80) == 80);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -117,21 +119,21 @@ int main()
P(1),
P(2)
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -139,9 +141,9 @@ int main()
assert(c2.count(4) == 1);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -170,12 +172,12 @@ int main()
P(70),
P(80)
};
- C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1));
- C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(2));
+ C c1(std::begin(a1), std::end(a1), 0, Hash(1), Compare(1), Alloc(1, 1));
+ C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2));
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -187,12 +189,12 @@ int main()
assert(*c1.find(80) == 80);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
- assert(c1.get_allocator() == Alloc(1));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(c1.get_allocator().get_id() == 1);
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -200,9 +202,9 @@ int main()
assert(c2.count(4) == 1);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
- assert(c2.get_allocator() == Alloc(2));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(c2.get_allocator().get_id() == 2);
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
@@ -217,22 +219,22 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -257,7 +259,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -270,17 +272,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -303,16 +305,16 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -321,8 +323,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -356,7 +358,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -369,11 +371,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc(2));
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -382,8 +384,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc(1));
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#if TEST_STD_VER >= 11
@@ -398,22 +400,22 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -438,7 +440,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -451,17 +453,17 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() == 0);
+ LIBCPP_ASSERT(c2.bucket_count() == 0);
assert(c2.size() == 0);
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -484,16 +486,16 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() == 0);
+ LIBCPP_ASSERT(c1.bucket_count() == 0);
assert(c1.size() == 0);
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -502,8 +504,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
{
@@ -537,7 +539,7 @@ int main()
c2.max_load_factor(2);
swap(c1, c2);
- assert(c1.bucket_count() >= 11);
+ assert(c1.bucket_count() >= 8);
assert(c1.size() == 8);
assert(*c1.find(10) == 10);
assert(*c1.find(20) == 20);
@@ -550,11 +552,11 @@ int main()
assert(c1.hash_function() == Hash(2));
assert(c1.key_eq() == Compare(2));
assert(c1.get_allocator() == Alloc());
- assert(std::distance(c1.begin(), c1.end()) == c1.size());
- assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
+ assert(static_cast<std::size_t>(std::distance(c1.cbegin(), c1.cend())) == c1.size());
assert(c1.max_load_factor() == 2);
- assert(c2.bucket_count() >= 5);
+ assert(c2.bucket_count() >= 4);
assert(c2.size() == 4);
assert(c2.count(1) == 1);
assert(c2.count(2) == 1);
@@ -563,8 +565,8 @@ int main()
assert(c2.hash_function() == Hash(1));
assert(c2.key_eq() == Compare(1));
assert(c2.get_allocator() == Alloc());
- assert(std::distance(c2.begin(), c2.end()) == c2.size());
- assert(std::distance(c2.cbegin(), c2.cend()) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.begin(), c2.end())) == c2.size());
+ assert(static_cast<std::size_t>(std::distance(c2.cbegin(), c2.cend())) == c2.size());
assert(c2.max_load_factor() == 1);
}
#endif
diff --git a/test/std/depr/depr.c.headers/ciso646.pass.cpp b/test/std/depr/depr.c.headers/ciso646.pass.cpp
index 725a7ab1331b..6a686dc0cf65 100644
--- a/test/std/depr/depr.c.headers/ciso646.pass.cpp
+++ b/test/std/depr/depr.c.headers/ciso646.pass.cpp
@@ -11,10 +11,6 @@
#include <ciso646>
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
int main()
{
}
diff --git a/test/std/depr/depr.c.headers/complex.h.pass.cpp b/test/std/depr/depr.c.headers/complex.h.pass.cpp
index da0707990d80..0e3fd3e990b1 100644
--- a/test/std/depr/depr.c.headers/complex.h.pass.cpp
+++ b/test/std/depr/depr.c.headers/complex.h.pass.cpp
@@ -11,10 +11,6 @@
#include <complex.h>
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
int main()
{
std::complex<double> d;
diff --git a/test/std/depr/depr.c.headers/inttypes_h.pass.cpp b/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
index ff045a913fdb..5b0bb3bff373 100644
--- a/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/inttypes_h.pass.cpp
@@ -872,54 +872,56 @@
#error SCNxPTR not defined
#endif
+template <class T> void test()
+{
+ T t = 0;
+ ((void)t); // Prevent unused warning
+}
+
int main()
{
- {
- int8_t i1 = 0;
- int16_t i2 = 0;
- int32_t i3 = 0;
- int64_t i4 = 0;
- }
- {
- uint8_t i1 = 0;
- uint16_t i2 = 0;
- uint32_t i3 = 0;
- uint64_t i4 = 0;
- }
- {
- int_least8_t i1 = 0;
- int_least16_t i2 = 0;
- int_least32_t i3 = 0;
- int_least64_t i4 = 0;
- }
- {
- uint_least8_t i1 = 0;
- uint_least16_t i2 = 0;
- uint_least32_t i3 = 0;
- uint_least64_t i4 = 0;
- }
- {
- int_fast8_t i1 = 0;
- int_fast16_t i2 = 0;
- int_fast32_t i3 = 0;
- int_fast64_t i4 = 0;
- }
- {
- uint_fast8_t i1 = 0;
- uint_fast16_t i2 = 0;
- uint_fast32_t i3 = 0;
- uint_fast64_t i4 = 0;
- }
- {
- intptr_t i1 = 0;
- uintptr_t i2 = 0;
- intmax_t i3 = 0;
- uintmax_t i4 = 0;
- }
+ test<int8_t >();
+ test<int16_t>();
+ test<int32_t>();
+ test<int64_t>();
+
+ test<uint8_t >();
+ test<uint16_t>();
+ test<uint32_t>();
+ test<uint64_t>();
+
+ test<int_least8_t >();
+ test<int_least16_t>();
+ test<int_least32_t>();
+ test<int_least64_t>();
+
+ test<uint_least8_t >();
+ test<uint_least16_t>();
+ test<uint_least32_t>();
+ test<uint_least64_t>();
+
+ test<int_fast8_t >();
+ test<int_fast16_t>();
+ test<int_fast32_t>();
+ test<int_fast64_t>();
+
+ test<uint_fast8_t >();
+ test<uint_fast16_t>();
+ test<uint_fast32_t>();
+ test<uint_fast64_t>();
+
+ test<intptr_t >();
+ test<uintptr_t>();
+ test<intmax_t >();
+ test<uintmax_t>();
+
{
imaxdiv_t i1 = {};
+ ((void)i1); // Prevent unused warning
}
+
intmax_t i = 0;
+ ((void)i); // Prevent unused warning
static_assert((std::is_same<decltype(imaxabs(i)), intmax_t>::value), "");
static_assert((std::is_same<decltype(imaxdiv(i, i)), imaxdiv_t>::value), "");
static_assert((std::is_same<decltype(strtoimax("", (char**)0, 0)), intmax_t>::value), "");
diff --git a/test/std/depr/depr.c.headers/stdlib_h.pass.cpp b/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
index 96d1143d4de6..1680f4349bb5 100644
--- a/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/stdlib_h.pass.cpp
@@ -104,11 +104,9 @@ int main()
wchar_t* pw = 0;
const wchar_t* pwc = 0;
char* pc = 0;
-#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
static_assert((std::is_same<decltype(mblen("",0)), int>::value), "");
static_assert((std::is_same<decltype(mbtowc(pw,"",0)), int>::value), "");
static_assert((std::is_same<decltype(wctomb(pc,L' ')), int>::value), "");
-#endif
static_assert((std::is_same<decltype(mbstowcs(pw,"",0)), size_t>::value), "");
static_assert((std::is_same<decltype(wcstombs(pc,pwc,0)), size_t>::value), "");
}
diff --git a/test/std/depr/depr.c.headers/tgmath_h.pass.cpp b/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
index a2ef814dcae1..965a8de3c56e 100644
--- a/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/tgmath_h.pass.cpp
@@ -11,10 +11,6 @@
#include <tgmath.h>
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
int main()
{
std::complex<double> cd;
diff --git a/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp b/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp
new file mode 100644
index 000000000000..bd843621def8
--- /dev/null
+++ b/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++03
+
+// <system_error>
+
+// template <> struct is_error_code_enum<> : public false_type {};
+
+#include <system_error>
+#include <string>
+#include "test_macros.h"
+
+template <bool Expected, class T>
+void
+test()
+{
+ static_assert((std::is_error_code_enum<T>::value == Expected), "");
+#if TEST_STD_VER > 14
+ static_assert((std::is_error_code_enum_v<T> == Expected), "");
+#endif
+}
+
+class A {
+ A();
+ operator std::error_code () const { return std::error_code(); }
+};
+
+// Specialize the template for my class
+namespace std
+{
+ template <>
+ struct is_error_code_enum<A> : public std::true_type {};
+}
+
+
+int main()
+{
+ test<false, void>();
+ test<false, int>();
+ test<false, std::nullptr_t>();
+ test<false, std::string>();
+
+ test<true, A>();
+}
diff --git a/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp b/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
new file mode 100644
index 000000000000..b2efd9e07750
--- /dev/null
+++ b/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <system_error>
+
+// template <class T> constexpr bool is_error_condition_enum_v;
+
+#include <system_error>
+#include <type_traits>
+#include "test_macros.h"
+
+template <bool Expected, class T>
+void
+test()
+{
+ static_assert((std::is_error_condition_enum<T>::value == Expected), "");
+#if TEST_STD_VER > 14
+ static_assert((std::is_error_condition_enum_v<T> == Expected), "");
+#endif
+}
+
+class A {
+ A();
+ operator std::error_condition () const { return std::error_condition(); }
+};
+
+// Specialize the template for my class
+namespace std
+{
+ template <>
+ struct is_error_condition_enum<A> : public std::true_type {};
+}
+
+
+int main()
+{
+ test<false, void>();
+ test<false, int>();
+ test<false, std::nullptr_t>();
+ test<false, std::string>();
+
+ test<true, A>();
+}
diff --git a/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp b/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
index c8b3d98103c4..4091f446af27 100644
--- a/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
+++ b/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
@@ -32,7 +32,7 @@ test(int i)
H h;
T ec(i, std::system_category());
const std::size_t result = h(ec);
- LIBCPP_ASSERT(result == i);
+ LIBCPP_ASSERT(result == static_cast<std::size_t>(i));
((void)result); // Prevent unused warning
}
diff --git a/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp b/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
new file mode 100644
index 000000000000..d455210c2697
--- /dev/null
+++ b/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <class T>
+// struct hash
+// : public unary_function<T, size_t>
+// {
+// size_t operator()(T val) const;
+// };
+
+#include <system_error>
+#include <cassert>
+#include <type_traits>
+
+#include "test_macros.h"
+
+void
+test(int i)
+{
+ typedef std::error_condition T;
+ typedef std::hash<T> H;
+ static_assert((std::is_same<H::argument_type, T>::value), "" );
+ static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
+ H h;
+ T ec(i, std::system_category());
+ const std::size_t result = h(ec);
+ LIBCPP_ASSERT(result == static_cast<std::size_t>(i));
+ ((void)result); // Prevent unused warning
+}
+
+int main()
+{
+ test(0);
+ test(2);
+ test(10);
+}
diff --git a/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp b/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp
index eeb437379325..85ff8e15d162 100644
--- a/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp
+++ b/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <algorithm>
// template <class PopulationIterator, class SampleIterator, class Distance,
@@ -32,5 +34,8 @@ template <class PopulationIterator, class SampleIterator> void test() {
}
int main() {
+ // expected-error@algorithm:* {{static_assert failed "SampleIterator must meet the requirements of RandomAccessIterator"}}
+ // expected-error@algorithm:* 2 {{does not provide a subscript operator}}
+ // expected-error@algorithm:* {{invalid operands}}
test<input_iterator<int *>, output_iterator<int *> >();
}
diff --git a/test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp b/test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp
index 1a9f9b099b20..531731791c5d 100644
--- a/test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp
+++ b/test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp
@@ -46,8 +46,8 @@ template <>
struct TestExpectations<std::input_iterator_tag>
: public ReservoirSampleExpectations {};
-template <template<class> class PopulationIteratorType, class PopulationItem,
- template<class> class SampleIteratorType, class SampleItem>
+template <template<class...> class PopulationIteratorType, class PopulationItem,
+ template<class...> class SampleIteratorType, class SampleItem>
void test() {
typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
typedef SampleIteratorType<SampleItem *> SampleIterator;
@@ -68,13 +68,13 @@ void test() {
assert(std::equal(oa, oa + os, oa1));
end = std::experimental::sample(PopulationIterator(ia),
PopulationIterator(ia + is),
- SampleIterator(oa), os, g);
+ SampleIterator(oa), os, std::move(g));
assert(end.base() - oa == std::min(os, is));
assert(std::equal(oa, oa + os, oa2));
}
-template <template<class> class PopulationIteratorType, class PopulationItem,
- template<class> class SampleIteratorType, class SampleItem>
+template <template<class...> class PopulationIteratorType, class PopulationItem,
+ template<class...> class SampleIteratorType, class SampleItem>
void test_empty_population() {
typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
typedef SampleIteratorType<SampleItem *> SampleIterator;
@@ -88,8 +88,8 @@ void test_empty_population() {
assert(end.base() == oa);
}
-template <template<class> class PopulationIteratorType, class PopulationItem,
- template<class> class SampleIteratorType, class SampleItem>
+template <template<class...> class PopulationIteratorType, class PopulationItem,
+ template<class...> class SampleIteratorType, class SampleItem>
void test_empty_sample() {
typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
typedef SampleIteratorType<SampleItem *> SampleIterator;
@@ -103,8 +103,8 @@ void test_empty_sample() {
assert(end.base() == oa);
}
-template <template<class> class PopulationIteratorType, class PopulationItem,
- template<class> class SampleIteratorType, class SampleItem>
+template <template<class...> class PopulationIteratorType, class PopulationItem,
+ template<class...> class SampleIteratorType, class SampleItem>
void test_small_population() {
// The population size is less than the sample size.
typedef PopulationIteratorType<PopulationItem *> PopulationIterator;
diff --git a/test/std/experimental/any/any.class/any.assign/copy.pass.cpp b/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
index 8ee575c408f9..17b01fe630bf 100644
--- a/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
+++ b/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
@@ -18,7 +18,7 @@
#include <experimental/any>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
#include "count_new.hpp"
#include "test_macros.h"
diff --git a/test/std/experimental/any/any.class/any.assign/move.pass.cpp b/test/std/experimental/any/any.class/any.assign/move.pass.cpp
index 0a2d71967cd4..49508febd941 100644
--- a/test/std/experimental/any/any.class/any.assign/move.pass.cpp
+++ b/test/std/experimental/any/any.class/any.assign/move.pass.cpp
@@ -18,7 +18,7 @@
#include <experimental/any>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
#include "test_macros.h"
using std::experimental::any;
diff --git a/test/std/experimental/any/any.class/any.assign/value.pass.cpp b/test/std/experimental/any/any.class/any.assign/value.pass.cpp
index 8262990523c3..b42a4ba2b050 100644
--- a/test/std/experimental/any/any.class/any.assign/value.pass.cpp
+++ b/test/std/experimental/any/any.class/any.assign/value.pass.cpp
@@ -18,7 +18,7 @@
#include <experimental/any>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
#include "count_new.hpp"
#include "test_macros.h"
diff --git a/test/std/experimental/any/any.class/any.cons/copy.pass.cpp b/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
index 3d0b34b27406..69341ca6b801 100644
--- a/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
+++ b/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
@@ -16,7 +16,7 @@
#include <experimental/any>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
#include "count_new.hpp"
#include "test_macros.h"
diff --git a/test/std/experimental/any/any.class/any.cons/default.pass.cpp b/test/std/experimental/any/any.class/any.cons/default.pass.cpp
index b52c83fc3881..3839e3afc81d 100644
--- a/test/std/experimental/any/any.class/any.cons/default.pass.cpp
+++ b/test/std/experimental/any/any.class/any.cons/default.pass.cpp
@@ -17,7 +17,7 @@
#include <type_traits>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
#include "count_new.hpp"
diff --git a/test/std/experimental/any/any.class/any.cons/move.pass.cpp b/test/std/experimental/any/any.class/any.cons/move.pass.cpp
index 40534cb55066..2a050946afab 100644
--- a/test/std/experimental/any/any.class/any.cons/move.pass.cpp
+++ b/test/std/experimental/any/any.class/any.cons/move.pass.cpp
@@ -18,7 +18,7 @@
#include <type_traits>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
#include "count_new.hpp"
#include "test_macros.h"
diff --git a/test/std/experimental/any/any.class/any.cons/value.pass.cpp b/test/std/experimental/any/any.class/any.cons/value.pass.cpp
index 7bb134efd28a..a3ab0edc8b6b 100644
--- a/test/std/experimental/any/any.class/any.cons/value.pass.cpp
+++ b/test/std/experimental/any/any.class/any.cons/value.pass.cpp
@@ -23,7 +23,7 @@
#include <experimental/any>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
#include "count_new.hpp"
#include "test_macros.h"
diff --git a/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp b/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
index 603490cef43d..781ed73f2b33 100644
--- a/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
+++ b/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
@@ -16,7 +16,7 @@
#include <experimental/any>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
int main()
{
diff --git a/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp b/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
index 064935167eb5..b1d315468968 100644
--- a/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
+++ b/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
@@ -18,7 +18,7 @@
#include <experimental/any>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
using std::experimental::any;
using std::experimental::any_cast;
diff --git a/test/std/experimental/any/any.class/any.observers/empty.pass.cpp b/test/std/experimental/any/any.class/any.observers/empty.pass.cpp
index 8c681f37017f..bdf0d511b811 100644
--- a/test/std/experimental/any/any.class/any.observers/empty.pass.cpp
+++ b/test/std/experimental/any/any.class/any.observers/empty.pass.cpp
@@ -16,7 +16,7 @@
#include <experimental/any>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
int main()
{
diff --git a/test/std/experimental/any/any.class/any.observers/type.pass.cpp b/test/std/experimental/any/any.class/any.observers/type.pass.cpp
index 682b73bc98c4..6d0048403677 100644
--- a/test/std/experimental/any/any.class/any.observers/type.pass.cpp
+++ b/test/std/experimental/any/any.class/any.observers/type.pass.cpp
@@ -17,7 +17,7 @@
#include <experimental/any>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
int main()
{
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
index 9d9a5cdb4726..46ddbe5b05a1 100644
--- a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
+++ b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
@@ -21,7 +21,7 @@
#include <type_traits>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
using std::experimental::any;
using std::experimental::any_cast;
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
index e97560937fb0..47fe52f7b1dd 100644
--- a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
+++ b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
@@ -24,7 +24,7 @@
#include <type_traits>
#include <cassert>
-#include "any_helpers.h"
+#include "experimental_any_helpers.h"
#include "count_new.hpp"
#include "test_macros.h"
@@ -98,6 +98,8 @@ void checkThrows(any& a)
} catch (...) {
assert(false);
}
+#else
+ ((void)a);
#endif
}
@@ -176,7 +178,6 @@ void test_cast_to_value() {
Type::reset();
{
any a((Type(42)));
- any const& ca = a;
assert(Type::count == 1);
assert(Type::copied == 0);
assert(Type::moved == 1);
diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp b/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp
index a6becb1bafaa..830e8123150a 100644
--- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp
+++ b/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp
@@ -87,9 +87,10 @@ TEST_CASE(access_denied_test_case)
env.create_file(testFile, 42);
// Test that we can iterator over the directory before changing the perms
- directory_iterator it(testDir);
- TEST_REQUIRE(it != directory_iterator{});
-
+ {
+ directory_iterator it(testDir);
+ TEST_REQUIRE(it != directory_iterator{});
+ }
// Change the permissions so we can no longer iterate
permissions(testDir, perms::none);
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp
index 1118497e06a8..f344e1153071 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp
@@ -24,6 +24,7 @@
#include <experimental/filesystem>
#include <type_traits>
+#include <string_view>
#include <cassert>
#include "test_macros.h"
@@ -77,6 +78,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC)
using namespace fs;
using Ptr = CharT const*;
using Str = std::basic_string<CharT>;
+ using StrView = std::basic_string_view<CharT>;
using InputIter = input_iterator<Ptr>;
const Ptr L = TC.lhs;
@@ -99,6 +101,16 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC)
}
assert(LHS == E);
}
+ // basic_string_view
+ {
+ path LHS(L); PathReserve(LHS, ReserveSize);
+ StrView RHS(R);
+ {
+ DisableAllocationGuard g;
+ LHS /= RHS;
+ }
+ assert(LHS == E);
+ }
// CharT*
{
path LHS(L); PathReserve(LHS, ReserveSize);
@@ -153,6 +165,7 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC)
using namespace fs;
using Ptr = CharT const*;
using Str = std::basic_string<CharT>;
+ using StrView = std::basic_string_view<CharT>;
using InputIter = input_iterator<Ptr>;
const Ptr L = TC.lhs;
const Ptr R = TC.rhs;
@@ -172,6 +185,21 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC)
assert(LHS == E);
assert(&Ref == &LHS);
}
+ // basic_string_view
+ {
+ path LHS(L);
+ StrView RHS(R);
+ path& Ref = (LHS /= RHS);
+ assert(LHS == E);
+ assert(&Ref == &LHS);
+ }
+ {
+ path LHS(L);
+ StrView RHS(R);
+ path& Ref = LHS.append(RHS);
+ assert(LHS == E);
+ assert(&Ref == &LHS);
+ }
// Char*
{
path LHS(L);
@@ -218,6 +246,60 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC)
}
}
+
+
+template <class It, class = decltype(fs::path{}.append(std::declval<It>()))>
+constexpr bool has_append(int) { return true; }
+template <class It>
+constexpr bool has_append(long) { return false; }
+
+template <class It, class = decltype(fs::path{}.operator/=(std::declval<It>()))>
+constexpr bool has_append_op(int) { return true; }
+template <class It>
+constexpr bool has_append_op(long) { return false; }
+
+template <class It>
+constexpr bool has_append() {
+ static_assert(has_append<It>(0) == has_append_op<It>(0), "must be same");
+ return has_append<It>(0) && has_append_op<It>(0);
+}
+
+void test_sfinae()
+{
+ using namespace fs;
+ {
+ using It = const char* const;
+ static_assert(has_append<It>(), "");
+ }
+ {
+ using It = input_iterator<const char*>;
+ static_assert(has_append<It>(), "");
+ }
+ {
+ struct Traits {
+ using iterator_category = std::input_iterator_tag;
+ using value_type = const char;
+ using pointer = const char*;
+ using reference = const char&;
+ using difference_type = std::ptrdiff_t;
+ };
+ using It = input_iterator<const char*, Traits>;
+ static_assert(has_append<It>(), "");
+ }
+ {
+ using It = output_iterator<const char*>;
+ static_assert(!has_append<It>(), "");
+
+ }
+ {
+ static_assert(!has_append<int*>(), "");
+ }
+ {
+ static_assert(!has_append<char>(), "");
+ static_assert(!has_append<const char>(), "");
+ }
+}
+
int main()
{
using namespace fs;
@@ -238,4 +320,5 @@ int main()
doAppendSourceAllocTest<char>(TC);
doAppendSourceAllocTest<wchar_t>(TC);
}
+ test_sfinae();
}
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp
index 4c2d5112d10b..9e48cbf1e7f2 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp
@@ -23,6 +23,7 @@
#include <experimental/filesystem>
#include <type_traits>
+#include <string_view>
#include <cassert>
#include "test_macros.h"
@@ -69,6 +70,32 @@ void RunTestCase(MultiStringType const& MS) {
assert(p.string<CharT>() == TestPath);
assert(p.string<CharT>() == S);
}
+ // basic_string<Char, Traits, Alloc>
+ {
+ const std::basic_string_view<CharT> S(TestPath);
+ path p; PathReserve(p, S.length() + 1);
+ {
+ // string provides a contigious iterator. No allocation needed.
+ DisableAllocationGuard g;
+ path& pref = (p = S);
+ assert(&pref == &p);
+ }
+ assert(p.native() == Expect);
+ assert(p.string<CharT>() == TestPath);
+ assert(p.string<CharT>() == S);
+ }
+ {
+ const std::basic_string_view<CharT> S(TestPath);
+ path p; PathReserve(p, S.length() + 1);
+ {
+ DisableAllocationGuard g;
+ path& pref = p.assign(S);
+ assert(&pref == &p);
+ }
+ assert(p.native() == Expect);
+ assert(p.string<CharT>() == TestPath);
+ assert(p.string<CharT>() == S);
+ }
//////////////////////////////////////////////////////////////////////////////
// Char* pointers
{
@@ -143,6 +170,49 @@ void RunTestCase(MultiStringType const& MS) {
}
}
+template <class It, class = decltype(fs::path{}.assign(std::declval<It>()))>
+constexpr bool has_assign(int) { return true; }
+template <class It>
+constexpr bool has_assign(long) { return false; }
+template <class It>
+constexpr bool has_assign() { return has_assign<It>(0); }
+
+void test_sfinae() {
+ using namespace fs;
+ {
+ using It = const char* const;
+ static_assert(std::is_assignable<path, It>::value, "");
+ static_assert(has_assign<It>(), "");
+ }
+ {
+ using It = input_iterator<const char*>;
+ static_assert(std::is_assignable<path, It>::value, "");
+ static_assert(has_assign<It>(), "");
+ }
+ {
+ struct Traits {
+ using iterator_category = std::input_iterator_tag;
+ using value_type = const char;
+ using pointer = const char*;
+ using reference = const char&;
+ using difference_type = std::ptrdiff_t;
+ };
+ using It = input_iterator<const char*, Traits>;
+ static_assert(std::is_assignable<path, It>::value, "");
+ static_assert(has_assign<It>(), "");
+ }
+ {
+ using It = output_iterator<const char*>;
+ static_assert(!std::is_assignable<path, It>::value, "");
+ static_assert(!has_assign<It>(), "");
+
+ }
+ {
+ static_assert(!std::is_assignable<path, int*>::value, "");
+ static_assert(!has_assign<int*>(), "");
+ }
+}
+
int main() {
for (auto const& MS : PathList) {
RunTestCase<char>(MS);
@@ -150,4 +220,5 @@ int main() {
RunTestCase<char16_t>(MS);
RunTestCase<char32_t>(MS);
}
+ test_sfinae();
}
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp
index 557c1b24d88f..69d08e6eb49a 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp
@@ -73,6 +73,11 @@ const PathCompareTest CompareTestCases[] =
#undef LONGC
#undef LONGD
+static inline int normalize_ret(int ret)
+{
+ return ret < 0 ? -1 : (ret > 0 ? 1 : 0);
+}
+
int main()
{
using namespace fs;
@@ -80,17 +85,18 @@ int main()
const path p1(TC.LHS);
const path p2(TC.RHS);
const std::string R(TC.RHS);
+ const std::string_view RV(TC.RHS);
const int E = TC.expect;
{ // compare(...) functions
DisableAllocationGuard g; // none of these operations should allocate
// check runtime results
- int ret1 = p1.compare(p2);
- int ret2 = p1.compare(R);
- int ret3 = p1.compare(TC.RHS);
- assert(ret1 == ret2 && ret1 == ret3);
- int normalized_ret = ret1 < 0 ? -1 : (ret1 > 0 ? 1 : 0);
- assert(normalized_ret == E);
+ int ret1 = normalize_ret(p1.compare(p2));
+ int ret2 = normalize_ret(p1.compare(R));
+ int ret3 = normalize_ret(p1.compare(TC.RHS));
+ int ret4 = normalize_ret(p1.compare(RV));
+ assert(ret1 == ret2 && ret1 == ret3 && ret1 == ret4);
+ assert(ret1 == E);
// check signatures
ASSERT_NOEXCEPT(p1.compare(p2));
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp
index 6e00afe0b49c..89269362d06f 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp
@@ -14,8 +14,9 @@
// class path
// path& operator+=(const path& x);
-// path& operator+=(const string_type& x); // Implemented as Source template
-// path& operator+=(const value_type* x); // Implemented as Source template
+// path& operator+=(const string_type& x);
+// path& operator+=(string_view x);
+// path& operator+=(const value_type* x);
// path& operator+=(value_type x);
// template <class Source>
// path& operator+=(const Source& x);
@@ -29,6 +30,8 @@
#include <experimental/filesystem>
#include <type_traits>
+#include <string>
+#include <string_view>
#include <cassert>
#include "test_macros.h"
@@ -82,6 +85,7 @@ void doConcatSourceAllocTest(ConcatOperatorTestcase const& TC)
using namespace fs;
using Ptr = CharT const*;
using Str = std::basic_string<CharT>;
+ using StrView = std::basic_string_view<CharT>;
using InputIter = input_iterator<Ptr>;
const Ptr L = TC.lhs;
@@ -98,6 +102,16 @@ void doConcatSourceAllocTest(ConcatOperatorTestcase const& TC)
}
assert(LHS == E);
}
+ // basic_string_view
+ {
+ path LHS(L); PathReserve(LHS, ReserveSize);
+ StrView RHS(R);
+ {
+ DisableAllocationGuard g;
+ LHS += RHS;
+ }
+ assert(LHS == E);
+ }
// CharT*
{
path LHS(L); PathReserve(LHS, ReserveSize);
@@ -152,6 +166,7 @@ void doConcatSourceTest(ConcatOperatorTestcase const& TC)
using namespace fs;
using Ptr = CharT const*;
using Str = std::basic_string<CharT>;
+ using StrView = std::basic_string_view<CharT>;
using InputIter = input_iterator<Ptr>;
const Ptr L = TC.lhs;
const Ptr R = TC.rhs;
@@ -171,6 +186,21 @@ void doConcatSourceTest(ConcatOperatorTestcase const& TC)
assert(LHS == E);
assert(&Ref == &LHS);
}
+ // basic_string_view
+ {
+ path LHS(L);
+ StrView RHS(R);
+ path& Ref = (LHS += RHS);
+ assert(LHS == E);
+ assert(&Ref == &LHS);
+ }
+ {
+ path LHS(L);
+ StrView RHS(R);
+ path& Ref = LHS.concat(RHS);
+ assert(LHS == E);
+ assert(&Ref == &LHS);
+ }
// Char*
{
path LHS(L);
@@ -235,6 +265,68 @@ void doConcatECharTest(ConcatOperatorTestcase const& TC)
}
}
+
+template <class It, class = decltype(fs::path{}.concat(std::declval<It>()))>
+constexpr bool has_concat(int) { return true; }
+template <class It>
+constexpr bool has_concat(long) { return false; }
+
+template <class It, class = decltype(fs::path{}.operator+=(std::declval<It>()))>
+constexpr bool has_concat_op(int) { return true; }
+template <class It>
+constexpr bool has_concat_op(long) { return false; }
+template <class It>
+constexpr bool has_concat_op() { return has_concat_op<It>(0); }
+
+template <class It>
+constexpr bool has_concat() {
+ static_assert(has_concat<It>(0) == has_concat_op<It>(0), "must be same");
+ return has_concat<It>(0) && has_concat_op<It>(0);
+}
+
+void test_sfinae() {
+ using namespace fs;
+ {
+ static_assert(has_concat_op<char>(), "");
+ static_assert(has_concat_op<const char>(), "");
+ static_assert(has_concat_op<char16_t>(), "");
+ static_assert(has_concat_op<const char16_t>(), "");
+ }
+ {
+ using It = const char* const;
+ static_assert(has_concat<It>(), "");
+ }
+ {
+ using It = input_iterator<const char*>;
+ static_assert(has_concat<It>(), "");
+ }
+ {
+ struct Traits {
+ using iterator_category = std::input_iterator_tag;
+ using value_type = const char;
+ using pointer = const char*;
+ using reference = const char&;
+ using difference_type = std::ptrdiff_t;
+ };
+ using It = input_iterator<const char*, Traits>;
+ static_assert(has_concat<It>(), "");
+ }
+ {
+ using It = output_iterator<const char*>;
+ static_assert(!has_concat<It>(), "");
+ }
+ {
+ static_assert(!has_concat<int>(0), "");
+ // operator+=(int) is well formed since it converts to operator+=(value_type)
+ // but concat(int) isn't valid because there is no concat(value_type).
+ // This should probably be addressed by a LWG issue.
+ static_assert(has_concat_op<int>(), "");
+ }
+ {
+ static_assert(!has_concat<int*>(), "");
+ }
+}
+
int main()
{
using namespace fs;
@@ -246,6 +338,13 @@ int main()
assert(LHS == (const char*)TC.expect);
assert(&Ref == &LHS);
}
+ {
+ path LHS((const char*)TC.lhs);
+ std::string_view RHS((const char*)TC.rhs);
+ path& Ref = (LHS += RHS);
+ assert(LHS == (const char*)TC.expect);
+ assert(&Ref == &LHS);
+ }
doConcatSourceTest<char> (TC);
doConcatSourceTest<wchar_t> (TC);
doConcatSourceTest<char16_t>(TC);
@@ -265,6 +364,18 @@ int main()
}
assert(LHS == E);
}
+ {
+ path LHS((const char*)TC.lhs);
+ std::string_view RHS((const char*)TC.rhs);
+ const char* E = TC.expect;
+ PathReserve(LHS, StrLen(E) + 5);
+ {
+ DisableAllocationGuard g;
+ path& Ref = (LHS += RHS);
+ assert(&Ref == &LHS);
+ }
+ assert(LHS == E);
+ }
doConcatSourceAllocTest<char>(TC);
doConcatSourceAllocTest<wchar_t>(TC);
}
@@ -274,4 +385,5 @@ int main()
doConcatECharTest<char16_t>(TC);
doConcatECharTest<char32_t>(TC);
}
+ test_sfinae();
}
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp
index d89e7c815efb..a04f35af5780 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp
@@ -47,6 +47,13 @@ void RunTestCase(MultiStringType const& MS) {
assert(p.string<CharT>() == TestPath);
assert(p.string<CharT>() == S);
}
+ {
+ const std::basic_string_view<CharT> S(TestPath);
+ path p(S);
+ assert(p.native() == Expect);
+ assert(p.string<CharT>() == TestPath);
+ assert(p.string<CharT>() == S);
+ }
// Char* pointers
{
path p(TestPath);
@@ -73,6 +80,37 @@ void RunTestCase(MultiStringType const& MS) {
}
}
+void test_sfinae() {
+ using namespace fs;
+ {
+ using It = const char* const;
+ static_assert(std::is_constructible<path, It>::value, "");
+ }
+ {
+ using It = input_iterator<const char*>;
+ static_assert(std::is_constructible<path, It>::value, "");
+ }
+ {
+ struct Traits {
+ using iterator_category = std::input_iterator_tag;
+ using value_type = const char;
+ using pointer = const char*;
+ using reference = const char&;
+ using difference_type = std::ptrdiff_t;
+ };
+ using It = input_iterator<const char*, Traits>;
+ static_assert(std::is_constructible<path, It>::value, "");
+ }
+ {
+ using It = output_iterator<const char*>;
+ static_assert(!std::is_constructible<path, It>::value, "");
+
+ }
+ {
+ static_assert(!std::is_constructible<path, int*>::value, "");
+ }
+}
+
int main() {
for (auto const& MS : PathList) {
RunTestCase<char>(MS);
@@ -80,4 +118,5 @@ int main() {
RunTestCase<char16_t>(MS);
RunTestCase<char32_t>(MS);
}
+ test_sfinae();
}
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp
index 5be934968c46..7881c9700d6e 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp
@@ -28,7 +28,6 @@ namespace fs = std::experimental::filesystem;
int main() {
using namespace fs;
- const path p("/foo/bar/baz");
{
path p;
ASSERT_NOEXCEPT(p.clear());
@@ -37,6 +36,7 @@ int main() {
assert(p.empty());
}
{
+ const path p("/foo/bar/baz");
path p2(p);
assert(p == p2);
p2.clear();
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp
index 4ad9084dbf81..e414202bf8ff 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp
@@ -35,16 +35,24 @@ const RemoveFilenameTestcase TestCases[] =
{
{"", ""}
, {"/", ""}
+ , {"//", ""}
+ , {"///", ""}
, {"\\", ""}
, {".", ""}
, {"..", ""}
, {"/foo", "/"}
+ , {"//foo", ""}
+ , {"//foo/", ""}
+ , {"//foo///", ""}
+ , {"///foo", "/"}
+ , {"///foo/", "///foo"}
, {"/foo/", "/foo"}
, {"/foo/.", "/foo"}
, {"/foo/..", "/foo"}
, {"/foo/////", "/foo"}
, {"/foo\\\\", "/"}
, {"/foo//\\/", "/foo//\\"}
+ , {"///foo", "/"}
, {"file.txt", ""}
, {"bar/../baz/./file.txt", "bar/../baz/."}
};
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp
index 7cf3564bb9b1..796609432727 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp
@@ -30,8 +30,8 @@ int main()
using namespace fs;
const char* const value = "hello world";
const std::string str_value = value;
- path p(value);
{ // Check signature
+ path p(value);
ASSERT_SAME_TYPE(path::value_type const*, decltype(p.c_str()));
ASSERT_NOEXCEPT(p.c_str());
}
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp
index 7f8df27faf0a..db1326483776 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp
@@ -28,8 +28,8 @@ int main()
{
using namespace fs;
const char* const value = "hello world";
- path p(value);
{ // Check signature
+ path p(value);
ASSERT_SAME_TYPE(path::string_type const&, decltype(p.native()));
ASSERT_NOEXCEPT(p.native());
}
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp
index 9ef83f989aa5..013d26cdb7f6 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp
@@ -30,8 +30,8 @@ int main()
using namespace fs;
using string_type = path::string_type;
const char* const value = "hello world";
- path p(value);
{ // Check signature
+ path p(value);
static_assert(std::is_convertible<path, string_type>::value, "");
static_assert(std::is_constructible<string_type, path>::value, "");
ASSERT_SAME_TYPE(string_type, decltype(p.operator string_type()));
diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp b/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp
index e8d150f1e39d..4b7ad735c7f8 100644
--- a/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp
@@ -40,7 +40,6 @@ void doIOTest() {
using namespace fs;
using Ptr = const CharT*;
using StrStream = std::basic_stringstream<CharT>;
- const char* const InCStr = InStr;
const Ptr E = OutStr;
const path p((const char*)InStr);
StrStream ss;
diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp b/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp
index 1cddccd0d724..8f6009d399c1 100644
--- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp
+++ b/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp
@@ -91,8 +91,10 @@ TEST_CASE(access_denied_test_case)
env.create_file(testFile, 42);
// Test that we can iterator over the directory before changing the perms
- RDI it(testDir);
- TEST_REQUIRE(it != RDI{});
+ {
+ RDI it(testDir);
+ TEST_REQUIRE(it != RDI{});
+ }
// Change the permissions so we can no longer iterate
permissions(testDir, perms::none);
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp
index 7d318719f740..c9b42b3596ad 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp
@@ -19,6 +19,7 @@
#include <experimental/filesystem>
#include <type_traits>
+#include <cstddef>
#include <cassert>
#include "test_macros.h"
@@ -59,6 +60,7 @@ TEST_CASE(test_error_reporting)
&& err.code() == ec;
}
#else
+ ((void)f); ((void)t); ((void)ec);
return true;
#endif
};
@@ -69,37 +71,44 @@ TEST_CASE(test_error_reporting)
const path fifo = env.create_fifo("fifo");
TEST_REQUIRE(is_other(fifo));
+ const auto test_ec = GetTestEC();
+
// !exists(f)
{
- std::error_code ec;
+ std::error_code ec = test_ec;
const path f = StaticEnv::DNE;
const path t = env.test_root;
fs::copy(f, t, ec);
TEST_REQUIRE(ec);
+ TEST_REQUIRE(ec != test_ec);
TEST_CHECK(checkThrow(f, t, ec));
}
{ // equivalent(f, t) == true
- std::error_code ec;
+ std::error_code ec = test_ec;
fs::copy(file, file, ec);
TEST_REQUIRE(ec);
+ TEST_REQUIRE(ec != test_ec);
TEST_CHECK(checkThrow(file, file, ec));
}
{ // is_directory(from) && is_file(to)
- std::error_code ec;
+ std::error_code ec = test_ec;
fs::copy(dir, file, ec);
TEST_REQUIRE(ec);
+ TEST_REQUIRE(ec != test_ec);
TEST_CHECK(checkThrow(dir, file, ec));
}
{ // is_other(from)
- std::error_code ec;
+ std::error_code ec = test_ec;
fs::copy(fifo, dir, ec);
TEST_REQUIRE(ec);
+ TEST_REQUIRE(ec != test_ec);
TEST_CHECK(checkThrow(fifo, dir, ec));
}
{ // is_other(to)
- std::error_code ec;
+ std::error_code ec = test_ec;
fs::copy(file, fifo, ec);
TEST_REQUIRE(ec);
+ TEST_REQUIRE(ec != test_ec);
TEST_CHECK(checkThrow(file, fifo, ec));
}
}
@@ -129,11 +138,13 @@ TEST_CASE(from_is_symlink)
std::error_code ec = GetTestEC();
fs::copy(symlink, file, copy_options::copy_symlinks, ec);
TEST_CHECK(ec);
+ TEST_CHECK(ec != GetTestEC());
}
{ // create symlinks but target exists
std::error_code ec = GetTestEC();
fs::copy(symlink, file, copy_options::create_symlinks, ec);
TEST_CHECK(ec);
+ TEST_CHECK(ec != GetTestEC());
}
}
@@ -187,7 +198,7 @@ TEST_CASE(from_is_directory)
{
struct FileInfo {
path filename;
- int size;
+ std::size_t size;
};
const FileInfo files[] = {
{"file1", 0},
@@ -246,6 +257,60 @@ TEST_CASE(from_is_directory)
TEST_CHECK(file_size(nested_created) == FI.size);
}
}
+}
+TEST_CASE(test_copy_symlinks_to_symlink_dir)
+{
+ scoped_test_env env;
+ const path file1 = env.create_file("file1", 42);
+ const path file2 = env.create_file("file2", 101);
+ const path file2_sym = env.create_symlink(file2, "file2_sym");
+ const path dir = env.create_dir("dir");
+ const path dir_sym = env.create_symlink(dir, "dir_sym");
+ {
+ std::error_code ec = GetTestEC();
+ fs::copy(file1, dir_sym, copy_options::copy_symlinks, ec);
+ TEST_CHECK(!ec);
+ const path dest = env.make_env_path("dir/file1");
+ TEST_CHECK(exists(dest));
+ TEST_CHECK(!is_symlink(dest));
+ TEST_CHECK(file_size(dest) == 42);
+ }
}
+
+
+TEST_CASE(test_dir_create_symlink)
+{
+ scoped_test_env env;
+ const path dir = env.create_dir("dir1");
+ const path dest = env.make_env_path("dne");
+ {
+ std::error_code ec = GetTestEC();
+ fs::copy(dir, dest, copy_options::create_symlinks, ec);
+ TEST_CHECK(ec == std::make_error_code(std::errc::is_a_directory));
+ TEST_CHECK(!exists(dest));
+ TEST_CHECK(!is_symlink(dest));
+ }
+ {
+ std::error_code ec = GetTestEC();
+ fs::copy(dir, dest, copy_options::create_symlinks|copy_options::recursive, ec);
+ TEST_CHECK(ec == std::make_error_code(std::errc::is_a_directory));
+ TEST_CHECK(!exists(dest));
+ TEST_CHECK(!is_symlink(dest));
+ }
+}
+
+TEST_CASE(test_otherwise_no_effects_clause)
+{
+ scoped_test_env env;
+ const path dir = env.create_dir("dir1");
+ { // skip copy because of directory
+ const path dest = env.make_env_path("dest1");
+ std::error_code ec;
+ fs::copy(dir, dest, CO::directories_only, ec);
+ TEST_CHECK(!ec);
+ TEST_CHECK(!exists(dest));
+ }
+}
+
TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
index ac9877bbd9ce..8c5241c71af8 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
@@ -62,6 +62,7 @@ TEST_CASE(test_error_reporting)
&& err.code() == ec;
}
#else
+ ((void)f); ((void)t); ((void)ec);
return true;
#endif
};
@@ -138,7 +139,6 @@ TEST_CASE(test_attributes_get_copied)
const path file = env.create_file("file1", 42);
const path dest = env.make_env_path("file2");
auto st = status(file);
- perms default_perms = st.permissions();
perms new_perms = perms::owner_read;
permissions(file, new_perms);
std::error_code ec;
@@ -153,12 +153,36 @@ TEST_CASE(copy_dir_test)
scoped_test_env env;
const path file = env.create_file("file1", 42);
const path dest = env.create_dir("dir1");
- std::error_code ec;
+ std::error_code ec = GetTestEC();
TEST_CHECK(fs::copy_file(file, dest, ec) == false);
TEST_CHECK(ec);
- ec.clear();
+ TEST_CHECK(ec != GetTestEC());
+ ec = GetTestEC();
TEST_CHECK(fs::copy_file(dest, file, ec) == false);
TEST_CHECK(ec);
+ TEST_CHECK(ec != GetTestEC());
+}
+
+TEST_CASE(non_regular_file_test)
+{
+ scoped_test_env env;
+ const path fifo = env.create_fifo("fifo");
+ const path dest = env.make_env_path("dest");
+ const path file = env.create_file("file", 42);
+ {
+ std::error_code ec = GetTestEC();
+ TEST_REQUIRE(fs::copy_file(fifo, dest, ec) == false);
+ TEST_CHECK(ec);
+ TEST_CHECK(ec != GetTestEC());
+ TEST_CHECK(!exists(dest));
+ }
+ {
+ std::error_code ec = GetTestEC();
+ TEST_REQUIRE(fs::copy_file(file, fifo, copy_options::overwrite_existing, ec) == false);
+ TEST_CHECK(ec);
+ TEST_CHECK(ec != GetTestEC());
+ TEST_CHECK(is_fifo(fifo));
+ }
}
TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp
index 6fae11195206..fe4729806772 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp
@@ -50,6 +50,7 @@ TEST_CASE(test_error_reporting)
&& err.code() == ec;
}
#else
+ ((void)f); ((void)t); ((void)ec);
return true;
#endif
};
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp
index e0473754cc88..85a3b6cb3465 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp
@@ -37,21 +37,6 @@ TEST_CASE(test_signatures)
TEST_CASE(test_error_reporting)
{
- auto checkThrow = [](path const& f, path const& t, const std::error_code& ec)
- {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- fs::create_directory_symlink(f, t);
- return true;
- } catch (filesystem_error const& err) {
- return err.path1() == f
- && err.code() == ec;
- }
-#else
- return true;
-#endif
- };
-
scoped_test_env env;
const path file = env.create_file("file1", 42);
const path file2 = env.create_file("file2", 55);
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp
index 4a865fdee7e8..7aefece46a4a 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp
@@ -36,21 +36,6 @@ TEST_CASE(test_signatures)
TEST_CASE(test_error_reporting)
{
- auto checkThrow = [](path const& f, path const& t, const std::error_code& ec)
- {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- fs::create_hard_link(f, t);
- return true;
- } catch (filesystem_error const& err) {
- return err.path1() == f
- && err.code() == ec;
- }
-#else
- return true;
-#endif
- };
-
scoped_test_env env;
const path file = env.create_file("file1", 42);
const path file2 = env.create_file("file2", 55);
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp
index 35ba57f3ab46..d261d987a1ee 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp
@@ -37,21 +37,6 @@ TEST_CASE(test_signatures)
TEST_CASE(test_error_reporting)
{
- auto checkThrow = [](path const& f, path const& t, const std::error_code& ec)
- {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- try {
- fs::create_symlink(f, t);
- return true;
- } catch (filesystem_error const& err) {
- return err.path1() == f
- && err.code() == ec;
- }
-#else
- return true;
-#endif
- };
-
scoped_test_env env;
const path file = env.create_file("file1", 42);
const path file2 = env.create_file("file2", 55);
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
index abc50e9c6a41..7537ac20c757 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
@@ -45,18 +45,27 @@ TEST_CASE(hard_link_count_for_file)
TEST_CASE(hard_link_count_for_directory)
{
- uintmax_t DirExpect = 3;
- uintmax_t Dir3Expect = 2;
+ uintmax_t DirExpect = 3; // hard link from . .. and Dir2
+ uintmax_t Dir3Expect = 2; // hard link from . ..
+ uintmax_t DirExpectAlt = DirExpect;
+ uintmax_t Dir3ExpectAlt = Dir3Expect;
#if defined(__APPLE__)
- DirExpect += 2;
- Dir3Expect += 1;
+ // Filesystems formatted with case sensitive hfs+ behave unixish as
+ // expected. Normal hfs+ filesystems report the number of directory
+ // entries instead.
+ DirExpectAlt = 5; // . .. Dir2 file1 file2
+ Dir3Expect = 3; // . .. file5
#endif
- TEST_CHECK(hard_link_count(StaticEnv::Dir) == DirExpect);
- TEST_CHECK(hard_link_count(StaticEnv::Dir3) == Dir3Expect);
+ TEST_CHECK(hard_link_count(StaticEnv::Dir) == DirExpect ||
+ hard_link_count(StaticEnv::Dir) == DirExpectAlt);
+ TEST_CHECK(hard_link_count(StaticEnv::Dir3) == Dir3Expect ||
+ hard_link_count(StaticEnv::Dir3) == Dir3ExpectAlt);
std::error_code ec;
- TEST_CHECK(hard_link_count(StaticEnv::Dir, ec) == DirExpect);
- TEST_CHECK(hard_link_count(StaticEnv::Dir3, ec) == Dir3Expect);
+ TEST_CHECK(hard_link_count(StaticEnv::Dir, ec) == DirExpect ||
+ hard_link_count(StaticEnv::Dir, ec) == DirExpectAlt);
+ TEST_CHECK(hard_link_count(StaticEnv::Dir3, ec) == Dir3Expect ||
+ hard_link_count(StaticEnv::Dir3, ec) == Dir3ExpectAlt);
}
TEST_CASE(hard_link_count_increments_test)
{
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp
index ba07d09d10d9..bc62086c2cff 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp
@@ -77,4 +77,33 @@ TEST_CASE(test_is_empty_fails)
TEST_CHECK_THROW(filesystem_error, is_empty(dir2));
}
+TEST_CASE(test_directory_access_denied)
+{
+ scoped_test_env env;
+ const path dir = env.create_dir("dir");
+ const path file1 = env.create_file("dir/file", 42);
+ permissions(dir, perms::none);
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(is_empty(dir, ec) == false);
+ TEST_CHECK(ec);
+ TEST_CHECK(ec != GetTestEC());
+
+ TEST_CHECK_THROW(filesystem_error, is_empty(dir));
+}
+
+
+TEST_CASE(test_fifo_fails)
+{
+ scoped_test_env env;
+ const path fifo = env.create_fifo("fifo");
+
+ std::error_code ec = GetTestEC();
+ TEST_CHECK(is_empty(fifo, ec) == false);
+ TEST_CHECK(ec);
+ TEST_CHECK(ec != GetTestEC());
+
+ TEST_CHECK_THROW(filesystem_error, is_empty(fifo));
+}
+
TEST_SUITE_END()
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
index b177693c09bd..4177392141e5 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
@@ -35,7 +35,8 @@ TEST_CASE(test_signatures)
std::error_code ec; ((void)ec);
ASSERT_NOT_NOEXCEPT(fs::permissions(p, opts));
// Not noexcept because of narrow contract
- ASSERT_NOT_NOEXCEPT(fs::permissions(p, opts, ec));
+ LIBCPP_ONLY(
+ ASSERT_NOT_NOEXCEPT(fs::permissions(p, opts, ec)));
}
TEST_CASE(test_error_reporting)
@@ -52,6 +53,7 @@ TEST_CASE(test_error_reporting)
&& err.code() == ec;
}
#else
+ ((void)f); ((void)opts); ((void)ec);
return true;
#endif
};
@@ -115,7 +117,7 @@ TEST_CASE(basic_permissions_test)
permissions(TC.p, TC.set_perms, ec);
TEST_CHECK(!ec);
auto pp = status(TC.p).permissions();
- TEST_CHECK(status(TC.p).permissions() == TC.expected);
+ TEST_CHECK(pp == TC.expected);
}
}
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
index 00581cbe8bcc..d69e95ce5d5c 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
@@ -51,6 +51,7 @@ TEST_CASE(test_error_reporting)
&& err.code() == ec;
}
#else
+ ((void)f); ((void)ec);
return true;
#endif
};
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp
index edb0c4fc76c9..f7ce8a30e64e 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp
@@ -50,6 +50,7 @@ TEST_CASE(test_error_reporting)
&& err.code() == ec;
}
#else
+ ((void)f); ((void)ec);
return true;
#endif
};
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp
index aecfce7885e9..b84c18c1da06 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp
@@ -50,6 +50,7 @@ TEST_CASE(test_error_reporting)
&& err.code() == ec;
}
#else
+ ((void)f); ((void)ec);
return true;
#endif
};
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp
index c2ae854c0bf6..e265c7af6b10 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp
@@ -50,6 +50,7 @@ TEST_CASE(test_error_reporting)
&& err.code() == ec;
}
#else
+ ((void)f); ((void)t); ((void)ec);
return true;
#endif
};
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp
index 8a6aa09b14c7..f7c2ee14e83a 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp
@@ -52,6 +52,7 @@ TEST_CASE(test_error_reporting)
&& err.code() == ec;
}
#else
+ ((void)f); ((void)s); ((void)ec);
return true;
#endif
};
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp
index 865191520be3..8f241810fc7d 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp
@@ -57,6 +57,7 @@ TEST_CASE(test_error_reporting)
&& err.code() == ec;
}
#else
+ ((void)f); ((void)ec);
return true;
#endif
};
diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
index 215c35a33f30..148564e61961 100644
--- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
+++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
@@ -51,7 +51,6 @@ TEST_CASE(basic_tests)
const path dir_perms = env.create_dir("bad_perms_dir");
const path nested_dir = env.create_dir("bad_perms_dir/nested");
permissions(dir_perms, perms::none);
- const std::error_code set_ec = std::make_error_code(std::errc::address_in_use);
const std::error_code expect_ec = std::make_error_code(std::errc::not_a_directory);
struct TestCase {
std::string name;
@@ -66,7 +65,7 @@ TEST_CASE(basic_tests)
PutEnv(TC.name, TC.p);
}
for (auto& TC : cases) {
- std::error_code ec = set_ec;
+ std::error_code ec = GetTestEC();
path ret = temp_directory_path(ec);
TEST_CHECK(!ec);
TEST_CHECK(ret == TC.p);
@@ -75,21 +74,25 @@ TEST_CASE(basic_tests)
// Set the env variable to a path that does not exist and check
// that it fails.
PutEnv(TC.name, dne);
- ec = set_ec;
+ ec = GetTestEC();
ret = temp_directory_path(ec);
- TEST_CHECK(ec == expect_ec);
+ LIBCPP_ONLY(TEST_CHECK(ec == expect_ec));
+ TEST_CHECK(ec != GetTestEC());
+ TEST_CHECK(ec);
TEST_CHECK(ret == "");
// Set the env variable to point to a file and check that it fails.
PutEnv(TC.name, file);
- ec = set_ec;
+ ec = GetTestEC();
ret = temp_directory_path(ec);
- TEST_CHECK(ec == expect_ec);
+ LIBCPP_ONLY(TEST_CHECK(ec == expect_ec));
+ TEST_CHECK(ec != GetTestEC());
+ TEST_CHECK(ec);
TEST_CHECK(ret == "");
// Set the env variable to point to a dir we can't access
PutEnv(TC.name, nested_dir);
- ec = set_ec;
+ ec = GetTestEC();
ret = temp_directory_path(ec);
TEST_CHECK(ec == std::make_error_code(std::errc::permission_denied));
TEST_CHECK(ret == "");
@@ -99,7 +102,7 @@ TEST_CASE(basic_tests)
}
// No env variables are defined
{
- std::error_code ec = set_ec;
+ std::error_code ec = GetTestEC();
path ret = temp_directory_path(ec);
TEST_CHECK(!ec);
TEST_CHECK(ret == "/tmp");
diff --git a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp
index bc44f1f6cbbf..467e09d5d2b6 100644
--- a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp
@@ -43,7 +43,7 @@ template <typename T> struct MyHash {
};
template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned /*max_count*/) {
std::experimental::boyer_moore_searcher<Iter2,
MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>>
s{b2, e2};
diff --git a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp
index 743ab92156be..b0e5e877dfe1 100644
--- a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp
@@ -58,7 +58,9 @@ void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned ma
MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>,
count_equal>
s{b2, e2};
+ count_equal::count = 0;
assert(result == std::experimental::search(b1, e1, s));
+ assert(count_equal::count <= max_count);
}
template <class Iter1, class Iter2>
@@ -78,7 +80,9 @@ test()
do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
- do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+
+ do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+
int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
const unsigned sb = sizeof(ib)/sizeof(ib[0]);
int ic[] = {1};
@@ -93,6 +97,7 @@ test()
const unsigned sh = sizeof(ih)/sizeof(ih[0]);
int ii[] = {1, 1, 2};
do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3);
+
}
template <class Iter1, class Iter2>
@@ -112,7 +117,9 @@ test2()
do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+
do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+
char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
const unsigned sb = sizeof(ib)/sizeof(ib[0]);
char ic[] = {1};
diff --git a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp
index b27cabd76ab3..c80ef7968628 100644
--- a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp
@@ -54,7 +54,7 @@ void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned ma
typename std::hash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2};
count_equal::count = 0;
assert(result == std::experimental::search(b1, e1, s));
-// assert(count_equal::count <= max_count);
+ assert(count_equal::count <= max_count);
}
template <class Iter1, class Iter2>
@@ -74,7 +74,9 @@ test()
do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa);
do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa);
do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa);
+
do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa);
+
int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4};
const unsigned sb = sizeof(ib)/sizeof(ib[0]);
int ic[] = {1};
diff --git a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp
index 28a3f6d912f8..abfab17d02ce 100644
--- a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp
@@ -42,7 +42,7 @@ template <typename T> struct MyHash {
};
template <typename Iter1, typename Iter2>
-void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) {
+void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned /*max_count*/) {
std::experimental::boyer_moore_horspool_searcher<Iter2,
MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>>
s{b2, e2};
diff --git a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp
index 3a6647dbc7f5..28f3324966ea 100644
--- a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp
@@ -57,7 +57,9 @@ void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned ma
MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>,
count_equal>
s{b2, e2};
+ count_equal::count = 0;
assert(result == std::experimental::search(b1, e1, s));
+ assert(count_equal::count <= max_count);
}
template <class Iter1, class Iter2>
diff --git a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp
index 8c78b9de0b35..4e961ec9e20c 100644
--- a/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp
+++ b/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp
@@ -53,7 +53,7 @@ void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned ma
typename std::hash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2};
count_equal::count = 0;
assert(result == std::experimental::search(b1, e1, s));
-// assert(count_equal::count <= max_count);
+ assert(count_equal::count <= max_count);
}
template <class Iter1, class Iter2>
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
index 50a71eeca82b..acc42d39f60c 100644
--- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
@@ -23,7 +23,12 @@
#include <tuple>
#include <cassert>
#include <cstdlib>
+
+#include "test_macros.h"
+#include "test_memory_resource.hpp"
#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
+#include "test_allocator.h"
namespace ex = std::experimental::pmr;
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
index b6adb558b1e4..05cf82cfbd2b 100644
--- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
@@ -23,7 +23,12 @@
#include <tuple>
#include <cassert>
#include <cstdlib>
+
+#include "test_macros.h"
+#include "test_memory_resource.hpp"
#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
+#include "test_allocator.h"
namespace ex = std::experimental::pmr;
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
index a913742a854b..1a76072661d6 100644
--- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
@@ -23,7 +23,12 @@
#include <tuple>
#include <cassert>
#include <cstdlib>
+
+#include "test_macros.h"
+#include "test_memory_resource.hpp"
#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
+#include "test_allocator.h"
namespace ex = std::experimental::pmr;
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
index d0d76503da50..8f78521995d8 100644
--- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
@@ -24,7 +24,11 @@
#include <tuple>
#include <cassert>
#include <cstdlib>
+
+#include "test_macros.h"
+#include "test_memory_resource.hpp"
#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
#include "test_allocator.h"
namespace ex = std::experimental::pmr;
diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
index 73e4f0e101a8..a02dcf336960 100644
--- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
+++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
@@ -21,7 +21,11 @@
#include <type_traits>
#include <cassert>
#include <cstdlib>
+
+#include "test_macros.h"
+#include "test_memory_resource.hpp"
#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
#include "test_allocator.h"
namespace ex = std::experimental::pmr;
diff --git a/test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp b/test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp
index 26cf903fe0d8..efb529b3c118 100644
--- a/test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp
+++ b/test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp
@@ -73,8 +73,8 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
{
TestResource R2;
- auto& P = R2.getController();
- P.throw_on_alloc = true;
+ auto& P2 = R2.getController();
+ P2.throw_on_alloc = true;
memory_resource& M2 = R2;
try {
M2.allocate(42);
diff --git a/test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp b/test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp
new file mode 100644
index 000000000000..7b2527f22bf4
--- /dev/null
+++ b/test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp
@@ -0,0 +1,15 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// <numeric>
+
+#include <experimental/numeric>
+
+int main () {}
diff --git a/test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp b/test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp
new file mode 100644
index 000000000000..7b2527f22bf4
--- /dev/null
+++ b/test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp
@@ -0,0 +1,15 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// <numeric>
+
+#include <experimental/numeric>
+
+int main () {}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp
new file mode 100644
index 000000000000..8b069832aac8
--- /dev/null
+++ b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type, the program is ill-formed.
+
+#include <experimental/numeric>
+
+
+int main()
+{
+ std::experimental::gcd(2.0, 4);
+}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp
new file mode 100644
index 000000000000..ca9b871ef5e0
--- /dev/null
+++ b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type, the program is ill-formed.
+
+#include <experimental/numeric>
+
+
+int main()
+{
+ std::experimental::gcd(4, 6.0);
+}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
new file mode 100644
index 000000000000..a52b50b391cd
--- /dev/null
+++ b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
@@ -0,0 +1,132 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+#include <experimental/numeric>
+#include <cassert>
+#include <cstdlib> // for rand()
+#include <iostream>
+
+constexpr struct {
+ int x;
+ int y;
+ int expect;
+} Cases[] = {
+ {0, 0, 0},
+ {1, 0, 1},
+ {0, 1, 1},
+ {1, 1, 1},
+ {2, 3, 1},
+ {2, 4, 2},
+ {36, 17, 1},
+ {36, 18, 18}
+};
+
+
+template <typename Input1, typename Input2, typename Output>
+constexpr bool test0(Input1 in1, Input2 in2, Output out)
+{
+ static_assert((std::is_same<Output, decltype(std::experimental::gcd(in1, in2))>::value), "" );
+ static_assert((std::is_same<Output, decltype(std::experimental::gcd(in2, in1))>::value), "" );
+ return out == std::experimental::gcd(in1, in2) ? true : (std::abort(), false);
+}
+
+
+template <typename Input1, typename Input2 = Input1>
+constexpr bool do_test(int = 0)
+{
+ using S1 = typename std::make_signed<Input1>::type;
+ using S2 = typename std::make_signed<Input2>::type;
+ using U1 = typename std::make_unsigned<Input1>::type;
+ using U2 = typename std::make_unsigned<Input2>::type;
+ bool accumulate = true;
+ for (auto TC : Cases) {
+ { // Test with two signed types
+ using Output = std::common_type_t<S1, S2>;
+ accumulate &= test0<S1, S2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(-TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(-TC.x, -TC.y, TC.expect);
+ }
+ { // test with two unsigned types
+ using Output = std::common_type_t<U1, U2>;
+ accumulate &= test0<U1, U2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, U1, Output>(TC.x, TC.y, TC.expect);
+ }
+ { // Test with mixed signs
+ using Output = std::common_type_t<S1, U2>;
+ accumulate &= test0<S1, U2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, S1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, U2, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, S1, Output>(TC.x, -TC.y, TC.expect);
+ }
+ { // Test with mixed signs
+ using Output = std::common_type_t<S2, U1>;
+ accumulate &= test0<S2, U1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U1, S2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, U1, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<U1, S2, Output>(TC.x, -TC.y, TC.expect);
+ }
+ }
+ return accumulate;
+}
+
+int main()
+{
+ auto non_cce = std::rand(); // a value that can't possibly be constexpr
+
+ static_assert(do_test<signed char>(), "");
+ static_assert(do_test<short>(), "");
+ static_assert(do_test<int>(), "");
+ static_assert(do_test<long>(), "");
+ static_assert(do_test<long long>(), "");
+
+ assert(do_test<signed char>(non_cce));
+ assert(do_test<short>(non_cce));
+ assert(do_test<int>(non_cce));
+ assert(do_test<long>(non_cce));
+ assert(do_test<long long>(non_cce));
+
+ static_assert(do_test< int8_t>(), "");
+ static_assert(do_test<int16_t>(), "");
+ static_assert(do_test<int32_t>(), "");
+ static_assert(do_test<int64_t>(), "");
+
+ assert(do_test< int8_t>(non_cce));
+ assert(do_test<int16_t>(non_cce));
+ assert(do_test<int32_t>(non_cce));
+ assert(do_test<int64_t>(non_cce));
+
+ static_assert(do_test<signed char, int>(), "");
+ static_assert(do_test<int, signed char>(), "");
+ static_assert(do_test<short, int>(), "");
+ static_assert(do_test<int, short>(), "");
+ static_assert(do_test<int, long>(), "");
+ static_assert(do_test<long, int>(), "");
+ static_assert(do_test<int, long long>(), "");
+ static_assert(do_test<long long, int>(), "");
+
+ assert((do_test<signed char, int>(non_cce)));
+ assert((do_test<int, signed char>(non_cce)));
+ assert((do_test<short, int>(non_cce)));
+ assert((do_test<int, short>(non_cce)));
+ assert((do_test<int, long>(non_cce)));
+ assert((do_test<long, int>(non_cce)));
+ assert((do_test<int, long long>(non_cce)));
+ assert((do_test<long long, int>(non_cce)));
+}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp
new file mode 100644
index 000000000000..d12b35609b1e
--- /dev/null
+++ b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type, the program is ill-formed.
+
+#include <experimental/numeric>
+
+
+int main()
+{
+ std::experimental::lcm(2.0, 4);
+}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp
new file mode 100644
index 000000000000..d5731870eb19
--- /dev/null
+++ b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type, the program is ill-formed.
+
+#include <experimental/numeric>
+
+
+int main()
+{
+ std::experimental::lcm(4, 6.0);
+}
diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
new file mode 100644
index 000000000000..e3c109f7447b
--- /dev/null
+++ b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
@@ -0,0 +1,131 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+#include <experimental/numeric>
+#include <cassert>
+#include <cstdlib>
+#include <iostream>
+
+constexpr struct {
+ int x;
+ int y;
+ int expect;
+} Cases[] = {
+ {0, 0, 0},
+ {1, 0, 0},
+ {0, 1, 0},
+ {1, 1, 1},
+ {2, 3, 6},
+ {2, 4, 4},
+ {3, 17, 51},
+ {36, 18, 36}
+};
+
+template <typename Input1, typename Input2, typename Output>
+constexpr bool test0(Input1 in1, Input2 in2, Output out)
+{
+ static_assert((std::is_same<Output, decltype(std::experimental::lcm(Input1(0), Input2(0)))>::value), "" );
+ static_assert((std::is_same<Output, decltype(std::experimental::lcm(Input2(0), Input1(0)))>::value), "" );
+ return out == std::experimental::lcm(in1, in2) ? true : (std::abort(), false);
+}
+
+
+template <typename Input1, typename Input2 = Input1>
+constexpr bool do_test(int = 0)
+{
+ using S1 = typename std::make_signed<Input1>::type;
+ using S2 = typename std::make_signed<Input2>::type;
+ using U1 = typename std::make_unsigned<Input1>::type;
+ using U2 = typename std::make_unsigned<Input2>::type;
+ bool accumulate = true;
+ for (auto TC : Cases) {
+ { // Test with two signed types
+ using Output = std::common_type_t<S1, S2>;
+ accumulate &= test0<S1, S2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(-TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(-TC.x, -TC.y, TC.expect);
+ }
+ { // test with two unsigned types
+ using Output = std::common_type_t<U1, U2>;
+ accumulate &= test0<U1, U2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, U1, Output>(TC.x, TC.y, TC.expect);
+ }
+ { // Test with mixed signs
+ using Output = std::common_type_t<S1, U2>;
+ accumulate &= test0<S1, U2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, S1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, U2, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, S1, Output>(TC.x, -TC.y, TC.expect);
+ }
+ { // Test with mixed signs
+ using Output = std::common_type_t<S2, U1>;
+ accumulate &= test0<S2, U1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U1, S2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, U1, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<U1, S2, Output>(TC.x, -TC.y, TC.expect);
+ }
+ }
+ return accumulate;
+}
+
+int main()
+{
+ auto non_cce = std::rand(); // a value that can't possibly be constexpr
+
+ static_assert(do_test<signed char>(), "");
+ static_assert(do_test<short>(), "");
+ static_assert(do_test<int>(), "");
+ static_assert(do_test<long>(), "");
+ static_assert(do_test<long long>(), "");
+
+ assert(do_test<signed char>(non_cce));
+ assert(do_test<short>(non_cce));
+ assert(do_test<int>(non_cce));
+ assert(do_test<long>(non_cce));
+ assert(do_test<long long>(non_cce));
+
+ static_assert(do_test< int8_t>(), "");
+ static_assert(do_test<int16_t>(), "");
+ static_assert(do_test<int32_t>(), "");
+ static_assert(do_test<int64_t>(), "");
+
+ assert(do_test< int8_t>(non_cce));
+ assert(do_test<int16_t>(non_cce));
+ assert(do_test<int32_t>(non_cce));
+ assert(do_test<int64_t>(non_cce));
+
+ static_assert(do_test<signed char, int>(), "");
+ static_assert(do_test<int, signed char>(), "");
+ static_assert(do_test<short, int>(), "");
+ static_assert(do_test<int, short>(), "");
+ static_assert(do_test<int, long>(), "");
+ static_assert(do_test<long, int>(), "");
+ static_assert(do_test<int, long long>(), "");
+ static_assert(do_test<long long, int>(), "");
+
+ assert((do_test<signed char, int>(non_cce)));
+ assert((do_test<int, signed char>(non_cce)));
+ assert((do_test<short, int>(non_cce)));
+ assert((do_test<int, short>(non_cce)));
+ assert((do_test<int, long>(non_cce)));
+ assert((do_test<long, int>(non_cce)));
+ assert((do_test<int, long long>(non_cce)));
+ assert((do_test<long long, int>(non_cce)));
+}
diff --git a/test/std/experimental/optional/optional.nullops/less_equal.pass.cpp b/test/std/experimental/optional/optional.nullops/less_equal.pass.cpp
index cddb27e93a6a..ac7be156c69c 100644
--- a/test/std/experimental/optional/optional.nullops/less_equal.pass.cpp
+++ b/test/std/experimental/optional/optional.nullops/less_equal.pass.cpp
@@ -15,9 +15,11 @@
#include <experimental/optional>
+#include "test_macros.h"
+
int main()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
using std::experimental::optional;
using std::experimental::nullopt_t;
using std::experimental::nullopt;
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp
index 3d0d2e03158b..0215417ce0b2 100644
--- a/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp
@@ -19,6 +19,14 @@
using std::experimental::optional;
+struct AllowConstAssign {
+ AllowConstAssign() {}
+ AllowConstAssign(AllowConstAssign const&) {}
+ AllowConstAssign const& operator=(AllowConstAssign const&) const {
+ return *this;
+ }
+};
+
struct X
{
};
@@ -53,6 +61,11 @@ int main()
assert(*opt == i);
}
{
+ optional<const AllowConstAssign> opt;
+ const AllowConstAssign other;
+ opt = other;
+ }
+ {
optional<std::unique_ptr<int>> opt;
opt = std::unique_ptr<int>(new int(3));
assert(static_cast<bool>(opt) == true);
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp
index 89ea345029c2..17ee9754531f 100644
--- a/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// optional<T>& operator=(const optional<T>& rhs);
@@ -17,8 +16,17 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
+struct AllowConstAssign {
+ AllowConstAssign(AllowConstAssign const&) {}
+ AllowConstAssign const& operator=(AllowConstAssign const&) const {
+ return *this;
+ }
+};
+
struct X
{
static bool throw_now;
@@ -27,7 +35,7 @@ struct X
X(const X&)
{
if (throw_now)
- throw 6;
+ TEST_THROW(6);
}
};
@@ -43,6 +51,11 @@ int main()
assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
}
{
+ optional<const AllowConstAssign> opt;
+ optional<const AllowConstAssign> opt2;
+ opt = opt2;
+ }
+ {
optional<int> opt;
constexpr optional<int> opt2(2);
opt = opt2;
@@ -67,6 +80,7 @@ int main()
assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
assert(*opt == *opt2);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
optional<X> opt;
optional<X> opt2(X{});
@@ -83,4 +97,5 @@ int main()
assert(static_cast<bool>(opt) == false);
}
}
+#endif
}
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp
index 94f2bb21a475..256396094a90 100644
--- a/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// template <class... Args> void optional<T>::emplace(Args&&... args);
@@ -18,6 +17,8 @@
#include <cassert>
#include <memory>
+#include "test_macros.h"
+
using std::experimental::optional;
class X
@@ -48,7 +49,7 @@ class Z
public:
static bool dtor_called;
Z() = default;
- Z(int) {throw 6;}
+ Z(int) {TEST_THROW(6);}
~Z() {dtor_called = true;}
};
@@ -81,6 +82,12 @@ int main()
assert(*opt == 1);
}
{
+ optional<const int> opt(2);
+ opt.emplace(1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == 1);
+ }
+ {
optional<X> opt;
opt.emplace();
assert(static_cast<bool>(opt) == true);
@@ -125,6 +132,7 @@ int main()
assert(Y::dtor_called == true);
}
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
Z z;
optional<Z> opt(z);
@@ -141,4 +149,5 @@ int main()
assert(Z::dtor_called == true);
}
}
+#endif
}
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
index fec37408e43b..8a265808a3c3 100644
--- a/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// template <class U, class... Args>
@@ -19,6 +18,8 @@
#include <cassert>
#include <vector>
+#include "test_macros.h"
+
using std::experimental::optional;
class X
@@ -60,7 +61,7 @@ public:
constexpr Z() : i_(0) {}
constexpr Z(int i) : i_(i) {}
Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
- {throw 6;}
+ {TEST_THROW(6);}
~Z() {dtor_called = true;}
friend constexpr bool operator==(const Z& x, const Z& y)
@@ -81,6 +82,17 @@ int main()
assert(*opt == X({1, 2}));
}
}
+ X::dtor_called = false;
+ {
+ X x;
+ {
+ optional<const X> opt(x);
+ assert(X::dtor_called == false);
+ opt.emplace({1, 2});
+ assert(X::dtor_called == true);
+ assert(*opt == X({1, 2}));
+ }
+ }
{
optional<std::vector<int>> opt;
opt.emplace({1, 2, 3}, std::allocator<int>());
@@ -93,6 +105,7 @@ int main()
assert(static_cast<bool>(opt) == true);
assert(*opt == Y({1, 2}));
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
Z z;
optional<Z> opt(z);
@@ -109,4 +122,5 @@ int main()
assert(Z::dtor_called == true);
}
}
+#endif
}
diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp
index fa00f5602c7f..4e2aca978865 100644
--- a/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// optional<T>& operator=(optional<T>&& rhs)
@@ -19,8 +18,17 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
+struct AllowConstAssign {
+ AllowConstAssign(AllowConstAssign const&) {}
+ AllowConstAssign const& operator=(AllowConstAssign const&) const {
+ return *this;
+ }
+};
+
struct X
{
static bool throw_now;
@@ -29,7 +37,7 @@ struct X
X(X&&)
{
if (throw_now)
- throw 6;
+ TEST_THROW(6);
}
X& operator=(X&&) noexcept
{
@@ -37,10 +45,10 @@ struct X
}
};
-struct Y {};
-
bool X::throw_now = false;
+struct Y {};
+
int main()
{
{
@@ -77,6 +85,12 @@ int main()
assert(*opt == *opt2);
}
{
+ optional<const AllowConstAssign> opt;
+ optional<const AllowConstAssign> opt2;
+ opt = std::move(opt2);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
static_assert(!std::is_nothrow_move_assignable<optional<X>>::value, "");
optional<X> opt;
optional<X> opt2(X{});
@@ -93,6 +107,7 @@ int main()
assert(static_cast<bool>(opt) == false);
}
}
+#endif
{
static_assert(std::is_nothrow_move_assignable<optional<Y>>::value, "");
}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp
index 9b6511a0006d..6371dcb4e51c 100644
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
@@ -18,6 +17,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
class X
@@ -42,7 +43,7 @@ class Z
{
public:
Z(int) {}
- Z(const Z&) {throw 6;}
+ Z(const Z&) {TEST_THROW(6);}
};
@@ -97,6 +98,7 @@ int main()
};
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
typedef Z T;
try
@@ -110,4 +112,5 @@ int main()
assert(i == 6);
}
}
+#endif
}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp
index 144af2e3a7dc..4b66fe80bbb2 100644
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// optional(const optional<T>& rhs);
@@ -17,6 +16,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
template <class T>
@@ -24,7 +25,12 @@ void
test(const optional<T>& rhs, bool is_going_to_throw = false)
{
bool rhs_engaged = static_cast<bool>(rhs);
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (is_going_to_throw)
+ return;
+#else
try
+#endif
{
optional<T> lhs = rhs;
assert(is_going_to_throw == false);
@@ -32,10 +38,13 @@ test(const optional<T>& rhs, bool is_going_to_throw = false)
if (rhs_engaged)
assert(*lhs == *rhs);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (int i)
{
assert(i == 6);
+ assert(is_going_to_throw);
}
+#endif
}
class X
@@ -68,7 +77,7 @@ public:
Z(const Z&)
{
if (++count == 2)
- throw 6;
+ TEST_THROW(6);
}
friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
@@ -88,6 +97,11 @@ int main()
test(rhs);
}
{
+ typedef const int T;
+ optional<T> rhs(3);
+ test(rhs);
+ }
+ {
typedef X T;
optional<T> rhs;
test(rhs);
@@ -98,6 +112,11 @@ int main()
test(rhs);
}
{
+ typedef const X T;
+ optional<T> rhs(X(3));
+ test(rhs);
+ }
+ {
typedef Y T;
optional<T> rhs;
test(rhs);
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp
index dc1666b10362..c46407896576 100644
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
@@ -19,6 +18,7 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
using std::experimental::optional;
using std::experimental::in_place_t;
@@ -55,7 +55,7 @@ public:
class Z
{
public:
- Z(int i) {throw 6;}
+ Z(int) {TEST_THROW(6);}
};
@@ -128,6 +128,7 @@ int main()
};
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
try
{
@@ -139,4 +140,5 @@ int main()
assert(i == 6);
}
}
+#endif
}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
index 9bd6b18989fc..b75c147df513 100644
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// template <class U, class... Args>
@@ -20,6 +19,8 @@
#include <vector>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
using std::experimental::in_place_t;
using std::experimental::in_place;
@@ -60,7 +61,7 @@ public:
constexpr Z() : i_(0) {}
constexpr Z(int i) : i_(i) {}
Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
- {throw 6;}
+ {TEST_THROW(6);}
friend constexpr bool operator==(const Z& x, const Z& y)
{return x.i_ == y.i_ && x.j_ == y.j_;}
@@ -100,6 +101,7 @@ int main()
constexpr test_constexpr_ctor dopt(in_place, {42, 101, -1});
static_assert(*dopt == Y{42, 101, -1}, "");
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
static_assert(std::is_constructible<optional<Z>, std::initializer_list<int>&>::value, "");
try
@@ -112,4 +114,5 @@ int main()
assert(i == 6);
}
}
+#endif
}
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp
index 851157f960f9..a8bb6e9c275c 100644
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// optional(optional<T>&& rhs) noexcept(is_nothrow_move_constructible<T>::value);
@@ -17,6 +16,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
template <class T>
@@ -26,16 +27,24 @@ test(optional<T>& rhs, bool is_going_to_throw = false)
static_assert(std::is_nothrow_move_constructible<optional<T>>::value ==
std::is_nothrow_move_constructible<T>::value, "");
bool rhs_engaged = static_cast<bool>(rhs);
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (is_going_to_throw)
+ return;
+#else
try
+#endif
{
optional<T> lhs = std::move(rhs);
assert(is_going_to_throw == false);
assert(static_cast<bool>(lhs) == rhs_engaged);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (int i)
{
assert(i == 6);
+ assert(is_going_to_throw);
}
+#endif
}
class X
@@ -68,12 +77,23 @@ public:
Z(Z&&)
{
if (++count == 2)
- throw 6;
+ TEST_THROW(6);
}
friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
};
+
+class ConstMovable
+{
+ int i_;
+public:
+ ConstMovable(int i) : i_(i) {}
+ ConstMovable(const ConstMovable&& x) : i_(x.i_) {}
+ ~ConstMovable() {i_ = 0;}
+ friend bool operator==(const ConstMovable& x, const ConstMovable& y) {return x.i_ == y.i_;}
+};
+
int main()
{
{
@@ -87,6 +107,11 @@ int main()
test(rhs);
}
{
+ typedef const int T;
+ optional<T> rhs(3);
+ test(rhs);
+ }
+ {
typedef X T;
optional<T> rhs;
test(rhs);
@@ -97,6 +122,11 @@ int main()
test(rhs);
}
{
+ typedef const ConstMovable T;
+ optional<T> rhs(ConstMovable(3));
+ test(rhs);
+ }
+ {
typedef Y T;
optional<T> rhs;
test(rhs);
diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
index ef21fcdf9e6d..1941546a53f7 100644
--- a/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
@@ -18,6 +17,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
class X
@@ -44,7 +45,7 @@ class Z
{
public:
Z(int) {}
- Z(Z&&) {throw 6;}
+ Z(Z&&) {TEST_THROW(6);}
};
@@ -92,6 +93,7 @@ int main()
constexpr test_constexpr_ctor(T&&) {}
};
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
typedef Z T;
try
@@ -104,4 +106,5 @@ int main()
assert(i == 6);
}
}
+#endif
}
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
index cf900d7029e1..46586c65a6e0 100644
--- a/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
@@ -51,6 +51,9 @@ int main()
{
constexpr optional<Z> opt(Z{});
assert(opt->test() == 1);
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+ static_assert(opt->test() == 1, "");
+#endif
}
#ifdef _LIBCPP_DEBUG
{
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp
index b998f3067f4f..c8f07111c23d 100644
--- a/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// T& optional<T>::value();
@@ -17,6 +16,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
using std::experimental::bad_optional_access;
@@ -35,6 +36,7 @@ int main()
opt.emplace();
assert(opt.value().test() == 4);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
optional<X> opt;
try
@@ -46,4 +48,5 @@ int main()
{
}
}
+#endif
}
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp
index a38b1f930c72..98ff16e4d13b 100644
--- a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// constexpr const T& optional<T>::value() const;
@@ -17,6 +16,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
using std::experimental::in_place_t;
using std::experimental::in_place;
@@ -40,6 +41,7 @@ int main()
const optional<X> opt(in_place);
assert(opt.value().test() == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
const optional<X> opt;
try
@@ -51,4 +53,5 @@ int main()
{
}
}
+#endif
}
diff --git a/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp
index 620dda19e3ff..f2d373c299bf 100644
--- a/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// void swap(optional&)
@@ -19,6 +18,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
class X
@@ -56,11 +57,15 @@ class Z
int i_;
public:
Z(int i) : i_(i) {}
- Z(Z&&) {throw 7;}
+ Z(Z&&) {TEST_THROW(7);}
friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
- friend void swap(Z& x, Z& y) {throw 6;}
+ friend void swap(Z&, Z&) {TEST_THROW(6);}
+};
+
+struct ConstSwappable {
};
+void swap(ConstSwappable const&, ConstSwappable const&) {}
int main()
{
@@ -113,6 +118,11 @@ int main()
assert(*opt2 == 1);
}
{
+ optional<const ConstSwappable> opt;
+ optional<const ConstSwappable> opt2;
+ opt.swap(opt2);
+ }
+ {
optional<X> opt1;
optional<X> opt2;
static_assert(noexcept(opt1.swap(opt2)) == true, "");
@@ -222,6 +232,7 @@ int main()
assert(static_cast<bool>(opt2) == true);
assert(*opt2 == 1);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
optional<Z> opt1;
optional<Z> opt2;
@@ -298,4 +309,5 @@ int main()
assert(static_cast<bool>(opt2) == true);
assert(*opt2 == 2);
}
+#endif
}
diff --git a/test/std/experimental/optional/optional.specalg/swap.pass.cpp b/test/std/experimental/optional/optional.specalg/swap.pass.cpp
index d339c53c1f77..4d643cb44b67 100644
--- a/test/std/experimental/optional/optional.specalg/swap.pass.cpp
+++ b/test/std/experimental/optional/optional.specalg/swap.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: libcpp-no-exceptions
// <optional>
// template <class T> void swap(optional<T>& x, optional<T>& y)
@@ -18,6 +17,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
using std::experimental::optional;
class X
@@ -55,10 +56,10 @@ class Z
int i_;
public:
Z(int i) : i_(i) {}
- Z(Z&&) {throw 7;}
+ Z(Z&&) {TEST_THROW(7);}
friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
- friend void swap(Z& x, Z& y) {throw 6;}
+ friend void swap(Z&, Z&) {TEST_THROW(6);}
};
int main()
@@ -231,6 +232,7 @@ int main()
assert(static_cast<bool>(opt1) == false);
assert(static_cast<bool>(opt2) == false);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
optional<Z> opt1;
opt1.emplace(1);
@@ -297,4 +299,5 @@ int main()
assert(static_cast<bool>(opt2) == true);
assert(*opt2 == 2);
}
+#endif // TEST_HAS_NO_EXCEPTIONS
}
diff --git a/test/std/experimental/string.view/string.view.access/data.pass.cpp b/test/std/experimental/string.view/string.view.access/data.pass.cpp
index 53e95ddaea31..4b581d653eac 100644
--- a/test/std/experimental/string.view/string.view.access/data.pass.cpp
+++ b/test/std/experimental/string.view/string.view.access/data.pass.cpp
@@ -39,7 +39,7 @@ int main () {
test ( U"a", 1 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char *s = "ABC";
constexpr std::experimental::basic_string_view<char> sv( s, 2 );
diff --git a/test/std/experimental/string.view/string.view.access/index.pass.cpp b/test/std/experimental/string.view/string.view.access/index.pass.cpp
index 2c1bd1dc91cb..0cb385eeff58 100644
--- a/test/std/experimental/string.view/string.view.access/index.pass.cpp
+++ b/test/std/experimental/string.view/string.view.access/index.pass.cpp
@@ -42,7 +42,7 @@ int main () {
test ( U"a", 1 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 );
static_assert ( sv.length() == 2, "" );
diff --git a/test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp b/test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp
index 9f5d86f2f82b..a5108bf12660 100644
--- a/test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp
+++ b/test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp
@@ -23,7 +23,7 @@
template<typename SV>
void test1 () {
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr SV sv1;
static_assert ( sv1.size() == 0, "" );
diff --git a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp
index 0df37a6ffd9f..bd566a986276 100644
--- a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp
@@ -17,6 +17,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -49,7 +50,7 @@ int main()
test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp
index 5971f6974380..51decdca67cd 100644
--- a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp
@@ -16,6 +16,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -48,7 +49,7 @@ int main()
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp
index f5bcb7e97b73..cf8a30a3942c 100644
--- a/test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp
@@ -17,6 +17,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -49,7 +50,7 @@ int main()
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp
index e13a4ea119d1..1bacf285f4eb 100644
--- a/test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp
@@ -16,6 +16,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -48,7 +49,7 @@ int main()
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp
index 63002a5c415c..0aae3d41a825 100644
--- a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp
@@ -17,6 +17,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -49,7 +50,7 @@ int main()
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp
index 3047cc7be118..e014872a613c 100644
--- a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp
@@ -16,6 +16,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -48,7 +49,7 @@ int main()
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp
index c542efea99a7..bdc4c966fd06 100644
--- a/test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp
@@ -17,6 +17,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -49,7 +50,7 @@ int main()
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp
index 17219a42602c..e814283ad5b6 100644
--- a/test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp
@@ -16,6 +16,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -48,7 +49,7 @@ int main()
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp
index 2c0461481e78..10e82437cd6d 100644
--- a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp
@@ -17,6 +17,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -49,7 +50,7 @@ int main()
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp
index df9e90893f7c..77d8fa3e5b27 100644
--- a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp
@@ -16,6 +16,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -48,7 +49,7 @@ int main()
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp
index 1deee9ac7fc6..9c13199d24a7 100644
--- a/test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp
@@ -17,6 +17,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -49,7 +50,7 @@ int main()
test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp
index c99489eb3070..c74b327f14bb 100644
--- a/test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp
+++ b/test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp
@@ -16,6 +16,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -48,7 +49,7 @@ int main()
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.cons/default.pass.cpp b/test/std/experimental/string.view/string.view.cons/default.pass.cpp
index e817bfffb89d..37df020e7ea4 100644
--- a/test/std/experimental/string.view/string.view.cons/default.pass.cpp
+++ b/test/std/experimental/string.view/string.view.cons/default.pass.cpp
@@ -15,9 +15,11 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
+
template<typename T>
void test () {
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T sv1;
static_assert ( sv1.size() == 0, "" );
diff --git a/test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp b/test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp
index 9de3a3039523..a8638389e168 100644
--- a/test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp
+++ b/test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp
@@ -18,6 +18,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template<typename CharT>
@@ -55,7 +56,7 @@ int main () {
test ( U"" );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::experimental::basic_string_view<char, constexpr_char_traits<char>> sv1 ( "ABCDE" );
static_assert ( sv1.size() == 5, "");
diff --git a/test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp b/test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp
index 663d25e954f9..c2f312daa863 100644
--- a/test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp
+++ b/test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp
@@ -34,7 +34,7 @@ int main () {
test ( "QBCDE", 5 );
test ( "QBCDE", 2 );
test ( "", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char *s = "QBCDE";
constexpr std::experimental::basic_string_view<char> sv1 ( s, 2 );
@@ -46,7 +46,7 @@ int main () {
test ( L"QBCDE", 5 );
test ( L"QBCDE", 2 );
test ( L"", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const wchar_t *s = L"QBCDE";
constexpr std::experimental::basic_string_view<wchar_t> sv1 ( s, 2 );
@@ -59,7 +59,7 @@ int main () {
test ( u"QBCDE", 5 );
test ( u"QBCDE", 2 );
test ( u"", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char16_t *s = u"QBCDE";
constexpr std::experimental::basic_string_view<char16_t> sv1 ( s, 2 );
@@ -71,7 +71,7 @@ int main () {
test ( U"QBCDE", 5 );
test ( U"QBCDE", 2 );
test ( U"", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char32_t *s = U"QBCDE";
constexpr std::experimental::basic_string_view<char32_t> sv1 ( s, 2 );
diff --git a/test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp
index 6e6a1f55710a..fdaf8aa066f5 100644
--- a/test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -66,7 +67,7 @@ int main()
test(S("abcdeabcdeabcdeabcde"), 'c', 2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
index 73580aed89ad..859980af2956 100644
--- a/test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -68,7 +69,7 @@ int main()
test(S("laenfsbridchgotmkqpj"), 'q', 0);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
index de93288cc010..1f7ce3ef54d1 100644
--- a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -149,7 +150,7 @@ int main()
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
index cfb0029fa180..28255dd457f7 100644
--- a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -376,7 +377,7 @@ int main()
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp
index dde2f2c9f378..ffafcfc04481 100644
--- a/test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -66,7 +67,7 @@ int main()
test(S("laenfsbridchgotmkqpj"), 'e', 2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
index e49e82ccab11..7b37fe057213 100644
--- a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -149,7 +150,7 @@ int main()
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
index 1dc8d85472c7..1f7ea383a589 100644
--- a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -376,7 +377,7 @@ int main()
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
index ed1a35e91845..307be23708b3 100644
--- a/test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -66,7 +67,7 @@ int main()
test(S("laenfsbridchgotmkqpj"), 'i', 19);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
index e07c4f361da3..b0d3f0636b21 100644
--- a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -149,7 +150,7 @@ int main()
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
index 3ddf03365060..8a591ccbe44a 100644
--- a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -376,7 +377,7 @@ int main()
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp
index d28e0079561f..b949eec1b3c3 100644
--- a/test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -66,7 +67,7 @@ int main()
test(S("laenfsbridchgotmkqpj"), 'm', 15);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
index f01e277f5ada..3755b2653d19 100644
--- a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -149,7 +150,7 @@ int main()
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
index a38ffa692f48..64b29ec7da6f 100644
--- a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -376,7 +377,7 @@ int main()
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp
index 5ebe414be096..bdccb2f22645 100644
--- a/test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -155,7 +156,7 @@ int main()
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp
index 382cbaf07934..856dc4a3a072 100644
--- a/test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -376,7 +377,7 @@ int main()
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp
index 84132ac7a161..f25efdd02072 100644
--- a/test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -148,7 +149,7 @@ int main()
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp
index 9014d888d4ef..f07071101c77 100644
--- a/test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp
@@ -13,6 +13,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -65,7 +66,7 @@ int main()
test(S("abcdeabcdeabcdeabcde"), 'b', 16);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp
index 0559d3121db9..7a8795be0816 100644
--- a/test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp
@@ -13,6 +13,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -155,7 +156,7 @@ int main()
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
index 9116e3aa95a8..2755d2c567b6 100644
--- a/test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
@@ -13,6 +13,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -375,7 +376,7 @@ int main()
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp
index 88457c662016..e77d668d79ba 100644
--- a/test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp
+++ b/test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
@@ -148,7 +149,7 @@ int main()
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.iterators/begin.pass.cpp b/test/std/experimental/string.view/string.view.iterators/begin.pass.cpp
index 8040b81d4efe..5f28f63f8275 100644
--- a/test/std/experimental/string.view/string.view.iterators/begin.pass.cpp
+++ b/test/std/experimental/string.view/string.view.iterators/begin.pass.cpp
@@ -58,7 +58,7 @@ int main()
test(u32string_view{U"123"});
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr string_view sv { "123", 3 };
constexpr u16string_view u16sv {u"123", 3 };
diff --git a/test/std/experimental/string.view/string.view.iterators/end.pass.cpp b/test/std/experimental/string.view/string.view.iterators/end.pass.cpp
index 3a1091e9983c..1f22b3fbe4ba 100644
--- a/test/std/experimental/string.view/string.view.iterators/end.pass.cpp
+++ b/test/std/experimental/string.view/string.view.iterators/end.pass.cpp
@@ -12,6 +12,7 @@
// constexpr const_iterator end() const;
#include <experimental/string_view>
+#include <cstddef>
#include <cassert>
#include "test_macros.h"
@@ -38,9 +39,9 @@ test(S s)
assert(ce2 != s.begin());
}
- assert( e - s.begin() == s.size());
- assert(ce1 - cs.begin() == cs.size());
- assert(ce2 - s.cbegin() == s.size());
+ assert( e - s.begin() == static_cast<std::ptrdiff_t>(s.size()));
+ assert(ce1 - cs.begin() == static_cast<std::ptrdiff_t>(cs.size()));
+ assert(ce2 - s.cbegin() == static_cast<std::ptrdiff_t>(s.size()));
assert( e == ce1);
assert( e == ce2);
@@ -66,7 +67,7 @@ int main()
test(u32string_view{U"123"});
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr string_view sv { "123", 3 };
constexpr u16string_view u16sv {u"123", 3 };
diff --git a/test/std/experimental/string.view/string.view.iterators/rend.pass.cpp b/test/std/experimental/string.view/string.view.iterators/rend.pass.cpp
index 55e28a266948..bd24c327e090 100644
--- a/test/std/experimental/string.view/string.view.iterators/rend.pass.cpp
+++ b/test/std/experimental/string.view/string.view.iterators/rend.pass.cpp
@@ -12,6 +12,7 @@
// constexpr const_iterator rend() const;
#include <experimental/string_view>
+#include <cstddef>
#include <cassert>
#include "test_macros.h"
@@ -38,9 +39,9 @@ test(S s)
assert(ce2 != s.rbegin());
}
- assert( e - s.rbegin() == s.size());
- assert(ce1 - cs.rbegin() == cs.size());
- assert(ce2 - s.crbegin() == s.size());
+ assert( e - s.rbegin() == static_cast<std::ptrdiff_t>(s.size()));
+ assert(ce1 - cs.rbegin() == static_cast<std::ptrdiff_t>(cs.size()));
+ assert(ce2 - s.crbegin() == static_cast<std::ptrdiff_t>(s.size()));
assert( e == ce1);
assert( e == ce2);
diff --git a/test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp
index 9a4891c8f259..00b0661d85f5 100644
--- a/test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp
+++ b/test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp
@@ -32,7 +32,7 @@ void test ( const CharT *s, size_t len ) {
}
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n ) {
typedef std::experimental::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
@@ -60,7 +60,7 @@ int main () {
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert ( test_ce (5) == 0, "" );
#endif
diff --git a/test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp
index 4a31486afaa0..03484a0b5ebb 100644
--- a/test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp
+++ b/test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp
@@ -39,7 +39,7 @@ void test ( const CharT *s, size_t len ) {
}
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n, size_t k ) {
typedef std::experimental::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
@@ -67,7 +67,7 @@ int main () {
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static_assert ( test_ce ( 5, 0 ) == 5, "" );
static_assert ( test_ce ( 5, 1 ) == 4, "" );
diff --git a/test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp
index 9ddc6de84bf3..6b632d0efad8 100644
--- a/test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp
+++ b/test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp
@@ -39,7 +39,7 @@ void test ( const CharT *s, size_t len ) {
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n, size_t k ) {
typedef std::experimental::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
@@ -67,7 +67,7 @@ int main () {
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static_assert ( test_ce ( 5, 0 ) == 5, "" );
static_assert ( test_ce ( 5, 1 ) == 4, "" );
diff --git a/test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp
index d747def8549e..2912fd8b9150 100644
--- a/test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp
+++ b/test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp
@@ -36,7 +36,7 @@ void test ( const CharT *s, size_t len ) {
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n, size_t k ) {
typedef std::experimental::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
@@ -66,7 +66,7 @@ int main () {
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static_assert ( test_ce (2, 3) == 3, "" );
static_assert ( test_ce (5, 3) == 3, "" );
diff --git a/test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp b/test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp
index 6ba03212d42b..202e9ced451f 100644
--- a/test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp
+++ b/test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp
@@ -16,7 +16,9 @@
#include <experimental/string_view>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
+#include "test_macros.h"
+
+#if TEST_STD_VER > 11
// quoted is C++14 only
bool is_skipws ( const std::istream *is ) {
diff --git a/test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp
index 583395451fd4..93014ea119f9 100644
--- a/test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp
+++ b/test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
@@ -112,7 +113,7 @@ int main()
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
diff --git a/test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp
index 4364ab063543..ff01daaf1ce4 100644
--- a/test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp
+++ b/test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp
@@ -14,6 +14,7 @@
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
@@ -106,7 +107,7 @@ int main () {
test(U"abcdefghijklmnopqrst", U"abcdefghijklmnopqrst", 0);
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1 { "abcde", 5 };
diff --git a/test/std/experimental/string.view/string.view.ops/substr.pass.cpp b/test/std/experimental/string.view/string.view.ops/substr.pass.cpp
index a651010d4b27..a3a1dbf418b8 100644
--- a/test/std/experimental/string.view/string.view.ops/substr.pass.cpp
+++ b/test/std/experimental/string.view/string.view.ops/substr.pass.cpp
@@ -27,6 +27,7 @@ void test1 ( std::experimental::basic_string_view<CharT> sv, size_t n, size_t po
try {
std::experimental::basic_string_view<CharT> sv1 = sv.substr(pos, n);
assert(false);
+ ((void)sv1);
} catch (const std::out_of_range&) {
return;
} catch (...) {
diff --git a/test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp b/test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
new file mode 100644
index 000000000000..ffce81459478
--- /dev/null
+++ b/test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+// <experimental/type_traits>
+
+#include <experimental/type_traits>
+#include <string>
+
+#include "test_macros.h"
+
+namespace ex = std::experimental;
+
+template <typename T>
+ using hasFoo = typename T::Foo;
+
+struct yesFoo {
+ using Foo = int;
+};
+
+struct noFoo {
+};
+
+
+template <typename T, typename Res>
+void test() {
+ static_assert( std::is_same<Res, typename ex::detected_or <double, hasFoo, T>::type>::value, "" );
+ static_assert( std::is_same<Res, typename ex::detected_or_t<double, hasFoo, T> >::value, "" );
+}
+
+int main () {
+ test<yesFoo, int>();
+ test<noFoo, double>();
+}
diff --git a/test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp b/test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
new file mode 100644
index 000000000000..136fb068be3c
--- /dev/null
+++ b/test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+// <experimental/type_traits>
+
+#include <experimental/type_traits>
+#include <string>
+
+#include "test_macros.h"
+
+namespace ex = std::experimental;
+
+template <typename T>
+ using callFoo = decltype(std::declval<T&>().Foo());
+
+struct yesFoo {
+ int Foo() { return 0; }
+};
+
+struct noFoo {
+};
+
+struct wrongFoo {
+ std::string Foo() { return ""; }
+};
+
+struct convertibleFoo {
+ long Foo() { return 0; }
+};
+
+
+template <typename T, typename Res>
+void test() {
+ static_assert( std::is_same<Res, typename ex::detected_t<callFoo, T>>::value, "" );
+}
+
+int main () {
+ test<yesFoo, int>();
+ test<noFoo, ex::nonesuch>(); // lookup failure returns nonesuch
+ test<wrongFoo, std::string>();
+}
diff --git a/test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp b/test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
new file mode 100644
index 000000000000..d8528a25161e
--- /dev/null
+++ b/test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+// <experimental/type_traits>
+
+#include <experimental/type_traits>
+#include <string>
+
+#include "test_macros.h"
+
+namespace ex = std::experimental;
+
+template <typename T>
+ using copy_assign_t = decltype(std::declval<T&>() = std::declval<T const &>());
+
+struct not_assignable {
+ not_assignable & operator=(const not_assignable&) = delete;
+};
+
+template <typename T, bool b>
+void test() {
+ static_assert( b == ex::is_detected <copy_assign_t, T>::value, "" );
+ static_assert( b == ex::is_detected_v<copy_assign_t, T>, "" );
+}
+
+int main () {
+ test<int, true>();
+ test<std::string, true>();
+ test<not_assignable, false>();
+}
diff --git a/test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp b/test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
new file mode 100644
index 000000000000..8d1e0ae825d5
--- /dev/null
+++ b/test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+// <experimental/type_traits>
+
+#include <experimental/type_traits>
+#include <string>
+
+#include "test_macros.h"
+
+namespace ex = std::experimental;
+
+template <typename T>
+ using callFoo = decltype(std::declval<T&>().Foo());
+
+struct yesFoo {
+ int Foo() { return 0; }
+};
+
+struct noFoo {
+};
+
+struct wrongFoo {
+ std::string Foo() { return ""; }
+};
+
+struct convertibleFoo {
+ long Foo() { return 0; }
+};
+
+
+template <typename T, bool b>
+void test() {
+ static_assert( b == ex::is_detected_convertible <int, callFoo, T>::value, "" );
+ static_assert( b == ex::is_detected_convertible_v<int, callFoo, T>, "" );
+}
+
+int main () {
+ test<yesFoo, true>();
+ test<noFoo, false>();
+ test<wrongFoo, false>();
+ test<convertibleFoo, true>();
+}
diff --git a/test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp b/test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
new file mode 100644
index 000000000000..e9e5d8ce0056
--- /dev/null
+++ b/test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+// <experimental/type_traits>
+
+#include <experimental/type_traits>
+#include <string>
+
+#include "test_macros.h"
+
+namespace ex = std::experimental;
+
+template <typename T>
+ using callFoo = decltype(std::declval<T&>().Foo());
+
+struct yesFoo {
+ int Foo() { return 0; }
+};
+
+struct noFoo {
+};
+
+struct wrongFoo {
+ std::string Foo() { return ""; }
+};
+
+struct convertibleFoo {
+ long Foo() { return 0; }
+};
+
+template <typename T, bool b>
+void test() {
+ static_assert( b == ex::is_detected_exact <int, callFoo, T>::value, "" );
+ static_assert( b == ex::is_detected_exact_v<int, callFoo, T>, "" );
+}
+
+int main () {
+ test<yesFoo, true>();
+ test<noFoo, false>();
+ test<wrongFoo, false>();
+ test<convertibleFoo, false>();
+}
diff --git a/test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp b/test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp
new file mode 100644
index 000000000000..cb8db1febd27
--- /dev/null
+++ b/test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+// <experimental/type_traits>
+
+// template<class... B> struct conjunction; // C++17
+// template<class... B>
+// constexpr bool conjunction_v = conjunction<B...>::value; // C++17
+
+#include <experimental/type_traits>
+#include <cassert>
+
+namespace ex = std::experimental;
+
+struct True { static constexpr bool value = true; };
+struct False { static constexpr bool value = false; };
+
+int main()
+{
+ static_assert ( ex::conjunction<>::value, "" );
+ static_assert ( ex::conjunction<std::true_type >::value, "" );
+ static_assert (!ex::conjunction<std::false_type>::value, "" );
+
+ static_assert ( ex::conjunction_v<>, "" );
+ static_assert ( ex::conjunction_v<std::true_type >, "" );
+ static_assert (!ex::conjunction_v<std::false_type>, "" );
+
+ static_assert ( ex::conjunction<std::true_type, std::true_type >::value, "" );
+ static_assert (!ex::conjunction<std::true_type, std::false_type>::value, "" );
+ static_assert (!ex::conjunction<std::false_type, std::true_type >::value, "" );
+ static_assert (!ex::conjunction<std::false_type, std::false_type>::value, "" );
+
+ static_assert ( ex::conjunction_v<std::true_type, std::true_type >, "" );
+ static_assert (!ex::conjunction_v<std::true_type, std::false_type>, "" );
+ static_assert (!ex::conjunction_v<std::false_type, std::true_type >, "" );
+ static_assert (!ex::conjunction_v<std::false_type, std::false_type>, "" );
+
+ static_assert ( ex::conjunction<std::true_type, std::true_type, std::true_type >::value, "" );
+ static_assert (!ex::conjunction<std::true_type, std::false_type, std::true_type >::value, "" );
+ static_assert (!ex::conjunction<std::false_type, std::true_type, std::true_type >::value, "" );
+ static_assert (!ex::conjunction<std::false_type, std::false_type, std::true_type >::value, "" );
+ static_assert (!ex::conjunction<std::true_type, std::true_type, std::false_type>::value, "" );
+ static_assert (!ex::conjunction<std::true_type, std::false_type, std::false_type>::value, "" );
+ static_assert (!ex::conjunction<std::false_type, std::true_type, std::false_type>::value, "" );
+ static_assert (!ex::conjunction<std::false_type, std::false_type, std::false_type>::value, "" );
+
+ static_assert ( ex::conjunction_v<std::true_type, std::true_type, std::true_type >, "" );
+ static_assert (!ex::conjunction_v<std::true_type, std::false_type, std::true_type >, "" );
+ static_assert (!ex::conjunction_v<std::false_type, std::true_type, std::true_type >, "" );
+ static_assert (!ex::conjunction_v<std::false_type, std::false_type, std::true_type >, "" );
+ static_assert (!ex::conjunction_v<std::true_type, std::true_type, std::false_type>, "" );
+ static_assert (!ex::conjunction_v<std::true_type, std::false_type, std::false_type>, "" );
+ static_assert (!ex::conjunction_v<std::false_type, std::true_type, std::false_type>, "" );
+ static_assert (!ex::conjunction_v<std::false_type, std::false_type, std::false_type>, "" );
+
+ static_assert ( ex::conjunction<True >::value, "" );
+ static_assert (!ex::conjunction<False>::value, "" );
+
+ static_assert ( ex::conjunction_v<True >, "" );
+ static_assert (!ex::conjunction_v<False>, "" );
+}
diff --git a/test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp b/test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp
new file mode 100644
index 000000000000..dcdbf09fb099
--- /dev/null
+++ b/test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+// <experimental/type_traits>
+
+// template<class... B> struct disjunction;
+// template<class... B>
+// constexpr bool disjunction_v = disjunction<B...>::value;
+
+#include <experimental/type_traits>
+#include <cassert>
+
+namespace ex = std::experimental;
+
+struct True { static constexpr bool value = true; };
+struct False { static constexpr bool value = false; };
+
+int main()
+{
+ static_assert (!ex::disjunction<>::value, "" );
+ static_assert ( ex::disjunction<std::true_type >::value, "" );
+ static_assert (!ex::disjunction<std::false_type>::value, "" );
+
+ static_assert (!ex::disjunction_v<>, "" );
+ static_assert ( ex::disjunction_v<std::true_type >, "" );
+ static_assert (!ex::disjunction_v<std::false_type>, "" );
+
+ static_assert ( ex::disjunction<std::true_type, std::true_type >::value, "" );
+ static_assert ( ex::disjunction<std::true_type, std::false_type>::value, "" );
+ static_assert ( ex::disjunction<std::false_type, std::true_type >::value, "" );
+ static_assert (!ex::disjunction<std::false_type, std::false_type>::value, "" );
+
+ static_assert ( ex::disjunction_v<std::true_type, std::true_type >, "" );
+ static_assert ( ex::disjunction_v<std::true_type, std::false_type>, "" );
+ static_assert ( ex::disjunction_v<std::false_type, std::true_type >, "" );
+ static_assert (!ex::disjunction_v<std::false_type, std::false_type>, "" );
+
+ static_assert ( ex::disjunction<std::true_type, std::true_type, std::true_type >::value, "" );
+ static_assert ( ex::disjunction<std::true_type, std::false_type, std::true_type >::value, "" );
+ static_assert ( ex::disjunction<std::false_type, std::true_type, std::true_type >::value, "" );
+ static_assert ( ex::disjunction<std::false_type, std::false_type, std::true_type >::value, "" );
+ static_assert ( ex::disjunction<std::true_type, std::true_type, std::false_type>::value, "" );
+ static_assert ( ex::disjunction<std::true_type, std::false_type, std::false_type>::value, "" );
+ static_assert ( ex::disjunction<std::false_type, std::true_type, std::false_type>::value, "" );
+ static_assert (!ex::disjunction<std::false_type, std::false_type, std::false_type>::value, "" );
+
+ static_assert ( ex::disjunction_v<std::true_type, std::true_type, std::true_type >, "" );
+ static_assert ( ex::disjunction_v<std::true_type, std::false_type, std::true_type >, "" );
+ static_assert ( ex::disjunction_v<std::false_type, std::true_type, std::true_type >, "" );
+ static_assert ( ex::disjunction_v<std::false_type, std::false_type, std::true_type >, "" );
+ static_assert ( ex::disjunction_v<std::true_type, std::true_type, std::false_type>, "" );
+ static_assert ( ex::disjunction_v<std::true_type, std::false_type, std::false_type>, "" );
+ static_assert ( ex::disjunction_v<std::false_type, std::true_type, std::false_type>, "" );
+ static_assert (!ex::disjunction_v<std::false_type, std::false_type, std::false_type>, "" );
+
+ static_assert ( ex::disjunction<True >::value, "" );
+ static_assert (!ex::disjunction<False>::value, "" );
+
+ static_assert ( ex::disjunction_v<True >, "" );
+ static_assert (!ex::disjunction_v<False>, "" );
+}
diff --git a/test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp b/test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp
new file mode 100644
index 000000000000..b0d43d7e5122
--- /dev/null
+++ b/test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+// <experimental/type_traits>
+
+// template<class B> struct negation;
+// template<class B>
+// constexpr bool negation_v = negation<B>::value;
+
+#include <experimental/type_traits>
+#include <cassert>
+
+namespace ex = std::experimental;
+
+struct True { static constexpr bool value = true; };
+struct False { static constexpr bool value = false; };
+
+int main()
+{
+ static_assert (!ex::negation<std::true_type >::value, "" );
+ static_assert ( ex::negation<std::false_type>::value, "" );
+
+ static_assert (!ex::negation_v<std::true_type >, "" );
+ static_assert ( ex::negation_v<std::false_type>, "" );
+
+ static_assert (!ex::negation<True >::value, "" );
+ static_assert ( ex::negation<False>::value, "" );
+
+ static_assert (!ex::negation_v<True >, "" );
+ static_assert ( ex::negation_v<False>, "" );
+
+ static_assert ( ex::negation<ex::negation<std::true_type >>::value, "" );
+ static_assert (!ex::negation<ex::negation<std::false_type>>::value, "" );
+}
diff --git a/test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/move_ctor.pass.cpp b/test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/move_ctor.pass.cpp
index a5adf2d1f7f0..0e46f91cfd1e 100644
--- a/test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/move_ctor.pass.cpp
+++ b/test/std/experimental/utilities/propagate_const/propagate_const.class/propagate_const.ctors/move_ctor.pass.cpp
@@ -25,4 +25,5 @@ int main() {
P p1(2);
P p2(std::move(p1));
+ assert(*p2 == 2);
}
diff --git a/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp b/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp
index 8cf670a25402..488738d32072 100644
--- a/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp
+++ b/test/std/experimental/utilities/propagate_const/propagate_const.nonmembers/hash.pass.cpp
@@ -24,7 +24,7 @@ template <> struct hash<X>
{
typedef X first_argument_type;
- size_t operator()(const first_argument_type& x1) const
+ size_t operator()(const first_argument_type&) const
{
return 99;
}
diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp
index f19a8211cdac..485da33cdec7 100644
--- a/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp
+++ b/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp
@@ -18,4 +18,5 @@
int main()
{
std::ratio<100> x;
+ ((void)x);
}
diff --git a/test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp
index 314d2783f7ec..01d36637e1c3 100644
--- a/test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp
+++ b/test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp
@@ -20,32 +20,32 @@
static int my_int = 42;
-template <int N> struct index {};
+template <int N> struct index_t {};
-void f(index<0>) {}
+void f(index_t<0>) {}
-int f(index<1>) { return 0; }
+int f(index_t<1>) { return 0; }
-int & f(index<2>) { return static_cast<int &>(my_int); }
-int const & f(index<3>) { return static_cast<int const &>(my_int); }
-int volatile & f(index<4>) { return static_cast<int volatile &>(my_int); }
-int const volatile & f(index<5>) { return static_cast<int const volatile &>(my_int); }
+int & f(index_t<2>) { return static_cast<int &>(my_int); }
+int const & f(index_t<3>) { return static_cast<int const &>(my_int); }
+int volatile & f(index_t<4>) { return static_cast<int volatile &>(my_int); }
+int const volatile & f(index_t<5>) { return static_cast<int const volatile &>(my_int); }
-int && f(index<6>) { return static_cast<int &&>(my_int); }
-int const && f(index<7>) { return static_cast<int const &&>(my_int); }
-int volatile && f(index<8>) { return static_cast<int volatile &&>(my_int); }
-int const volatile && f(index<9>) { return static_cast<int const volatile &&>(my_int); }
+int && f(index_t<6>) { return static_cast<int &&>(my_int); }
+int const && f(index_t<7>) { return static_cast<int const &&>(my_int); }
+int volatile && f(index_t<8>) { return static_cast<int volatile &&>(my_int); }
+int const volatile && f(index_t<9>) { return static_cast<int const volatile &&>(my_int); }
-int * f(index<10>) { return static_cast<int *>(&my_int); }
-int const * f(index<11>) { return static_cast<int const *>(&my_int); }
-int volatile * f(index<12>) { return static_cast<int volatile *>(&my_int); }
-int const volatile * f(index<13>) { return static_cast<int const volatile *>(&my_int); }
+int * f(index_t<10>) { return static_cast<int *>(&my_int); }
+int const * f(index_t<11>) { return static_cast<int const *>(&my_int); }
+int volatile * f(index_t<12>) { return static_cast<int volatile *>(&my_int); }
+int const volatile * f(index_t<13>) { return static_cast<int const volatile *>(&my_int); }
template <int Func, class Expect>
void test()
{
- using F = decltype(f(index<Func>{}));
+ using F = decltype(f(index_t<Func>{}));
static_assert(std::is_same<F, Expect>::value, "");
}
diff --git a/test/std/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp b/test/std/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp
index 51f9ab6bee18..7ac96d2502d8 100644
--- a/test/std/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp
+++ b/test/std/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp
@@ -13,5 +13,6 @@
int main()
{
- std::experimental::erased_type e;
+ std::experimental::erased_type e;
+ ((void)e);
}
diff --git a/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp b/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
index 8937950522c8..ab2f15e9576c 100644
--- a/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
+++ b/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
@@ -872,54 +872,56 @@
#error SCNxPTR not defined
#endif
+template <class T> void test()
+{
+ T t = 0;
+ ((void)t); // Prevent unused warning
+}
+
int main()
{
- {
- std::int8_t i1 = 0;
- std::int16_t i2 = 0;
- std::int32_t i3 = 0;
- std::int64_t i4 = 0;
- }
- {
- std::uint8_t i1 = 0;
- std::uint16_t i2 = 0;
- std::uint32_t i3 = 0;
- std::uint64_t i4 = 0;
- }
- {
- std::int_least8_t i1 = 0;
- std::int_least16_t i2 = 0;
- std::int_least32_t i3 = 0;
- std::int_least64_t i4 = 0;
- }
- {
- std::uint_least8_t i1 = 0;
- std::uint_least16_t i2 = 0;
- std::uint_least32_t i3 = 0;
- std::uint_least64_t i4 = 0;
- }
- {
- std::int_fast8_t i1 = 0;
- std::int_fast16_t i2 = 0;
- std::int_fast32_t i3 = 0;
- std::int_fast64_t i4 = 0;
- }
- {
- std::uint_fast8_t i1 = 0;
- std::uint_fast16_t i2 = 0;
- std::uint_fast32_t i3 = 0;
- std::uint_fast64_t i4 = 0;
- }
- {
- std::intptr_t i1 = 0;
- std::uintptr_t i2 = 0;
- std::intmax_t i3 = 0;
- std::uintmax_t i4 = 0;
- }
+ test<std::int8_t >();
+ test<std::int16_t>();
+ test<std::int32_t>();
+ test<std::int64_t>();
+
+ test<std::uint8_t >();
+ test<std::uint16_t>();
+ test<std::uint32_t>();
+ test<std::uint64_t>();
+
+ test<std::int_least8_t >();
+ test<std::int_least16_t>();
+ test<std::int_least32_t>();
+ test<std::int_least64_t>();
+
+ test<std::uint_least8_t >();
+ test<std::uint_least16_t>();
+ test<std::uint_least32_t>();
+ test<std::uint_least64_t>();
+
+ test<std::int_fast8_t >();
+ test<std::int_fast16_t>();
+ test<std::int_fast32_t>();
+ test<std::int_fast64_t>();
+
+ test<std::uint_fast8_t >();
+ test<std::uint_fast16_t>();
+ test<std::uint_fast32_t>();
+ test<std::uint_fast64_t>();
+
+ test<std::intptr_t >();
+ test<std::uintptr_t>();
+ test<std::intmax_t >();
+ test<std::uintmax_t>();
+
{
std::imaxdiv_t i1 = {};
+ ((void)i1); // Prevent unused warning
}
+
std::intmax_t i = 0;
+ ((void)i); // Prevent unused warning
static_assert((std::is_same<decltype(std::imaxabs(i)), std::intmax_t>::value), "");
static_assert((std::is_same<decltype(std::imaxdiv(i, i)), std::imaxdiv_t>::value), "");
static_assert((std::is_same<decltype(std::strtoimax("", (char**)0, 0)), std::intmax_t>::value), "");
diff --git a/test/std/input.output/file.streams/c.files/cstdio.pass.cpp b/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
index 4c2be7d4aa9e..5df8691ef1f9 100644
--- a/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
+++ b/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
@@ -12,6 +12,8 @@
#include <cstdio>
#include <type_traits>
+#include "test_macros.h"
+
#ifndef BUFSIZ
#error BUFSIZ not defined
#endif
@@ -140,7 +142,7 @@ int main()
#ifndef _LIBCPP_HAS_NO_STDIN
static_assert((std::is_same<decltype(std::getchar()), int>::value), "");
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
static_assert((std::is_same<decltype(std::gets(cp)), char*>::value), "");
#endif
static_assert((std::is_same<decltype(std::scanf(" ")), int>::value), "");
diff --git a/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
index 9ada23b45468..3c9c0d35db20 100644
--- a/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
@@ -16,6 +16,7 @@
// This test is not entirely portable
#include <fstream>
+#include <cstddef>
#include <cassert>
#include "platform_support.h" // locale name macros
@@ -111,6 +112,7 @@ int main()
assert(f.egptr() - f.gptr() == 1);
}
{
+ typedef std::char_traits<wchar_t> Traits;
test_buf<wchar_t> f;
f.pubimbue(std::locale(LOCALE_en_US_UTF_8));
assert(f.open("underflow_utf8.dat", std::ios_base::in) != 0);
@@ -118,6 +120,6 @@ int main()
assert(f.sbumpc() == 0x4E51);
assert(f.sbumpc() == 0x4E52);
assert(f.sbumpc() == 0x4E53);
- assert(f.sbumpc() == -1);
+ assert(f.sbumpc() == static_cast<Traits::int_type>(-1));
}
}
diff --git a/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp b/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
index f43df3c9f84a..ef3959cfcefb 100644
--- a/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
@@ -25,22 +25,16 @@ int main()
fs >> x;
assert(x == 3.25);
}
- {
- std::ifstream fs("test.dat", std::ios_base::out);
- double x = 0;
- fs >> x;
- assert(x == 3.25);
- }
+ // std::ifstream(const char*, std::ios_base::openmode) is tested in
+ // test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
+ // which creates writable files.
{
std::wifstream fs("test.dat");
double x = 0;
fs >> x;
assert(x == 3.25);
}
- {
- std::wifstream fs("test.dat", std::ios_base::out);
- double x = 0;
- fs >> x;
- assert(x == 3.25);
- }
+ // std::wifstream(const char*, std::ios_base::openmode) is tested in
+ // test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
+ // which creates writable files.
}
diff --git a/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp b/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
index ad5fe5149df2..d4155ea8e7f5 100644
--- a/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
@@ -25,22 +25,16 @@ int main()
fs >> x;
assert(x == 3.25);
}
- {
- std::ifstream fs(std::string("test.dat"), std::ios_base::out);
- double x = 0;
- fs >> x;
- assert(x == 3.25);
- }
+ // std::ifstream(const std::string&, std::ios_base::openmode) is tested in
+ // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
+ // which creates writable files.
{
std::wifstream fs(std::string("test.dat"));
double x = 0;
fs >> x;
assert(x == 3.25);
}
- {
- std::wifstream fs(std::string("test.dat"), std::ios_base::out);
- double x = 0;
- fs >> x;
- assert(x == 3.25);
- }
+ // std::wifstream(const std::string&, std::ios_base::openmode) is tested in
+ // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
+ // which creates writable files.
}
diff --git a/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
index bd5832abeb59..60f92569049d 100644
--- a/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
@@ -31,6 +31,12 @@ int main()
fs >> x;
assert(x == 3.25);
}
+ {
+ std::ifstream fs(temp.c_str(), std::ios_base::out);
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
std::remove(temp.c_str());
{
std::wofstream fs(temp.c_str());
@@ -42,5 +48,11 @@ int main()
fs >> x;
assert(x == 3.25);
}
+ {
+ std::wifstream fs(temp.c_str(), std::ios_base::out);
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
std::remove(temp.c_str());
}
diff --git a/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
index 7112b17fb8be..b95db6626020 100644
--- a/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
@@ -31,6 +31,12 @@ int main()
fs >> x;
assert(x == 3.25);
}
+ {
+ std::ifstream fs(temp, std::ios_base::out);
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
std::remove(temp.c_str());
{
std::wofstream fs(temp);
@@ -42,5 +48,11 @@ int main()
fs >> x;
assert(x == 3.25);
}
+ {
+ std::wifstream fs(temp, std::ios_base::out);
+ double x = 0;
+ fs >> x;
+ assert(x == 3.25);
+ }
std::remove(temp.c_str());
}
diff --git a/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp b/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp
index e907708d0f22..d12b91cc0cba 100644
--- a/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp
+++ b/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp
@@ -39,8 +39,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
index 5b7664e3f55c..77c41b09ad7b 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
@@ -7,17 +7,18 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <istream>
// template <class charT, class traits, class T>
// basic_istream<charT, traits>&
-// operator>>(basic_istream<charT, traits>&& is, T& x);
+// operator>>(basic_istream<charT, traits>&& is, T&& x);
#include <istream>
+#include <sstream>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class CharT>
struct testbuf
: public std::basic_streambuf<CharT>
@@ -42,11 +43,13 @@ public:
CharT* egptr() const {return base::egptr();}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+struct A{};
+bool called = false;
+void operator>>(std::istream&, A&&){ called = true; }
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
testbuf<char> sb(" 123");
int i = 0;
@@ -59,5 +62,11 @@ int main()
std::wistream(&sb) >> i;
assert(i == 123);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ { // test perfect forwarding
+ assert(called == false);
+ std::istringstream ss;
+ auto& out = (std::move(ss) >> A{});
+ assert(&out == &ss);
+ assert(called);
+ }
}
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
index 41a721d50f13..0f356e26d237 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
@@ -43,7 +43,7 @@ int main()
{
testbuf<char> sb(" ");
std::istream is(&sb);
- char c = is.get();
+ char c = static_cast<char>(is.get());
assert(!is.eof());
assert(!is.fail());
assert(c == ' ');
@@ -52,22 +52,22 @@ int main()
{
testbuf<char> sb(" abc");
std::istream is(&sb);
- char c = is.get();
+ char c = static_cast<char>(is.get());
assert(!is.eof());
assert(!is.fail());
assert(c == ' ');
assert(is.gcount() == 1);
- c = is.get();
+ c = static_cast<char>(is.get());
assert(!is.eof());
assert(!is.fail());
assert(c == 'a');
assert(is.gcount() == 1);
- c = is.get();
+ c = static_cast<char>(is.get());
assert(!is.eof());
assert(!is.fail());
assert(c == 'b');
assert(is.gcount() == 1);
- c = is.get();
+ c = static_cast<char>(is.get());
assert(!is.eof());
assert(!is.fail());
assert(c == 'c');
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp
index 7a55f847d734..e7327293bf82 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp
@@ -42,8 +42,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp
index cbc007587d5e..292cf7c3b11d 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp
@@ -43,8 +43,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
index e498172aa8b1..ed68279d7b57 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
@@ -27,8 +27,8 @@ int main()
std::istringstream is(s);
const unsigned int ignoreLen=10;
- size_t a=is.tellg();
+ std::istringstream::pos_type a=is.tellg();
is.ignore(ignoreLen);
- size_t b=is.tellg();
+ std::istringstream::pos_type b=is.tellg();
assert((b-a)==ignoreLen);
}
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/bool.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/bool.pass.cpp
index 13035b74436e..fe038a7cc1a9 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/bool.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/bool.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/double.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/double.pass.cpp
index 38ee37ff1892..197e4602ff3a 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/double.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/double.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/float.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/float.pass.cpp
index 1da0ac685fcb..d31da5a18be6 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/float.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/float.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/int.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/int.pass.cpp
index efcb08a3da10..1b33280e6693 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/int.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/int.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long.pass.cpp
index 6d617a453ebc..7cf46096d029 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long_double.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long_double.pass.cpp
index 20b20b2231a2..dba3f8a68151 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long_double.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long_double.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long_long.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long_long.pass.cpp
index dc77eb72192d..1174a0934ed6 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long_long.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/long_long.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
index 47e257a18684..e68fb774335d 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
@@ -51,7 +51,7 @@ void test_hex(const char *expected)
std::string str = ss.str();
for (size_t i = 0; i < str.size(); ++i )
- str[i] = std::toupper(str[i]);
+ str[i] = static_cast<char>(std::toupper(str[i]));
assert(str == expected);
}
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp
index b74d99a34ec9..f6589397ed88 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/short.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/short.pass.cpp
index ebd349bcbb79..3b8182c1b621 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/short.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/short.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_int.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_int.pass.cpp
index ac60fa9c1979..61057f7b3063 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_int.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_int.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_long.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_long.pass.cpp
index b5a38017dce4..4558993e8e1f 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_long.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_long.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_long_long.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_long_long.pass.cpp
index 25dc4d834975..1727b3657ce0 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_long_long.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_long_long.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
@@ -76,7 +76,7 @@ int main()
testbuf<char> sb;
std::ostream os(&sb);
hex(os);
- unsigned long long n = -10;
+ unsigned long long n = static_cast<unsigned long long>(-10);
os << n;
assert(sb.str() == "fffffffffffffff6");
}
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_short.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_short.pass.cpp
index 7c28a8ee79c4..a42cd5628856 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_short.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/unsigned_short.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp
index f74e2a4abd9e..b778da2240a0 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp
@@ -39,7 +39,7 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
+ int n = static_cast<int>(str_.size());
str_.push_back(__c);
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp
index 2b78fa75aa30..29153c1d4241 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp
@@ -39,7 +39,7 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
+ int n = static_cast<int>(str_.size());
str_.push_back(__c);
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char.pass.cpp
index 253b524308c0..91ee08cd0563 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char.pass.cpp
@@ -39,8 +39,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_pointer.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_pointer.pass.cpp
index c544554ae0e2..1eb48d378e4c 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_pointer.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_pointer.pass.cpp
@@ -39,8 +39,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp
index 6449a13a6426..a50e376643c3 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp
@@ -39,7 +39,7 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
+ int n = static_cast<int>(str_.size());
str_.push_back(__c);
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp
index e679a5c48ba4..5c900e6ae533 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp
@@ -39,7 +39,7 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
+ int n = static_cast<int>(str_.size());
str_.push_back(__c);
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/signed_char.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/signed_char.pass.cpp
index dc0ee4266c77..d57d0e7075b5 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/signed_char.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/signed_char.pass.cpp
@@ -39,8 +39,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/signed_char_pointer.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/signed_char_pointer.pass.cpp
index e465b94b6b93..e51e8815730f 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/signed_char_pointer.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/signed_char_pointer.pass.cpp
@@ -39,8 +39,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/unsigned_char.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/unsigned_char.pass.cpp
index d818c5f358f2..9956f3b0162b 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/unsigned_char.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/unsigned_char.pass.cpp
@@ -39,8 +39,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/unsigned_char_pointer.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/unsigned_char_pointer.pass.cpp
index 3257f4a776ca..d87e733c09dd 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/unsigned_char_pointer.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/unsigned_char_pointer.pass.cpp
@@ -39,8 +39,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/basic_ios.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/basic_ios.pass.cpp
index e26466e13f6e..ef7e292e901a 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/basic_ios.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/basic_ios.pass.cpp
@@ -39,8 +39,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/ios_base.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/ios_base.pass.cpp
index 238a62108249..933e01c66e8d 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/ios_base.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/ios_base.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/ostream.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/ostream.pass.cpp
index 3ed400a705ca..5c0604b73d4d 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/ostream.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/ostream.pass.cpp
@@ -39,8 +39,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp
index 1cb9413a7cc9..a26450ae5bf2 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp
@@ -45,8 +45,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp
index d503544a97f2..72df6085571f 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp
@@ -41,8 +41,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp
index 975b660b4770..dcded343431a 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp
@@ -39,8 +39,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp
index ec0e8e1e8c7a..8be0b51d9fdf 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp
@@ -42,8 +42,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp
index 396bb093f9c7..0958f8330236 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp
index 8dd4e4cf76a6..0d6eb3f226f9 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp
@@ -38,8 +38,8 @@ protected:
{
if (__c != base::traits_type::eof())
{
- int n = str_.size();
- str_.push_back(__c);
+ int n = static_cast<int>(str_.size());
+ str_.push_back(static_cast<CharT>(__c));
str_.resize(str_.capacity());
base::setp(const_cast<CharT*>(str_.data()),
const_cast<CharT*>(str_.data() + str_.size()));
diff --git a/test/std/input.output/iostream.format/output.streams/ostream_sentry/destruct.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream_sentry/destruct.pass.cpp
index a8ef34e49278..d351c565eb66 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream_sentry/destruct.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream_sentry/destruct.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <ostream>
// template <class charT, class traits = char_traits<charT> >
@@ -18,6 +17,8 @@
#include <ostream>
#include <cassert>
+#include "test_macros.h"
+
int sync_called = 0;
template <class CharT>
@@ -58,6 +59,7 @@ int main()
unitbuf(os);
}
assert(sync_called == 1);
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
testbuf1<char> sb;
std::ostream os(&sb);
@@ -73,4 +75,5 @@ int main()
}
assert(sync_called == 1);
}
+#endif
}
diff --git a/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp b/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
index ee9aabcb6ac8..8f07742c673f 100644
--- a/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
+++ b/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
@@ -32,6 +32,7 @@ void both_ways ( const CharT *p ) {
std::basic_stringstream<CharT, Traits> ss;
bool skippingws = is_skipws ( ss );
+ ((void)skippingws); // Prevent unused warning
ss << q;
ss >> q;
}
diff --git a/test/std/input.output/iostream.forward/iosfwd.pass.cpp b/test/std/input.output/iostream.forward/iosfwd.pass.cpp
index 7250c2adb279..53d12ecfc77c 100644
--- a/test/std/input.output/iostream.forward/iosfwd.pass.cpp
+++ b/test/std/input.output/iostream.forward/iosfwd.pass.cpp
@@ -12,131 +12,112 @@
#include <iosfwd>
#include <cwchar> // for mbstate_t
+template <class Ptr> void test()
+{
+ Ptr p = 0;
+ ((void)p); // Prevent unused warning
+}
+
int main()
{
- {
- std::char_traits<char>* t1 = 0;
- std::char_traits<wchar_t>* t2 = 0;
- std::char_traits<unsigned short>* t3 = 0;
- }
- {
- std::basic_ios<char>* t1 = 0;
- std::basic_ios<wchar_t>* t2 = 0;
- std::basic_ios<unsigned short>* t3 = 0;
- }
- {
- std::basic_streambuf<char>* t1 = 0;
- std::basic_streambuf<wchar_t>* t2 = 0;
- std::basic_streambuf<unsigned short>* t3 = 0;
- }
- {
- std::basic_istream<char>* t1 = 0;
- std::basic_istream<wchar_t>* t2 = 0;
- std::basic_istream<unsigned short>* t3 = 0;
- }
- {
- std::basic_ostream<char>* t1 = 0;
- std::basic_ostream<wchar_t>* t2 = 0;
- std::basic_ostream<unsigned short>* t3 = 0;
- }
- {
- std::basic_iostream<char>* t1 = 0;
- std::basic_iostream<wchar_t>* t2 = 0;
- std::basic_iostream<unsigned short>* t3 = 0;
- }
- {
- std::basic_stringbuf<char>* t1 = 0;
- std::basic_stringbuf<wchar_t>* t2 = 0;
- std::basic_stringbuf<unsigned short>* t3 = 0;
- }
- {
- std::basic_istringstream<char>* t1 = 0;
- std::basic_istringstream<wchar_t>* t2 = 0;
- std::basic_istringstream<unsigned short>* t3 = 0;
- }
- {
- std::basic_ostringstream<char>* t1 = 0;
- std::basic_ostringstream<wchar_t>* t2 = 0;
- std::basic_ostringstream<unsigned short>* t3 = 0;
- }
- {
- std::basic_stringstream<char>* t1 = 0;
- std::basic_stringstream<wchar_t>* t2 = 0;
- std::basic_stringstream<unsigned short>* t3 = 0;
- }
- {
- std::basic_filebuf<char>* t1 = 0;
- std::basic_filebuf<wchar_t>* t2 = 0;
- std::basic_filebuf<unsigned short>* t3 = 0;
- }
- {
- std::basic_ifstream<char>* t1 = 0;
- std::basic_ifstream<wchar_t>* t2 = 0;
- std::basic_ifstream<unsigned short>* t3 = 0;
- }
- {
- std::basic_ofstream<char>* t1 = 0;
- std::basic_ofstream<wchar_t>* t2 = 0;
- std::basic_ofstream<unsigned short>* t3 = 0;
- }
- {
- std::basic_fstream<char>* t1 = 0;
- std::basic_fstream<wchar_t>* t2 = 0;
- std::basic_fstream<unsigned short>* t3 = 0;
- }
- {
- std::istreambuf_iterator<char>* t1 = 0;
- std::istreambuf_iterator<wchar_t>* t2 = 0;
- std::istreambuf_iterator<unsigned short>* t3 = 0;
- }
- {
- std::ostreambuf_iterator<char>* t1 = 0;
- std::ostreambuf_iterator<wchar_t>* t2 = 0;
- std::ostreambuf_iterator<unsigned short>* t3 = 0;
- }
- {
- std::ios* t1 = 0;
- std::wios* t2 = 0;
- }
- {
- std::streambuf* t1 = 0;
- std::istream* t2 = 0;
- std::ostream* t3 = 0;
- std::iostream* t4 = 0;
- }
- {
- std::stringbuf* t1 = 0;
- std::istringstream* t2 = 0;
- std::ostringstream* t3 = 0;
- std::stringstream* t4 = 0;
- }
- {
- std::filebuf* t1 = 0;
- std::ifstream* t2 = 0;
- std::ofstream* t3 = 0;
- std::fstream* t4 = 0;
- }
- {
- std::wstreambuf* t1 = 0;
- std::wistream* t2 = 0;
- std::wostream* t3 = 0;
- std::wiostream* t4 = 0;
- }
- {
- std::wstringbuf* t1 = 0;
- std::wistringstream* t2 = 0;
- std::wostringstream* t3 = 0;
- std::wstringstream* t4 = 0;
- }
- {
- std::wfilebuf* t1 = 0;
- std::wifstream* t2 = 0;
- std::wofstream* t3 = 0;
- std::wfstream* t4 = 0;
- }
- {
- std::fpos<std::mbstate_t>* t1 = 0;
- std::streampos* t2 = 0;
- std::wstreampos* t3 = 0;
- }
+ test<std::char_traits<char>* >();
+ test<std::char_traits<wchar_t>* >();
+ test<std::char_traits<unsigned short>*>();
+
+ test<std::basic_ios<char>* >();
+ test<std::basic_ios<wchar_t>* >();
+ test<std::basic_ios<unsigned short>*>();
+
+ test<std::basic_streambuf<char>* >();
+ test<std::basic_streambuf<wchar_t>* >();
+ test<std::basic_streambuf<unsigned short>*>();
+
+ test<std::basic_istream<char>* >();
+ test<std::basic_istream<wchar_t>* >();
+ test<std::basic_istream<unsigned short>*>();
+
+ test<std::basic_ostream<char>* >();
+ test<std::basic_ostream<wchar_t>* >();
+ test<std::basic_ostream<unsigned short>*>();
+
+ test<std::basic_iostream<char>* >();
+ test<std::basic_iostream<wchar_t>* >();
+ test<std::basic_iostream<unsigned short>*>();
+
+ test<std::basic_stringbuf<char>* >();
+ test<std::basic_stringbuf<wchar_t>* >();
+ test<std::basic_stringbuf<unsigned short>*>();
+
+ test<std::basic_istringstream<char>* >();
+ test<std::basic_istringstream<wchar_t>* >();
+ test<std::basic_istringstream<unsigned short>*>();
+
+ test<std::basic_ostringstream<char>* >();
+ test<std::basic_ostringstream<wchar_t>* >();
+ test<std::basic_ostringstream<unsigned short>*>();
+
+ test<std::basic_stringstream<char>* >();
+ test<std::basic_stringstream<wchar_t>* >();
+ test<std::basic_stringstream<unsigned short>*>();
+
+ test<std::basic_filebuf<char>* >();
+ test<std::basic_filebuf<wchar_t>* >();
+ test<std::basic_filebuf<unsigned short>*>();
+
+ test<std::basic_ifstream<char>* >();
+ test<std::basic_ifstream<wchar_t>* >();
+ test<std::basic_ifstream<unsigned short>*>();
+
+ test<std::basic_ofstream<char>* >();
+ test<std::basic_ofstream<wchar_t>* >();
+ test<std::basic_ofstream<unsigned short>*>();
+
+ test<std::basic_fstream<char>* >();
+ test<std::basic_fstream<wchar_t>* >();
+ test<std::basic_fstream<unsigned short>*>();
+
+ test<std::istreambuf_iterator<char>* >();
+ test<std::istreambuf_iterator<wchar_t>* >();
+ test<std::istreambuf_iterator<unsigned short>*>();
+
+ test<std::ostreambuf_iterator<char>* >();
+ test<std::ostreambuf_iterator<wchar_t>* >();
+ test<std::ostreambuf_iterator<unsigned short>*>();
+
+ test<std::ios* >();
+ test<std::wios*>();
+
+ test<std::streambuf*>();
+ test<std::istream* >();
+ test<std::ostream* >();
+ test<std::iostream* >();
+
+ test<std::stringbuf* >();
+ test<std::istringstream*>();
+ test<std::ostringstream*>();
+ test<std::stringstream* >();
+
+ test<std::filebuf* >();
+ test<std::ifstream*>();
+ test<std::ofstream*>();
+ test<std::fstream* >();
+
+ test<std::wstreambuf*>();
+ test<std::wistream* >();
+ test<std::wostream* >();
+ test<std::wiostream* >();
+
+ test<std::wstringbuf* >();
+ test<std::wistringstream*>();
+ test<std::wostringstream*>();
+ test<std::wstringstream* >();
+
+ test<std::wfilebuf* >();
+ test<std::wifstream*>();
+ test<std::wofstream*>();
+ test<std::wfstream* >();
+
+ test<std::fpos<std::mbstate_t>*>();
+ test<std::streampos* >();
+ test<std::wstreampos* >();
}
diff --git a/test/std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp b/test/std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp
index acefb8d16176..77b4336538ed 100644
--- a/test/std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp
+++ b/test/std/input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
@@ -23,6 +22,8 @@
#include "platform_support.h" // locale name macros
+#include "test_macros.h"
+
struct testbuf
: public std::streambuf
{
@@ -158,6 +159,7 @@ int main()
ios1.copyfmt(ios1);
assert(!f1_called);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
ios1.copyfmt(ios2);
@@ -188,4 +190,5 @@ int main()
assert(ios1.pword(1) == &d2);
assert(ios1.tie() == (std::ostream*)2);
assert(ios1.fill() == '2');
+#endif
}
diff --git a/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp b/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp
index 1c40a81aa069..8852c9b55bb4 100644
--- a/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp
+++ b/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios
@@ -18,6 +17,8 @@
#include <streambuf>
#include <cassert>
+#include "test_macros.h"
+
struct testbuf
: public std::streambuf
{
@@ -35,16 +36,20 @@ int main()
testbuf sb1;
testbuf sb2;
testios ios(&sb1);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
ios.setstate(std::ios::badbit);
ios.exceptions(std::ios::badbit);
+ assert(false);
}
catch (...)
{
}
+#endif
ios.set_rdbuf(&sb2);
assert(ios.rdbuf() == &sb2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
ios.setstate(std::ios::badbit);
@@ -53,6 +58,7 @@ int main()
catch (...)
{
}
+#endif
ios.set_rdbuf(0);
assert(ios.rdbuf() == 0);
}
diff --git a/test/std/input.output/iostreams.base/ios/iostate.flags/bool.pass.cpp b/test/std/input.output/iostreams.base/ios/iostate.flags/bool.pass.cpp
index 0de889e549cc..4e3faa27c401 100644
--- a/test/std/input.output/iostreams.base/ios/iostate.flags/bool.pass.cpp
+++ b/test/std/input.output/iostreams.base/ios/iostate.flags/bool.pass.cpp
@@ -14,12 +14,21 @@
// operator unspecified-bool-type() const;
#include <ios>
+#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
std::ios ios(0);
assert(static_cast<bool>(ios) == !ios.fail());
ios.setstate(std::ios::failbit);
assert(static_cast<bool>(ios) == !ios.fail());
+ static_assert((!std::is_convertible<std::ios, void*>::value), "");
+ static_assert((!std::is_convertible<std::ios, int>::value), "");
+ static_assert((!std::is_convertible<std::ios const&, int>::value), "");
+#if TEST_STD_VER >= 11
+ static_assert((!std::is_convertible<std::ios, bool>::value), "");
+#endif
}
diff --git a/test/std/input.output/iostreams.base/ios/iostate.flags/clear.pass.cpp b/test/std/input.output/iostreams.base/ios/iostate.flags/clear.pass.cpp
index c4aad797801d..3efe910b32b0 100644
--- a/test/std/input.output/iostreams.base/ios/iostate.flags/clear.pass.cpp
+++ b/test/std/input.output/iostreams.base/ios/iostate.flags/clear.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios
@@ -18,6 +17,8 @@
#include <streambuf>
#include <cassert>
+#include "test_macros.h"
+
struct testbuf : public std::streambuf {};
int main()
@@ -26,9 +27,11 @@ int main()
std::ios ios(0);
ios.clear();
assert(ios.rdstate() == std::ios::badbit);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
ios.exceptions(std::ios::badbit);
+ assert(false);
}
catch (...)
{
@@ -51,6 +54,7 @@ int main()
{
assert(ios.rdstate() == (std::ios::eofbit | std::ios::badbit));
}
+#endif
}
{
testbuf sb;
diff --git a/test/std/input.output/iostreams.base/ios/iostate.flags/exceptions_iostate.pass.cpp b/test/std/input.output/iostreams.base/ios/iostate.flags/exceptions_iostate.pass.cpp
index 9347644b12b1..d99269be704f 100644
--- a/test/std/input.output/iostreams.base/ios/iostate.flags/exceptions_iostate.pass.cpp
+++ b/test/std/input.output/iostreams.base/ios/iostate.flags/exceptions_iostate.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios
@@ -18,6 +17,8 @@
#include <streambuf>
#include <cassert>
+#include "test_macros.h"
+
struct testbuf : public std::streambuf {};
int main()
@@ -27,6 +28,7 @@ int main()
assert(ios.exceptions() == std::ios::goodbit);
ios.exceptions(std::ios::eofbit);
assert(ios.exceptions() == std::ios::eofbit);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
ios.exceptions(std::ios::badbit);
@@ -36,6 +38,7 @@ int main()
{
}
assert(ios.exceptions() == std::ios::badbit);
+#endif
}
{
testbuf sb;
diff --git a/test/std/input.output/iostreams.base/ios/iostate.flags/setstate.pass.cpp b/test/std/input.output/iostreams.base/ios/iostate.flags/setstate.pass.cpp
index 41cb61db194d..6d2fe0691353 100644
--- a/test/std/input.output/iostreams.base/ios/iostate.flags/setstate.pass.cpp
+++ b/test/std/input.output/iostreams.base/ios/iostate.flags/setstate.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <ios>
// template <class charT, class traits> class basic_ios
@@ -18,6 +17,8 @@
#include <streambuf>
#include <cassert>
+#include "test_macros.h"
+
struct testbuf : public std::streambuf {};
int main()
@@ -26,9 +27,11 @@ int main()
std::ios ios(0);
ios.setstate(std::ios::goodbit);
assert(ios.rdstate() == std::ios::badbit);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
ios.exceptions(std::ios::badbit);
+ assert(false);
}
catch (...)
{
@@ -51,6 +54,7 @@ int main()
{
assert(ios.rdstate() == (std::ios::eofbit | std::ios::badbit));
}
+#endif
}
{
testbuf sb;
diff --git a/test/std/input.output/iostreams.base/is_error_code_enum_io_errc.pass.cpp b/test/std/input.output/iostreams.base/is_error_code_enum_io_errc.pass.cpp
new file mode 100644
index 000000000000..5bba8bd3a8bb
--- /dev/null
+++ b/test/std/input.output/iostreams.base/is_error_code_enum_io_errc.pass.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++03
+
+// <ios>
+
+// template <> struct is_error_code_enum<io_errc> : public true_type {};
+
+#include <ios>
+#include "test_macros.h"
+
+int main()
+{
+ static_assert(std::is_error_code_enum <std::io_errc>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(std::is_error_code_enum_v<std::io_errc>, "");
+#endif
+}
diff --git a/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.fail.cpp b/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.fail.cpp
index 469c7449971e..03f6d7d0b243 100644
--- a/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.fail.cpp
+++ b/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.fail.cpp
@@ -17,9 +17,9 @@
#include <streambuf>
#include <cassert>
-std::streambuf get();
+std::streambuf &get();
int main()
{
- std::streambuf sb = get();
+ std::streambuf sb = get(); // expected-error {{calling a protected constructor}}
}
diff --git a/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp b/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp
index eff47452c58f..5e24542abeca 100644
--- a/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp
+++ b/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp
@@ -27,9 +27,9 @@ int main()
assert(ss.good());
assert(ss.str() == " 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == "234 5676");
- ss0 << i << ' ' << 567;;
+ ss0 << i << ' ' << 567;
assert(ss0.str() == "234 567");
}
{
@@ -40,9 +40,9 @@ int main()
assert(ss.good());
assert(ss.str() == L" 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == L"234 5676");
- ss0 << i << ' ' << 567;;
+ ss0 << i << ' ' << 567;
assert(ss0.str() == L"234 567");
}
}
diff --git a/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp b/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp
index a6fb8ba69b2e..a52068595178 100644
--- a/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp
+++ b/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp
@@ -28,7 +28,7 @@ int main()
assert(ss.good());
assert(ss.str() == " 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == "234 5676");
}
{
@@ -39,7 +39,7 @@ int main()
assert(ss.good());
assert(ss.str() == L" 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == L"234 5676");
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp b/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp
index 3d7081d8e241..c98a2e367978 100644
--- a/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp
+++ b/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp
@@ -27,9 +27,9 @@ int main()
assert(ss.good());
assert(ss.str() == " 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == "234 5676");
- ss0 << i << ' ' << 567;;
+ ss0 << i << ' ' << 567;
assert(ss0.str() == "234 567");
}
{
@@ -40,9 +40,9 @@ int main()
assert(ss.good());
assert(ss.str() == L" 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == L"234 5676");
- ss0 << i << ' ' << 567;;
+ ss0 << i << ' ' << 567;
assert(ss0.str() == L"234 567");
}
}
diff --git a/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp b/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
index dc63b59fe39f..3d9e305e0408 100644
--- a/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
+++ b/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
@@ -27,7 +27,7 @@ int main()
assert(ss.good());
assert(ss.str() == " 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == "234 5676");
}
{
@@ -37,7 +37,7 @@ int main()
assert(ss.good());
assert(ss.str() == L" 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == L"234 5676");
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp b/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp
index 89c91bdee05d..8b90f72d4d12 100644
--- a/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp
+++ b/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp
@@ -26,7 +26,7 @@ int main()
assert(ss.good());
assert(ss.str() == " 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == "234 5676");
}
{
@@ -35,7 +35,7 @@ int main()
assert(ss.good());
assert(ss.str() == " 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == "234 5676");
}
{
@@ -44,7 +44,7 @@ int main()
assert(ss.good());
assert(ss.str() == L" 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == L"234 5676");
}
{
@@ -53,7 +53,7 @@ int main()
assert(ss.good());
assert(ss.str() == L" 123 456");
int i = 234;
- ss << i << ' ' << 567;;
+ ss << i << ' ' << 567;
assert(ss.str() == L"234 5676");
}
}
diff --git a/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp b/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp
index 67363b559d99..7eec808378dd 100644
--- a/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp
+++ b/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp
@@ -38,7 +38,7 @@ struct testbuf
int main()
{
{ // sanity check
- testbuf<char> tb("");;
+ testbuf<char> tb("");
tb.overflow();
}
{
diff --git a/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp b/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp
index a0509008d50b..d6adf6964178 100644
--- a/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp
+++ b/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp
@@ -36,7 +36,7 @@ struct testbuf
int main()
{
{ // sanity check
- testbuf<char> tb("");;
+ testbuf<char> tb("");
tb.pbackfail();
}
{
diff --git a/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp b/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp
index 856cf3cbeafd..78d682fc44f6 100644
--- a/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp
+++ b/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp
@@ -18,6 +18,7 @@
#include <vector>
#include <string>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
vecis.back().str("hub started at [00 6b 8b 45 69]");
vecis.push_back(std::istringstream());
vecis.back().str("hub started at [00 6b 8b 45 69]");
- for (int n = 0; n < vecis.size(); n++)
+ for (std::size_t n = 0; n < vecis.size(); n++)
{
assert(vecis[n].str().size() == 31);
vecis[n].seekg(0, std::ios_base::beg);
diff --git a/test/std/iterators/iterator.range/begin-end.fail.cpp b/test/std/iterators/iterator.range/begin-end.fail.cpp
index 1a1493099664..94a3d8c2004d 100644
--- a/test/std/iterators/iterator.range/begin-end.fail.cpp
+++ b/test/std/iterators/iterator.range/begin-end.fail.cpp
@@ -39,13 +39,13 @@ namespace Foo {
FakeIter crbegin(const FakeContainer &) { return 13; }
FakeIter crend (const FakeContainer &) { return 14; }
}
-
+
int main(){
// Bug #28927 - shouldn't find these via ADL
(void) std::cbegin (Foo::FakeContainer());
(void) std::cend (Foo::FakeContainer());
(void) std::crbegin(Foo::FakeContainer());
- (void) std::crend (Foo::FakeContainer());
+ (void) std::crend (Foo::FakeContainer());
}
#endif
diff --git a/test/std/iterators/iterator.range/begin-end.pass.cpp b/test/std/iterators/iterator.range/begin-end.pass.cpp
index ec3f61789b27..68186919198d 100644
--- a/test/std/iterators/iterator.range/begin-end.pass.cpp
+++ b/test/std/iterators/iterator.range/begin-end.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: c++03, c++98
+
// <iterator>
// template <class C> auto begin(C& c) -> decltype(c.begin());
// template <class C> auto begin(const C& c) -> decltype(c.begin());
@@ -17,7 +19,6 @@
#include "test_macros.h"
-#if TEST_STD_VER >= 11
#include <iterator>
#include <cassert>
#include <vector>
@@ -31,7 +32,7 @@ void test_const_container( const C & c, typename C::value_type val ) {
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
assert ( std::cbegin(c) == c.cbegin());
assert ( std::cbegin(c) != c.cend());
assert ( std::cend(c) == c.cend());
@@ -50,7 +51,7 @@ void test_const_container( const std::initializer_list<T> & c, T val ) {
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
// initializer_list doesn't have cbegin/cend/rbegin/rend
// but std::cbegin(),etc work (b/c they're general fn templates)
// assert ( std::cbegin(c) == c.cbegin());
@@ -71,7 +72,7 @@ void test_container( C & c, typename C::value_type val ) {
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
assert ( std::cbegin(c) == c.cbegin());
assert ( std::cbegin(c) != c.cend());
assert ( std::cend(c) == c.cend());
@@ -90,7 +91,7 @@ void test_container( std::initializer_list<T> & c, T val ) {
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
// initializer_list doesn't have cbegin/cend/rbegin/rend
// assert ( std::cbegin(c) == c.cbegin());
// assert ( std::cbegin(c) != c.cend());
@@ -110,7 +111,7 @@ void test_const_array( const T (&array)[Sz] ) {
assert (*std::begin(array) == array[0] );
assert ( std::begin(array) != std::end(array));
assert ( std::end(array) == array + Sz);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
assert ( std::cbegin(array) == array );
assert (*std::cbegin(array) == array[0] );
assert ( std::cbegin(array) != std::cend(array));
@@ -136,13 +137,9 @@ int main(){
static constexpr int arrA [] { 1, 2, 3 };
test_const_array ( arrA );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr const int *b = std::cbegin(arrA);
constexpr const int *e = std::cend(arrA);
static_assert(e - b == 3, "");
#endif
}
-
-#else
-int main(){}
-#endif
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp
index 06834981ef38..d2ad79af66fd 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp
@@ -14,10 +14,13 @@
// template <InputIterator Iter>
// move_iterator<Iter>
// make_move_iterator(const Iter& i);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -43,4 +46,12 @@ int main()
std::make_move_iterator(a+4);
std::make_move_iterator(a); // test for LWG issue 2061
}
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ constexpr auto iter = std::make_move_iterator<const char *>(p);
+ static_assert(iter.base() == p);
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/minus.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/minus.pass.cpp
index d52175c92296..758ef0f213e8 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/minus.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/minus.pass.cpp
@@ -16,10 +16,13 @@
// auto
// operator-(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y)
// -> decltype(x.base() - y.base());
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -36,4 +39,15 @@ int main()
char s[] = "1234567890";
test(random_access_iterator<char*>(s+5), random_access_iterator<char*>(s), 5);
test(s+5, s, 5);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p+1);
+ static_assert( it1 - it2 == -1, "");
+ static_assert( it2 - it1 == 1, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/plus.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/plus.pass.cpp
index e67ebfca3717..54b79b511d82 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/plus.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/plus.pass.cpp
@@ -14,10 +14,13 @@
// template <RandomAccessIterator Iter>
// move_iterator<Iter>
// operator+(Iter::difference_type n, const move_iterator<Iter>& x);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,17 @@ int main()
char s[] = "1234567890";
test(random_access_iterator<char*>(s+5), 5, random_access_iterator<char*>(s+10));
test(s+5, 5, s+10);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p + 5);
+ constexpr MI it3 = it1 + 5;
+ static_assert(it1 != it2, "");
+ static_assert(it1 != it3, "");
+ static_assert(it2 == it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.+/difference_type.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.+/difference_type.pass.cpp
index e9a19f4932c5..e74be5e24080 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.+/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.+/difference_type.pass.cpp
@@ -13,10 +13,13 @@
// requires RandomAccessIterator<Iter>
// move_iterator operator+(difference_type n) const;
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -33,4 +36,17 @@ int main()
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10));
test(s+5, 5, s+10);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p + 5);
+ constexpr MI it3 = it1 + 5;
+ static_assert(it1 != it2, "");
+ static_assert(it1 != it3, "");
+ static_assert(it2 == it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.+=/difference_type.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.+=/difference_type.pass.cpp
index 5de1bccf877f..6b4396c83d30 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.+=/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.+=/difference_type.pass.cpp
@@ -13,10 +13,13 @@
// requires RandomAccessIterator<Iter>
// move_iterator& operator+=(difference_type n);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,17 @@ int main()
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10));
test(s+5, 5, s+10);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p + 5);
+ constexpr MI it3 = std::make_move_iterator(p) += 5;
+ static_assert(it1 != it2, "");
+ static_assert(it1 != it3, "");
+ static_assert(it2 == it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.-/difference_type.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.-/difference_type.pass.cpp
index 852f76a4a4d3..460636df7c99 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.-/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.-/difference_type.pass.cpp
@@ -13,10 +13,13 @@
// requires RandomAccessIterator<Iter>
// move_iterator operator-(difference_type n) const;
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -33,4 +36,17 @@ int main()
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
test(s+5, 5, s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p + 5);
+ constexpr MI it3 = it2 - 5;
+ static_assert(it1 != it2, "");
+ static_assert(it1 == it3, "");
+ static_assert(it2 != it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.-=/difference_type.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.-=/difference_type.pass.cpp
index f8630736980d..1b2ce8f0dfce 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.-=/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.-=/difference_type.pass.cpp
@@ -13,10 +13,13 @@
// requires RandomAccessIterator<Iter>
// move_iterator& operator-=(difference_type n);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,13 @@ int main()
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
test(s+5, 5, s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ constexpr auto it1 = std::make_move_iterator(p);
+ constexpr auto it2 = std::make_move_iterator(p+5) -= 5;
+ static_assert(it1 == it2, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_eq.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_eq.pass.cpp
index fb4f0fa1dc12..a365f08f3737 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_eq.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_eq.pass.cpp
@@ -15,10 +15,13 @@
// requires HasEqualTo<Iter1, Iter2>
// bool
// operator==(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -43,4 +46,17 @@ int main()
test(random_access_iterator<char*>(s), random_access_iterator<char*>(s+1), false);
test(s, s, true);
test(s, s+1, false);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p + 5);
+ constexpr MI it3 = std::make_move_iterator(p);
+ static_assert(!(it1 == it2), "");
+ static_assert( (it1 == it3), "");
+ static_assert(!(it2 == it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_gt.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_gt.pass.cpp
index 0edd2857c081..ddd59a6174d5 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_gt.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_gt.pass.cpp
@@ -15,10 +15,13 @@
// requires HasLess<Iter2, Iter1>
// bool
// operator>(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -39,4 +42,17 @@ int main()
test(s, s, false);
test(s, s+1, false);
test(s+1, s, true);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p + 5);
+ constexpr MI it3 = std::make_move_iterator(p);
+ static_assert(!(it1 > it2), "");
+ static_assert(!(it1 > it3), "");
+ static_assert( (it2 > it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_gte.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_gte.pass.cpp
index cb9cdb9aeb4f..e78082e34d26 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_gte.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_gte.pass.cpp
@@ -15,10 +15,13 @@
// requires HasLess<Iter1, Iter2>
// bool
// operator>=(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -39,4 +42,17 @@ int main()
test(s, s, true);
test(s, s+1, false);
test(s+1, s, true);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p + 5);
+ constexpr MI it3 = std::make_move_iterator(p);
+ static_assert(!(it1 >= it2), "");
+ static_assert( (it1 >= it3), "");
+ static_assert( (it2 >= it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_lt.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_lt.pass.cpp
index e7979ddd746e..37034d516d3f 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_lt.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_lt.pass.cpp
@@ -15,10 +15,13 @@
// requires HasLess<Iter1, Iter2>
// bool
// operator<(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -39,4 +42,17 @@ int main()
test(s, s, false);
test(s, s+1, true);
test(s+1, s, false);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p + 5);
+ constexpr MI it3 = std::make_move_iterator(p);
+ static_assert( (it1 < it2), "");
+ static_assert(!(it1 < it3), "");
+ static_assert(!(it2 < it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_lte.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_lte.pass.cpp
index 97a7bfdee466..5074ee33a891 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_lte.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_lte.pass.cpp
@@ -15,10 +15,13 @@
// requires HasLess<Iter2, Iter1>
// bool
// operator<=(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -39,4 +42,17 @@ int main()
test(s, s, true);
test(s, s+1, true);
test(s+1, s, false);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p + 5);
+ constexpr MI it3 = std::make_move_iterator(p);
+ static_assert( (it1 <= it2), "");
+ static_assert( (it1 <= it3), "");
+ static_assert(!(it2 <= it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_neq.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_neq.pass.cpp
index 9e4b9e37202c..8e6c827fdcd6 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_neq.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_neq.pass.cpp
@@ -15,10 +15,13 @@
// requires HasEqualTo<Iter1, Iter2>
// bool
// operator!=(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -43,4 +46,17 @@ int main()
test(random_access_iterator<char*>(s), random_access_iterator<char*>(s+1), true);
test(s, s, false);
test(s, s+1, true);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p + 5);
+ constexpr MI it3 = std::make_move_iterator(p);
+ static_assert( (it1 != it2), "");
+ static_assert(!(it1 != it3), "");
+ static_assert( (it2 != it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/convert.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/convert.pass.cpp
index 8c73a7d5c93c..36d3651949bd 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/convert.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/convert.pass.cpp
@@ -14,10 +14,13 @@
// template <class U>
// requires HasConstructor<Iter, const U&>
// move_iterator(const move_iterator<U> &u);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It, class U>
@@ -41,4 +44,13 @@ int main()
test<bidirectional_iterator<Base*> >(bidirectional_iterator<Derived*>(&d));
test<random_access_iterator<const Base*> >(random_access_iterator<Derived*>(&d));
test<Base*>(&d);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const Derived *p = nullptr;
+ constexpr std::move_iterator<const Derived *> it1 = std::make_move_iterator(p);
+ constexpr std::move_iterator<const Base *> it2(it1);
+ static_assert(it2.base() == p);
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp
index 782cb6020326..ba1406ada288 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp
@@ -12,9 +12,12 @@
// move_iterator
// move_iterator();
+//
+// constexpr in C++17
#include <iterator>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -31,4 +34,10 @@ int main()
test<bidirectional_iterator<char*> >();
test<random_access_iterator<char*> >();
test<char*>();
+
+#if TEST_STD_VER > 14
+ {
+ constexpr std::move_iterator<const char *> it;
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/iter.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/iter.pass.cpp
index 4a4a06018377..09a534b66c46 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/iter.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/iter.pass.cpp
@@ -12,10 +12,13 @@
// move_iterator
// explicit move_iterator(Iter i);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,12 @@ int main()
test(bidirectional_iterator<char*>(s));
test(random_access_iterator<char*>(s));
test(s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ constexpr std::move_iterator<const char *> it(p);
+ static_assert(it.base() == p);
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.decr/post.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.decr/post.pass.cpp
index 26fab5be7931..f5f921a777eb 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.decr/post.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.decr/post.pass.cpp
@@ -12,10 +12,13 @@
// move_iterator
// move_iterator operator--(int);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,17 @@ int main()
test(bidirectional_iterator<char*>(s+1), bidirectional_iterator<char*>(s));
test(random_access_iterator<char*>(s+1), random_access_iterator<char*>(s));
test(s+1, s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p+1);
+ static_assert(it1 != it2, "");
+ constexpr MI it3 = std::make_move_iterator(p+1) --;
+ static_assert(it1 != it3, "");
+ static_assert(it2 == it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.decr/pre.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.decr/pre.pass.cpp
index 700b3b637749..c434b3082e5a 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.decr/pre.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.decr/pre.pass.cpp
@@ -12,10 +12,13 @@
// move_iterator
// move_iterator& operator--();
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,17 @@ int main()
test(bidirectional_iterator<char*>(s+1), bidirectional_iterator<char*>(s));
test(random_access_iterator<char*>(s+1), random_access_iterator<char*>(s));
test(s+1, s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p+1);
+ static_assert(it1 != it2, "");
+ constexpr MI it3 = -- std::make_move_iterator(p+1);
+ static_assert(it1 == it3, "");
+ static_assert(it2 != it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp
index e7c13b579622..4ff511c132eb 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp
@@ -12,10 +12,13 @@
// move_iterator
// move_iterator operator++(int);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -36,4 +39,17 @@ int main()
test(bidirectional_iterator<char*>(s), bidirectional_iterator<char*>(s+1));
test(random_access_iterator<char*>(s), random_access_iterator<char*>(s+1));
test(s, s+1);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p+1);
+ static_assert(it1 != it2, "");
+ constexpr MI it3 = std::make_move_iterator(p) ++;
+ static_assert(it1 == it3, "");
+ static_assert(it2 != it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/pre.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/pre.pass.cpp
index f27c737277d9..e5d5704293f4 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/pre.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/pre.pass.cpp
@@ -12,10 +12,13 @@
// move_iterator
// move_iterator& operator++();
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -36,4 +39,17 @@ int main()
test(bidirectional_iterator<char*>(s), bidirectional_iterator<char*>(s+1));
test(random_access_iterator<char*>(s), random_access_iterator<char*>(s+1));
test(s, s+1);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p+1);
+ static_assert(it1 != it2, "");
+ constexpr MI it3 = ++ std::make_move_iterator(p);
+ static_assert(it1 != it3, "");
+ static_assert(it2 == it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.index/difference_type.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.index/difference_type.pass.cpp
index 8d507b822cd2..bf7a8e33ee54 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.index/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.index/difference_type.pass.cpp
@@ -13,13 +13,14 @@
// requires RandomAccessIterator<Iter>
// unspecified operator[](difference_type n) const;
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -33,26 +34,35 @@ test(It i, typename std::iterator_traits<It>::difference_type n,
assert(rr == x);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
struct do_nothing
{
void operator()(void*) const {}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
int main()
{
- char s[] = "1234567890";
- test(random_access_iterator<char*>(s+5), 4, '0');
- test(s+5, 4, '0');
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- int i[5];
- typedef std::unique_ptr<int, do_nothing> Ptr;
- Ptr p[5];
- for (unsigned j = 0; j < 5; ++j)
- p[j].reset(i+j);
- test(p, 3, Ptr(i+3));
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ {
+ char s[] = "1234567890";
+ test(random_access_iterator<char*>(s+5), 4, '0');
+ test(s+5, 4, '0');
+ }
+#if TEST_STD_VER >= 11
+ {
+ int i[5];
+ typedef std::unique_ptr<int, do_nothing> Ptr;
+ Ptr p[5];
+ for (unsigned j = 0; j < 5; ++j)
+ p[j].reset(i+j);
+ test(p, 3, Ptr(i+3));
+ }
+#endif
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ static_assert(it1[0] == '1', "");
+ static_assert(it1[5] == '6', "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/op_arrow.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/op_arrow.pass.cpp
index b0c00e3fbf86..ef87014cd2da 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/op_arrow.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/op_arrow.pass.cpp
@@ -12,10 +12,14 @@
// move_iterator
// pointer operator->() const;
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
+
template <class It>
void
test(It i)
@@ -28,4 +32,15 @@ int main()
{
char s[] = "123";
test(s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p+1);
+ static_assert(it1.operator->() == p, "");
+ static_assert(it2.operator->() == p + 1, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp
index 6de708baa327..4c5d816b8c2d 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp
@@ -12,12 +12,14 @@
// move_iterator
// reference operator*() const;
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+
+#include "test_macros.h"
class A
{
@@ -40,22 +42,33 @@ test(It i, typename std::iterator_traits<It>::value_type x)
assert(x2 == x);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
struct do_nothing
{
void operator()(void*) const {}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
int main()
{
- A a;
- test(&a, A());
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- int i;
- std::unique_ptr<int, do_nothing> p(&i);
- test(&p, std::unique_ptr<int, do_nothing>(&i));
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ {
+ A a;
+ test(&a, A());
+ }
+#if TEST_STD_VER >= 11
+ {
+ int i;
+ std::unique_ptr<int, do_nothing> p(&i);
+ test(&p, std::unique_ptr<int, do_nothing>(&i));
+ }
+#endif
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::move_iterator<const char *> MI;
+ constexpr MI it1 = std::make_move_iterator(p);
+ constexpr MI it2 = std::make_move_iterator(p+1);
+ static_assert(*it1 == p[0], "");
+ static_assert(*it2 == p[1], "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op=/move_iterator.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op=/move_iterator.pass.cpp
index 449f7e809db4..30a95c36706c 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op=/move_iterator.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op=/move_iterator.pass.cpp
@@ -15,10 +15,13 @@
// requires HasAssign<Iter, const U&>
// move_iterator&
// operator=(const move_iterator<U>& u);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It, class U>
@@ -44,4 +47,14 @@ int main()
test<bidirectional_iterator<Base*> >(bidirectional_iterator<Derived*>(&d));
test<random_access_iterator<const Base*> >(random_access_iterator<Derived*>(&d));
test<Base*>(&d);
+#if TEST_STD_VER > 14
+ {
+ using BaseIter = std::move_iterator<const Base *>;
+ using DerivedIter = std::move_iterator<const Derived *>;
+ constexpr const Derived *p = nullptr;
+ constexpr DerivedIter it1 = std::make_move_iterator(p);
+ constexpr BaseIter it2 = (BaseIter{nullptr} = it1);
+ static_assert(it2.base() == p, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp
index 72a767d17114..855dbd7ba316 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp
@@ -11,10 +11,13 @@
// reverse_iterator
-// reverse_iterator();
+// constexpr reverse_iterator();
+//
+// constexpr in c++17
#include <iterator>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -30,4 +33,10 @@ int main()
test<random_access_iterator<char*> >();
test<char*>();
test<const char*>();
+
+#if TEST_STD_VER > 14
+ {
+ constexpr std::reverse_iterator<const char *> it;
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.pass.cpp
index ea213c0dcf0d..9bded7c5a429 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.pass.cpp
@@ -11,11 +11,14 @@
// reverse_iterator
-// explicit reverse_iterator(Iter x);
+// explicit constexpr reverse_iterator(Iter x);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -32,4 +35,12 @@ int main()
test(bidirectional_iterator<const char*>(s));
test(random_access_iterator<const char*>(s));
test(s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ constexpr std::reverse_iterator<const char *> it(p);
+ static_assert(it.base() == p);
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.pass.cpp
index 280e7d59ae86..2c15743db506 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.pass.cpp
@@ -13,11 +13,14 @@
// template <class U>
// requires HasConstructor<Iter, const U&>
-// reverse_iterator(const reverse_iterator<U> &u);
+// constexpr reverse_iterator(const reverse_iterator<U> &u);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It, class U>
@@ -39,4 +42,13 @@ int main()
test<bidirectional_iterator<Base*> >(bidirectional_iterator<Derived*>(&d));
test<random_access_iterator<const Base*> >(random_access_iterator<Derived*>(&d));
test<Base*>(&d);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const Derived *p = nullptr;
+ constexpr std::reverse_iterator<const Derived *> it1 = std::make_reverse_iterator(p);
+ constexpr std::reverse_iterator<const Base *> it2(it1);
+ static_assert(it2.base() == p);
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp
index 7ec287e5cd37..cd155988b11b 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp
@@ -12,12 +12,16 @@
// reverse_iterator
-// template <class Iterator> reverse_iterator<Iterator>
+// template <class Iterator>
+// constexpr reverse_iterator<Iterator>
// make_reverse_iterator(Iterator i);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -35,5 +39,13 @@ int main()
random_access_iterator<const char*>e(s+10);
while ( b != e )
test ( b++ );
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ constexpr auto it1 = std::make_reverse_iterator(p);
+ static_assert(it1.base() == p, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op!=/test.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op!=/test.pass.cpp
index 29da57e3b5af..f5162a7c5dc3 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op!=/test.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op!=/test.pass.cpp
@@ -13,12 +13,15 @@
// template <BidirectionalIterator Iter1, BidirectionalIterator Iter2>
// requires HasEqualTo<Iter1, Iter2>
-// bool
+// constexpr bool
// operator!=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -39,4 +42,16 @@ int main()
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1), true);
test(s, s, false);
test(s, s+1, true);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p);
+ constexpr RI it3 = std::make_reverse_iterator(p+1);
+ static_assert(!(it1 != it2), "");
+ static_assert( (it1 != it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/post.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/post.pass.cpp
index bd936060c4d4..6a2ab2797cab 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/post.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/post.pass.cpp
@@ -11,11 +11,14 @@
// reverse_iterator
-// reverse_iterator operator++(int);
+// constexpr reverse_iterator operator++(int);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,17 @@ int main()
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s));
test(s+1, s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p+1);
+ static_assert(it1 != it2, "");
+ constexpr RI it3 = std::make_reverse_iterator(p+1) ++;
+ static_assert(it1 != it3, "");
+ static_assert(it2 == it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/pre.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/pre.pass.cpp
index f68a612fae6b..510242244444 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/pre.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/pre.pass.cpp
@@ -11,11 +11,14 @@
// reverse_iterator
-// reverse_iterator& operator++();
+// constexpr reverse_iterator& operator++();
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,18 @@ int main()
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s));
test(s+1, s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p+1);
+ static_assert(it1 != it2, "");
+ constexpr RI it3 = ++ std::make_reverse_iterator(p+1);
+ static_assert(it1 == it3, "");
+ static_assert(it2 != it3, "");
+ static_assert(*(++std::make_reverse_iterator(p+2)) == '1', "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+/difference_type.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+/difference_type.pass.cpp
index 39129d6b64d8..0c9682f45c1c 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+/difference_type.pass.cpp
@@ -12,11 +12,14 @@
// reverse_iterator
// requires RandomAccessIterator<Iter>
-// reverse_iterator operator+(difference_type n) const;
+// constexpr reverse_iterator operator+(difference_type n) const;
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -33,4 +36,17 @@ int main()
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
test(s+5, 5, s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p + 5);
+ constexpr RI it3 = it2 + 5;
+ static_assert(it1 != it2, "");
+ static_assert(it1 == it3, "");
+ static_assert(it2 != it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+=/difference_type.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+=/difference_type.pass.cpp
index ac97aaf8c203..67ad1ae888ec 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+=/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+=/difference_type.pass.cpp
@@ -12,11 +12,14 @@
// reverse_iterator
// requires RandomAccessIterator<Iter>
-// reverse_iterator& operator+=(difference_type n);
+// constexpr reverse_iterator& operator+=(difference_type n);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,13 @@ int main()
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
test(s+5, 5, s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ constexpr auto it1 = std::make_reverse_iterator(p);
+ constexpr auto it2 = std::make_reverse_iterator(p+5) += 5;
+ static_assert(it1 == it2, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/post.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/post.pass.cpp
index c3126e8c21ff..5a06ea5ad14f 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/post.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/post.pass.cpp
@@ -11,11 +11,14 @@
// reverse_iterator
-// reverse_iterator operator--(int);
+// constexpr reverse_iterator operator--(int);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,17 @@ int main()
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s+2));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s+2));
test(s+1, s+2);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p+1);
+ static_assert(it1 != it2, "");
+ constexpr RI it3 = std::make_reverse_iterator(p) --;
+ static_assert(it1 == it3, "");
+ static_assert(it2 != it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/pre.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/pre.pass.cpp
index f9361cf9c72c..3265624765e0 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/pre.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/pre.pass.cpp
@@ -11,11 +11,14 @@
// reverse_iterator
-// reverse_iterator& operator--();
+// constexpr reverse_iterator& operator--();
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,18 @@ int main()
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s+2));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s+2));
test(s+1, s+2);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p+1);
+ static_assert(it1 != it2, "");
+ constexpr RI it3 = -- std::make_reverse_iterator(p);
+ static_assert(it1 != it3, "");
+ static_assert(it2 == it3, "");
+ static_assert(*(--std::make_reverse_iterator(p)) == '1', "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-/difference_type.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-/difference_type.pass.cpp
index 79d477976fb7..9148cc117ca0 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-/difference_type.pass.cpp
@@ -12,11 +12,14 @@
// reverse_iterator
// requires RandomAccessIterator<Iter>
-// reverse_iterator operator-(difference_type n) const;
+// constexpr reverse_iterator operator-(difference_type n) const;
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -33,4 +36,17 @@ int main()
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10));
test(s+5, 5, s+10);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p + 5);
+ constexpr RI it3 = it1 - 5;
+ static_assert(it1 != it2, "");
+ static_assert(it1 != it3, "");
+ static_assert(it2 == it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-=/difference_type.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-=/difference_type.pass.cpp
index 93addf99dc61..3bed189dc6ab 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-=/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-=/difference_type.pass.cpp
@@ -12,11 +12,14 @@
// reverse_iterator
// requires RandomAccessIterator<Iter>
-// reverse_iterator& operator-=(difference_type n);
+// constexpr reverse_iterator& operator-=(difference_type n);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,13 @@ int main()
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10));
test(s+5, 5, s+10);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ constexpr auto it1 = std::make_reverse_iterator(p+5);
+ constexpr auto it2 = std::make_reverse_iterator(p) -= 5;
+ static_assert(it1 == it2, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op.star/op_star.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op.star/op_star.pass.cpp
index 7a7759843eea..4e727564ab72 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op.star/op_star.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op.star/op_star.pass.cpp
@@ -11,7 +11,9 @@
// reverse_iterator
-// reference operator*() const;
+// constexpr reference operator*() const;
+//
+// constexpr in c++17
// Be sure to respect LWG 198:
// http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#198
@@ -21,6 +23,8 @@
#include <iterator>
#include <cassert>
+#include "test_macros.h"
+
class A
{
int data_;
@@ -44,4 +48,15 @@ int main()
{
A a;
test(&a+1, A());
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p+1);
+ constexpr RI it2 = std::make_reverse_iterator(p+2);
+ static_assert(*it1 == p[0], "");
+ static_assert(*it2 == p[1], "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.pass.cpp
index 92573f9a9242..78f6fc4cb26a 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.pass.cpp
@@ -13,12 +13,15 @@
// template <class U>
// requires HasAssign<Iter, const U&>
-// reverse_iterator&
+// constexpr reverse_iterator&
// operator=(const reverse_iterator<U>& u);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It, class U>
@@ -42,4 +45,15 @@ int main()
test<bidirectional_iterator<Base*> >(bidirectional_iterator<Derived*>(&d));
test<random_access_iterator<const Base*> >(random_access_iterator<Derived*>(&d));
test<Base*>(&d);
+
+#if TEST_STD_VER > 14
+ {
+ using BaseIter = std::reverse_iterator<const Base *>;
+ using DerivedIter = std::reverse_iterator<const Derived *>;
+ constexpr const Derived *p = nullptr;
+ constexpr DerivedIter it1 = std::make_reverse_iterator(p);
+ constexpr BaseIter it2 = (BaseIter{nullptr} = it1);
+ static_assert(it2.base() == p, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op==/test.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op==/test.pass.cpp
index 3da4b951df1e..70c9e198519c 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op==/test.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op==/test.pass.cpp
@@ -13,12 +13,15 @@
// template <BidirectionalIterator Iter1, BidirectionalIterator Iter2>
// requires HasEqualTo<Iter1, Iter2>
-// bool
+// constexpr bool
// operator==(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -39,4 +42,17 @@ int main()
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1), false);
test(s, s, true);
test(s, s+1, false);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p);
+ constexpr RI it3 = std::make_reverse_iterator(p+1);
+ static_assert( (it1 == it2), "");
+ static_assert(!(it1 == it3), "");
+ }
+#endif
+
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opdiff/test.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opdiff/test.pass.cpp
index 437bb6f9f7ef..73e49027b0f5 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opdiff/test.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opdiff/test.pass.cpp
@@ -13,13 +13,16 @@
// template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
// requires HasMinus<Iter2, Iter1>
-// auto operator-(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y)
+// constexpr auto operator-(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y)
// -> decltype(y.base() - x.base());
+//
+// constexpr in c++17
#include <iterator>
#include <cstddef>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It1, class It2>
@@ -40,4 +43,15 @@ int main()
test(s, s, 0);
test(s, s+1, 1);
test(s+1, s, -1);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p+1);
+ static_assert( it1 - it2 == 1, "");
+ static_assert( it2 - it1 == -1, "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt/test.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt/test.pass.cpp
index afbb334ebfd5..b6adcf40ede4 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt/test.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt/test.pass.cpp
@@ -13,12 +13,15 @@
// template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
// requires HasGreater<Iter1, Iter2>
-// bool
+// constexpr bool
// operator>(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -39,4 +42,16 @@ int main()
test(s, s, false);
test(s, s+1, true);
test(s+1, s, false);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p);
+ constexpr RI it3 = std::make_reverse_iterator(p+1);
+ static_assert(!(it1 > it2), "");
+ static_assert( (it1 > it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt=/test.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt=/test.pass.cpp
index c6e79aff126f..dc917b29f907 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt=/test.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt=/test.pass.cpp
@@ -13,12 +13,15 @@
// template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
// requires HasGreater<Iter1, Iter2>
-// bool
+// constexpr bool
// operator>=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -39,4 +42,16 @@ int main()
test(s, s, true);
test(s, s+1, true);
test(s+1, s, false);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p);
+ constexpr RI it3 = std::make_reverse_iterator(p+1);
+ static_assert( (it1 >= it2), "");
+ static_assert( (it1 >= it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opindex/difference_type.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opindex/difference_type.pass.cpp
index 16f4a072855a..4596d6f38b66 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opindex/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opindex/difference_type.pass.cpp
@@ -17,6 +17,7 @@
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -35,4 +36,14 @@ int main()
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 4, '1');
test(s+5, 4, '1');
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p + 5);
+ static_assert(it1[0] == '5', "");
+ static_assert(it1[4] == '1', "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt/test.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt/test.pass.cpp
index 2b389b853a5a..668f7d839754 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt/test.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt/test.pass.cpp
@@ -13,12 +13,15 @@
// template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
// requires HasGreater<Iter1, Iter2>
-// bool
+// constexpr bool
// operator<(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -39,4 +42,16 @@ int main()
test(s, s, false);
test(s, s+1, false);
test(s+1, s, true);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p);
+ constexpr RI it3 = std::make_reverse_iterator(p+1);
+ static_assert(!(it1 < it2), "");
+ static_assert(!(it1 < it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt=/test.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt=/test.pass.cpp
index 6c4f05cdf656..5201bc43db2c 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt=/test.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt=/test.pass.cpp
@@ -13,12 +13,15 @@
// template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
// requires HasGreater<Iter1, Iter2>
-// bool
+// constexpr bool
// operator<=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
+//
+// constexpr in c++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -39,4 +42,16 @@ int main()
test(s, s, true);
test(s, s+1, false);
test(s+1, s, true);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p);
+ constexpr RI it3 = std::make_reverse_iterator(p+1);
+ static_assert( (it1 <= it2), "");
+ static_assert(!(it1 <= it3), "");
+ }
+#endif
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opref/op_arrow.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opref/op_arrow.pass.cpp
index 404e8fbf19bf..7b829ff6a5ab 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opref/op_arrow.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opref/op_arrow.pass.cpp
@@ -11,7 +11,9 @@
// reverse_iterator
-// pointer operator->() const;
+// constexpr pointer operator->() const;
+//
+// constexpr in C++17
// Be sure to respect LWG 198:
// http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#198
@@ -23,6 +25,8 @@
#include <list>
#include <cassert>
+#include "test_macros.h"
+
class A
{
int data_;
@@ -59,6 +63,20 @@ public:
B *operator&() { return nullptr; }
};
+class C
+{
+ int data_;
+public:
+ TEST_CONSTEXPR C() : data_(1) {}
+
+ TEST_CONSTEXPR int get() const {return data_;}
+
+ friend TEST_CONSTEXPR bool operator==(const C& x, const C& y)
+ {return x.data_ == y.data_;}
+};
+
+TEST_CONSTEXPR C gC;
+
int main()
{
A a;
@@ -86,4 +104,16 @@ int main()
assert ( ri == l.rend ());
}
}
+
+#if TEST_STD_VER > 14
+ {
+ typedef std::reverse_iterator<const C *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(&gC+1);
+
+ static_assert(it1->get() == gC.get(), "");
+ }
+#endif
+ {
+ ((void)gC);
+ }
}
diff --git a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opsum/difference_type.pass.cpp b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opsum/difference_type.pass.cpp
index 74747cb1f0f7..00f739d09a52 100644
--- a/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opsum/difference_type.pass.cpp
+++ b/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opsum/difference_type.pass.cpp
@@ -12,12 +12,15 @@
// reverse_iterator
// template <RandomAccessIterator Iterator>
-// reverse_iterator<Iter>
+// constexpr reverse_iterator<Iter>
// operator+(Iter::difference_type n, const reverse_iterator<Iter>& x);
+//
+// constexpr in C++17
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class It>
@@ -34,4 +37,17 @@ int main()
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
test(s+5, 5, s);
+
+#if TEST_STD_VER > 14
+ {
+ constexpr const char *p = "123456789";
+ typedef std::reverse_iterator<const char *> RI;
+ constexpr RI it1 = std::make_reverse_iterator(p);
+ constexpr RI it2 = std::make_reverse_iterator(p + 5);
+ constexpr RI it3 = 5 + it2;
+ static_assert(it1 != it2, "");
+ static_assert(it1 == it3, "");
+ static_assert(it2 != it3, "");
+ }
+#endif
}
diff --git a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/copy.pass.cpp b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/copy.pass.cpp
index 0d70c7fc9ed3..7f807b63e3ce 100644
--- a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/copy.pass.cpp
+++ b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/copy.pass.cpp
@@ -12,11 +12,15 @@
// class istream_iterator
// istream_iterator(const istream_iterator& x);
+// C++17 says: If is_trivially_copy_constructible_v<T> is true, then
+// this constructor shall beis a trivial copy constructor.
#include <iterator>
#include <sstream>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
diff --git a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp
index c1924e4b9272..32dc62817bc4 100644
--- a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp
+++ b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp
@@ -7,17 +7,41 @@
//
//===----------------------------------------------------------------------===//
+// Usage of is_trivially_constructible is broken with these compilers.
+// See https://llvm.org/bugs/show_bug.cgi?id=31016
+// XFAIL: clang-3.7, apple-clang-7, apple-clang-7.0
+
// <iterator>
// class istream_iterator
// constexpr istream_iterator();
+// C++17 says: If is_trivially_default_constructible_v<T> is true, then this
+// constructor shall beis a constexpr constructor.
#include <iterator>
#include <cassert>
+#include <string>
#include "test_macros.h"
+struct S { S(); }; // not constexpr
+
+#if TEST_STD_VER > 14
+template <typename T, bool isTrivial = std::is_trivially_default_constructible_v<T>>
+struct test_trivial {
+void operator ()() const {
+ constexpr std::istream_iterator<T> it;
+ }
+};
+
+template <typename T>
+struct test_trivial<T, false> {
+void operator ()() const {}
+};
+#endif
+
+
int main()
{
{
@@ -29,4 +53,11 @@ int main()
#endif
}
+#if TEST_STD_VER > 14
+ test_trivial<int>()();
+ test_trivial<char>()();
+ test_trivial<double>()();
+ test_trivial<S>()();
+ test_trivial<std::string>()();
+#endif
}
diff --git a/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp b/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
index 1250e364d35e..b1bf75b11958 100644
--- a/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
+++ b/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
@@ -23,9 +23,18 @@
// typedef basic_istream<charT,traits> istream_type;
// ...
//
+// Before C++17, we have:
// If T is a literal type, then the default constructor shall be a constexpr constructor.
// If T is a literal type, then this constructor shall be a trivial copy constructor.
// If T is a literal type, then this destructor shall be a trivial destructor.
+// C++17 says:
+// If is_trivially_default_constructible_v<T> is true, then
+// this constructor (the default ctor) shall beis a constexpr constructor.
+// If is_trivially_copy_constructible_v<T> is true, then
+// this constructor (the copy ctor) shall beis a trivial copy constructor.
+// If is_trivially_destructible_v<T> is true, then this
+// destructor shall beis a trivial destructor.
+// Testing the C++17 ctors for this are in the ctor tests.
#include <iterator>
#include <type_traits>
@@ -33,7 +42,7 @@
int main()
{
- typedef std::istream_iterator<double> I1;
+ typedef std::istream_iterator<double> I1; // double is trivially destructible
static_assert((std::is_convertible<I1,
std::iterator<std::input_iterator_tag, double, std::ptrdiff_t,
const double*, const double&> >::value), "");
@@ -43,7 +52,7 @@ int main()
static_assert( std::is_trivially_copy_constructible<I1>::value, "");
static_assert( std::is_trivially_destructible<I1>::value, "");
- typedef std::istream_iterator<unsigned, wchar_t> I2;
+ typedef std::istream_iterator<unsigned, wchar_t> I2; // unsigned is trivially destructible
static_assert((std::is_convertible<I2,
std::iterator<std::input_iterator_tag, unsigned, std::ptrdiff_t,
const unsigned*, const unsigned&> >::value), "");
@@ -53,7 +62,7 @@ int main()
static_assert( std::is_trivially_copy_constructible<I2>::value, "");
static_assert( std::is_trivially_destructible<I2>::value, "");
- typedef std::istream_iterator<std::string> I3;
+ typedef std::istream_iterator<std::string> I3; // string is NOT trivially destructible
static_assert(!std::is_trivially_copy_constructible<I3>::value, "");
static_assert(!std::is_trivially_destructible<I3>::value, "");
}
diff --git a/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp b/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp
index 2005d303fb3b..0137664312de 100644
--- a/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp
+++ b/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp
@@ -26,26 +26,37 @@ int main()
std::istreambuf_iterator<char> i2(inf2);
std::istreambuf_iterator<char> i3;
std::istreambuf_iterator<char> i4;
+ std::istreambuf_iterator<char> i5(nullptr);
assert( i1.equal(i1));
assert( i1.equal(i2));
assert(!i1.equal(i3));
assert(!i1.equal(i4));
+ assert(!i1.equal(i5));
assert( i2.equal(i1));
assert( i2.equal(i2));
assert(!i2.equal(i3));
assert(!i2.equal(i4));
+ assert(!i2.equal(i5));
assert(!i3.equal(i1));
assert(!i3.equal(i2));
assert( i3.equal(i3));
assert( i3.equal(i4));
+ assert( i3.equal(i5));
assert(!i4.equal(i1));
assert(!i4.equal(i2));
assert( i4.equal(i3));
assert( i4.equal(i4));
+ assert( i4.equal(i5));
+
+ assert(!i5.equal(i1));
+ assert(!i5.equal(i2));
+ assert( i5.equal(i3));
+ assert( i5.equal(i4));
+ assert( i5.equal(i5));
}
{
std::wistringstream inf1(L"abc");
@@ -54,25 +65,36 @@ int main()
std::istreambuf_iterator<wchar_t> i2(inf2);
std::istreambuf_iterator<wchar_t> i3;
std::istreambuf_iterator<wchar_t> i4;
+ std::istreambuf_iterator<wchar_t> i5(nullptr);
assert( i1.equal(i1));
assert( i1.equal(i2));
assert(!i1.equal(i3));
assert(!i1.equal(i4));
+ assert(!i1.equal(i5));
assert( i2.equal(i1));
assert( i2.equal(i2));
assert(!i2.equal(i3));
assert(!i2.equal(i4));
+ assert(!i2.equal(i5));
assert(!i3.equal(i1));
assert(!i3.equal(i2));
assert( i3.equal(i3));
assert( i3.equal(i4));
+ assert( i3.equal(i5));
assert(!i4.equal(i1));
assert(!i4.equal(i2));
assert( i4.equal(i3));
assert( i4.equal(i4));
+ assert( i4.equal(i5));
+
+ assert(!i5.equal(i1));
+ assert(!i5.equal(i2));
+ assert( i5.equal(i3));
+ assert( i5.equal(i4));
+ assert( i5.equal(i5));
}
}
diff --git a/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp b/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp
index 5e8536423d8b..81e5f3439fe6 100644
--- a/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp
+++ b/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp
@@ -28,26 +28,37 @@ int main()
std::istreambuf_iterator<char> i2(inf2);
std::istreambuf_iterator<char> i3;
std::istreambuf_iterator<char> i4;
+ std::istreambuf_iterator<char> i5(nullptr);
assert(!(i1 != i1));
assert(!(i1 != i2));
assert( (i1 != i3));
assert( (i1 != i4));
+ assert( (i1 != i5));
assert(!(i2 != i1));
assert(!(i2 != i2));
assert( (i2 != i3));
assert( (i2 != i4));
+ assert( (i2 != i5));
assert( (i3 != i1));
assert( (i3 != i2));
assert(!(i3 != i3));
assert(!(i3 != i4));
+ assert(!(i3 != i5));
assert( (i4 != i1));
assert( (i4 != i2));
assert(!(i4 != i3));
assert(!(i4 != i4));
+ assert(!(i4 != i5));
+
+ assert( (i5 != i1));
+ assert( (i5 != i2));
+ assert(!(i5 != i3));
+ assert(!(i5 != i4));
+ assert(!(i5 != i5));
}
{
std::wistringstream inf1(L"abc");
@@ -56,25 +67,36 @@ int main()
std::istreambuf_iterator<wchar_t> i2(inf2);
std::istreambuf_iterator<wchar_t> i3;
std::istreambuf_iterator<wchar_t> i4;
+ std::istreambuf_iterator<wchar_t> i5(nullptr);
assert(!(i1 != i1));
assert(!(i1 != i2));
assert( (i1 != i3));
assert( (i1 != i4));
+ assert( (i1 != i5));
assert(!(i2 != i1));
assert(!(i2 != i2));
assert( (i2 != i3));
assert( (i2 != i4));
+ assert( (i2 != i5));
assert( (i3 != i1));
assert( (i3 != i2));
assert(!(i3 != i3));
assert(!(i3 != i4));
+ assert(!(i3 != i5));
assert( (i4 != i1));
assert( (i4 != i2));
assert(!(i4 != i3));
assert(!(i4 != i4));
+ assert(!(i4 != i5));
+
+ assert( (i5 != i1));
+ assert( (i5 != i2));
+ assert(!(i5 != i3));
+ assert(!(i5 != i4));
+ assert(!(i5 != i5));
}
}
diff --git a/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp b/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp
index 919576920ef5..65a78cb104a8 100644
--- a/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp
+++ b/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp
@@ -28,26 +28,37 @@ int main()
std::istreambuf_iterator<char> i2(inf2);
std::istreambuf_iterator<char> i3;
std::istreambuf_iterator<char> i4;
+ std::istreambuf_iterator<char> i5(nullptr);
assert( (i1 == i1));
assert( (i1 == i2));
assert(!(i1 == i3));
assert(!(i1 == i4));
+ assert(!(i1 == i5));
assert( (i2 == i1));
assert( (i2 == i2));
assert(!(i2 == i3));
assert(!(i2 == i4));
+ assert(!(i2 == i5));
assert(!(i3 == i1));
assert(!(i3 == i2));
assert( (i3 == i3));
assert( (i3 == i4));
+ assert( (i3 == i5));
assert(!(i4 == i1));
assert(!(i4 == i2));
assert( (i4 == i3));
assert( (i4 == i4));
+ assert( (i4 == i5));
+
+ assert(!(i5 == i1));
+ assert(!(i5 == i2));
+ assert( (i5 == i3));
+ assert( (i5 == i4));
+ assert( (i5 == i5));
}
{
std::wistringstream inf1(L"abc");
@@ -56,25 +67,36 @@ int main()
std::istreambuf_iterator<wchar_t> i2(inf2);
std::istreambuf_iterator<wchar_t> i3;
std::istreambuf_iterator<wchar_t> i4;
+ std::istreambuf_iterator<wchar_t> i5(nullptr);
assert( (i1 == i1));
assert( (i1 == i2));
assert(!(i1 == i3));
assert(!(i1 == i4));
+ assert(!(i1 == i5));
assert( (i2 == i1));
assert( (i2 == i2));
assert(!(i2 == i3));
assert(!(i2 == i4));
+ assert(!(i2 == i5));
assert(!(i3 == i1));
assert(!(i3 == i2));
assert( (i3 == i3));
assert( (i3 == i4));
+ assert( (i3 == i5));
assert(!(i4 == i1));
assert(!(i4 == i2));
assert( (i4 == i3));
assert( (i4 == i4));
+ assert( (i4 == i5));
+
+ assert(!(i5 == i1));
+ assert(!(i5 == i2));
+ assert( (i5 == i3));
+ assert( (i5 == i4));
+ assert( (i5 == i5));
}
}
diff --git a/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/copy.pass.cpp b/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/copy.pass.cpp
index 88624581df9a..c1f3e55759a0 100644
--- a/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/copy.pass.cpp
+++ b/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/copy.pass.cpp
@@ -23,4 +23,5 @@ int main()
std::ostream_iterator<int> i(outf);
std::ostream_iterator<int> j = i;
assert(outf.good());
+ ((void)j);
}
diff --git a/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp b/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
index 932ef25b784c..0baefb5ee766 100644
--- a/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
+++ b/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
@@ -21,6 +21,10 @@
#pragma clang diagnostic ignored "-Wliteral-conversion"
#endif
+#ifdef _MSC_VER
+#pragma warning(disable: 4244) // conversion from 'X' to 'Y', possible loss of data
+#endif
+
int main()
{
{
diff --git a/test/std/language.support/support.dynamic/align_val_t.pass.cpp b/test/std/language.support/support.dynamic/align_val_t.pass.cpp
new file mode 100644
index 000000000000..0a19de919f7f
--- /dev/null
+++ b/test/std/language.support/support.dynamic/align_val_t.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// enum class align_val_t : size_t {}
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+#include <new>
+
+#include "test_macros.h"
+
+int main() {
+ {
+ static_assert(std::is_enum<std::align_val_t>::value, "");
+ static_assert(std::is_same<std::underlying_type<std::align_val_t>::type, std::size_t>::value, "");
+ static_assert(!std::is_constructible<std::align_val_t, std::size_t>::value, "");
+ static_assert(!std::is_constructible<std::size_t, std::align_val_t>::value, "");
+ }
+ {
+ constexpr auto a = std::align_val_t(0);
+ constexpr auto b = std::align_val_t(32);
+ constexpr auto c = std::align_val_t(-1);
+ static_assert(a != b, "");
+ static_assert(a == std::align_val_t(0), "");
+ static_assert(b == std::align_val_t(32), "");
+ static_assert(static_cast<std::size_t>(c) == (std::size_t)-1, "");
+ }
+} \ No newline at end of file
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
new file mode 100644
index 000000000000..c88e5b06e675
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
@@ -0,0 +1,89 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// test aligned operator delete replacement.
+
+// UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11, c++14
+
+// Older Clang versions do not support this
+// XFAIL: clang-3, apple-clang
+
+// None of the current GCC compilers support this.
+// XFAIL: gcc
+
+#include <new>
+#include <cstddef>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+
+constexpr auto OverAligned = alignof(std::max_align_t) * 2;
+
+int unsized_delete_called = 0;
+int unsized_delete_nothrow_called = 0;
+int aligned_delete_called = 0;
+
+void reset() {
+ unsized_delete_called = 0;
+ unsized_delete_nothrow_called = 0;
+ aligned_delete_called = 0;
+}
+
+void operator delete(void* p) TEST_NOEXCEPT
+{
+ ++unsized_delete_called;
+ std::free(p);
+}
+
+void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT
+{
+ ++unsized_delete_nothrow_called;
+ std::free(p);
+}
+
+void operator delete [] (void* p, std::align_val_t) TEST_NOEXCEPT
+{
+ ++aligned_delete_called;
+ std::free(p);
+}
+
+struct alignas(OverAligned) A {};
+struct alignas(std::max_align_t) B {};
+
+B* volatile b; // Escape the memory
+A* volatile a;
+
+int main()
+{
+ reset();
+ {
+ b = new B[2];
+ assert(0 == unsized_delete_called);
+ assert(0 == unsized_delete_nothrow_called);
+ assert(0 == aligned_delete_called);
+
+ delete [] b;
+ assert(1 == unsized_delete_called);
+ assert(0 == unsized_delete_nothrow_called);
+ assert(0 == aligned_delete_called);
+ }
+ reset();
+ {
+ a = new A[2];
+ assert(0 == unsized_delete_called);
+ assert(0 == unsized_delete_nothrow_called);
+ assert(0 == aligned_delete_called);
+
+ delete [] a;
+ assert(0 == unsized_delete_called);
+ assert(0 == unsized_delete_nothrow_called);
+ assert(1 == aligned_delete_called);
+ }
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
new file mode 100644
index 000000000000..55c26fa5c4a7
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// asan and msan will not call the new handler.
+// UNSUPPORTED: sanitizer-new-delete
+
+// FIXME change this to XFAIL.
+// UNSUPPORTED: no-aligned-allocation
+
+// test operator new
+
+#include <new>
+#include <cstddef>
+#include <cassert>
+#include <cstdint>
+#include <limits>
+
+#include "test_macros.h"
+
+constexpr auto OverAligned = alignof(std::max_align_t) * 2;
+
+int new_handler_called = 0;
+
+void new_handler()
+{
+ ++new_handler_called;
+ std::set_new_handler(0);
+}
+
+int A_constructed = 0;
+
+struct alignas(OverAligned) A
+{
+ A() { ++A_constructed;}
+ ~A() { --A_constructed;}
+};
+
+void test_throw_max_size() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ std::set_new_handler(new_handler);
+ try
+ {
+ void* vp = operator new[] (std::numeric_limits<std::size_t>::max(),
+ static_cast<std::align_val_t>(32));
+ ((void)vp);
+ assert(false);
+ }
+ catch (std::bad_alloc&)
+ {
+ assert(new_handler_called == 1);
+ }
+ catch (...)
+ {
+ assert(false);
+ }
+#endif
+}
+
+int main()
+{
+ {
+ A* ap = new A[2];
+ assert(ap);
+ assert(reinterpret_cast<std::uintptr_t>(ap) % OverAligned == 0);
+ assert(A_constructed == 2);
+ delete [] ap;
+ assert(A_constructed == 0);
+ }
+ {
+ test_throw_max_size();
+ }
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
new file mode 100644
index 000000000000..28da3093f398
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
@@ -0,0 +1,82 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// asan and msan will not call the new handler.
+// UNSUPPORTED: sanitizer-new-delete
+
+// FIXME turn this into an XFAIL
+// UNSUPPORTED: no-aligned-allocation
+
+// test operator new (nothrow)
+
+#include <new>
+#include <cstddef>
+#include <cstdint>
+#include <cassert>
+#include <limits>
+
+#include "test_macros.h"
+
+constexpr auto OverAligned = alignof(std::max_align_t) * 2;
+
+int new_handler_called = 0;
+
+void new_handler()
+{
+ ++new_handler_called;
+ std::set_new_handler(0);
+}
+
+int A_constructed = 0;
+
+struct alignas(OverAligned) A
+{
+ A() { ++A_constructed; }
+ ~A() { --A_constructed; }
+};
+
+void test_max_alloc() {
+ std::set_new_handler(new_handler);
+ auto do_test = []() {
+ void* vp = operator new [](std::numeric_limits<std::size_t>::max(),
+ std::align_val_t(OverAligned),
+ std::nothrow);
+ assert(new_handler_called == 1);
+ assert(vp == 0);
+ };
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try
+ {
+ do_test();
+ }
+ catch (...)
+ {
+ assert(false);
+ }
+#else
+ do_test();
+#endif
+}
+
+int main()
+{
+ {
+ A* ap = new(std::nothrow) A[3];
+ assert(ap);
+ assert(reinterpret_cast<std::uintptr_t>(ap) % OverAligned == 0);
+ assert(A_constructed == 3);
+ delete [] ap;
+ assert(!A_constructed);
+ }
+ {
+ test_max_alloc();
+ }
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp
new file mode 100644
index 000000000000..03e490e8ed85
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: sanitizer-new-delete
+
+// XFAIL: no-aligned-allocation
+
+// test operator new nothrow by replacing only operator new
+
+#include <new>
+#include <cstddef>
+#include <cstdlib>
+#include <cassert>
+#include <limits>
+
+#include "test_macros.h"
+
+constexpr auto OverAligned = alignof(std::max_align_t) * 2;
+
+int A_constructed = 0;
+
+struct alignas(OverAligned) A
+{
+ A() {++A_constructed;}
+ ~A() {--A_constructed;}
+};
+
+int B_constructed = 0;
+
+struct B {
+ std::max_align_t member;
+ B() { ++B_constructed; }
+ ~B() { --B_constructed; }
+};
+
+int new_called = 0;
+alignas(OverAligned) char Buff[OverAligned * 3];
+
+void* operator new[](std::size_t s, std::align_val_t a) TEST_THROW_SPEC(std::bad_alloc)
+{
+ assert(!new_called);
+ assert(s <= sizeof(Buff));
+ assert(static_cast<std::size_t>(a) == OverAligned);
+ ++new_called;
+ return Buff;
+}
+
+void operator delete[](void* p, std::align_val_t a) TEST_NOEXCEPT
+{
+ assert(p == Buff);
+ assert(static_cast<std::size_t>(a) == OverAligned);
+ assert(new_called);
+ --new_called;
+}
+
+int main()
+{
+ {
+ A* ap = new (std::nothrow) A[2];
+ assert(ap);
+ assert(A_constructed == 2);
+ assert(new_called);
+ delete [] ap;
+ assert(A_constructed == 0);
+ assert(!new_called);
+ }
+ {
+ B* bp = new (std::nothrow) B[2];
+ assert(bp);
+ assert(B_constructed == 2);
+ assert(!new_called);
+ delete [] bp;
+ assert(!new_called);
+ assert(!B_constructed);
+ }
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp
new file mode 100644
index 000000000000..131deb340d2f
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp
@@ -0,0 +1,85 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: sanitizer-new-delete
+
+// XFAIL: no-aligned-allocation
+
+// test operator new replacement
+
+#include <new>
+#include <cstddef>
+#include <cstdlib>
+#include <cstdint>
+#include <cassert>
+#include <limits>
+
+#include "test_macros.h"
+
+constexpr auto OverAligned = alignof(std::max_align_t) * 2;
+
+int A_constructed = 0;
+
+struct alignas(OverAligned) A {
+ A() { ++A_constructed;}
+ ~A() { --A_constructed;}
+};
+
+
+int B_constructed = 0;
+
+struct alignas(std::max_align_t) B
+{
+ std::max_align_t member;
+ B() { ++B_constructed;}
+ ~B() { --B_constructed;}
+};
+
+int new_called = 0;
+
+alignas(OverAligned) char DummyData[OverAligned * 4];
+
+void* operator new[](std::size_t s, std::align_val_t a) TEST_THROW_SPEC(std::bad_alloc)
+{
+ assert(new_called == 0); // We already allocated
+ assert(s <= sizeof(DummyData));
+ assert(static_cast<std::size_t>(a) == OverAligned);
+ ++new_called;
+ return DummyData;
+}
+
+void operator delete[](void* p, std::align_val_t) TEST_NOEXCEPT
+{
+ assert(new_called == 1);
+ --new_called;
+ assert(p == DummyData);
+}
+
+
+int main()
+{
+ {
+ A* ap = new A[3];
+ assert(ap);
+ assert(A_constructed == 3);
+ assert(new_called);
+ delete [] ap;
+ assert(!A_constructed);
+ assert(!new_called);
+ }
+ {
+ B* bp = new B[3];
+ assert(bp);
+ assert(B_constructed == 3);
+ assert(!new_called);
+ delete [] bp;
+ assert(!new_called);
+ }
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp
index 55a3200a13b7..dd4ff46bceb9 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// test operator new[]
// NOTE: asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete
@@ -18,6 +17,8 @@
#include <cassert>
#include <limits>
+#include "test_macros.h"
+
int new_handler_called = 0;
void new_handler()
@@ -36,6 +37,7 @@ struct A
int main()
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
std::set_new_handler(new_handler);
try
{
@@ -51,6 +53,7 @@ int main()
{
assert(false);
}
+#endif
A* ap = new A[3];
assert(ap);
assert(A_constructed == 3);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp
index 9531b1c37480..2f51b1990436 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// test operator new [] (nothrow)
// NOTE: asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete
@@ -18,6 +17,8 @@
#include <cassert>
#include <limits>
+#include "test_macros.h"
+
int new_handler_called = 0;
void new_handler()
@@ -37,16 +38,20 @@ struct A
int main()
{
std::set_new_handler(new_handler);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
void*volatile vp = operator new [] (std::numeric_limits<std::size_t>::max(), std::nothrow);
assert(new_handler_called == 1);
assert(vp == 0);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (...)
{
assert(false);
}
+#endif
A* ap = new(std::nothrow) A[3];
assert(ap);
assert(A_constructed == 3);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp
index 5887bb0bdf30..53e26c99f92e 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp
@@ -11,19 +11,17 @@
// UNSUPPORTED: sanitizer-new-delete
-// TODO Investigate why UBSAN prevents new from calling our replacement.
-// XFAIL: ubsan
-
-
#include <new>
#include <cstddef>
#include <cstdlib>
#include <cassert>
#include <limits>
+#include "test_macros.h"
+
int new_called = 0;
-void* operator new(std::size_t s) throw(std::bad_alloc)
+void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
++new_called;
void* ret = std::malloc(s);
@@ -31,7 +29,7 @@ void* operator new(std::size_t s) throw(std::bad_alloc)
return ret;
}
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
--new_called;
std::free(p);
@@ -45,9 +43,11 @@ struct A
~A() {--A_constructed;}
};
+A* volatile ap;
+
int main()
{
- A* ap = new (std::nothrow) A[3];
+ ap = new (std::nothrow) A[3];
assert(ap);
assert(A_constructed == 3);
assert(new_called);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp
index 1e78ea8fe267..b0820b14f410 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp
@@ -11,9 +11,6 @@
// UNSUPPORTED: sanitizer-new-delete
-// TODO Investigate why UBSAN prevents new from calling our replacement.
-// XFAIL: ubsan
-
#include <new>
#include <cstddef>
@@ -21,9 +18,11 @@
#include <cassert>
#include <limits>
+#include "test_macros.h"
+
volatile int new_called = 0;
-void* operator new(std::size_t s) throw(std::bad_alloc)
+void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
++new_called;
void* ret = std::malloc(s);
@@ -31,7 +30,7 @@ void* operator new(std::size_t s) throw(std::bad_alloc)
return ret;
}
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
--new_called;
std::free(p);
@@ -45,9 +44,11 @@ struct A
~A() {--A_constructed;}
};
+A* volatile ap;
+
int main()
{
- A* ap = new A[3];
+ ap = new A[3];
assert(ap);
assert(A_constructed == 3);
assert(new_called == 1);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp
index 0f7840ca9ef8..3e41b24d292f 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp
@@ -20,23 +20,25 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
int unsized_delete_called = 0;
int unsized_delete_nothrow_called = 0;
int sized_delete_called = 0;
-void operator delete[](void* p) throw()
+void operator delete[](void* p) TEST_NOEXCEPT
{
++unsized_delete_called;
std::free(p);
}
-void operator delete[](void* p, const std::nothrow_t&) throw()
+void operator delete[](void* p, const std::nothrow_t&) TEST_NOEXCEPT
{
++unsized_delete_nothrow_called;
std::free(p);
}
-void operator delete[](void* p, std::size_t) throw()
+void operator delete[](void* p, std::size_t) TEST_NOEXCEPT
{
++sized_delete_called;
std::free(p);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp
index 0e2cc6d8da4e..fb715805083f 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp
@@ -25,23 +25,25 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
int unsized_delete_called = 0;
int unsized_delete_nothrow_called = 0;
int sized_delete_called = 0;
-void operator delete[](void* p) throw()
+void operator delete[](void* p) TEST_NOEXCEPT
{
++unsized_delete_called;
std::free(p);
}
-void operator delete[](void* p, const std::nothrow_t&) throw()
+void operator delete[](void* p, const std::nothrow_t&) TEST_NOEXCEPT
{
++unsized_delete_nothrow_called;
std::free(p);
}
-void operator delete[](void* p, std::size_t) throw()
+void operator delete[](void* p, std::size_t) TEST_NOEXCEPT
{
++sized_delete_called;
std::free(p);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp
index 6d24aec35ef8..ff55ec74e3cd 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp
@@ -18,16 +18,18 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
int delete_called = 0;
int delete_nothrow_called = 0;
-void operator delete[](void* p) throw()
+void operator delete[](void* p) TEST_NOEXCEPT
{
++delete_called;
std::free(p);
}
-void operator delete[](void* p, const std::nothrow_t&) throw()
+void operator delete[](void* p, const std::nothrow_t&) TEST_NOEXCEPT
{
++delete_nothrow_called;
std::free(p);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
index 7dd510b4dac8..5b93540eac57 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
@@ -33,23 +33,25 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
int unsized_delete_called = 0;
int unsized_delete_nothrow_called = 0;
int sized_delete_called = 0;
-void operator delete[](void* p) throw()
+void operator delete[](void* p) TEST_NOEXCEPT
{
++unsized_delete_called;
std::free(p);
}
-void operator delete[](void* p, const std::nothrow_t&) throw()
+void operator delete[](void* p, const std::nothrow_t&) TEST_NOEXCEPT
{
++unsized_delete_nothrow_called;
std::free(p);
}
-void operator delete[](void* p, std::size_t) throw()
+void operator delete[](void* p, std::size_t) TEST_NOEXCEPT
{
++sized_delete_called;
std::free(p);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp
new file mode 100644
index 000000000000..a5d4df34a85d
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// test aligned operator delete replacement.
+
+// UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11, c++14
+
+// Older Clang versions do not support this
+// XFAIL: clang-3, apple-clang
+
+// None of the current GCC compilers support this.
+// XFAIL: gcc
+
+
+#include <new>
+#include <cstddef>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+
+constexpr auto OverAligned = alignof(std::max_align_t) * 2;
+
+int unsized_delete_called = 0;
+int unsized_delete_nothrow_called = 0;
+int aligned_delete_called = 0;
+
+void reset() {
+ unsized_delete_called = 0;
+ unsized_delete_nothrow_called = 0;
+ aligned_delete_called = 0;
+}
+
+void operator delete(void* p) TEST_NOEXCEPT
+{
+ ++unsized_delete_called;
+ std::free(p);
+}
+
+void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT
+{
+ ++unsized_delete_nothrow_called;
+ std::free(p);
+}
+
+void operator delete(void* p, std::align_val_t) TEST_NOEXCEPT
+{
+ ++aligned_delete_called;
+ std::free(p);
+}
+
+struct alignas(OverAligned) A {};
+struct alignas(std::max_align_t) B {};
+
+B* volatile bp;
+A* volatile ap;
+
+int main()
+{
+ reset();
+ {
+ bp = new B;
+ assert(0 == unsized_delete_called);
+ assert(0 == unsized_delete_nothrow_called);
+ assert(0 == aligned_delete_called);
+
+ delete bp;
+ assert(1 == unsized_delete_called);
+ assert(0 == unsized_delete_nothrow_called);
+ assert(0 == aligned_delete_called);
+ }
+ reset();
+ {
+ ap = new A;
+ assert(0 == unsized_delete_called);
+ assert(0 == unsized_delete_nothrow_called);
+ assert(0 == aligned_delete_called);
+
+ delete ap;
+ assert(0 == unsized_delete_called);
+ assert(0 == unsized_delete_nothrow_called);
+ assert(1 == aligned_delete_called);
+ }
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.pass.cpp
index 892842a1b9f4..26f7bc392c79 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.pass.cpp
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
-
// test operator new
// asan and msan will not call the new handler.
@@ -19,6 +17,8 @@
#include <cassert>
#include <limits>
+#include "test_macros.h"
+
int new_handler_called = 0;
void new_handler()
@@ -37,6 +37,7 @@ struct A
int main()
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
std::set_new_handler(new_handler);
try
{
@@ -52,6 +53,7 @@ int main()
{
assert(false);
}
+#endif
A* ap = new A;
assert(ap);
assert(A_constructed);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
new file mode 100644
index 000000000000..fefae51dac93
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// asan and msan will not call the new handler.
+// UNSUPPORTED: sanitizer-new-delete
+
+// FIXME turn this into an XFAIL
+// UNSUPPORTED: no-aligned-allocation
+
+// test operator new
+
+#include <new>
+#include <cstddef>
+#include <cassert>
+#include <cstdint>
+#include <limits>
+
+#include "test_macros.h"
+
+constexpr auto OverAligned = alignof(std::max_align_t) * 2;
+
+int new_handler_called = 0;
+
+void new_handler()
+{
+ ++new_handler_called;
+ std::set_new_handler(0);
+}
+
+bool A_constructed = false;
+
+struct alignas(OverAligned) A
+{
+ A() {A_constructed = true;}
+ ~A() {A_constructed = false;}
+};
+
+void test_throw_max_size() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ std::set_new_handler(new_handler);
+ try
+ {
+ void* vp = operator new (std::numeric_limits<std::size_t>::max(),
+ static_cast<std::align_val_t>(32));
+ ((void)vp);
+ assert(false);
+ }
+ catch (std::bad_alloc&)
+ {
+ assert(new_handler_called == 1);
+ }
+ catch (...)
+ {
+ assert(false);
+ }
+#endif
+}
+
+int main()
+{
+ {
+ A* ap = new A;
+ assert(ap);
+ assert(reinterpret_cast<std::uintptr_t>(ap) % OverAligned == 0);
+ assert(A_constructed);
+ delete ap;
+ assert(!A_constructed);
+ }
+ {
+ test_throw_max_size();
+ }
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
new file mode 100644
index 000000000000..ca8503e8854d
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
@@ -0,0 +1,82 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// asan and msan will not call the new handler.
+// UNSUPPORTED: sanitizer-new-delete
+
+// FIXME turn this into an XFAIL
+// UNSUPPORTED: no-aligned-allocation
+
+// test operator new (nothrow)
+
+#include <new>
+#include <cstddef>
+#include <cstdint>
+#include <cassert>
+#include <limits>
+
+#include "test_macros.h"
+
+constexpr auto OverAligned = alignof(std::max_align_t) * 2;
+
+int new_handler_called = 0;
+
+void new_handler()
+{
+ ++new_handler_called;
+ std::set_new_handler(0);
+}
+
+bool A_constructed = false;
+
+struct alignas(OverAligned) A
+{
+ A() {A_constructed = true;}
+ ~A() {A_constructed = false;}
+};
+
+void test_max_alloc() {
+ std::set_new_handler(new_handler);
+ auto do_test = []() {
+ void* vp = operator new (std::numeric_limits<std::size_t>::max(),
+ std::align_val_t(OverAligned),
+ std::nothrow);
+ assert(new_handler_called == 1);
+ assert(vp == 0);
+ };
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try
+ {
+ do_test();
+ }
+ catch (...)
+ {
+ assert(false);
+ }
+#else
+ do_test();
+#endif
+}
+
+int main()
+{
+ {
+ A* ap = new(std::nothrow) A;
+ assert(ap);
+ assert(reinterpret_cast<std::uintptr_t>(ap) % OverAligned == 0);
+ assert(A_constructed);
+ delete ap;
+ assert(!A_constructed);
+ }
+ {
+ test_max_alloc();
+ }
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp
new file mode 100644
index 000000000000..9f64c9730166
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp
@@ -0,0 +1,84 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: sanitizer-new-delete
+
+// XFAIL: no-aligned-allocation
+
+// test operator new nothrow by replacing only operator new
+
+#include <new>
+#include <cstddef>
+#include <cstdlib>
+#include <cassert>
+#include <limits>
+
+#include "test_macros.h"
+
+constexpr auto OverAligned = alignof(std::max_align_t) * 2;
+
+bool A_constructed = false;
+
+struct alignas(OverAligned) A
+{
+ A() {A_constructed = true;}
+ ~A() {A_constructed = false;}
+};
+
+bool B_constructed = false;
+
+struct B {
+ std::max_align_t member;
+ B() { B_constructed = true; }
+ ~B() { B_constructed = false; }
+};
+
+int new_called = 0;
+alignas(OverAligned) char Buff[OverAligned * 2];
+
+void* operator new(std::size_t s, std::align_val_t a) TEST_THROW_SPEC(std::bad_alloc)
+{
+ assert(!new_called);
+ assert(s <= sizeof(Buff));
+ assert(static_cast<std::size_t>(a) == OverAligned);
+ ++new_called;
+ return Buff;
+}
+
+void operator delete(void* p, std::align_val_t a) TEST_NOEXCEPT
+{
+ assert(p == Buff);
+ assert(static_cast<std::size_t>(a) == OverAligned);
+ assert(new_called);
+ --new_called;
+}
+
+
+int main()
+{
+ {
+ A* ap = new (std::nothrow) A;
+ assert(ap);
+ assert(A_constructed);
+ assert(new_called);
+ delete ap;
+ assert(!A_constructed);
+ assert(!new_called);
+ }
+ {
+ B* bp = new (std::nothrow) B;
+ assert(bp);
+ assert(B_constructed);
+ assert(!new_called);
+ delete bp;
+ assert(!new_called);
+ assert(!B_constructed);
+ }
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp
new file mode 100644
index 000000000000..df3e4c1560a9
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp
@@ -0,0 +1,85 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: sanitizer-new-delete
+
+// XFAIL: no-aligned-allocation
+
+// test operator new replacement
+
+#include <new>
+#include <cstddef>
+#include <cstdlib>
+#include <cstdint>
+#include <cassert>
+#include <limits>
+
+#include "test_macros.h"
+
+constexpr auto OverAligned = alignof(std::max_align_t) * 2;
+
+bool A_constructed = false;
+
+struct alignas(OverAligned) A {
+ A() {A_constructed = true;}
+ ~A() {A_constructed = false;}
+};
+
+
+bool B_constructed = false;
+
+struct alignas(std::max_align_t) B
+{
+ std::max_align_t member;
+ B() {B_constructed = true;}
+ ~B() {B_constructed = false;}
+};
+
+int new_called = 0;
+
+alignas(OverAligned) char DummyData[OverAligned];
+
+void* operator new(std::size_t s, std::align_val_t a) TEST_THROW_SPEC(std::bad_alloc)
+{
+ assert(new_called == 0); // We already allocated
+ assert(s <= sizeof(DummyData));
+ assert(static_cast<std::size_t>(a) == OverAligned);
+ ++new_called;
+ return DummyData;
+}
+
+void operator delete(void* p, std::align_val_t) TEST_NOEXCEPT
+{
+ assert(new_called == 1);
+ --new_called;
+ assert(p == DummyData);
+}
+
+
+int main()
+{
+ {
+ A* ap = new A;
+ assert(ap);
+ assert(A_constructed);
+ assert(new_called);
+ delete ap;
+ assert(!A_constructed);
+ assert(!new_called);
+ }
+ {
+ B* bp = new B;
+ assert(bp);
+ assert(B_constructed);
+ assert(!new_called);
+ delete bp;
+ assert(!new_called);
+ }
+}
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow.pass.cpp
index c2f5830495d2..757e8ae18a47 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// test operator new (nothrow)
// asan and msan will not call the new handler.
@@ -18,6 +17,8 @@
#include <cassert>
#include <limits>
+#include "test_macros.h"
+
int new_handler_called = 0;
void new_handler()
@@ -37,16 +38,20 @@ struct A
int main()
{
std::set_new_handler(new_handler);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
void* vp = operator new (std::numeric_limits<std::size_t>::max(), std::nothrow);
assert(new_handler_called == 1);
assert(vp == 0);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (...)
{
assert(false);
}
+#endif
A* ap = new(std::nothrow) A;
assert(ap);
assert(A_constructed);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp
index eb8319bac2f7..dbc64bace332 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp
@@ -11,18 +11,17 @@
// UNSUPPORTED: sanitizer-new-delete
-// TODO Investigate why UBSAN prevents nothrow new from calling our replacement.
-// XFAIL: ubsan
-
#include <new>
#include <cstddef>
#include <cstdlib>
#include <cassert>
#include <limits>
+#include "test_macros.h"
+
int new_called = 0;
-void* operator new(std::size_t s) throw(std::bad_alloc)
+void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
++new_called;
void* ret = std::malloc(s);
@@ -30,7 +29,7 @@ void* operator new(std::size_t s) throw(std::bad_alloc)
return ret;
}
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
--new_called;
std::free(p);
@@ -44,9 +43,11 @@ struct A
~A() {A_constructed = false;}
};
+A* volatile ap;
+
int main()
{
- A* ap = new (std::nothrow) A;
+ ap = new (std::nothrow) A;
assert(ap);
assert(A_constructed);
assert(new_called);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp
index 6056ed7bb0b3..ad15b49483d0 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp
@@ -17,9 +17,11 @@
#include <cassert>
#include <limits>
+#include "test_macros.h"
+
int new_called = 0;
-void* operator new(std::size_t s) throw(std::bad_alloc)
+void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
++new_called;
void* ret = std::malloc(s);
@@ -27,7 +29,7 @@ void* operator new(std::size_t s) throw(std::bad_alloc)
return ret;
}
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
--new_called;
std::free(p);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp
index e4064e2ab510..7369c362fce2 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp
@@ -20,23 +20,25 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
int unsized_delete_called = 0;
int unsized_delete_nothrow_called = 0;
int sized_delete_called = 0;
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
++unsized_delete_called;
std::free(p);
}
-void operator delete(void* p, const std::nothrow_t&) throw()
+void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT
{
++unsized_delete_nothrow_called;
std::free(p);
}
-void operator delete(void* p, std::size_t) throw()
+void operator delete(void* p, std::size_t) TEST_NOEXCEPT
{
++sized_delete_called;
std::free(p);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp
index 5d9ddd4f0526..6c91f5ceda86 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp
@@ -25,23 +25,25 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
int unsized_delete_called = 0;
int unsized_delete_nothrow_called = 0;
int sized_delete_called = 0;
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
++unsized_delete_called;
std::free(p);
}
-void operator delete(void* p, const std::nothrow_t&) throw()
+void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT
{
++unsized_delete_nothrow_called;
std::free(p);
}
-void operator delete(void* p, std::size_t) throw()
+void operator delete(void* p, std::size_t) TEST_NOEXCEPT
{
++sized_delete_called;
std::free(p);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp
index f656d1cd712a..cb093f3637ce 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp
@@ -13,33 +13,33 @@
// UNSUPPORTED: sanitizer-new-delete
-// TODO Investigate why UBSAN prevents new from calling our replacement.
-// XFAIL: ubsan
-
-
#include <new>
#include <cstddef>
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
int delete_called = 0;
int delete_nothrow_called = 0;
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
++delete_called;
std::free(p);
}
-void operator delete(void* p, const std::nothrow_t&) throw()
+void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT
{
++delete_nothrow_called;
std::free(p);
}
+int* volatile x;
+
int main()
{
- int *x = new int(42);
+ x = new int(42);
assert(0 == delete_called);
assert(0 == delete_nothrow_called);
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
index 24d33e210f57..1b6de2367e10 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
@@ -14,9 +14,6 @@
// UNSUPPORTED: sanitizer-new-delete
-// TODO Investigate why UBSAN prevents new from calling our replacement.
-// XFAIL: ubsan
-
// NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
// REQUIRES: fsized-deallocation
@@ -36,31 +33,35 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
int unsized_delete_called = 0;
int unsized_delete_nothrow_called = 0;
int sized_delete_called = 0;
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
++unsized_delete_called;
std::free(p);
}
-void operator delete(void* p, const std::nothrow_t&) throw()
+void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT
{
++unsized_delete_nothrow_called;
std::free(p);
}
-void operator delete(void* p, std::size_t) throw()
+void operator delete(void* p, std::size_t) TEST_NOEXCEPT
{
++sized_delete_called;
std::free(p);
}
+int* volatile x;
+
int main()
{
- int *x = new int(42);
+ x = new int(42);
assert(0 == sized_delete_called);
assert(0 == unsized_delete_called);
assert(0 == unsized_delete_nothrow_called);
diff --git a/test/std/language.support/support.exception/except.nested/assign.pass.cpp b/test/std/language.support/support.exception/except.nested/assign.pass.cpp
index a5508d1436fa..6338c8aaa26e 100644
--- a/test/std/language.support/support.exception/except.nested/assign.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/assign.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;
@@ -17,6 +16,8 @@
#include <exception>
#include <cassert>
+#include "test_macros.h"
+
class A
{
int data_;
@@ -34,6 +35,7 @@ int main()
e = e0;
assert(e.nested_ptr() == nullptr);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
try
{
@@ -57,4 +59,5 @@ int main()
}
}
}
+#endif
}
diff --git a/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp b/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
index f9f293300e62..4cbdbb2ec892 100644
--- a/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;
@@ -17,6 +16,8 @@
#include <exception>
#include <cassert>
+#include "test_macros.h"
+
class A
{
int data_;
@@ -33,6 +34,7 @@ int main()
std::nested_exception e = e0;
assert(e.nested_ptr() == nullptr);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
try
{
@@ -55,4 +57,5 @@ int main()
}
}
}
+#endif
}
diff --git a/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp b/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
index 67766aa2c461..18ca9968ff56 100644
--- a/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <exception>
// class nested_exception;
@@ -17,6 +16,8 @@
#include <exception>
#include <cassert>
+#include "test_macros.h"
+
class A
{
int data_;
@@ -32,6 +33,7 @@ int main()
std::nested_exception e;
assert(e.nested_ptr() == nullptr);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
try
{
@@ -53,4 +55,5 @@ int main()
}
}
}
+#endif
}
diff --git a/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
index 4ee95fdf3001..57d193a411cc 100644
--- a/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <exception>
// class nested_exception;
@@ -18,12 +18,14 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
class A
{
int data_;
public:
explicit A(int data) : data_(data) {}
- virtual ~A() _NOEXCEPT {}
+ virtual ~A() TEST_NOEXCEPT {}
friend bool operator==(const A& x, const A& y) {return x.data_ == y.data_;}
};
diff --git a/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
index 13c1dfe59311..d511a72f9f57 100644
--- a/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <exception>
// class nested_exception;
diff --git a/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
index c14cb69bdea3..a86d8bcbe201 100644
--- a/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <exception>
// class nested_exception;
diff --git a/test/std/language.support/support.exception/propagation/current_exception.pass.cpp b/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
index 7bf1df457dbe..661f789fefd7 100644
--- a/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <exception>
// exception_ptr current_exception();
diff --git a/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp b/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
index 6e4c0a98b09f..36feda7304bc 100644
--- a/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <exception>
// template<class E> exception_ptr make_exception_ptr(E e);
diff --git a/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp b/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
index c28c901bdd73..565166cbdf76 100644
--- a/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <exception>
// void rethrow_exception [[noreturn]] (exception_ptr p);
diff --git a/test/std/language.support/support.exception/uncaught/uncaught_exception.pass.cpp b/test/std/language.support/support.exception/uncaught/uncaught_exception.pass.cpp
index 573d85bd242c..a4353be4f4cc 100644
--- a/test/std/language.support/support.exception/uncaught/uncaught_exception.pass.cpp
+++ b/test/std/language.support/support.exception/uncaught/uncaught_exception.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// test uncaught_exception
#include <exception>
diff --git a/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp b/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
index b35ad7313bcc..b92671588027 100644
--- a/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
+++ b/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// test uncaught_exceptions
#include <exception>
diff --git a/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp b/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp
index 2f0720639c66..e51ef7bd9230 100644
--- a/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp
+++ b/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp
@@ -15,6 +15,9 @@
#include <initializer_list>
#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
@@ -25,14 +28,14 @@ struct A
const int* b = il.begin();
const int* e = il.end();
assert(il.size() == 3);
- assert(e - b == il.size());
+ assert(static_cast<std::size_t>(e - b) == il.size());
assert(*b++ == 3);
assert(*b++ == 2);
assert(*b++ == 1);
}
};
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
struct B
{
constexpr B(std::initializer_list<int> il)
@@ -40,14 +43,14 @@ struct B
const int* b = il.begin();
const int* e = il.end();
assert(il.size() == 3);
- assert(e - b == il.size());
+ assert(static_cast<std::size_t>(e - b) == il.size());
assert(*b++ == 3);
assert(*b++ == 2);
assert(*b++ == 1);
}
};
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
@@ -56,7 +59,7 @@ int main()
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
A test1 = {3, 2, 1};
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr B test2 = {3, 2, 1};
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
}
diff --git a/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp b/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp
index 7822a62206a1..e091834340aa 100644
--- a/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp
+++ b/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp
@@ -14,6 +14,8 @@
#include <initializer_list>
#include <cassert>
+#include "test_macros.h"
+
struct A {};
int main()
@@ -22,8 +24,8 @@ int main()
std::initializer_list<A> il;
assert(il.size() == 0);
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr std::initializer_list<A> il2;
static_assert(il2.size() == 0, "");
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
}
diff --git a/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp b/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp
index 5fcd28f9156c..938025d385fa 100644
--- a/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp
+++ b/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp
@@ -13,6 +13,9 @@
#include <initializer_list>
#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
@@ -23,14 +26,14 @@ struct A
const int* b = begin(il);
const int* e = end(il);
assert(il.size() == 3);
- assert(e - b == il.size());
+ assert(static_cast<std::size_t>(e - b) == il.size());
assert(*b++ == 3);
assert(*b++ == 2);
assert(*b++ == 1);
}
};
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
struct B
{
constexpr B(std::initializer_list<int> il)
@@ -38,14 +41,14 @@ struct B
const int* b = begin(il);
const int* e = end(il);
assert(il.size() == 3);
- assert(e - b == il.size());
+ assert(static_cast<std::size_t>(e - b) == il.size());
assert(*b++ == 3);
assert(*b++ == 2);
assert(*b++ == 1);
}
};
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int main()
@@ -53,7 +56,7 @@ int main()
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
A test1 = {3, 2, 1};
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr B test2 = {3, 2, 1};
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
}
diff --git a/test/std/language.support/support.limits/limits/numeric.limits.members/infinity.pass.cpp b/test/std/language.support/support.limits/limits/numeric.limits.members/infinity.pass.cpp
index a2ccca333cc6..033ecdc31af0 100644
--- a/test/std/language.support/support.limits/limits/numeric.limits.members/infinity.pass.cpp
+++ b/test/std/language.support/support.limits/limits/numeric.limits.members/infinity.pass.cpp
@@ -50,7 +50,7 @@ int main()
test<__int128_t>(0);
test<__uint128_t>(0);
#endif
- test<float>(1./zero);
+ test<float>(1.f/zero);
test<double>(1./zero);
test<long double>(1./zero);
}
diff --git a/test/std/language.support/support.runtime/cstdlib.pass.cpp b/test/std/language.support/support.runtime/cstdlib.pass.cpp
index d8f88cf58d9d..60f7d954db54 100644
--- a/test/std/language.support/support.runtime/cstdlib.pass.cpp
+++ b/test/std/language.support/support.runtime/cstdlib.pass.cpp
@@ -96,11 +96,9 @@ int main()
wchar_t* pw = 0;
const wchar_t* pwc = 0;
char* pc = 0;
-#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
static_assert((std::is_same<decltype(std::mblen("",0)), int>::value), "");
static_assert((std::is_same<decltype(std::mbtowc(pw,"",0)), int>::value), "");
static_assert((std::is_same<decltype(std::wctomb(pc,L' ')), int>::value), "");
-#endif
static_assert((std::is_same<decltype(std::mbstowcs(pw,"",0)), std::size_t>::value), "");
static_assert((std::is_same<decltype(std::wcstombs(pc,pwc,0)), std::size_t>::value), "");
}
diff --git a/test/std/language.support/support.types/nullptr_t.pass.cpp b/test/std/language.support/support.types/nullptr_t.pass.cpp
index ca5170f649ed..2d0ed7410590 100644
--- a/test/std/language.support/support.types/nullptr_t.pass.cpp
+++ b/test/std/language.support/support.types/nullptr_t.pass.cpp
@@ -11,6 +11,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
// typedef decltype(nullptr) nullptr_t;
struct A
@@ -34,22 +36,20 @@ void test_conversions()
}
}
+template <class T> struct Voider { typedef void type; };
+template <class T, class = void> struct has_less : std::false_type {};
+
+template <class T> struct has_less<T,
+ typename Voider<decltype(std::declval<T>() < nullptr)>::type> : std::true_type {};
+
template <class T>
void test_comparisons()
{
T p = nullptr;
assert(p == nullptr);
- assert(p <= nullptr);
- assert(p >= nullptr);
assert(!(p != nullptr));
- assert(!(p < nullptr));
- assert(!(p > nullptr));
assert(nullptr == p);
- assert(nullptr <= p);
- assert(nullptr >= p);
assert(!(nullptr != p));
- assert(!(nullptr < p));
- assert(!(nullptr > p));
}
#if defined(__clang__)
@@ -89,6 +89,15 @@ int main()
test_conversions<int A::*>();
}
{
+#ifdef _LIBCPP_HAS_NO_NULLPTR
+ static_assert(!has_less<std::nullptr_t>::value, "");
+ // FIXME: our c++03 nullptr emulation still allows for comparisons
+ // with other pointer types by way of the conversion operator.
+ //static_assert(!has_less<void*>::value, "");
+#else
+ // TODO Enable this assertion when all compilers implement core DR 583.
+ // static_assert(!has_less<std::nullptr_t>::value, "");
+#endif
test_comparisons<std::nullptr_t>();
test_comparisons<void*>();
test_comparisons<A*>();
diff --git a/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp b/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
index 13945f8ee7ce..fd0b177c8064 100644
--- a/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
+++ b/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
@@ -29,6 +29,7 @@ int main()
{
assert(std::has_facet<std::collate<char> >(l));
const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+ ((void)f); // Prevent unused warning
{
(void)std::collate<char>::id;
}
@@ -39,6 +40,7 @@ int main()
{
assert(std::has_facet<std::collate<wchar_t> >(l));
const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+ ((void)f); // Prevent unused warning
{
(void)std::collate<wchar_t>::id;
}
diff --git a/test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp b/test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp
index f58ec30ef061..be223ce79489 100644
--- a/test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp
@@ -28,6 +28,7 @@ int main()
{
assert(std::has_facet<std::ctype<char> >(l));
const std::ctype<char>& f = std::use_facet<std::ctype<char> >(l);
+ ((void)f); // Prevent unused warning
{
(void)std::ctype<char>::id;
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp
index 8f9d1e6cd1f0..f645b32f2691 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp
@@ -36,5 +36,5 @@ int main()
assert(from_next - from == 9);
assert(to_next - to == 9);
for (unsigned i = 0; i < 9; ++i)
- assert(to[i] == from[i]);
+ assert(to[i] == static_cast<char32_t>(from[i]));
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp
index 4e0f600097a0..05a90d33d318 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp
@@ -40,6 +40,6 @@ int main()
assert(from_next - from == 9);
assert(to_next - to == 9);
for (unsigned i = 0; i < 9; ++i)
- assert(to[i] == from[i]);
+ assert(static_cast<char32_t>(to[i]) == from[i]);
}
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp
index a4ff61bcff65..0412f6fa5d42 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp
@@ -19,6 +19,7 @@
#include <string>
#include <vector>
#include <cassert>
+#include <cstddef>
typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
@@ -35,8 +36,8 @@ int main()
F::result r = f.in(mbs, from.data(), from.data() + from.size(), from_next,
&to[0], &to[0] + to.size(), to_next);
assert(r == F::ok);
- assert(from_next - from.data() == from.size());
- assert(to_next - to.data() == expected.size());
- assert(to_next - to.data() == expected.size());
+ assert(static_cast<std::size_t>(from_next - from.data()) == from.size());
+ assert(static_cast<std::size_t>(to_next - to.data()) == expected.size());
+ assert(static_cast<std::size_t>(to_next - to.data()) == expected.size());
assert(to == expected);
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
index 6f025e3ff094..d7bcb2908d72 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
@@ -19,6 +19,7 @@
#include <string>
#include <vector>
#include <cassert>
+#include <cstddef>
typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
@@ -35,8 +36,8 @@ int main()
F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
to.data(), to.data() + to.size(), to_next);
assert(r == F::ok);
- assert(from_next - from.data() == from.size());
- assert(to_next - to.data() == from.size());
+ assert(static_cast<std::size_t>(from_next - from.data()) == from.size());
+ assert(static_cast<std::size_t>(to_next - to.data()) == from.size());
assert(to.data() == std::string("some text"));
}
{
@@ -49,8 +50,8 @@ int main()
F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
to.data(), to.data() + to.size(), to_next);
assert(r == F::ok);
- assert(from_next - from.data() == from.size());
- assert(to_next - to.data() == from.size());
+ assert(static_cast<std::size_t>(from_next - from.data()) == from.size());
+ assert(static_cast<std::size_t>(to_next - to.data()) == from.size());
assert(memcmp(to.data(), "some\0text", from.size()) == 0);
}
{
@@ -62,8 +63,8 @@ int main()
F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
to.data(), to.data() + to.size()-1, to_next);
assert(r == F::partial);
- assert(from_next - from.data() == to.size()-1);
- assert(to_next - to.data() == to.size()-1);
+ assert(static_cast<std::size_t>(from_next - from.data()) == to.size()-1);
+ assert(static_cast<std::size_t>(to_next - to.data()) == to.size()-1);
assert(to.data() == std::string("some te"));
}
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp
index 5e2c44ff971c..892e89391e49 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp
@@ -36,5 +36,6 @@ int main()
std::locale l = std::locale::classic();
assert(std::has_facet<F>(l));
const F& f = std::use_facet<F>(l);
+ ((void)f); // Prevent unused warning
(void)F::id;
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp
index 9d512bd9d130..2b4a686cf3ef 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp
@@ -27,7 +27,6 @@
int main()
{
-//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef std::codecvt<char16_t, char, std::mbstate_t> F;
static_assert((std::is_base_of<std::locale::facet, F>::value), "");
static_assert((std::is_base_of<std::codecvt_base, F>::value), "");
@@ -38,5 +37,5 @@ int main()
assert(std::has_facet<F>(l));
const F& f = std::use_facet<F>(l);
(void)F::id;
-//#endif
+ ((void)f);
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp
index 25f2b3d8df58..c76fea9af9f5 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp
@@ -27,7 +27,6 @@
int main()
{
-//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef std::codecvt<char32_t, char, std::mbstate_t> F;
static_assert((std::is_base_of<std::locale::facet, F>::value), "");
static_assert((std::is_base_of<std::codecvt_base, F>::value), "");
@@ -38,5 +37,5 @@ int main()
assert(std::has_facet<F>(l));
const F& f = std::use_facet<F>(l);
(void)F::id;
-//#endif
+ ((void)f);
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
index 8b6868ec60d3..bfec2339feaa 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
@@ -36,5 +36,6 @@ int main()
std::locale l = std::locale::classic();
assert(std::has_facet<F>(l));
const F& f = std::use_facet<F>(l);
+ ((void)f); // Prevent unused warning
(void)F::id;
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
index 741f47f4380c..4488e9c3f73b 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
@@ -17,7 +17,6 @@
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
-// XFAIL: linux
#include <locale>
#include <cassert>
@@ -27,10 +26,11 @@
int main()
{
{
- std::locale l(LOCALE_en_US_UTF_8);
+ std::locale l;
{
- typedef std::ctype<char> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<char> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ const F& f = std::use_facet<F>(ll);
assert(f.tolower(' ') == ' ');
assert(f.tolower('A') == 'a');
@@ -38,15 +38,15 @@ int main()
assert(f.tolower('.') == '.');
assert(f.tolower('a') == 'a');
assert(f.tolower('1') == '1');
- assert(f.tolower('\xDA') == '\xFA');
assert(f.tolower('\xFA') == '\xFA');
}
}
{
- std::locale l("C");
+ std::locale l;
{
- typedef std::ctype<char> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<char> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
assert(f.tolower(' ') == ' ');
assert(f.tolower('A') == 'a');
@@ -59,10 +59,11 @@ int main()
}
}
{
- std::locale l(LOCALE_en_US_UTF_8);
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ const F& f = std::use_facet<F>(ll);
assert(f.tolower(L' ') == L' ');
assert(f.tolower(L'A') == L'a');
@@ -75,10 +76,11 @@ int main()
}
}
{
- std::locale l("C");
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
assert(f.tolower(L' ') == L' ');
assert(f.tolower(L'A') == L'a');
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
index bf1cb64b22c0..0c224e342fa9 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
@@ -17,7 +17,6 @@
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
-// XFAIL: linux
#include <locale>
#include <string>
@@ -28,14 +27,15 @@
int main()
{
{
- std::locale l(LOCALE_en_US_UTF_8);
+ std::locale l;
{
- typedef std::ctype<char> F;
- const F& f = std::use_facet<F>(l);
- std::string in("\xDA A\x07.a1");
+ typedef std::ctype_byname<char> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ const F& f = std::use_facet<F>(ll);
+ std::string in("c A\x07.a1");
assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
- assert(in[0] == '\xFA');
+ assert(in[0] == 'c');
assert(in[1] == ' ');
assert(in[2] == 'a');
assert(in[3] == '\x07');
@@ -45,10 +45,11 @@ int main()
}
}
{
- std::locale l("C");
+ std::locale l;
{
- typedef std::ctype<char> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<char> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
std::string in("\xDA A\x07.a1");
assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
@@ -62,10 +63,11 @@ int main()
}
}
{
- std::locale l(LOCALE_en_US_UTF_8);
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ const F& f = std::use_facet<F>(ll);
std::wstring in(L"\xDA A\x07.a1");
assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
@@ -79,10 +81,11 @@ int main()
}
}
{
- std::locale l("C");
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
std::wstring in(L"\xDA A\x07.a1");
assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
index 3044ba1897fc..0985de5007d6 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
@@ -17,7 +17,7 @@
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
-// XFAIL: linux
+
#include <locale>
#include <cassert>
@@ -27,10 +27,11 @@
int main()
{
{
- std::locale l(LOCALE_en_US_UTF_8);
+ std::locale l;
{
- typedef std::ctype<char> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<char> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ const F& f = std::use_facet<F>(ll);
assert(f.toupper(' ') == ' ');
assert(f.toupper('A') == 'A');
@@ -39,14 +40,15 @@ int main()
assert(f.toupper('a') == 'A');
assert(f.toupper('1') == '1');
assert(f.toupper('\xDA') == '\xDA');
- assert(f.toupper('\xFA') == '\xDA');
+ assert(f.toupper('c') == 'C');
}
}
{
- std::locale l("C");
+ std::locale l;
{
- typedef std::ctype<char> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<char> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
assert(f.toupper(' ') == ' ');
assert(f.toupper('A') == 'A');
@@ -59,10 +61,11 @@ int main()
}
}
{
- std::locale l(LOCALE_en_US_UTF_8);
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ const F& f = std::use_facet<F>(ll);
assert(f.toupper(L' ') == L' ');
assert(f.toupper(L'A') == L'A');
@@ -75,10 +78,11 @@ int main()
}
}
{
- std::locale l("C");
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
assert(f.toupper(L' ') == L' ');
assert(f.toupper(L'A') == L'A');
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
index be6ba4c3e908..ba047754916d 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
@@ -17,7 +17,6 @@
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
-// XFAIL: linux
#include <locale>
#include <string>
@@ -28,14 +27,15 @@
int main()
{
{
- std::locale l(LOCALE_en_US_UTF_8);
+ std::locale l;
{
- typedef std::ctype<char> F;
- const F& f = std::use_facet<F>(l);
- std::string in("\xFA A\x07.a1");
+ typedef std::ctype_byname<char> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ const F& f = std::use_facet<F>(ll);
+ std::string in("c A\x07.a1");
assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size());
- assert(in[0] == '\xDA');
+ assert(in[0] == 'C');
assert(in[1] == ' ');
assert(in[2] == 'A');
assert(in[3] == '\x07');
@@ -45,10 +45,11 @@ int main()
}
}
{
- std::locale l("C");
+ std::locale l;
{
- typedef std::ctype<char> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<char> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
std::string in("\xFA A\x07.a1");
assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size());
@@ -62,10 +63,11 @@ int main()
}
}
{
- std::locale l(LOCALE_en_US_UTF_8);
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ const F& f = std::use_facet<F>(ll);
std::wstring in(L"\xFA A\x07.a1");
assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size());
@@ -79,14 +81,15 @@ int main()
}
}
{
- std::locale l("C");
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
- std::wstring in(L"\xFA A\x07.a1");
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
+ std::wstring in(L"\u00FA A\x07.a1");
assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size());
- assert(in[0] == L'\xFA');
+ assert(in[0] == L'\u00FA');
assert(in[1] == L' ');
assert(in[2] == L'A');
assert(in[3] == L'\x07');
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
index e5c49defa11f..8f51d12d7c75 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
@@ -17,7 +17,6 @@
// I doubt this test is portable
-// XFAIL: linux
#include <locale>
#include <cassert>
@@ -28,10 +27,11 @@
int main()
{
{
- std::locale l(LOCALE_en_US_UTF_8);
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ const F& f = std::use_facet<F>(ll);
assert(f.widen(' ') == L' ');
assert(f.widen('A') == L'A');
@@ -43,10 +43,11 @@ int main()
}
}
{
- std::locale l("C");
+ std::locale l;
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
assert(f.widen(' ') == L' ');
assert(f.widen('A') == L'A');
@@ -54,7 +55,11 @@ int main()
assert(f.widen('.') == L'.');
assert(f.widen('a') == L'a');
assert(f.widen('1') == L'1');
- assert(f.widen(char(-5)) == wchar_t(251));
+#ifdef __APPLE__
+ assert(f.widen(char(-5)) == L'\u00fb');
+#else
+ assert(f.widen(char(-5)) == wchar_t(-1));
+#endif
}
}
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
index c16974a2414a..7a382c4dfa2c 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
@@ -17,8 +17,6 @@
// I doubt this test is portable
-// XFAIL: linux
-
#include <locale>
#include <string>
#include <vector>
@@ -31,8 +29,9 @@ int main()
{
std::locale l(LOCALE_en_US_UTF_8);
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F(LOCALE_en_US_UTF_8));
+ F const& f = std::use_facet<F>(ll);
std::string in(" A\x07.a1\x85");
std::vector<wchar_t> v(in.size());
@@ -49,8 +48,9 @@ int main()
{
std::locale l("C");
{
- typedef std::ctype<wchar_t> F;
- const F& f = std::use_facet<F>(l);
+ typedef std::ctype_byname<wchar_t> F;
+ std::locale ll(l, new F("C"));
+ const F& f = std::use_facet<F>(ll);
std::string in(" A\x07.a1\x85");
std::vector<wchar_t> v(in.size());
@@ -61,7 +61,11 @@ int main()
assert(v[3] == L'.');
assert(v[4] == L'a');
assert(v[5] == L'1');
- assert(v[6] == wchar_t(133));
+#ifdef __APPLE__
+ assert(v[6] == L'\x85');
+#else
+ assert(v[6] == wchar_t(-1));
+#endif
}
}
}
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
index 7ad36afee669..ae356606053e 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
@@ -28,6 +28,7 @@ int main()
{
assert(std::has_facet<std::ctype<wchar_t> >(l));
const std::ctype<wchar_t>& f = std::use_facet<std::ctype<wchar_t> >(l);
+ ((void)f); // Prevent unused warning
{
(void)std::ctype<wchar_t>::id;
}
diff --git a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
index 6d23d6361f85..8490b708b6cf 100644
--- a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
+++ b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
@@ -24,6 +24,7 @@
#include <limits>
#include <cassert>
+#include "test_macros.h"
#include "platform_support.h" // locale name macros
class Fnf
@@ -113,7 +114,14 @@ int main()
{
Fnf f(LOCALE_ru_RU_UTF_8, 1);
+ // GLIBC <= 2.23 uses currency_symbol="<U0440><U0443><U0431>"
+ // GLIBC >= 2.24 uses currency_symbol="<U20BD>"
+ // See also: http://www.fileformat.info/info/unicode/char/20bd/index.htm
+#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24)
+ assert(f.curr_symbol() == " \u20BD");
+#else
assert(f.curr_symbol() == " \xD1\x80\xD1\x83\xD0\xB1");
+#endif
}
{
Fnt f(LOCALE_ru_RU_UTF_8, 1);
@@ -121,8 +129,13 @@ int main()
}
{
Fwf f(LOCALE_ru_RU_UTF_8, 1);
+#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24)
+ assert(f.curr_symbol() == L" \u20BD");
+#else
assert(f.curr_symbol() == L" \x440\x443\x431");
+#endif
}
+
{
Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.curr_symbol() == L" RUB");
diff --git a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
index 8270377f3ab9..4051d451fcb6 100644
--- a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
+++ b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
@@ -12,9 +12,6 @@
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
-// Russia uses ',' for the decimal separator. GLIBC returns '.'
-// XFAIL: linux
-
// <locale>
// class moneypunct_byname<charT, International>
@@ -25,6 +22,7 @@
#include <limits>
#include <cassert>
+#include "test_macros.h"
#include "platform_support.h" // locale name macros
class Fnf
@@ -111,22 +109,29 @@ int main()
Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.decimal_point() == L',');
}
-
+// GLIBC 2.23 uses '.' as the decimal point while other C libraries use ','
+#ifndef TEST_HAS_GLIBC
+ const char sep = ',';
+ const wchar_t wsep = L',';
+#else
+ const char sep = '.';
+ const wchar_t wsep = L'.';
+#endif
{
Fnf f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.decimal_point() == ',');
+ assert(f.decimal_point() == sep);
}
{
Fnt f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.decimal_point() == ',');
+ assert(f.decimal_point() == sep);
}
{
Fwf f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.decimal_point() == L',');
+ assert(f.decimal_point() == wsep);
}
{
Fwt f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.decimal_point() == L',');
+ assert(f.decimal_point() == wsep);
}
{
diff --git a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
index a8782832de5c..aa585a436e6e 100644
--- a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
+++ b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
@@ -18,16 +18,11 @@
// charT thousands_sep() const;
-// Failure related to GLIBC's use of U00A0 as mon_thousands_sep
-// and U002E as mon_decimal_point.
-// TODO: U00A0 should be investigated.
-// Possibly related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006
-// XFAIL: linux-gnu
-
#include <locale>
#include <limits>
#include <cassert>
+#include "test_macros.h"
#include "platform_support.h" // locale name macros
class Fnf
@@ -114,22 +109,34 @@ int main()
Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == L' ');
}
-
+// The below tests work around GLIBC's use of U00A0 as mon_thousands_sep
+// and U002E as mon_decimal_point.
+// TODO: Fix thousands_sep for 'char'.
+// related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006
+#ifndef TEST_HAS_GLIBC
+ const char sep = ' ';
+ const wchar_t wsep = L' ';
+#else
+ // FIXME libc++ specifically works around \u00A0 by translating it into
+ // a regular space.
+ const char sep = ' ';
+ const wchar_t wsep = L'\u00A0';
+#endif
{
Fnf f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.thousands_sep() == ' ');
+ assert(f.thousands_sep() == sep);
}
{
Fnt f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.thousands_sep() == ' ');
+ assert(f.thousands_sep() == sep);
}
{
Fwf f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.thousands_sep() == L' ');
+ assert(f.thousands_sep() == wsep);
}
{
Fwt f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.thousands_sep() == L' ');
+ assert(f.thousands_sep() == wsep);
}
{
diff --git a/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp
index 4085f08c7420..1a0a7663ddc8 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp
@@ -47,7 +47,6 @@ int main()
std::ios ios(0);
long v = 0;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0");
@@ -56,7 +55,6 @@ int main()
std::ios ios(0);
long v = 1;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "1");
@@ -65,7 +63,6 @@ int main()
std::ios ios(0);
long v = -1;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "-1");
@@ -74,7 +71,6 @@ int main()
std::ios ios(0);
long v = -1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "-1000");
@@ -83,7 +79,6 @@ int main()
std::ios ios(0);
long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "1000");
@@ -93,7 +88,6 @@ int main()
showpos(ios);
long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "+1000");
@@ -103,7 +97,6 @@ int main()
oct(ios);
long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "1750");
@@ -114,7 +107,6 @@ int main()
showbase(ios);
long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "01750");
@@ -124,7 +116,6 @@ int main()
hex(ios);
long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "3e8");
@@ -135,7 +126,6 @@ int main()
showbase(ios);
long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0x3e8");
@@ -147,7 +137,6 @@ int main()
uppercase(ios);
long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0X3E8");
@@ -160,7 +149,6 @@ int main()
uppercase(ios);
long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0X3E_8");
@@ -172,7 +160,6 @@ int main()
showbase(ios);
long v = 2147483647;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0x7f_fff_ff_f");
@@ -183,7 +170,6 @@ int main()
oct(ios);
long v = 0123467;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "123_46_7");
@@ -195,7 +181,6 @@ int main()
showbase(ios);
long v = 0123467;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0_123_46_7");
@@ -209,7 +194,6 @@ int main()
ios.width(15);
long v = 0123467;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "*****0_123_46_7");
@@ -223,7 +207,6 @@ int main()
ios.width(15);
long v = 0123467;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0_123_46_7*****");
@@ -237,7 +220,6 @@ int main()
ios.width(15);
long v = 0123467;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "*****0_123_46_7");
@@ -252,7 +234,6 @@ int main()
ios.width(15);
long v = 2147483647;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "**0x7f_fff_ff_f");
@@ -266,7 +247,6 @@ int main()
ios.width(15);
long v = 2147483647;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0x7f_fff_ff_f**");
@@ -280,7 +260,6 @@ int main()
ios.width(15);
long v = 2147483647;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0x**7f_fff_ff_f");
@@ -294,7 +273,6 @@ int main()
right(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "***+1_00_0");
@@ -308,7 +286,6 @@ int main()
left(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "+1_00_0***");
@@ -322,7 +299,6 @@ int main()
internal(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "+***1_00_0");
@@ -336,7 +312,6 @@ int main()
showpos(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "***-1_00_0");
@@ -349,7 +324,6 @@ int main()
left(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "-1_00_0***");
@@ -362,7 +336,6 @@ int main()
internal(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "-***1_00_0");
diff --git a/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
index cf9339341abb..cdd163980efd 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
@@ -26226,25 +26226,25 @@ int main()
std::locale lg(lc, new my_numpunct);
const my_facet f(1);
{
- long double v = -INFINITY;
+ long double v = -INFINITY; ((void)v);
}
{
- long double v = std::nan("");
+ long double v = std::nan(""); ((void)v);
}
{
- long double v = +0.;
+ long double v = +0.; ((void)v);
}
{
- long double v = -INFINITY;
+ long double v = -INFINITY; ((void)v);
}
{
- long double v = std::nan("");
+ long double v = std::nan(""); ((void)v);
}
{
- long double v = -INFINITY;
+ long double v = -INFINITY; ((void)v);
}
{
- long double v = std::nan("");
+ long double v = std::nan(""); ((void)v);
}
}
diff --git a/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp
index f7a577fb8a9e..cfa6382a49bd 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp
@@ -47,7 +47,6 @@ int main()
std::ios ios(0);
unsigned long v = 0;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0");
@@ -56,25 +55,22 @@ int main()
std::ios ios(0);
unsigned long v = 1;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "1");
}
{
std::ios ios(0);
- unsigned long v = -1;
+ unsigned long v = static_cast<unsigned long>(-1);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == (sizeof(unsigned long) == 4 ? "4294967295" : "18446744073709551615"));
}
{
std::ios ios(0);
- unsigned long v = -1000;
+ unsigned long v = static_cast<unsigned long>(-1000);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == (sizeof(unsigned long) == 4 ? "4294966296" : "18446744073709550616"));
@@ -83,7 +79,6 @@ int main()
std::ios ios(0);
unsigned long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "1000");
@@ -93,7 +88,6 @@ int main()
showpos(ios);
unsigned long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "1000");
@@ -103,7 +97,6 @@ int main()
oct(ios);
unsigned long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "1750");
@@ -114,7 +107,6 @@ int main()
showbase(ios);
unsigned long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "01750");
@@ -124,7 +116,6 @@ int main()
hex(ios);
unsigned long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "3e8");
@@ -135,7 +126,6 @@ int main()
showbase(ios);
unsigned long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0x3e8");
@@ -147,7 +137,6 @@ int main()
uppercase(ios);
unsigned long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0X3E8");
@@ -160,7 +149,6 @@ int main()
uppercase(ios);
unsigned long v = 1000;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0X3E_8");
@@ -172,7 +160,6 @@ int main()
showbase(ios);
unsigned long v = 2147483647;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0x7f_fff_ff_f");
@@ -183,7 +170,6 @@ int main()
oct(ios);
unsigned long v = 0123467;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "123_46_7");
@@ -195,7 +181,6 @@ int main()
showbase(ios);
unsigned long v = 0123467;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0_123_46_7");
@@ -209,7 +194,6 @@ int main()
ios.width(15);
unsigned long v = 0123467;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "*****0_123_46_7");
@@ -223,7 +207,6 @@ int main()
ios.width(15);
unsigned long v = 0123467;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0_123_46_7*****");
@@ -237,7 +220,6 @@ int main()
ios.width(15);
unsigned long v = 0123467;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "*****0_123_46_7");
@@ -252,7 +234,6 @@ int main()
ios.width(15);
unsigned long v = 2147483647;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "**0x7f_fff_ff_f");
@@ -266,7 +247,6 @@ int main()
ios.width(15);
unsigned long v = 2147483647;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0x7f_fff_ff_f**");
@@ -280,7 +260,6 @@ int main()
ios.width(15);
unsigned long v = 2147483647;
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "0x**7f_fff_ff_f");
@@ -294,7 +273,6 @@ int main()
right(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "****1_00_0");
@@ -308,7 +286,6 @@ int main()
left(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "1_00_0****");
@@ -322,7 +299,6 @@ int main()
internal(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == "****1_00_0");
@@ -331,12 +307,11 @@ int main()
{
std::ios ios(0);
ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
- unsigned long v = -1000;
+ unsigned long v = static_cast<unsigned long>(-1000);
right(ios);
showpos(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == (sizeof(unsigned long) == 4 ? "4_294_966_29_6"
@@ -346,11 +321,10 @@ int main()
{
std::ios ios(0);
ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
- unsigned long v = -1000;
+ unsigned long v = static_cast<unsigned long>(-1000);
left(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == (sizeof(unsigned long) == 4 ? "4_294_966_29_6"
@@ -360,11 +334,10 @@ int main()
{
std::ios ios(0);
ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
- unsigned long v = -1000;
+ unsigned long v = static_cast<unsigned long>(-1000);
internal(ios);
ios.width(10);
char str[50];
- std::ios_base::iostate err = ios.goodbit;
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
assert(ex == (sizeof(unsigned long) == 4 ? "4_294_966_29_6"
diff --git a/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp
index debbd5e0ee6c..eaf670972bae 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp
@@ -61,15 +61,15 @@ int main()
}
{
std::ios ios(0);
- unsigned long long v = -1;
+ unsigned long long v = static_cast<unsigned long long>(-1);
char str[50];
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
- assert(ex == (sizeof(unsigned long long) == 4 ? "4294967295" : "18446744073709551615"));
+ assert(ex == "18446744073709551615");
}
{
std::ios ios(0);
- unsigned long long v = -1000;
+ unsigned long long v = static_cast<unsigned long long>(-1000);
char str[50];
output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
std::string ex(str, iter.base());
@@ -307,7 +307,7 @@ int main()
{
std::ios ios(0);
ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
- unsigned long long v = -1000;
+ unsigned long long v = static_cast<unsigned long long>(-1000);
right(ios);
showpos(ios);
ios.width(10);
@@ -320,7 +320,7 @@ int main()
{
std::ios ios(0);
ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
- unsigned long long v = -1000;
+ unsigned long long v = static_cast<unsigned long long>(-1000);
left(ios);
ios.width(10);
char str[50];
@@ -332,7 +332,7 @@ int main()
{
std::ios ios(0);
ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
- unsigned long long v = -1000;
+ unsigned long long v = static_cast<unsigned long long>(-1000);
internal(ios);
ios.width(10);
char str[50];
diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_long.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_long.pass.cpp
index fe00876251cb..86e64e6222b3 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_long.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_long.pass.cpp
@@ -100,6 +100,7 @@ int main()
ios, err, v);
assert(iter.base() == str+sizeof(str)-1);
assert(err == ios.goodbit);
- assert(v == 0x8000000000000000LL);
+ const long long expect = 0x8000000000000000LL;
+ assert(v == expect);
}
}
diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp
index 2d10569796c9..0665bf2ac1c0 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp
@@ -45,7 +45,7 @@ int main()
{
const my_facet f(1);
std::ios ios(0);
- unsigned int v = -1;
+ unsigned int v = static_cast<unsigned int>(-1);
{
const char str[] = "0";
std::ios_base::iostate err = ios.goodbit;
diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp
index 50f0ff5ee5da..03fa3d777852 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp
@@ -45,7 +45,7 @@ int main()
{
const my_facet f(1);
std::ios ios(0);
- unsigned long v = -1;
+ unsigned long v = static_cast<unsigned long>(-1);
{
const char str[] = "0";
std::ios_base::iostate err = ios.goodbit;
diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp
index 31fbb2a2c819..dcf4bf1990b7 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp
@@ -45,7 +45,7 @@ int main()
{
const my_facet f(1);
std::ios ios(0);
- unsigned long long v = -1;
+ unsigned long long v = static_cast<unsigned long long>(-1);
{
const char str[] = "0";
std::ios_base::iostate err = ios.goodbit;
diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp
index 822b83e0ff93..283c8e63db4f 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp
@@ -45,7 +45,7 @@ int main()
{
const my_facet f(1);
std::ios ios(0);
- unsigned short v = -1;
+ unsigned short v = static_cast<unsigned short>(-1);
{
const char str[] = "0";
std::ios_base::iostate err = ios.goodbit;
diff --git a/test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp b/test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp
index 28bc3aa89f9c..9045ecbe5935 100644
--- a/test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp
+++ b/test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp
@@ -21,6 +21,7 @@
int main()
{
std::time_base::dateorder d = std::time_base::no_order;
+ ((void)d); // Prevent unused warning
assert(std::time_base::no_order == 0);
assert(std::time_base::dmy == 1);
assert(std::time_base::mdy == 2);
diff --git a/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp b/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
index d5112a9508b7..f3df52a21b89 100644
--- a/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
+++ b/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
@@ -16,12 +16,10 @@
// string grouping() const;
-// TODO: investigation needed
-// XFAIL: linux-gnu
-
#include <locale>
#include <cassert>
+#include "test_macros.h"
#include "platform_support.h" // locale name macros
int main()
@@ -54,15 +52,20 @@ int main()
}
{
std::locale l(LOCALE_fr_FR_UTF_8);
+#if defined(TEST_HAS_GLIBC)
+ const char* const group = "\3";
+#else
+ const char* const group = "\x7f";
+#endif
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
- assert(np.grouping() == "\x7F");
+ assert(np.grouping() == group);
}
{
typedef wchar_t C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
- assert(np.grouping() == "\x7F");
+ assert(np.grouping() == group);
}
}
}
diff --git a/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
index b1bd03ff7364..38cbcfda4f05 100644
--- a/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
+++ b/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
@@ -16,12 +16,11 @@
// char_type thousands_sep() const;
-// TODO: investigation needed
-// XFAIL: linux-gnu
#include <locale>
#include <cassert>
+#include "test_macros.h"
#include "platform_support.h" // locale name macros
int main()
@@ -54,15 +53,22 @@ int main()
}
{
std::locale l(LOCALE_fr_FR_UTF_8);
+#if defined(TEST_HAS_GLIBC)
+ const char sep = ' ';
+ const wchar_t wsep = L' ';
+#else
+ const char sep = ',';
+ const wchar_t wsep = L',';
+#endif
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
- assert(np.thousands_sep() == ',');
+ assert(np.thousands_sep() == sep);
}
{
typedef wchar_t C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
- assert(np.thousands_sep() == L',');
+ assert(np.thousands_sep() == wsep);
}
}
}
diff --git a/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp b/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
index bbdf3254de21..967a4f4b25ba 100644
--- a/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
+++ b/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
@@ -28,6 +28,7 @@ int main()
{
assert(std::has_facet<std::numpunct<char> >(l));
const std::numpunct<char>& f = std::use_facet<std::numpunct<char> >(l);
+ ((void)f); // Prevent unused warning
{
(void)std::numpunct<char>::id;
}
@@ -38,6 +39,7 @@ int main()
{
assert(std::has_facet<std::numpunct<wchar_t> >(l));
const std::numpunct<wchar_t>& f = std::use_facet<std::numpunct<wchar_t> >(l);
+ ((void)f); // Prevent unused warning
{
(void)std::numpunct<wchar_t>::id;
}
diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp
index 5f57df12f022..6f0994a00679 100644
--- a/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp
+++ b/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp
@@ -19,12 +19,13 @@
#include <sstream>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
int main()
{
typedef std::wbuffer_convert<std::codecvt_utf8<wchar_t> > B;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(!std::is_convertible<std::streambuf*, B>::value, "");
static_assert( std::is_constructible<B, std::streambuf*>::value, "");
#endif
diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp
index 6abf5cee328e..aba76df0b9c7 100644
--- a/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp
+++ b/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp
@@ -24,5 +24,6 @@ int main()
{
B b;
std::mbstate_t s = b.state();
+ ((void)s);
}
}
diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp
index 9099b5e38fcc..b56b72fb050c 100644
--- a/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp
+++ b/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp
@@ -17,6 +17,8 @@
#include <codecvt>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -30,7 +32,7 @@ int main()
typedef std::wstring_convert<Codecvt> Myconv;
Myconv myconv(new Codecvt);
assert(myconv.converted() == 0);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(!std::is_convertible<Codecvt*, Myconv>::value, "");
static_assert( std::is_constructible<Myconv, Codecvt*>::value, "");
#endif
diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
index 5a58b06cc2d7..70204c2fb99a 100644
--- a/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
+++ b/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <locale>
// wstring_convert<Codecvt, Elem, Wide_alloc, Byte_alloc>
@@ -19,14 +18,17 @@
#include <codecvt>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::codecvt_utf8<wchar_t> Codecvt;
typedef std::wstring_convert<Codecvt> Myconv;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(!std::is_convertible<std::string, Myconv>::value, "");
static_assert( std::is_constructible<Myconv, std::string>::value, "");
#endif
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
Myconv myconv;
try
@@ -46,10 +48,12 @@ int main()
{
}
}
+#endif
{
Myconv myconv("byte error");
std::string bs = myconv.to_bytes(L"\xDA83");
assert(bs == "byte error");
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
myconv.from_bytes('\xA5');
@@ -58,6 +62,7 @@ int main()
catch (const std::range_error&)
{
}
+#endif
}
{
Myconv myconv("byte error", L"wide error");
diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp
index 08dfa2558be1..a7a816b37f9d 100644
--- a/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp
+++ b/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp
@@ -22,4 +22,5 @@ int main()
typedef std::wstring_convert<Codecvt> Myconv;
Myconv myconv;
std::mbstate_t s = myconv.state();
+ ((void)s);
}
diff --git a/test/std/localization/locales/locale.global.templates/use_facet.pass.cpp b/test/std/localization/locales/locale.global.templates/use_facet.pass.cpp
index 303fd790566c..2dba4b68e91f 100644
--- a/test/std/localization/locales/locale.global.templates/use_facet.pass.cpp
+++ b/test/std/localization/locales/locale.global.templates/use_facet.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <locale>
// template <class Facet> const Facet& use_facet(const locale& loc);
@@ -15,6 +14,8 @@
#include <locale>
#include <cassert>
+#include "test_macros.h"
+
int facet_count = 0;
struct my_facet
@@ -32,14 +33,17 @@ std::locale::id my_facet::id;
int main()
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
const my_facet& f = std::use_facet<my_facet>(std::locale());
+ ((void)f); // Prevent unused warning
assert(false);
}
catch (std::bad_cast&)
{
}
+#endif
const my_facet* fp = 0;
{
std::locale loc(std::locale(), new my_facet);
diff --git a/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp b/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
index c7021df8f577..aef2ea93d667 100644
--- a/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
+++ b/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
@@ -22,6 +21,8 @@
#include "count_new.hpp"
#include "platform_support.h" // locale name macros
+#include "test_macros.h"
+
void check(const std::locale& loc)
{
@@ -70,6 +71,7 @@ int main()
check(loc3);
assert(!(loc == loc3));
assert(loc != loc3);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
std::locale((const char*)0);
@@ -86,6 +88,7 @@ int main()
catch (std::runtime_error&)
{
}
+#endif
std::locale ok("");
}
assert(globalMemCounter.checkOutstandingNewEq(0));
diff --git a/test/std/localization/locales/locale/locale.members/combine.pass.cpp b/test/std/localization/locales/locale/locale.members/combine.pass.cpp
index 26a760f773a5..a9919f6a8c67 100644
--- a/test/std/localization/locales/locale/locale.members/combine.pass.cpp
+++ b/test/std/localization/locales/locale/locale.members/combine.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <locale>
// template <class Facet> locale combine(const locale& other) const;
@@ -18,6 +17,8 @@
#include "count_new.hpp"
+#include "test_macros.h"
+
void check(const std::locale& loc)
{
assert(std::has_facet<std::collate<char> >(loc));
@@ -78,6 +79,7 @@ int main()
}
assert(globalMemCounter.checkOutstandingNewEq(0));
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
{
std::locale loc;
@@ -93,4 +95,5 @@ int main()
}
assert(globalMemCounter.checkOutstandingNewEq(0));
}
+#endif
}
diff --git a/test/std/numerics/c.math/ctgmath.pass.cpp b/test/std/numerics/c.math/ctgmath.pass.cpp
index 278217e04840..9e10690e3cac 100644
--- a/test/std/numerics/c.math/ctgmath.pass.cpp
+++ b/test/std/numerics/c.math/ctgmath.pass.cpp
@@ -11,12 +11,9 @@
#include <ctgmath>
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
int main()
{
std::complex<double> cd;
double x = std::sin(0);
+ ((void)x); // Prevent unused warning
}
diff --git a/test/std/numerics/c.math/tgmath_h.pass.cpp b/test/std/numerics/c.math/tgmath_h.pass.cpp
index 23143c7140a6..65fc54ebda51 100644
--- a/test/std/numerics/c.math/tgmath_h.pass.cpp
+++ b/test/std/numerics/c.math/tgmath_h.pass.cpp
@@ -11,10 +11,6 @@
#include <tgmath.h>
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
int main()
{
}
diff --git a/test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp b/test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp
index 21aaa669fd43..4b89414686ba 100644
--- a/test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp
+++ b/test/std/numerics/complex.number/ccmplx/ccomplex.pass.cpp
@@ -11,10 +11,6 @@
#include <ccomplex>
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
int main()
{
std::complex<double> d;
diff --git a/test/std/numerics/complex.number/cmplx.over/UDT_is_rejected.fail.cpp b/test/std/numerics/complex.number/cmplx.over/UDT_is_rejected.fail.cpp
new file mode 100644
index 000000000000..6a3ae48d7bbf
--- /dev/null
+++ b/test/std/numerics/complex.number/cmplx.over/UDT_is_rejected.fail.cpp
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <complex>
+
+// Test that UDT's convertible to an integral or floating point type do not
+// participate in overload resolution.
+
+#include <complex>
+#include <type_traits>
+#include <cassert>
+
+template <class IntT>
+struct UDT {
+ operator IntT() const { return 1; }
+};
+
+UDT<float> ft;
+UDT<double> dt;
+UDT<long double> ldt;
+UDT<int> it;
+UDT<unsigned long> uit;
+
+int main()
+{
+ {
+ std::real(ft); // expected-error {{no matching function}}
+ std::real(dt); // expected-error {{no matching function}}
+ std::real(ldt); // expected-error {{no matching function}}
+ std::real(it); // expected-error {{no matching function}}
+ std::real(uit); // expected-error {{no matching function}}
+ }
+ {
+ std::imag(ft); // expected-error {{no matching function}}
+ std::imag(dt); // expected-error {{no matching function}}
+ std::imag(ldt); // expected-error {{no matching function}}
+ std::imag(it); // expected-error {{no matching function}}
+ std::imag(uit); // expected-error {{no matching function}}
+ }
+ {
+ std::arg(ft); // expected-error {{no matching function}}
+ std::arg(dt); // expected-error {{no matching function}}
+ std::arg(ldt); // expected-error {{no matching function}}
+ std::arg(it); // expected-error {{no matching function}}
+ std::arg(uit); // expected-error {{no matching function}}
+ }
+ {
+ std::norm(ft); // expected-error {{no matching function}}
+ std::norm(dt); // expected-error {{no matching function}}
+ std::norm(ldt); // expected-error {{no matching function}}
+ std::norm(it); // expected-error {{no matching function}}
+ std::norm(uit); // expected-error {{no matching function}}
+ }
+ {
+ std::conj(ft); // expected-error {{no matching function}}
+ std::conj(dt); // expected-error {{no matching function}}
+ std::conj(ldt); // expected-error {{no matching function}}
+ std::conj(it); // expected-error {{no matching function}}
+ std::conj(uit); // expected-error {{no matching function}}
+ }
+ {
+ std::proj(ft); // expected-error {{no matching function}}
+ std::proj(dt); // expected-error {{no matching function}}
+ std::proj(ldt); // expected-error {{no matching function}}
+ std::proj(it); // expected-error {{no matching function}}
+ std::proj(uit); // expected-error {{no matching function}}
+ }
+}
diff --git a/test/std/numerics/complex.number/cmplx.over/arg.pass.cpp b/test/std/numerics/complex.number/cmplx.over/arg.pass.cpp
index 978c6255ac38..c649157a8c34 100644
--- a/test/std/numerics/complex.number/cmplx.over/arg.pass.cpp
+++ b/test/std/numerics/complex.number/cmplx.over/arg.pass.cpp
@@ -24,7 +24,7 @@ void
test(T x, typename std::enable_if<std::is_integral<T>::value>::type* = 0)
{
static_assert((std::is_same<decltype(std::arg(x)), double>::value), "");
- assert(std::arg(x) == arg(std::complex<double>(x, 0)));
+ assert(std::arg(x) == arg(std::complex<double>(static_cast<double>(x), 0)));
}
template <class T>
diff --git a/test/std/numerics/complex.number/cmplx.over/imag.pass.cpp b/test/std/numerics/complex.number/cmplx.over/imag.pass.cpp
index 7decea877fbd..b5cffe9c14a4 100644
--- a/test/std/numerics/complex.number/cmplx.over/imag.pass.cpp
+++ b/test/std/numerics/complex.number/cmplx.over/imag.pass.cpp
@@ -17,6 +17,7 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
#include "../cases.h"
template <class T, int x>
@@ -25,7 +26,7 @@ test(typename std::enable_if<std::is_integral<T>::value>::type* = 0)
{
static_assert((std::is_same<decltype(std::imag(T(x))), double>::value), "");
assert(std::imag(x) == 0);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr T val {x};
static_assert(std::imag(val) == 0, "");
constexpr std::complex<T> t{val, val};
@@ -39,7 +40,7 @@ test(typename std::enable_if<!std::is_integral<T>::value>::type* = 0)
{
static_assert((std::is_same<decltype(std::imag(T(x))), T>::value), "");
assert(std::imag(x) == 0);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr T val {x};
static_assert(std::imag(val) == 0, "");
constexpr std::complex<T> t{val, val};
diff --git a/test/std/numerics/complex.number/cmplx.over/norm.pass.cpp b/test/std/numerics/complex.number/cmplx.over/norm.pass.cpp
index badd5c0cc85f..e847a9413e3e 100644
--- a/test/std/numerics/complex.number/cmplx.over/norm.pass.cpp
+++ b/test/std/numerics/complex.number/cmplx.over/norm.pass.cpp
@@ -24,7 +24,7 @@ void
test(T x, typename std::enable_if<std::is_integral<T>::value>::type* = 0)
{
static_assert((std::is_same<decltype(std::norm(x)), double>::value), "");
- assert(std::norm(x) == norm(std::complex<double>(x, 0)));
+ assert(std::norm(x) == norm(std::complex<double>(static_cast<double>(x), 0)));
}
template <class T>
diff --git a/test/std/numerics/complex.number/cmplx.over/real.pass.cpp b/test/std/numerics/complex.number/cmplx.over/real.pass.cpp
index 491b35890c0c..07ae3ab7a3bd 100644
--- a/test/std/numerics/complex.number/cmplx.over/real.pass.cpp
+++ b/test/std/numerics/complex.number/cmplx.over/real.pass.cpp
@@ -17,6 +17,7 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
#include "../cases.h"
template <class T, int x>
@@ -25,7 +26,7 @@ test(typename std::enable_if<std::is_integral<T>::value>::type* = 0)
{
static_assert((std::is_same<decltype(std::real(T(x))), double>::value), "");
assert(std::real(x) == x);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr T val {x};
static_assert(std::real(val) == val, "");
constexpr std::complex<T> t{val, val};
@@ -39,7 +40,7 @@ test(typename std::enable_if<!std::is_integral<T>::value>::type* = 0)
{
static_assert((std::is_same<decltype(std::real(T(x))), T>::value), "");
assert(std::real(x) == x);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr T val {x};
static_assert(std::real(val) == val, "");
constexpr std::complex<T> t{val, val};
diff --git a/test/std/numerics/complex.number/complex.members/real_imag.pass.cpp b/test/std/numerics/complex.number/complex.members/real_imag.pass.cpp
index 7ead855f5c76..8d55fcdb441e 100644
--- a/test/std/numerics/complex.number/complex.members/real_imag.pass.cpp
+++ b/test/std/numerics/complex.number/complex.members/real_imag.pass.cpp
@@ -15,11 +15,13 @@
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr std::complex<T> c1;
static_assert(c1.real() == 0, "");
static_assert(c1.imag() == 0, "");
diff --git a/test/std/numerics/complex.number/complex.ops/complex_equals_complex.pass.cpp b/test/std/numerics/complex.number/complex.ops/complex_equals_complex.pass.cpp
index 970f021f8e63..59243c7c67a5 100644
--- a/test/std/numerics/complex.number/complex.ops/complex_equals_complex.pass.cpp
+++ b/test/std/numerics/complex.number/complex.ops/complex_equals_complex.pass.cpp
@@ -16,11 +16,13 @@
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::complex<T> lhs(1.5, 2.5);
constexpr std::complex<T> rhs(1.5, -2.5);
diff --git a/test/std/numerics/complex.number/complex.ops/complex_equals_scalar.pass.cpp b/test/std/numerics/complex.number/complex.ops/complex_equals_scalar.pass.cpp
index 3c8b772bcaa5..cd6972b9d0c2 100644
--- a/test/std/numerics/complex.number/complex.ops/complex_equals_scalar.pass.cpp
+++ b/test/std/numerics/complex.number/complex.ops/complex_equals_scalar.pass.cpp
@@ -16,11 +16,13 @@
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::complex<T> lhs(1.5, 2.5);
constexpr T rhs(-2.5);
diff --git a/test/std/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp b/test/std/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp
index ee138c1ecbcd..9c8ffe0b0169 100644
--- a/test/std/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp
+++ b/test/std/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp
@@ -16,11 +16,13 @@
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::complex<T> lhs(1.5, 2.5);
constexpr std::complex<T> rhs(1.5, -2.5);
diff --git a/test/std/numerics/complex.number/complex.ops/complex_not_equals_scalar.pass.cpp b/test/std/numerics/complex.number/complex.ops/complex_not_equals_scalar.pass.cpp
index efb1c0e872db..deb26e2d9990 100644
--- a/test/std/numerics/complex.number/complex.ops/complex_not_equals_scalar.pass.cpp
+++ b/test/std/numerics/complex.number/complex.ops/complex_not_equals_scalar.pass.cpp
@@ -16,11 +16,13 @@
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::complex<T> lhs(1.5, 2.5);
constexpr T rhs(-2.5);
diff --git a/test/std/numerics/complex.number/complex.ops/scalar_equals_complex.pass.cpp b/test/std/numerics/complex.number/complex.ops/scalar_equals_complex.pass.cpp
index 0cd903541fe3..777d7d614e37 100644
--- a/test/std/numerics/complex.number/complex.ops/scalar_equals_complex.pass.cpp
+++ b/test/std/numerics/complex.number/complex.ops/scalar_equals_complex.pass.cpp
@@ -16,11 +16,13 @@
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T lhs(-2.5);
constexpr std::complex<T> rhs(1.5, 2.5);
diff --git a/test/std/numerics/complex.number/complex.ops/scalar_not_equals_complex.pass.cpp b/test/std/numerics/complex.number/complex.ops/scalar_not_equals_complex.pass.cpp
index 7d6003cb891b..6bfffb849626 100644
--- a/test/std/numerics/complex.number/complex.ops/scalar_not_equals_complex.pass.cpp
+++ b/test/std/numerics/complex.number/complex.ops/scalar_not_equals_complex.pass.cpp
@@ -16,11 +16,13 @@
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T lhs(-2.5);
constexpr std::complex<T> rhs(1.5, 2.5);
diff --git a/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp
index e09163a7057d..03ed727cab8c 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp
@@ -35,7 +35,6 @@ test()
void test_edges()
{
typedef std::complex<double> C;
- const double pi = std::atan2(+0., -0.);
const unsigned N = sizeof(testcases) / sizeof(testcases[0]);
for (unsigned i = 0; i < N; ++i)
{
diff --git a/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp
index 0fd9cf79bcbf..a2c55390f2a8 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp
@@ -35,7 +35,6 @@ test()
void test_edges()
{
typedef std::complex<double> C;
- const double pi = std::atan2(+0., -0.);
const unsigned N = sizeof(testcases) / sizeof(testcases[0]);
for (unsigned i = 0; i < N; ++i)
{
diff --git a/test/std/numerics/complex.number/complex.transcendentals/log10.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/log10.pass.cpp
index 58286904ae25..8eb72006a1a5 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/log10.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/log10.pass.cpp
@@ -34,7 +34,6 @@ test()
void test_edges()
{
- const double pi = std::atan2(+0., -0.);
const unsigned N = sizeof(testcases) / sizeof(testcases[0]);
for (unsigned i = 0; i < N; ++i)
{
diff --git a/test/std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp
index 157246947cfe..0d039a159e4f 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/pow_complex_complex.pass.cpp
@@ -36,7 +36,6 @@ test()
void test_edges()
{
- const double pi = std::atan2(+0., -0.);
const unsigned N = sizeof(testcases) / sizeof(testcases[0]);
for (unsigned i = 0; i < N; ++i)
{
diff --git a/test/std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp
index 0752ea59f554..36a2962218dc 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/pow_complex_scalar.pass.cpp
@@ -36,7 +36,6 @@ test()
void test_edges()
{
- const double pi = std::atan2(+0., -0.);
const unsigned N = sizeof(testcases) / sizeof(testcases[0]);
for (unsigned i = 0; i < N; ++i)
{
diff --git a/test/std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp
index aedeec8caacc..74a3857e9325 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/pow_scalar_complex.pass.cpp
@@ -36,7 +36,6 @@ test()
void test_edges()
{
- const double pi = std::atan2(+0., -0.);
const unsigned N = sizeof(testcases) / sizeof(testcases[0]);
for (unsigned i = 0; i < N; ++i)
{
diff --git a/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp
index e1b98ecd0677..7ae59980b09d 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp
@@ -35,7 +35,6 @@ test()
void test_edges()
{
typedef std::complex<double> C;
- const double pi = std::atan2(+0., -0.);
const unsigned N = sizeof(testcases) / sizeof(testcases[0]);
for (unsigned i = 0; i < N; ++i)
{
diff --git a/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp
index 20f2e71b140a..491f3fac5738 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp
@@ -35,7 +35,6 @@ test()
void test_edges()
{
typedef std::complex<double> C;
- const double pi = std::atan2(+0., -0.);
const unsigned N = sizeof(testcases) / sizeof(testcases[0]);
for (unsigned i = 0; i < N; ++i)
{
diff --git a/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp
index 041a7814d033..9f09ab5827de 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp
@@ -36,7 +36,6 @@ test()
void test_edges()
{
typedef std::complex<double> C;
- const double pi = std::atan2(+0., -0.);
const unsigned N = sizeof(testcases) / sizeof(testcases[0]);
for (unsigned i = 0; i < N; ++i)
{
diff --git a/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp
index 9a2276a8b753..8fa419c2179d 100644
--- a/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp
+++ b/test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp
@@ -35,7 +35,6 @@ test()
void test_edges()
{
typedef std::complex<double> C;
- const double pi = std::atan2(+0., -0.);
const unsigned N = sizeof(testcases) / sizeof(testcases[0]);
for (unsigned i = 0; i < N; ++i)
{
diff --git a/test/std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp b/test/std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp
index 72275e01e1be..60b94ab5fc94 100644
--- a/test/std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp
+++ b/test/std/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp
@@ -45,7 +45,6 @@ int main()
// Test return value of assignment.
{
int a1[] = {0, 1, 2};
- int a2[] = {3, 4, 3};
std::valarray<int> v1(a1, 3);
std::slice_array<int> s1 = v1[std::slice(1, 1, 1)];
std::slice_array<int> s2 = v1[std::slice(0, 1, 1)];
diff --git a/test/std/numerics/numarray/template.valarray/valarray.access/access.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.access/access.pass.cpp
index 7bf164aafc20..2e3b83ec7d73 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.access/access.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.access/access.pass.cpp
@@ -23,11 +23,11 @@ int main()
T a[] = {5, 4, 3, 2, 1};
const unsigned N = sizeof(a)/sizeof(a[0]);
std::valarray<T> v(a, N);
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v[i] == a[i]);
v[i] = i;
- assert(v[i] == i);
+ assert(v[i] == static_cast<int>(i));
}
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.access/const_access.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.access/const_access.pass.cpp
index b9736eedd73b..8d5630516c06 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.access/const_access.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.access/const_access.pass.cpp
@@ -23,7 +23,7 @@ int main()
T a[] = {5, 4, 3, 2, 1};
const unsigned N = sizeof(a)/sizeof(a[0]);
const std::valarray<T> v(a, N);
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v[i] == a[i]);
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp
index 2fc42ada85be..3803489c3038 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v2;
v2 = v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v[i]);
}
{
@@ -37,7 +38,7 @@ int main()
std::valarray<T> v2;
v2 = v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v[i]);
}
{
@@ -48,10 +49,10 @@ int main()
std::valarray<T> v2(a, N-2);
v2 = v;
assert(v2.size() == v.size());
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v2[i].size() == v[i].size());
- for (int j = 0; j < v[i].size(); ++j)
+ for (std::size_t j = 0; j < v[i].size(); ++j)
assert(v2[i][j] == v[i][j]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp
index 571f56acd575..7a671a73eee6 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v2;
v2 = {1, 2, 3, 4, 5};
assert(v2.size() == N);
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a[i]);
}
{
@@ -36,7 +37,7 @@ int main()
std::valarray<T> v2;
v2 = {1, 2.5, 3, 4.25, 5};
assert(v2.size() == N);
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a[i]);
}
{
@@ -46,10 +47,10 @@ int main()
std::valarray<T> v2(a, N-2);
v2 = {T(1), T(2), T(3), T(4), T(5)};
assert(v2.size() == N);
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v2[i].size() == a[i].size());
- for (int j = 0; j < a[i].size(); ++j)
+ for (std::size_t j = 0; j < a[i].size(); ++j)
assert(v2[i][j] == a[i][j]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.assign/move_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/move_assign.pass.cpp
index d4f750652e28..d34ff1c64d83 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.assign/move_assign.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.assign/move_assign.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
v2 = std::move(v);
assert(v2.size() == N);
assert(v.size() == 0);
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a[i]);
}
{
@@ -40,7 +41,7 @@ int main()
v2 = std::move(v);
assert(v2.size() == N);
assert(v.size() == 0);
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a[i]);
}
{
@@ -52,10 +53,10 @@ int main()
v2 = std::move(v);
assert(v2.size() == N);
assert(v.size() == 0);
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v2[i].size() == a[i].size());
- for (int j = 0; j < a[i].size(); ++j)
+ for (std::size_t j = 0; j < a[i].size(); ++j)
assert(v2[i][j] == a[i][j]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.assign/value_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/value_assign.pass.cpp
index b9d67f86a212..cf1d34a117bb 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.assign/value_assign.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.assign/value_assign.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -25,7 +26,7 @@ int main()
std::valarray<T> v(a, N);
v = 7;
assert(v.size() == N);
- for (int i = 0; i < v.size(); ++i)
+ for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 7);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/and_valarray.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/and_valarray.pass.cpp
index 5b1c1b9911b4..9ceae5f2df97 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/and_valarray.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/and_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,7 +31,7 @@ int main()
v1 &= v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v3[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/and_value.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/and_value.pass.cpp
index 2106a13e2c35..2d74a33379ce 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/and_value.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/and_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
std::valarray<T> v2(a2, N);
v1 &= 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/divide_valarray.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/divide_valarray.pass.cpp
index 3992d0aa43da..914e632d53fe 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/divide_valarray.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/divide_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,7 +31,7 @@ int main()
v3 /= v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v3[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/divide_value.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/divide_value.pass.cpp
index 7bd1cc84df6c..58ea7f18bcd1 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/divide_value.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/divide_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
std::valarray<T> v2(a2, N);
v2 /= 6;
assert(v1.size() == v2.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/minus_valarray.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/minus_valarray.pass.cpp
index e3d308abacc1..2cc2cce564f4 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/minus_valarray.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/minus_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,7 +31,7 @@ int main()
v3 -= v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v3[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/minus_value.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/minus_value.pass.cpp
index 27ea8c2c0366..49d7c7f5b54d 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/minus_value.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/minus_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
std::valarray<T> v2(a2, N);
v1 -= 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/modulo_valarray.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/modulo_valarray.pass.cpp
index 1754a5575eb5..3bbff99430af 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/modulo_valarray.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/modulo_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,7 +31,7 @@ int main()
v2 %= v1;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v2[i] == v3[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/modulo_value.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/modulo_value.pass.cpp
index 794a0b629268..d372d88a4cfb 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/modulo_value.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/modulo_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
std::valarray<T> v2(a2, N);
v1 %= 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/or_valarray.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/or_valarray.pass.cpp
index 0d70b4e715da..4a1be1916f8a 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/or_valarray.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/or_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,7 +31,7 @@ int main()
v1 |= v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v3[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/or_value.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/or_value.pass.cpp
index 4030907ff3e7..bab99bca0f39 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/or_value.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/or_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
std::valarray<T> v2(a2, N);
v1 |= 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/plus_valarray.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/plus_valarray.pass.cpp
index fdf999c2a044..5f6047f65f4a 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/plus_valarray.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/plus_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,7 +31,7 @@ int main()
v1 += v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v3[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/plus_value.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/plus_value.pass.cpp
index 23d6d9d05229..0b5e88edaeed 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/plus_value.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/plus_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
std::valarray<T> v2(a2, N);
v1 += 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_left_valarray.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_left_valarray.pass.cpp
index ad44e3887eca..962648118662 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_left_valarray.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_left_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,7 +31,7 @@ int main()
v1 <<= v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v3[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_left_value.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_left_value.pass.cpp
index 366407a95c6f..05fa3b94c6bc 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_left_value.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_left_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
std::valarray<T> v2(a2, N);
v1 <<= 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_right_valarray.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_right_valarray.pass.cpp
index f7df16b843ca..7161d27e60d7 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_right_valarray.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_right_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,7 +31,7 @@ int main()
v3 >>= v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v3[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_right_value.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_right_value.pass.cpp
index 7c568b14cbea..726ac9b8f90b 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_right_value.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/shift_right_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
std::valarray<T> v2(a2, N);
v2 >>= 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/times_valarray.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/times_valarray.pass.cpp
index d3cf1eb88641..02c0cc59e74e 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/times_valarray.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/times_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,7 +31,7 @@ int main()
v1 *= v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v3[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/times_value.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/times_value.pass.cpp
index aea9806bc0d0..1740e449d11b 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/times_value.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/times_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
std::valarray<T> v2(a2, N);
v1 *= 6;
assert(v1.size() == v2.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/xor_valarray.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/xor_valarray.pass.cpp
index a10bd7e0a000..452b581e0b2e 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/xor_valarray.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/xor_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,7 +31,7 @@ int main()
v1 ^= v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v3[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cassign/xor_value.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cassign/xor_value.pass.cpp
index 327952f7b3aa..6951653b46b6 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cassign/xor_value.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cassign/xor_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,7 +28,7 @@ int main()
std::valarray<T> v2(a2, N);
v1 ^= 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp
index 04ac2cdf1b90..6ebff7256498 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cons/copy.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -25,7 +26,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v[i]);
}
{
@@ -35,7 +36,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v[i]);
}
{
@@ -45,10 +46,10 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = v;
assert(v2.size() == v.size());
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v2[i].size() == v[i].size());
- for (int j = 0; j < v[i].size(); ++j)
+ for (std::size_t j = 0; j < v[i].size(); ++j)
assert(v2[i][j] == v[i][j]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp
index 1ab460f1b9d5..4dfbe11bde9c 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp
@@ -25,7 +25,7 @@ int main()
const unsigned N = sizeof(a)/sizeof(a[0]);
std::valarray<T> v = {1, 2, 3, 4, 5};
assert(v.size() == N);
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
assert(v[i] == a[i]);
}
{
@@ -34,7 +34,7 @@ int main()
const unsigned N = sizeof(a)/sizeof(a[0]);
std::valarray<T> v = {1, 2, 3, 4, 5};
assert(v.size() == N);
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
assert(v[i] == a[i]);
}
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/move.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/move.pass.cpp
index 6ac8773fa4e2..a9692618e75f 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cons/move.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cons/move.pass.cpp
@@ -16,6 +16,7 @@
#include <valarray>
#include <utility>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v2 = std::move(v);
assert(v2.size() == N);
assert(v.size() == 0);
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a[i]);
}
{
@@ -39,7 +40,7 @@ int main()
std::valarray<T> v2 = std::move(v);
assert(v2.size() == N);
assert(v.size() == 0);
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a[i]);
}
{
@@ -50,10 +51,10 @@ int main()
std::valarray<T> v2 = std::move(v);
assert(v2.size() == N);
assert(v.size() == 0);
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v2[i].size() == a[i].size());
- for (int j = 0; j < v2[i].size(); ++j)
+ for (std::size_t j = 0; j < v2[i].size(); ++j)
assert(v2[i][j] == a[i][j]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/pointer_size.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/pointer_size.pass.cpp
index 3d3649ee40ac..f98230f47dd9 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cons/pointer_size.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cons/pointer_size.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -24,7 +25,7 @@ int main()
const unsigned N = sizeof(a)/sizeof(a[0]);
std::valarray<T> v(a, N);
assert(v.size() == N);
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
assert(v[i] == a[i]);
}
{
@@ -33,7 +34,7 @@ int main()
const unsigned N = sizeof(a)/sizeof(a[0]);
std::valarray<T> v(a, N);
assert(v.size() == N);
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
assert(v[i] == a[i]);
}
{
@@ -42,10 +43,10 @@ int main()
const unsigned N = sizeof(a)/sizeof(a[0]);
std::valarray<T> v(a, N);
assert(v.size() == N);
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v[i].size() == a[i].size());
- for (int j = 0; j < v[i].size(); ++j)
+ for (std::size_t j = 0; j < v[i].size(); ++j)
assert(v[i][j] == a[i][j]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.members/resize.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.members/resize.pass.cpp
index 176d958aab92..9a527c2509b4 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.members/resize.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.members/resize.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -25,17 +26,17 @@ int main()
std::valarray<T> v1(a1, N1);
v1.resize(8);
assert(v1.size() == 8);
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == 0);
v1.resize(0);
assert(v1.size() == 0);
v1.resize(80);
assert(v1.size() == 80);
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == 0);
v1.resize(40);
assert(v1.size() == 40);
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == 0);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.members/swap.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.members/swap.pass.cpp
index a90a80936376..b2b55fdc3c43 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.members/swap.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.members/swap.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -30,33 +31,31 @@ int main()
std::valarray<T> v2_save = v2;
v1.swap(v2);
assert(v1.size() == v2_save.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2_save[i]);
assert(v2.size() == v1_save.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v1_save[i]);
}
{
typedef int T;
T a1[] = {1, 2, 3, 4, 5};
const unsigned N1 = sizeof(a1)/sizeof(a1[0]);
- const unsigned N2 = 0;
std::valarray<T> v1(a1, N1);
std::valarray<T> v2;
std::valarray<T> v1_save = v1;
std::valarray<T> v2_save = v2;
v1.swap(v2);
assert(v1.size() == v2_save.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2_save[i]);
assert(v2.size() == v1_save.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v1_save[i]);
}
{
typedef int T;
T a2[] = {6, 7, 8, 9, 10, 11, 12};
- const unsigned N1 = 0;
const unsigned N2 = sizeof(a2)/sizeof(a2[0]);
std::valarray<T> v1;
std::valarray<T> v2(a2, N2);
@@ -64,26 +63,24 @@ int main()
std::valarray<T> v2_save = v2;
v1.swap(v2);
assert(v1.size() == v2_save.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2_save[i]);
assert(v2.size() == v1_save.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v1_save[i]);
}
{
typedef int T;
- const unsigned N1 = 0;
- const unsigned N2 = 0;
std::valarray<T> v1;
std::valarray<T> v2;
std::valarray<T> v1_save = v1;
std::valarray<T> v2_save = v2;
v1.swap(v2);
assert(v1.size() == v2_save.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2_save[i]);
assert(v2.size() == v1_save.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v1_save[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.unary/bit_not.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.unary/bit_not.pass.cpp
index c1d240cb6798..5b2501f7e357 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.unary/bit_not.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.unary/bit_not.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -25,7 +26,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = ~v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == ~v[i]);
}
{
@@ -35,10 +36,10 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = ~v;
assert(v2.size() == v.size());
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v2[i].size() == v[i].size());
- for (int j = 0; j < v[i].size(); ++j)
+ for (std::size_t j = 0; j < v[i].size(); ++j)
assert(v2[i][j] == ~v[i][j]);
}
}
@@ -49,7 +50,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = ~(v + v);
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == ~(2*v[i]));
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.unary/negate.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.unary/negate.pass.cpp
index 25674bb44d92..f4a83427cd2b 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.unary/negate.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.unary/negate.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -25,7 +26,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = -v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == -v[i]);
}
{
@@ -35,7 +36,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = -v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == -v[i]);
}
{
@@ -45,10 +46,10 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = -v;
assert(v2.size() == v.size());
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v2[i].size() == v[i].size());
- for (int j = 0; j < v[i].size(); ++j)
+ for (std::size_t j = 0; j < v[i].size(); ++j)
assert(v2[i][j] == -v[i][j]);
}
}
@@ -59,7 +60,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = -(v + v);
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == -2*v[i]);
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.unary/not.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.unary/not.pass.cpp
index 306ea0c18470..844b3d2100b3 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.unary/not.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.unary/not.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -25,7 +26,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<bool> v2 = !v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == !v[i]);
}
{
@@ -35,7 +36,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<bool> v2 = !(v + v);
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == !(2 * v[i]));
}
}
diff --git a/test/std/numerics/numarray/template.valarray/valarray.unary/plus.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.unary/plus.pass.cpp
index 4bcdaf095ff5..8df0494552d3 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.unary/plus.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.unary/plus.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -25,7 +26,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = +v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == +v[i]);
}
{
@@ -35,7 +36,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = +v;
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == +v[i]);
}
{
@@ -45,10 +46,10 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = +v;
assert(v2.size() == v.size());
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
{
assert(v2[i].size() == v[i].size());
- for (int j = 0; j < v[i].size(); ++j)
+ for (std::size_t j = 0; j < v[i].size(); ++j)
assert(v2[i][j] == +v[i][j]);
}
}
@@ -59,7 +60,7 @@ int main()
std::valarray<T> v(a, N);
std::valarray<T> v2 = +(v + v);
assert(v2.size() == v.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == +2*v[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_valarray_valarray.pass.cpp
index 9214e61fb4da..724b86841162 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_valarray_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -29,7 +30,7 @@ int main()
std::valarray<T> v3 = v1 & v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_valarray_value.pass.cpp
index 0976a88dcb81..360ffe5ebf84 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_valarray_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = v1 & 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_value_valarray.pass.cpp
index e3dd180b2181..7de81179d9f4 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/and_value_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = 3 & v1;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_valarray_valarray.pass.cpp
index ff250afd2a1a..cb02459cd911 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_valarray_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -29,7 +30,7 @@ int main()
std::valarray<T> v3 = v1 / v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_valarray_value.pass.cpp
index ffbebab1e1ae..0b692aa35a2d 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_valarray_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = v1 / 6;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_value_valarray.pass.cpp
index 1a7f2f07c83a..c6c339b2a445 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/divide_value_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = 3 / v1;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_valarray_valarray.pass.cpp
index 1f0354e8ac63..ddea683ceae2 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_valarray_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -29,7 +30,7 @@ int main()
std::valarray<T> v3 = v1 - v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_valarray_value.pass.cpp
index 382cab8eae6e..b5fc58a9f5e1 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_valarray_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = v1 - 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_value_valarray.pass.cpp
index 7f00aba84884..1780eda20d58 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/minus_value_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = 3 - v1;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_valarray_valarray.pass.cpp
index 0a9cf3884c08..58b78a322091 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_valarray_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -29,7 +30,7 @@ int main()
std::valarray<T> v3 = v1 % v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_valarray_value.pass.cpp
index 12c4c2453702..083fdabd8aa4 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_valarray_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = v1 % 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_value_valarray.pass.cpp
index 1d73887217e1..55801ca69dad 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/modulo_value_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = 3 % v1;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_valarray_valarray.pass.cpp
index a23ea4f58b8c..adea116c9f94 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_valarray_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -29,7 +30,7 @@ int main()
std::valarray<T> v3 = v1 | v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_valarray_value.pass.cpp
index f617c27ae7fc..3f526b8f6619 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_valarray_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = v1 | 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_value_valarray.pass.cpp
index 8903f438aaf1..246a48532df0 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/or_value_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = 3 | v1;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_valarray_valarray.pass.cpp
index 1167772aff6a..82ebebaa7b17 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_valarray_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -29,7 +30,7 @@ int main()
std::valarray<T> v3 = v1 + v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_valarray_value.pass.cpp
index b1b4e6931c0c..68c7528215e5 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_valarray_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = v1 + 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_value_valarray.pass.cpp
index df22853488e9..723ec62d8363 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/plus_value_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = 3 + v1;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_valarray_valarray.pass.cpp
index 42a7c419a3a3..31d50eeb8185 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_valarray_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -29,7 +30,7 @@ int main()
std::valarray<T> v3 = v1 << v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_valarray_value.pass.cpp
index 753ba38f357f..646b55ed3374 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_valarray_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = v1 << 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_value_valarray.pass.cpp
index 640ce1a47b32..5ddce6fd499f 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_left_value_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = 3 << v1;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_valarray.pass.cpp
index 8e6358d62060..b6c4c115038b 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -29,7 +30,7 @@ int main()
std::valarray<T> v3 = v1 >> v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_value.pass.cpp
index 0c0ba54463e1..abc7726dee92 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_valarray_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = v1 >> 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_value_valarray.pass.cpp
index ad5418af0267..956ec055c47e 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/shift_right_value_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = 40 >> v1;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_valarray_valarray.pass.cpp
index 69a3bffc3e77..23cbdbe922cb 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_valarray_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -29,7 +30,7 @@ int main()
std::valarray<T> v3 = v1 * v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_valarray_value.pass.cpp
index c4fb410de768..cf87f0094cd0 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_valarray_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = v1 * 6;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_value_valarray.pass.cpp
index f5d877783ded..23b078e2d1ab 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/times_value_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = 6 * v1;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_valarray_valarray.pass.cpp
index 71b505b0cbe8..e550d0c7fe37 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_valarray_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -29,7 +30,7 @@ int main()
std::valarray<T> v3 = v1 ^ v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_valarray_value.pass.cpp
index 8dbe6843cd24..d7d5aa497ab4 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_valarray_value.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = v1 ^ 3;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_value_valarray.pass.cpp
index face0635dfb4..3e83ff9ae176 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.binary/xor_value_valarray.pass.cpp
@@ -15,6 +15,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,7 +27,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v2 = 3 ^ v1;
assert(v1.size() == v2.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == a2[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_valarray_valarray.pass.cpp
index af2a1b3ed792..003ed3d2cfba 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_valarray_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -31,7 +32,7 @@ int main()
std::valarray<bool> v3 = v1 && v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_valarray_value.pass.cpp
index f34fe9642574..59f2999a2a1d 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_valarray_value.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<bool> v3 = v1 && 5;
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
{
@@ -39,7 +40,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<bool> v3 = v1 && 0;
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_value_valarray.pass.cpp
index c323d13ff42d..9be01bfcdd8f 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/and_value_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<bool> v3 = 5 && v2;
assert(v2.size() == v3.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
{
@@ -39,7 +40,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<bool> v3 = 0 && v2;
assert(v2.size() == v3.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_valarray_valarray.pass.cpp
index 6222e91595dd..78dabed3a46b 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_valarray_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -31,7 +32,7 @@ int main()
std::valarray<bool> v3 = v1 == v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_valarray_value.pass.cpp
index dca65055b2a0..31c040bfe530 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_valarray_value.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<bool> v3 = v1 == 2;
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_value_valarray.pass.cpp
index 532219e2e858..89d627de5e7a 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/equal_value_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<bool> v3 = 2 == v2;
assert(v2.size() == v3.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_valarray_valarray.pass.cpp
index 75e62693baef..f4a5e18e839d 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_valarray_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -31,7 +32,7 @@ int main()
std::valarray<bool> v3 = v1 >= v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_valarray_value.pass.cpp
index 020706dfa2ef..f0ea1e9f1e5f 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_valarray_value.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<bool> v3 = v1 >= 2;
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_value_valarray.pass.cpp
index faf2003adb7f..99b97d55cce2 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_equal_value_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<bool> v3 = 2 >= v2;
assert(v2.size() == v3.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_valarray_valarray.pass.cpp
index 3276085f37dc..bdfd191e4170 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_valarray_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -31,7 +32,7 @@ int main()
std::valarray<bool> v3 = v1 > v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_valarray_value.pass.cpp
index 1ab774cdfb48..a6cef86721df 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_valarray_value.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<bool> v3 = v1 > 2;
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_value_valarray.pass.cpp
index c5012d6fc0e5..712e39681e6f 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/greater_value_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<bool> v3 = 2 > v2;
assert(v2.size() == v3.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_valarray_valarray.pass.cpp
index ceb6658833eb..8ba8394fac12 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_valarray_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -31,7 +32,7 @@ int main()
std::valarray<bool> v3 = v1 <= v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_valarray_value.pass.cpp
index 4a391a3f3799..242ce8a42c2e 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_valarray_value.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<bool> v3 = v1 <= 2;
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_value_valarray.pass.cpp
index cf34e18b92c0..1b9ea4dccf56 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_equal_value_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<bool> v3 = 2 <= v2;
assert(v2.size() == v3.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_valarray_valarray.pass.cpp
index 0fa99488b791..5a5408537e8d 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_valarray_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -31,7 +32,7 @@ int main()
std::valarray<bool> v3 = v1 < v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_valarray_value.pass.cpp
index 7a47c900a8f8..50b074a1b619 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_valarray_value.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<bool> v3 = v1 < 2;
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_value_valarray.pass.cpp
index 4d6cbadcc8b5..248037d44ab3 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/less_value_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<bool> v3 = 2 < v2;
assert(v2.size() == v3.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_valarray_valarray.pass.cpp
index c9675a9ce3e7..a4404d14a084 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_valarray_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -31,7 +32,7 @@ int main()
std::valarray<bool> v3 = v1 != v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_valarray_value.pass.cpp
index 9daa7289b715..45df48f944c0 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_valarray_value.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<bool> v3 = v1 != 2;
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_value_valarray.pass.cpp
index 37439aabcb28..8545464470e7 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/not_equal_value_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<bool> v3 = 2 != v2;
assert(v2.size() == v3.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_valarray_valarray.pass.cpp
index 9a2f84e8f7da..1f2a7da9667c 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_valarray_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -31,7 +32,7 @@ int main()
std::valarray<bool> v3 = v1 || v2;
assert(v1.size() == v2.size());
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_valarray_value.pass.cpp
index 789df5badf04..426c0558bee4 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_valarray_value.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<bool> v3 = v1 || 5;
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
{
@@ -39,7 +40,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<bool> v3 = v1 || 0;
assert(v1.size() == v3.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_value_valarray.pass.cpp
index d66905960274..3bf0fe79da96 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.comparison/or_value_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<bool> v3 = 5 || v2;
assert(v2.size() == v3.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
{
@@ -39,7 +40,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<bool> v3 = 0 || v2;
assert(v2.size() == v3.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.special/swap.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.special/swap.pass.cpp
index 84f73945c401..cb1807bf3809 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.special/swap.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.special/swap.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -32,33 +33,31 @@ int main()
std::valarray<T> v2_save = v2;
swap(v1, v2);
assert(v1.size() == v2_save.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2_save[i]);
assert(v2.size() == v1_save.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v1_save[i]);
}
{
typedef int T;
T a1[] = {1, 2, 3, 4, 5};
const unsigned N1 = sizeof(a1)/sizeof(a1[0]);
- const unsigned N2 = 0;
std::valarray<T> v1(a1, N1);
std::valarray<T> v2;
std::valarray<T> v1_save = v1;
std::valarray<T> v2_save = v2;
swap(v1, v2);
assert(v1.size() == v2_save.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2_save[i]);
assert(v2.size() == v1_save.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v1_save[i]);
}
{
typedef int T;
T a2[] = {6, 7, 8, 9, 10, 11, 12};
- const unsigned N1 = 0;
const unsigned N2 = sizeof(a2)/sizeof(a2[0]);
std::valarray<T> v1;
std::valarray<T> v2(a2, N2);
@@ -66,26 +65,24 @@ int main()
std::valarray<T> v2_save = v2;
swap(v1, v2);
assert(v1.size() == v2_save.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2_save[i]);
assert(v2.size() == v1_save.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v1_save[i]);
}
{
typedef int T;
- const unsigned N1 = 0;
- const unsigned N2 = 0;
std::valarray<T> v1;
std::valarray<T> v2;
std::valarray<T> v1_save = v1;
std::valarray<T> v2_save = v2;
swap(v1, v2);
assert(v1.size() == v2_save.size());
- for (int i = 0; i < v1.size(); ++i)
+ for (std::size_t i = 0; i < v1.size(); ++i)
assert(v1[i] == v2_save[i]);
assert(v2.size() == v1_save.size());
- for (int i = 0; i < v2.size(); ++i)
+ for (std::size_t i = 0; i < v2.size(); ++i)
assert(v2[i] == v1_save[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/abs_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/abs_valarray.pass.cpp
index 7d112a61140e..9af8b1a9365c 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/abs_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/abs_valarray.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -28,7 +29,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = abs(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(v3[i] == a3[i]);
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/acos_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/acos_valarray.pass.cpp
index ef2451d76457..2814e2ed1b00 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/acos_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/acos_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = acos(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/asin_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/asin_valarray.pass.cpp
index 11c7c68d664a..f2f873cc6169 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/asin_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/asin_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = asin(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_valarray_valarray.pass.cpp
index b860413805b8..d5ae07be3634 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_valarray_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -47,7 +48,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<T> v3 = atan2(v1, v2);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_valarray_value.pass.cpp
index 94ffebf79d8d..8345f950dead 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_valarray_value.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = atan2(v1, .75);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_value_valarray.pass.cpp
index 360e70ee7cdd..f28a69a174da 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan2_value_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = atan2(.75, v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan_valarray.pass.cpp
index e66118b1d6de..78740a2b8fe2 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/atan_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = atan(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/cos_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/cos_valarray.pass.cpp
index baeb0d067008..eb5b9a3073d5 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/cos_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/cos_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = cos(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/cosh_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/cosh_valarray.pass.cpp
index 02a547a54404..f8075d31b7e3 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/cosh_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/cosh_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = cosh(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/exp_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/exp_valarray.pass.cpp
index dce9c5546f78..741e1abba8dd 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/exp_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/exp_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = exp(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/log10_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/log10_valarray.pass.cpp
index 2b9908198476..a2cfe6846c2d 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/log10_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/log10_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = log10(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/log_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/log_valarray.pass.cpp
index 2c51cd6ed405..d3795f97f19a 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/log_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/log_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = log(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_valarray_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_valarray_valarray.pass.cpp
index 37ca74292aad..d0f8bdb7c482 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_valarray_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_valarray_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -47,7 +48,7 @@ int main()
std::valarray<T> v2(a2, N);
std::valarray<T> v3 = pow(v1, v2);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_valarray_value.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_valarray_value.pass.cpp
index 290ddc6f63da..22017237bfa8 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_valarray_value.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_valarray_value.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = pow(v1, 2.0);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_value_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_value_valarray.pass.cpp
index f52990b4be7d..e34f664c2bcf 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_value_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/pow_value_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = pow(2.0, v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sin_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sin_valarray.pass.cpp
index f05bd058fd72..30b30caf9713 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sin_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sin_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = sin(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sinh_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sinh_valarray.pass.cpp
index 73dca833bf24..6fbb4f0635f3 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sinh_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sinh_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = sinh(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sqrt_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sqrt_valarray.pass.cpp
index 193dcd21fd1e..e577a83ad6be 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sqrt_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/sqrt_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = sqrt(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/tan_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/tan_valarray.pass.cpp
index 021dbc4d7754..9db12a351fbf 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/tan_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/tan_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = tan(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/tanh_valarray.pass.cpp b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/tanh_valarray.pass.cpp
index 4cc58c321af1..dfcd53106cf5 100644
--- a/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/tanh_valarray.pass.cpp
+++ b/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/tanh_valarray.pass.cpp
@@ -18,6 +18,7 @@
#include <valarray>
#include <cassert>
#include <sstream>
+#include <cstddef>
bool is_about(double x, double y, int p)
{
@@ -45,7 +46,7 @@ int main()
std::valarray<T> v1(a1, N);
std::valarray<T> v3 = tanh(v1);
assert(v3.size() == v1.size());
- for (int i = 0; i < v3.size(); ++i)
+ for (std::size_t i = 0; i < v3.size(); ++i)
assert(is_about(v3[i], a3[i], 10));
}
}
diff --git a/test/std/numerics/numarray/valarray.range/end_const.pass.cpp b/test/std/numerics/numarray/valarray.range/end_const.pass.cpp
index 7363508943bb..4d0015343e95 100644
--- a/test/std/numerics/numarray/valarray.range/end_const.pass.cpp
+++ b/test/std/numerics/numarray/valarray.range/end_const.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -26,6 +27,6 @@ int main()
const unsigned N = sizeof(a)/sizeof(a[0]);
const std::valarray<T> v(a, N);
assert(v[v.size()-1] == 5);
- assert(end(v) - begin(v) == v.size());
+ assert(static_cast<std::size_t>(end(v) - begin(v)) == v.size());
}
}
diff --git a/test/std/numerics/numarray/valarray.range/end_non_const.pass.cpp b/test/std/numerics/numarray/valarray.range/end_non_const.pass.cpp
index f095f5cc35ee..012434e8a6e6 100644
--- a/test/std/numerics/numarray/valarray.range/end_non_const.pass.cpp
+++ b/test/std/numerics/numarray/valarray.range/end_non_const.pass.cpp
@@ -17,6 +17,7 @@
#include <valarray>
#include <cassert>
+#include <cstddef>
int main()
{
@@ -27,6 +28,6 @@ int main()
std::valarray<T> v(a, N);
*(end(v) - 1) = 10;
assert(v[v.size()-1] == 10);
- assert(end(v) - begin(v) == v.size());
+ assert(static_cast<std::size_t>(end(v) - begin(v)) == v.size());
}
}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp
new file mode 100644
index 000000000000..7a8a60835f83
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::gcd(false, 4);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp
new file mode 100644
index 000000000000..909d7cbfc4f4
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::gcd(2, true);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool3.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool3.fail.cpp
new file mode 100644
index 000000000000..75a1bc128761
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool3.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::gcd<volatile bool, int>(false, 4);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp
new file mode 100644
index 000000000000..406b498508a9
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::gcd<int, const bool>(2, true);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp
new file mode 100644
index 000000000000..9354a4eb0287
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::gcd(2.0, 4);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp
new file mode 100644
index 000000000000..fa1b7da4811a
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::gcd(4, 6.0);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
new file mode 100644
index 000000000000..af065b84d1bb
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
@@ -0,0 +1,132 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+#include <numeric>
+#include <cassert>
+#include <cstdlib> // for rand()
+#include <iostream>
+
+constexpr struct {
+ int x;
+ int y;
+ int expect;
+} Cases[] = {
+ {0, 0, 0},
+ {1, 0, 1},
+ {0, 1, 1},
+ {1, 1, 1},
+ {2, 3, 1},
+ {2, 4, 2},
+ {36, 17, 1},
+ {36, 18, 18}
+};
+
+
+template <typename Input1, typename Input2, typename Output>
+constexpr bool test0(Input1 in1, Input2 in2, Output out)
+{
+ static_assert((std::is_same<Output, decltype(std::gcd(in1, in2))>::value), "" );
+ static_assert((std::is_same<Output, decltype(std::gcd(in2, in1))>::value), "" );
+ return out == std::gcd(in1, in2) ? true : (std::abort(), false);
+}
+
+
+template <typename Input1, typename Input2 = Input1>
+constexpr bool do_test(int = 0)
+{
+ using S1 = typename std::make_signed<Input1>::type;
+ using S2 = typename std::make_signed<Input2>::type;
+ using U1 = typename std::make_unsigned<Input1>::type;
+ using U2 = typename std::make_unsigned<Input2>::type;
+ bool accumulate = true;
+ for (auto TC : Cases) {
+ { // Test with two signed types
+ using Output = std::common_type_t<S1, S2>;
+ accumulate &= test0<S1, S2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(-TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(-TC.x, -TC.y, TC.expect);
+ }
+ { // test with two unsigned types
+ using Output = std::common_type_t<U1, U2>;
+ accumulate &= test0<U1, U2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, U1, Output>(TC.x, TC.y, TC.expect);
+ }
+ { // Test with mixed signs
+ using Output = std::common_type_t<S1, U2>;
+ accumulate &= test0<S1, U2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, S1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, U2, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, S1, Output>(TC.x, -TC.y, TC.expect);
+ }
+ { // Test with mixed signs
+ using Output = std::common_type_t<S2, U1>;
+ accumulate &= test0<S2, U1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U1, S2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, U1, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<U1, S2, Output>(TC.x, -TC.y, TC.expect);
+ }
+ }
+ return accumulate;
+}
+
+int main()
+{
+ auto non_cce = std::rand(); // a value that can't possibly be constexpr
+
+ static_assert(do_test<signed char>(), "");
+ static_assert(do_test<short>(), "");
+ static_assert(do_test<int>(), "");
+ static_assert(do_test<long>(), "");
+ static_assert(do_test<long long>(), "");
+
+ assert(do_test<signed char>(non_cce));
+ assert(do_test<short>(non_cce));
+ assert(do_test<int>(non_cce));
+ assert(do_test<long>(non_cce));
+ assert(do_test<long long>(non_cce));
+
+ static_assert(do_test< int8_t>(), "");
+ static_assert(do_test<int16_t>(), "");
+ static_assert(do_test<int32_t>(), "");
+ static_assert(do_test<int64_t>(), "");
+
+ assert(do_test< int8_t>(non_cce));
+ assert(do_test<int16_t>(non_cce));
+ assert(do_test<int32_t>(non_cce));
+ assert(do_test<int64_t>(non_cce));
+
+ static_assert(do_test<signed char, int>(), "");
+ static_assert(do_test<int, signed char>(), "");
+ static_assert(do_test<short, int>(), "");
+ static_assert(do_test<int, short>(), "");
+ static_assert(do_test<int, long>(), "");
+ static_assert(do_test<long, int>(), "");
+ static_assert(do_test<int, long long>(), "");
+ static_assert(do_test<long long, int>(), "");
+
+ assert((do_test<signed char, int>(non_cce)));
+ assert((do_test<int, signed char>(non_cce)));
+ assert((do_test<short, int>(non_cce)));
+ assert((do_test<int, short>(non_cce)));
+ assert((do_test<int, long>(non_cce)));
+ assert((do_test<long, int>(non_cce)));
+ assert((do_test<int, long long>(non_cce)));
+ assert((do_test<long long, int>(non_cce)));
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp
new file mode 100644
index 000000000000..1492c25adfc8
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::lcm(false, 4);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp
new file mode 100644
index 000000000000..de891f3ee654
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::lcm(2, true);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp
new file mode 100644
index 000000000000..d2a7f52e572a
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::lcm<volatile bool, int>(false, 4);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp
new file mode 100644
index 000000000000..88ca68bf08a9
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::lcm<int, const bool>(2, true);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp
new file mode 100644
index 000000000000..082631dc038e
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::lcm(2.0, 4);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp
new file mode 100644
index 000000000000..8ab68a4e6992
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
+
+// Remarks: If either M or N is not an integer type,
+// or if either is (a possibly cv-qualified) bool, the program is ill-formed.
+
+#include <numeric>
+
+
+int main()
+{
+ std::lcm(4, 6.0);
+}
diff --git a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
new file mode 100644
index 000000000000..cd03d99ebf13
--- /dev/null
+++ b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
@@ -0,0 +1,131 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <numeric>
+
+// template<class _M, class _N>
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
+
+#include <numeric>
+#include <cassert>
+#include <cstdlib>
+#include <iostream>
+
+constexpr struct {
+ int x;
+ int y;
+ int expect;
+} Cases[] = {
+ {0, 0, 0},
+ {1, 0, 0},
+ {0, 1, 0},
+ {1, 1, 1},
+ {2, 3, 6},
+ {2, 4, 4},
+ {3, 17, 51},
+ {36, 18, 36}
+};
+
+template <typename Input1, typename Input2, typename Output>
+constexpr bool test0(Input1 in1, Input2 in2, Output out)
+{
+ static_assert((std::is_same<Output, decltype(std::lcm(Input1(0), Input2(0)))>::value), "" );
+ static_assert((std::is_same<Output, decltype(std::lcm(Input2(0), Input1(0)))>::value), "" );
+ return out == std::lcm(in1, in2) ? true : (std::abort(), false);
+}
+
+
+template <typename Input1, typename Input2 = Input1>
+constexpr bool do_test(int = 0)
+{
+ using S1 = typename std::make_signed<Input1>::type;
+ using S2 = typename std::make_signed<Input2>::type;
+ using U1 = typename std::make_unsigned<Input1>::type;
+ using U2 = typename std::make_unsigned<Input2>::type;
+ bool accumulate = true;
+ for (auto TC : Cases) {
+ { // Test with two signed types
+ using Output = std::common_type_t<S1, S2>;
+ accumulate &= test0<S1, S2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S1, S2, Output>(-TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(TC.x, -TC.y, TC.expect);
+ accumulate &= test0<S2, S1, Output>(-TC.x, -TC.y, TC.expect);
+ }
+ { // test with two unsigned types
+ using Output = std::common_type_t<U1, U2>;
+ accumulate &= test0<U1, U2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, U1, Output>(TC.x, TC.y, TC.expect);
+ }
+ { // Test with mixed signs
+ using Output = std::common_type_t<S1, U2>;
+ accumulate &= test0<S1, U2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, S1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S1, U2, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<U2, S1, Output>(TC.x, -TC.y, TC.expect);
+ }
+ { // Test with mixed signs
+ using Output = std::common_type_t<S2, U1>;
+ accumulate &= test0<S2, U1, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<U1, S2, Output>(TC.x, TC.y, TC.expect);
+ accumulate &= test0<S2, U1, Output>(-TC.x, TC.y, TC.expect);
+ accumulate &= test0<U1, S2, Output>(TC.x, -TC.y, TC.expect);
+ }
+ }
+ return accumulate;
+}
+
+int main()
+{
+ auto non_cce = std::rand(); // a value that can't possibly be constexpr
+
+ static_assert(do_test<signed char>(), "");
+ static_assert(do_test<short>(), "");
+ static_assert(do_test<int>(), "");
+ static_assert(do_test<long>(), "");
+ static_assert(do_test<long long>(), "");
+
+ assert(do_test<signed char>(non_cce));
+ assert(do_test<short>(non_cce));
+ assert(do_test<int>(non_cce));
+ assert(do_test<long>(non_cce));
+ assert(do_test<long long>(non_cce));
+
+ static_assert(do_test< int8_t>(), "");
+ static_assert(do_test<int16_t>(), "");
+ static_assert(do_test<int32_t>(), "");
+ static_assert(do_test<int64_t>(), "");
+
+ assert(do_test< int8_t>(non_cce));
+ assert(do_test<int16_t>(non_cce));
+ assert(do_test<int32_t>(non_cce));
+ assert(do_test<int64_t>(non_cce));
+
+ static_assert(do_test<signed char, int>(), "");
+ static_assert(do_test<int, signed char>(), "");
+ static_assert(do_test<short, int>(), "");
+ static_assert(do_test<int, short>(), "");
+ static_assert(do_test<int, long>(), "");
+ static_assert(do_test<long, int>(), "");
+ static_assert(do_test<int, long long>(), "");
+ static_assert(do_test<long long, int>(), "");
+
+ assert((do_test<signed char, int>(non_cce)));
+ assert((do_test<int, signed char>(non_cce)));
+ assert((do_test<short, int>(non_cce)));
+ assert((do_test<int, short>(non_cce)));
+ assert((do_test<int, long>(non_cce)));
+ assert((do_test<long, int>(non_cce)));
+ assert((do_test<int, long long>(non_cce)));
+ assert((do_test<long long, int>(non_cce)));
+}
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp
index 53e4c29affc4..f819f48b1975 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp
@@ -35,8 +35,13 @@ test1()
typedef std::ranlux24 E;
static_assert((E::block_size == 223), "");
static_assert((E::used_block == 23), "");
- /*static_*/assert((E::min() == 0)/*, ""*/);
- /*static_*/assert((E::max() == 0xFFFFFF)/*, ""*/);
+#if TEST_STD_VER >= 11
+ static_assert((E::min() == 0), "");
+ static_assert((E::max() == 0xFFFFFF), "");
+#else
+ assert((E::min() == 0));
+ assert((E::max() == 0xFFFFFF));
+#endif
where(E::block_size);
where(E::used_block);
}
@@ -47,8 +52,13 @@ test2()
typedef std::ranlux48 E;
static_assert((E::block_size == 389), "");
static_assert((E::used_block == 11), "");
- /*static_*/assert((E::min() == 0)/*, ""*/);
- /*static_*/assert((E::max() == 0xFFFFFFFFFFFFull)/*, ""*/);
+#if TEST_STD_VER >= 11
+ static_assert((E::min() == 0), "");
+ static_assert((E::max() == 0xFFFFFFFFFFFFull), "");
+#else
+ assert((E::min() == 0));
+ assert((E::max() == 0xFFFFFFFFFFFFull));
+#endif
where(E::block_size);
where(E::used_block);
}
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp
index 1c2b2a80c59b..a5893ead732d 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp
@@ -17,6 +17,8 @@
#include <random>
#include <cassert>
+#include "test_macros.h"
+
template <class UIntType, UIntType Min, UIntType Max>
class rand1
{
@@ -30,14 +32,14 @@ private:
static_assert(Min < Max, "rand1 invalid parameters");
public:
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION)
// Workaround for lack of constexpr in C++03
static const result_type _Min = Min;
static const result_type _Max = Max;
#endif
- static _LIBCPP_CONSTEXPR result_type min() {return Min;}
- static _LIBCPP_CONSTEXPR result_type max() {return Max;}
+ static TEST_CONSTEXPR result_type min() {return Min;}
+ static TEST_CONSTEXPR result_type max() {return Max;}
explicit rand1(result_type sd = Min) : x_(sd)
{
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp
index 78040ad987d1..9ae955478017 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp
@@ -19,6 +19,8 @@
#include <random>
#include <type_traits>
+#include "test_macros.h"
+
template <class UIntType, UIntType Min, UIntType Max>
class rand1
{
@@ -32,14 +34,14 @@ private:
static_assert(Min < Max, "rand1 invalid parameters");
public:
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION)
// Workaround for lack of constexpr in C++03
static const result_type _Min = Min;
static const result_type _Max = Max;
#endif
- static _LIBCPP_CONSTEXPR result_type min() {return Min;}
- static _LIBCPP_CONSTEXPR result_type max() {return Max;}
+ static TEST_CONSTEXPR result_type min() {return Min;}
+ static TEST_CONSTEXPR result_type max() {return Max;}
explicit rand1(result_type sd = Min) : x_(sd)
{
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp
index 20ca7d5510bf..187a71edcd7e 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp
@@ -28,16 +28,26 @@ void
test1()
{
typedef std::independent_bits_engine<std::ranlux24, 32, unsigned> E;
- /*static_*/assert((E::min() == 0)/*, ""*/);
- /*static_*/assert((E::max() == 0xFFFFFFFF)/*, ""*/);
+#if TEST_STD_VER >= 11
+ static_assert((E::min() == 0), "");
+ static_assert((E::max() == 0xFFFFFFFF), "");
+#else
+ assert((E::min() == 0));
+ assert((E::max() == 0xFFFFFFFF));
+#endif
}
void
test2()
{
typedef std::independent_bits_engine<std::ranlux48, 64, unsigned long long> E;
- /*static_*/assert((E::min() == 0)/*, ""*/);
- /*static_*/assert((E::max() == 0xFFFFFFFFFFFFFFFFull)/*, ""*/);
+#if TEST_STD_VER >= 11
+ static_assert((E::min() == 0), "");
+ static_assert((E::max() == 0xFFFFFFFFFFFFFFFFull), "");
+#else
+ assert((E::min() == 0));
+ assert((E::max() == 0xFFFFFFFFFFFFFFFFull));
+#endif
}
int main()
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp
index c218c17dde69..d2a5292e1323 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp
@@ -17,6 +17,8 @@
#include <random>
#include <cassert>
+#include "test_macros.h"
+
template <class UIntType, UIntType Min, UIntType Max>
class rand1
{
@@ -30,14 +32,14 @@ private:
static_assert(Min < Max, "rand1 invalid parameters");
public:
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION)
// Workaround for lack of constexpr in C++03
static const result_type _Min = Min;
static const result_type _Max = Max;
#endif
- static _LIBCPP_CONSTEXPR result_type min() {return Min;}
- static _LIBCPP_CONSTEXPR result_type max() {return Max;}
+ static TEST_CONSTEXPR result_type min() {return Min;}
+ static TEST_CONSTEXPR result_type max() {return Max;}
explicit rand1(result_type sd = Min) : x_(sd)
{
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp
index 3271d933cb27..a6f1eadb0884 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp
@@ -19,6 +19,8 @@
#include <random>
#include <type_traits>
+#include "test_macros.h"
+
template <class UIntType, UIntType Min, UIntType Max>
class rand1
{
@@ -32,14 +34,14 @@ private:
static_assert(Min < Max, "rand1 invalid parameters");
public:
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION)
// Workaround for lack of constexpr in C++03
static const result_type _Min = Min;
static const result_type _Max = Max;
#endif
- static _LIBCPP_CONSTEXPR result_type min() {return Min;}
- static _LIBCPP_CONSTEXPR result_type max() {return Max;}
+ static TEST_CONSTEXPR result_type min() {return Min;}
+ static TEST_CONSTEXPR result_type max() {return Max;}
explicit rand1(result_type sd = Min) : x_(sd)
{
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp
index eb42d644d301..be5b4a9786af 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp
@@ -33,8 +33,13 @@ test1()
{
typedef std::knuth_b E;
static_assert(E::table_size == 256, "");
- /*static_*/assert((E::min() == 1)/*, ""*/);
- /*static_*/assert((E::max() == 2147483646)/*, ""*/);
+#if TEST_STD_VER >= 11
+ static_assert((E::min() == 1), "");
+ static_assert((E::max() == 2147483646), "");
+#else
+ assert((E::min() == 1));
+ assert((E::max() == 2147483646));
+#endif
where(E::table_size);
}
diff --git a/test/std/numerics/rand/rand.device/ctor.pass.cpp b/test/std/numerics/rand/rand.device/ctor.pass.cpp
index 8c45bb19a0a6..730576844a0b 100644
--- a/test/std/numerics/rand/rand.device/ctor.pass.cpp
+++ b/test/std/numerics/rand/rand.device/ctor.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <random>
// class random_device;
@@ -44,11 +43,15 @@ void check_random_device_valid(const std::string &token) {
}
void check_random_device_invalid(const std::string &token) {
+#ifndef TEST_HAS_NO_EXCEPTIONS
try {
std::random_device r(token);
LIBCPP_ASSERT(false);
} catch (const std::system_error&) {
}
+#else
+ ((void)token);
+#endif
}
diff --git a/test/std/numerics/rand/rand.device/entropy.pass.cpp b/test/std/numerics/rand/rand.device/entropy.pass.cpp
index f01e5653391f..141a84a6d9bd 100644
--- a/test/std/numerics/rand/rand.device/entropy.pass.cpp
+++ b/test/std/numerics/rand/rand.device/entropy.pass.cpp
@@ -20,4 +20,5 @@ int main()
{
std::random_device r;
double e = r.entropy();
+ ((void)e); // Prevent unused warning
}
diff --git a/test/std/numerics/rand/rand.device/eval.pass.cpp b/test/std/numerics/rand/rand.device/eval.pass.cpp
index eabcc201e068..890f4caa31a7 100644
--- a/test/std/numerics/rand/rand.device/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.device/eval.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <random>
// class random_device;
@@ -24,8 +23,10 @@ int main()
{
std::random_device r;
std::random_device::result_type e = r();
+ ((void)e); // Prevent unused warning
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
std::random_device r("/dev/null");
@@ -35,4 +36,5 @@ int main()
catch (const std::system_error&)
{
}
+#endif
}
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval.pass.cpp
index b267c2477e91..0118ae0bf7d1 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval.pass.cpp
@@ -17,6 +17,7 @@
#include <numeric>
#include <vector>
#include <cassert>
+#include <cstddef>
template <class T>
inline
@@ -42,7 +43,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -78,7 +79,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval_param.pass.cpp
index f96df82304f0..0cdb0b77a617 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval_param.pass.cpp
@@ -17,6 +17,7 @@
#include <numeric>
#include <vector>
#include <cassert>
+#include <cstddef>
template <class T>
inline
@@ -44,7 +45,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -82,7 +83,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp
index 88004ba4a741..de5b153e0d13 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp
@@ -49,7 +49,7 @@ test1()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -92,7 +92,7 @@ test2()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -135,7 +135,7 @@ test3()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -178,7 +178,7 @@ test4()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -187,7 +187,7 @@ test4()
kurtosis += d2 * d2;
}
var /= u.size();
- double dev = std::sqrt(var);
+ //double dev = std::sqrt(var);
// In this case:
// skew computes to 0./0. == nan
// kurtosis computes to 0./0. == nan
@@ -227,7 +227,7 @@ test5()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -236,7 +236,7 @@ test5()
kurtosis += d2 * d2;
}
var /= u.size();
- double dev = std::sqrt(var);
+// double dev = std::sqrt(var);
// In this case:
// skew computes to 0./0. == nan
// kurtosis computes to 0./0. == nan
@@ -276,7 +276,7 @@ test6()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -319,7 +319,7 @@ test7()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -352,8 +352,12 @@ test8()
std::binomial_distribution<> dist1(5, 0.1);
std::binomial_distribution<unsigned> dist2(5, 0.1);
- for(int i = 0; i < N; ++i)
- assert(dist1(gen1) == dist2(gen2));
+ for(int i = 0; i < N; ++i) {
+ int r1 = dist1(gen1);
+ unsigned r2 = dist2(gen2);
+ assert(r1 >= 0);
+ assert(static_cast<unsigned>(r1) == r2);
+ }
}
void
@@ -376,7 +380,7 @@ test9()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -385,7 +389,7 @@ test9()
kurtosis += d2 * d2;
}
var /= u.size();
- double dev = std::sqrt(var);
+// double dev = std::sqrt(var);
// In this case:
// skew computes to 0./0. == nan
// kurtosis computes to 0./0. == nan
@@ -425,7 +429,7 @@ test10()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -434,7 +438,7 @@ test10()
kurtosis += d2 * d2;
}
var /= u.size();
- double dev = std::sqrt(var);
+// double dev = std::sqrt(var);
// In this case:
// skew computes to 0./0. == nan
// kurtosis computes to 0./0. == nan
@@ -474,7 +478,7 @@ test11()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -483,7 +487,7 @@ test11()
kurtosis += d2 * d2;
}
var /= u.size();
- double dev = std::sqrt(var);
+// double dev = std::sqrt(var);
// In this case:
// skew computes to 0./0. == nan
// kurtosis computes to 0./0. == nan
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval_param.pass.cpp
index 092a69778513..5ce0cb412cb2 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval_param.pass.cpp
@@ -51,7 +51,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -93,7 +93,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -135,7 +135,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp
index 4e9f9d3c044d..6e6072a4faf9 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp
@@ -49,7 +49,7 @@ test1()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -92,7 +92,7 @@ test2()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -135,7 +135,7 @@ test3()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -178,7 +178,7 @@ test4()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -221,7 +221,7 @@ test5()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -264,7 +264,7 @@ test6()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval_param.pass.cpp
index c451f0130904..254c347b3d25 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/eval_param.pass.cpp
@@ -51,7 +51,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -93,7 +93,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -135,7 +135,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp
index 929e6e7e6c3b..17503364e030 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp
@@ -49,7 +49,7 @@ test1()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -92,7 +92,7 @@ test2()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -135,7 +135,7 @@ test3()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -178,7 +178,7 @@ test4()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -193,8 +193,8 @@ test4()
kurtosis -= 3;
double x_mean = d.k() * (1 - d.p()) / d.p();
double x_var = x_mean / d.p();
- double x_skew = (2 - d.p()) / std::sqrt(d.k() * (1 - d.p()));
- double x_kurtosis = 6. / d.k() + sqr(d.p()) / (d.k() * (1 - d.p()));
+// double x_skew = (2 - d.p()) / std::sqrt(d.k() * (1 - d.p()));
+// double x_kurtosis = 6. / d.k() + sqr(d.p()) / (d.k() * (1 - d.p()));
assert(mean == x_mean);
assert(var == x_var);
}
@@ -219,7 +219,7 @@ test5()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -262,7 +262,7 @@ test6()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval_param.pass.cpp
index 2710061a1a05..6467dbf5754d 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/eval_param.pass.cpp
@@ -51,7 +51,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -93,7 +93,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -135,7 +135,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval.pass.cpp
index f6bc3c73993c..3b54790aee0a 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -49,7 +50,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -89,7 +90,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -129,7 +130,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval_param.pass.cpp
index fd52a0488979..dbc2d09dfd97 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval_param.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -50,7 +51,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -91,7 +92,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -132,7 +133,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
index 091bbb9bb452..4da7f2e70e9b 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
@@ -34,7 +34,7 @@ double
I(double x, unsigned a, unsigned b)
{
double r = 0;
- for (int j = a; j <= a+b-1; ++j)
+ for (int j = a; static_cast<unsigned>(j) <= a+b-1; ++j)
r += fac(a+b-1)/(fac(j) * fac(a + b - 1 - j)) * std::pow(x, j) *
std::pow(1-x, a+b-1-j);
return r;
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp
index 774137154e09..74025b701504 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp
@@ -34,7 +34,7 @@ double
I(double x, unsigned a, unsigned b)
{
double r = 0;
- for (int j = a; j <= a+b-1; ++j)
+ for (int j = a; static_cast<unsigned>(j) <= a+b-1; ++j)
r += fac(a+b-1)/(fac(j) * fac(a + b - 1 - j)) * std::pow(x, j) *
std::pow(1-x, a+b-1-j);
return r;
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp
index 2ad6784cd878..cfaddb73f0b8 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp
@@ -49,7 +49,7 @@ test1()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -94,7 +94,7 @@ test2()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -139,7 +139,7 @@ test3()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -184,7 +184,7 @@ test4()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -229,7 +229,7 @@ test5()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval_param.pass.cpp
index 8f397fcab096..35596a0d7df5 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval_param.pass.cpp
@@ -50,7 +50,7 @@ test1()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -96,7 +96,7 @@ test2()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -142,7 +142,7 @@ test3()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -188,7 +188,7 @@ test4()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -234,7 +234,7 @@ test5()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval.pass.cpp
index 69f786397711..e1084d3ef03d 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -45,7 +46,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval_param.pass.cpp
index af9c547cb7f9..8527052c7182 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval_param.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -46,7 +47,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp
index 9210e8a8d350..b207eece67d0 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp
@@ -45,7 +45,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -81,7 +81,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -117,7 +117,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval_param.pass.cpp
index 93053f0a36b7..983a2d243744 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval_param.pass.cpp
@@ -46,7 +46,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -83,7 +83,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -120,7 +120,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval.pass.cpp
index 42965b0e6ab2..223d6f4d2216 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -49,7 +50,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -89,7 +90,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -129,7 +130,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval_param.pass.cpp
index e7de18fdb434..465f5a70a655 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval_param.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -50,7 +51,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp
index 3f1b331889e5..3999cbeccbb7 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp
@@ -48,7 +48,7 @@ test1()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -90,7 +90,7 @@ test2()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -132,7 +132,7 @@ test3()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -174,7 +174,7 @@ test4()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval_param.pass.cpp
index 21bf774228f8..b69a04cc1755 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval_param.pass.cpp
@@ -49,7 +49,7 @@ test1()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -92,7 +92,7 @@ test2()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -135,7 +135,7 @@ test3()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -178,7 +178,7 @@ test4()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp
index 7c23630ed1e1..d0ac16298e42 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp
@@ -49,7 +49,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -89,7 +89,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -129,7 +129,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval_param.pass.cpp
index 54a89b6b3f40..12167c54f737 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval_param.pass.cpp
@@ -50,7 +50,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -91,7 +91,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -132,7 +132,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp
index a475624a58a8..12fcfa354fd3 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp
@@ -48,7 +48,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -87,7 +87,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -126,7 +126,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval_param.pass.cpp
index d24fbd9f9cf5..caa56eaab4ad 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval_param.pass.cpp
@@ -50,7 +50,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -91,7 +91,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -132,7 +132,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (unsigned i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval.pass.cpp
index cfec8c0d81e1..10337907b964 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -49,7 +50,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -93,7 +94,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -137,7 +138,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval_param.pass.cpp
index a19654dbd575..e13507672553 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval_param.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -50,7 +51,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -95,7 +96,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -140,7 +141,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp
index 3111912ec29c..14a59621fa5d 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval.pass.cpp
@@ -51,10 +51,10 @@ test1()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
@@ -114,10 +114,10 @@ test2()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
@@ -177,10 +177,10 @@ test3()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
@@ -240,10 +240,10 @@ test4()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
@@ -303,10 +303,10 @@ test5()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
@@ -366,10 +366,10 @@ test6()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
@@ -429,10 +429,10 @@ test7()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
@@ -492,10 +492,10 @@ test8()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
@@ -555,10 +555,10 @@ test9()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
@@ -618,10 +618,10 @@ test10()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
@@ -681,10 +681,10 @@ test11()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
index ffd53c05d37e..b374c5ec22de 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
@@ -22,6 +22,7 @@
#include <iterator>
#include <numeric>
#include <cassert>
+#include <cstddef>
template <class T>
inline
@@ -53,10 +54,10 @@ int main()
}
std::vector<double> prob(std::begin(p), std::end(p));
double s = std::accumulate(prob.begin(), prob.end(), 0.0);
- for (int i = 0; i < prob.size(); ++i)
+ for (std::size_t i = 0; i < prob.size(); ++i)
prob[i] /= s;
std::sort(u.begin(), u.end());
- for (int i = 0; i < Np; ++i)
+ for (std::size_t i = 0; i < Np; ++i)
{
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
index 03da9b8960e4..7da4b9bfb1e5 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
@@ -53,7 +53,7 @@ test1()
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -67,16 +67,16 @@ test1()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (int i = 0; i < Np+1; ++i)
+ for (size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
@@ -106,7 +106,7 @@ test2()
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -120,16 +120,16 @@ test2()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (int i = 0; i < Np+1; ++i)
+ for (size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
@@ -157,9 +157,9 @@ test3()
double p[] = {1, 0, 0, 0};
const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
- const int N = 1000000;
+ const size_t N = 1000000;
std::vector<D::result_type> u;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -173,16 +173,16 @@ test3()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (int i = 0; i < Np+1; ++i)
+ for (size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
@@ -212,7 +212,7 @@ test4()
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -226,16 +226,16 @@ test4()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (int i = 0; i < Np+1; ++i)
+ for (size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
@@ -243,7 +243,7 @@ test4()
a = 0;
for (int j = 0; j < k; ++j)
a += areas[j];
- assert(k < Np);
+ assert(k < static_cast<int>(Np));
m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
bk = b[k];
c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);
@@ -266,7 +266,7 @@ test5()
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -280,17 +280,17 @@ test5()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
{
assert(i < Np);
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (int i = 0; i < Np+1; ++i)
+ for (size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
@@ -298,7 +298,7 @@ test5()
a = 0;
for (int j = 0; j < k; ++j)
a += areas[j];
- assert(k < Np);
+ assert(k < static_cast<int>(Np));
m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
bk = b[k];
c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);
@@ -321,7 +321,7 @@ test6()
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
@@ -335,16 +335,16 @@ test6()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (int i = 0; i < Np+1; ++i)
+ for (size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
index 8054a69fed87..f455dcff900e 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
@@ -50,9 +50,9 @@ int main()
const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d;
P pa(b, b+Np+1, p);
- const int N = 1000000;
+ const size_t N = 1000000;
std::vector<D::result_type> u;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
D::result_type v = d(g, pa);
assert(10 <= v && v < 17);
@@ -66,16 +66,16 @@ int main()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
- for (int i = 0; i < areas.size(); ++i)
+ for (size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
- for (int i = 0; i < Np+1; ++i)
+ for (size_t i = 0; i < Np+1; ++i)
p[i] /= S;
- for (int i = 0; i < N; ++i)
+ for (size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp
index 2abc9d4c6dd5..1be34f615712 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -49,7 +50,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -90,7 +91,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -131,7 +132,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -172,7 +173,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -213,7 +214,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -254,7 +255,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -295,7 +296,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -336,7 +337,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -377,7 +378,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
@@ -429,7 +430,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval_param.pass.cpp
index 849f25107fa8..bb5a59d4f5b8 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/eval_param.pass.cpp
@@ -18,6 +18,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -49,7 +50,7 @@ int main()
double var = 0;
double skew = 0;
double kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
double dbl = (u[i] - mean);
double d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp
index e000363f3215..621fdc1bfe8c 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -49,7 +50,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
@@ -89,7 +90,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
@@ -129,7 +130,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
@@ -169,7 +170,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
@@ -209,7 +210,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
@@ -249,7 +250,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
@@ -289,7 +290,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
@@ -329,7 +330,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
@@ -369,7 +370,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
@@ -409,7 +410,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
@@ -449,7 +450,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval_param.pass.cpp
index d351f0caed71..8a06220630fa 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval_param.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/eval_param.pass.cpp
@@ -18,6 +18,7 @@
#include <cassert>
#include <vector>
#include <numeric>
+#include <cstddef>
template <class T>
inline
@@ -49,7 +50,7 @@ int main()
D::result_type var = 0;
D::result_type skew = 0;
D::result_type kurtosis = 0;
- for (int i = 0; i < u.size(); ++i)
+ for (std::size_t i = 0; i < u.size(); ++i)
{
D::result_type dbl = (u[i] - mean);
D::result_type d2 = sqr(dbl);
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp
index 8c09f4fd0109..d96ccf9de7f5 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp
@@ -37,7 +37,7 @@ test()
test1<T, 0, 0, 0>();
test1<T, 0, 1, 2>();
test1<T, 1, 1, 2>();
- const T M(~0);
+ const T M(static_cast<T>(-1));
test1<T, 0, 0, M>();
test1<T, 0, M-2, M>();
test1<T, 0, M-1, M>();
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp
index 4b2b20da13ab..b38e8f583f23 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp
@@ -37,7 +37,7 @@ test()
test1<T, 0, 0, 0>();
test1<T, 0, 1, 2>();
test1<T, 1, 1, 2>();
- const T M(~0);
+ const T M(static_cast<T>(-1));
test1<T, 0, 0, M>();
test1<T, 0, M-2, M>();
test1<T, 0, M-1, M>();
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp
index 6c4a7f434f12..734b4209984a 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp
@@ -36,7 +36,7 @@ test()
test1<T, 0, 0, 0>();
test1<T, 0, 1, 2>();
test1<T, 1, 1, 2>();
- const T M(~0);
+ const T M(static_cast<T>(-1));
test1<T, 0, 0, M>();
test1<T, 0, M-2, M>();
test1<T, 0, M-1, M>();
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/seed_result_type.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/seed_result_type.pass.cpp
index 1afbe75efa58..8156d63f08da 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/seed_result_type.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/seed_result_type.pass.cpp
@@ -21,7 +21,7 @@ template <class T>
void
test1()
{
- for (int s = 0; s < 20; ++s)
+ for (T s = 0; s < 20; ++s)
{
typedef std::linear_congruential_engine<T, 2, 3, 7> E;
E e1(s);
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
index 857a478a5579..cd496fdbc5e0 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
@@ -37,8 +37,27 @@ test1()
static_assert((LCE::multiplier == a), "");
static_assert((LCE::increment == c), "");
static_assert((LCE::modulus == m), "");
- /*static_*/assert((LCE::min() == (c == 0u ? 1u: 0u))/*, ""*/);
- /*static_*/assert((LCE::max() == result_type(m - 1u))/*, ""*/);
+#if TEST_STD_VER >= 11
+ static_assert((LCE::min() == (c == 0u ? 1u: 0u)), "");
+#else
+ assert((LCE::min() == (c == 0u ? 1u: 0u)));
+#endif
+
+#ifdef _MSC_VER
+ #pragma warning(push)
+ #pragma warning(disable: 4310) // cast truncates constant value
+#endif // _MSC_VER
+
+#if TEST_STD_VER >= 11
+ static_assert((LCE::max() == result_type(m - 1u)), "");
+#else
+ assert((LCE::max() == result_type(m - 1u)));
+#endif
+
+#ifdef _MSC_VER
+ #pragma warning(pop)
+#endif // _MSC_VER
+
static_assert((LCE::default_seed == 1), "");
where(LCE::multiplier);
where(LCE::increment);
@@ -53,7 +72,7 @@ test()
test1<T, 0, 0, 0>();
test1<T, 0, 1, 2>();
test1<T, 1, 1, 2>();
- const T M(~0);
+ const T M(static_cast<T>(-1));
test1<T, 0, 0, M>();
test1<T, 0, M-2, M>();
test1<T, 0, M-1, M>();
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp
index 331d3c51119f..3a16d62d728d 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp
@@ -60,8 +60,13 @@ test1()
static_assert((E::tempering_c == 0xefc60000), "");
static_assert((E::tempering_l == 18), "");
static_assert((E::initialization_multiplier == 1812433253), "");
- /*static_*/assert((E::min() == 0)/*, ""*/);
- /*static_*/assert((E::max() == 0xFFFFFFFF)/*, ""*/);
+#if TEST_STD_VER >= 11
+ static_assert((E::min() == 0), "");
+ static_assert((E::max() == 0xFFFFFFFF), "");
+#else
+ assert((E::min() == 0));
+ assert((E::max() == 0xFFFFFFFF));
+#endif
static_assert((E::default_seed == 5489u), "");
where(E::word_size);
where(E::state_size);
@@ -96,8 +101,13 @@ test2()
static_assert((E::tempering_c == 0xfff7eee000000000ull), "");
static_assert((E::tempering_l == 43), "");
static_assert((E::initialization_multiplier == 6364136223846793005ull), "");
- /*static_*/assert((E::min() == 0)/*, ""*/);
- /*static_*/assert((E::max() == 0xFFFFFFFFFFFFFFFFull)/*, ""*/);
+#if TEST_STD_VER >= 11
+ static_assert((E::min() == 0), "");
+ static_assert((E::max() == 0xFFFFFFFFFFFFFFFFull), "");
+#else
+ assert((E::min() == 0));
+ assert((E::max() == 0xFFFFFFFFFFFFFFFFull));
+#endif
static_assert((E::default_seed == 5489u), "");
where(E::word_size);
where(E::state_size);
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp
index 75716a43deae..b3f12e72383b 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp
@@ -38,8 +38,13 @@ test1()
static_assert((E::word_size == 24), "");
static_assert((E::short_lag == 10), "");
static_assert((E::long_lag == 24), "");
- /*static_*/assert((E::min() == 0)/*, ""*/);
- /*static_*/assert((E::max() == 0xFFFFFF)/*, ""*/);
+#if TEST_STD_VER >= 11
+ static_assert((E::min() == 0), "");
+ static_assert((E::max() == 0xFFFFFF), "");
+#else
+ assert((E::min() == 0));
+ assert((E::max() == 0xFFFFFF));
+#endif
static_assert((E::default_seed == 19780503u), "");
where(E::word_size);
where(E::short_lag);
@@ -54,8 +59,13 @@ test2()
static_assert((E::word_size == 48), "");
static_assert((E::short_lag == 5), "");
static_assert((E::long_lag == 12), "");
- /*static_*/assert((E::min() == 0)/*, ""*/);
- /*static_*/assert((E::max() == 0xFFFFFFFFFFFFull)/*, ""*/);
+#if TEST_STD_VER >= 11
+ static_assert((E::min() == 0), "");
+ static_assert((E::max() == 0xFFFFFFFFFFFFull), "");
+#else
+ assert((E::min() == 0));
+ assert((E::max() == 0xFFFFFFFFFFFFull));
+#endif
static_assert((E::default_seed == 19780503u), "");
where(E::word_size);
where(E::short_lag);
diff --git a/test/std/numerics/rand/rand.predef/default_random_engine.pass.cpp b/test/std/numerics/rand/rand.predef/default_random_engine.pass.cpp
index 426586007c1a..c6d24e6334d9 100644
--- a/test/std/numerics/rand/rand.predef/default_random_engine.pass.cpp
+++ b/test/std/numerics/rand/rand.predef/default_random_engine.pass.cpp
@@ -14,9 +14,11 @@
#include <random>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
std::default_random_engine e;
e.discard(9999);
- assert(e() == 399268537u);
+ LIBCPP_ASSERT(e() == 399268537u);
}
diff --git a/test/std/re/re.alg/re.alg.match/awk.pass.cpp b/test/std/re/re.alg/re.alg.match/awk.pass.cpp
index a32b2ca0ae32..f866929795db 100644
--- a/test/std/re/re.alg/re.alg.match/awk.pass.cpp
+++ b/test/std/re/re.alg/re.alg.match/awk.pass.cpp
@@ -617,11 +617,12 @@ int main()
}
std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
*/ {
+ /*
std::cmatch m;
const char s[] = "m";
- /* assert(std::regex_match(s, m,*/ std::regex("[a[=M=]z]"/*,
- std::regex_constants::awk*/);//));
-/* assert(m.size() == 1);
+ assert(std::regex_match(s, m, std::regex("[a[=M=]z]",
+ std::regex_constants::awk);
+ assert(m.size() == 1);
assert(!m.prefix().matched);
assert(m.prefix().first == s);
assert(m.prefix().second == m[0].first);
diff --git a/test/std/re/re.alg/re.alg.match/basic.pass.cpp b/test/std/re/re.alg/re.alg.match/basic.pass.cpp
index 901bf90e6386..cb23cfa15d24 100644
--- a/test/std/re/re.alg/re.alg.match/basic.pass.cpp
+++ b/test/std/re/re.alg/re.alg.match/basic.pass.cpp
@@ -387,7 +387,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -405,7 +405,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -430,7 +430,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -525,7 +525,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -548,7 +548,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -578,7 +578,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -594,7 +594,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -610,7 +610,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -634,7 +634,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -650,7 +650,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -941,7 +941,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -956,7 +956,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -971,7 +971,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1004,7 +1004,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1019,7 +1019,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1034,7 +1034,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1055,7 +1055,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -1073,7 +1073,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -1098,7 +1098,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -1193,7 +1193,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1216,7 +1216,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1246,7 +1246,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1262,7 +1262,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1278,7 +1278,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1302,7 +1302,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1318,7 +1318,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/test/std/re/re.alg/re.alg.match/ecma.pass.cpp b/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
index a4568f60167c..ae42b46668b0 100644
--- a/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
+++ b/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
@@ -266,7 +266,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -281,7 +281,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -296,7 +296,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -329,7 +329,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -344,7 +344,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -359,7 +359,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -371,16 +371,37 @@ int main()
}
{
std::cmatch m;
+ // http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2273
const char s[] = "tournament";
- assert(!std::regex_match(s, m, std::regex("tour|to|tournament")));
- assert(m.size() == 0);
+ assert(std::regex_match(s, m, std::regex("tour|to|tournament")));
+ assert(m.size() == 1);
+ assert(!m.prefix().matched);
+ assert(m.prefix().first == s);
+ assert(m.prefix().second == m[0].first);
+ assert(!m.suffix().matched);
+ assert(m.suffix().first == m[0].second);
+ assert(m.suffix().second == m[0].second);
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.position(0) == 0);
+ assert(m.str(0) == s);
}
{
std::cmatch m;
+ // http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2273
const char s[] = "tournamenttotour";
- assert(!std::regex_match(s, m, std::regex("(tour|to|tournament)+",
- std::regex_constants::nosubs)));
- assert(m.size() == 0);
+ assert(
+ std::regex_match(s, m, std::regex("(tour|to|tournament)+",
+ std::regex_constants::nosubs)));
+ assert(m.size() == 1);
+ assert(!m.prefix().matched);
+ assert(m.prefix().first == s);
+ assert(m.prefix().second == m[0].first);
+ assert(!m.suffix().matched);
+ assert(m.suffix().first == m[0].second);
+ assert(m.suffix().second == m[0].second);
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+ assert(m.position(0) == 0);
+ assert(m.str(0) == s);
}
{
std::cmatch m;
@@ -393,7 +414,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -417,7 +438,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -495,7 +516,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -516,7 +537,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -543,7 +564,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -558,7 +579,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -573,7 +594,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -595,7 +616,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -611,7 +632,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -690,7 +711,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<char>::length(s));
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -931,7 +952,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -946,7 +967,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -961,7 +982,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -994,7 +1015,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1009,7 +1030,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1024,7 +1045,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1036,16 +1057,37 @@ int main()
}
{
std::wcmatch m;
+ // http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2273
const wchar_t s[] = L"tournament";
- assert(!std::regex_match(s, m, std::wregex(L"tour|to|tournament")));
- assert(m.size() == 0);
+ assert(std::regex_match(s, m, std::wregex(L"tour|to|tournament")));
+ assert(m.size() == 1);
+ assert(!m.prefix().matched);
+ assert(m.prefix().first == s);
+ assert(m.prefix().second == m[0].first);
+ assert(!m.suffix().matched);
+ assert(m.suffix().first == m[0].second);
+ assert(m.suffix().second == m[0].second);
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.position(0) == 0);
+ assert(m.str(0) == s);
}
{
std::wcmatch m;
+ // http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2273
const wchar_t s[] = L"tournamenttotour";
- assert(!std::regex_match(s, m, std::wregex(L"(tour|to|tournament)+",
- std::regex_constants::nosubs)));
- assert(m.size() == 0);
+ assert(
+ std::regex_match(s, m, std::wregex(L"(tour|to|tournament)+",
+ std::regex_constants::nosubs)));
+ assert(m.size() == 1);
+ assert(!m.prefix().matched);
+ assert(m.prefix().first == s);
+ assert(m.prefix().second == m[0].first);
+ assert(!m.suffix().matched);
+ assert(m.suffix().first == m[0].second);
+ assert(m.suffix().second == m[0].second);
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
+ assert(m.position(0) == 0);
+ assert(m.str(0) == s);
}
{
std::wcmatch m;
@@ -1058,7 +1100,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1082,7 +1124,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1160,7 +1202,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1181,7 +1223,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1208,7 +1250,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1223,7 +1265,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1238,7 +1280,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1260,7 +1302,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1276,7 +1318,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1343,7 +1385,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/test/std/re/re.alg/re.alg.match/extended.pass.cpp b/test/std/re/re.alg/re.alg.match/extended.pass.cpp
index 5e08d0ac5fdb..aac03839a05d 100644
--- a/test/std/re/re.alg/re.alg.match/extended.pass.cpp
+++ b/test/std/re/re.alg/re.alg.match/extended.pass.cpp
@@ -267,7 +267,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -282,7 +282,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -297,7 +297,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -330,7 +330,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -345,7 +345,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -360,7 +360,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -382,7 +382,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -398,7 +398,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -414,7 +414,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -438,7 +438,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -523,7 +523,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -546,7 +546,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -576,7 +576,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -592,7 +592,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -608,7 +608,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -632,7 +632,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -648,7 +648,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -933,7 +933,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -948,7 +948,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -963,7 +963,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -996,7 +996,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1011,7 +1011,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1026,7 +1026,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1048,7 +1048,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1064,7 +1064,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1080,7 +1080,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1104,7 +1104,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1189,7 +1189,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1212,7 +1212,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1242,7 +1242,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1258,7 +1258,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1274,7 +1274,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1298,7 +1298,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1314,7 +1314,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/test/std/re/re.alg/re.alg.search/awk.pass.cpp b/test/std/re/re.alg/re.alg.search/awk.pass.cpp
index 05d1f59e147a..be0c74e9c779 100644
--- a/test/std/re/re.alg/re.alg.search/awk.pass.cpp
+++ b/test/std/re/re.alg/re.alg.search/awk.pass.cpp
@@ -330,7 +330,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -345,7 +345,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -360,7 +360,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -393,7 +393,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -408,7 +408,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -423,7 +423,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -445,7 +445,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -461,7 +461,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -477,7 +477,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -501,7 +501,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -595,7 +595,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -618,7 +618,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -648,7 +648,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -664,7 +664,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -680,7 +680,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -704,7 +704,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -720,7 +720,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -797,7 +797,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<char>::length(s));
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1101,7 +1101,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1116,7 +1116,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1131,7 +1131,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1164,7 +1164,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1179,7 +1179,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1194,7 +1194,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1216,7 +1216,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1232,7 +1232,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1248,7 +1248,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1272,7 +1272,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1366,7 +1366,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1389,7 +1389,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1419,7 +1419,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1435,7 +1435,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1451,7 +1451,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1475,7 +1475,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1491,7 +1491,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1568,7 +1568,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/test/std/re/re.alg/re.alg.search/basic.pass.cpp b/test/std/re/re.alg/re.alg.search/basic.pass.cpp
index f5157f563755..11982a26d003 100644
--- a/test/std/re/re.alg/re.alg.search/basic.pass.cpp
+++ b/test/std/re/re.alg/re.alg.search/basic.pass.cpp
@@ -450,7 +450,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -468,7 +468,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -493,7 +493,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -597,7 +597,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -620,7 +620,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -650,7 +650,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -666,7 +666,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -682,7 +682,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -706,7 +706,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -722,7 +722,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1094,7 +1094,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1109,7 +1109,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1124,7 +1124,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1157,7 +1157,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1172,7 +1172,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1187,7 +1187,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1208,7 +1208,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 2);
@@ -1226,7 +1226,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -1251,7 +1251,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 3);
@@ -1355,7 +1355,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1378,7 +1378,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1408,7 +1408,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1424,7 +1424,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1440,7 +1440,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1464,7 +1464,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1480,7 +1480,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/test/std/re/re.alg/re.alg.search/ecma.pass.cpp b/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
index d6a3da6ea076..c41019542a55 100644
--- a/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
+++ b/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
@@ -329,7 +329,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -344,7 +344,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -359,7 +359,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -392,7 +392,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -407,7 +407,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -422,7 +422,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -474,7 +474,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -498,7 +498,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -585,7 +585,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -606,7 +606,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -633,7 +633,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -648,7 +648,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -663,7 +663,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -685,7 +685,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -701,7 +701,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -804,7 +804,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<char>::length(s));
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1108,7 +1108,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1123,7 +1123,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1138,7 +1138,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1171,7 +1171,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1186,7 +1186,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1201,7 +1201,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1253,7 +1253,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1277,7 +1277,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1364,7 +1364,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1385,7 +1385,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1412,7 +1412,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1427,7 +1427,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1442,7 +1442,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1464,7 +1464,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1480,7 +1480,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1583,7 +1583,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/test/std/re/re.alg/re.alg.search/extended.pass.cpp b/test/std/re/re.alg/re.alg.search/extended.pass.cpp
index 88af3b908815..4a2e6647e079 100644
--- a/test/std/re/re.alg/re.alg.search/extended.pass.cpp
+++ b/test/std/re/re.alg/re.alg.search/extended.pass.cpp
@@ -330,7 +330,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -345,7 +345,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -360,7 +360,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -393,7 +393,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -408,7 +408,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -423,7 +423,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -445,7 +445,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -461,7 +461,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -477,7 +477,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -501,7 +501,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -595,7 +595,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -618,7 +618,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -648,7 +648,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -664,7 +664,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -680,7 +680,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -704,7 +704,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -720,7 +720,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<char>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1086,7 +1086,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1101,7 +1101,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1116,7 +1116,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1149,7 +1149,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1164,7 +1164,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1179,7 +1179,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1201,7 +1201,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1217,7 +1217,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1233,7 +1233,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
@@ -1257,7 +1257,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1351,7 +1351,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1374,7 +1374,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1404,7 +1404,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1420,7 +1420,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1436,7 +1436,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1460,7 +1460,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
@@ -1476,7 +1476,7 @@ int main()
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
- assert(m.length(0) == std::char_traits<wchar_t>::length(s));
+ assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
diff --git a/test/std/re/re.alg/re.alg.search/grep.pass.cpp b/test/std/re/re.alg/re.alg.search/grep.pass.cpp
index 136f9958c9b2..fa4e675c78f0 100644
--- a/test/std/re/re.alg/re.alg.search/grep.pass.cpp
+++ b/test/std/re/re.alg/re.alg.search/grep.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <regex>
// template <class BidirectionalIterator, class Allocator, class charT, class traits>
@@ -25,6 +24,7 @@
extern "C" void LLVMFuzzerTestOneInput(const char *data)
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
size_t size = strlen(data);
if (size > 0)
{
@@ -37,6 +37,9 @@ extern "C" void LLVMFuzzerTestOneInput(const char *data)
}
catch (std::regex_error &) {}
}
+#else
+ ((void)data);
+#endif
}
diff --git a/test/std/re/re.const/re.matchflag/match_not_null.pass.cpp b/test/std/re/re.const/re.matchflag/match_not_null.pass.cpp
new file mode 100644
index 000000000000..41963fbb2ce2
--- /dev/null
+++ b/test/std/re/re.const/re.matchflag/match_not_null.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// match_not_null:
+// The regular expression shall not match an empty sequence.
+
+#include "test_macros.h"
+#include <cassert>
+#include <regex>
+
+int main()
+{
+ // When match_not_null is on, the regex engine should reject empty matches and
+ // move on to try other solutions.
+ std::cmatch m;
+ assert(!std::regex_search("a", m, std::regex("b*"),
+ std::regex_constants::match_not_null));
+ assert(std::regex_search("aa", m, std::regex("a*?"),
+ std::regex_constants::match_not_null));
+ assert(m[0].length() == 1);
+ assert(!std::regex_search("a", m, std::regex("b*", std::regex::extended),
+ std::regex_constants::match_not_null));
+ assert(!std::regex_search(
+ "a", m,
+ std::regex("b*", std::regex::extended | std::regex_constants::nosubs),
+ std::regex_constants::match_not_null));
+
+ assert(!std::regex_match("", m, std::regex("a*"),
+ std::regex_constants::match_not_null));
+ assert(!std::regex_match("", m, std::regex("a*", std::regex::extended),
+ std::regex_constants::match_not_null));
+ assert(!std::regex_match(
+ "", m,
+ std::regex("a*", std::regex::extended | std::regex_constants::nosubs),
+ std::regex_constants::match_not_null));
+
+ return 0;
+}
diff --git a/test/std/re/re.regex/re.regex.assign/assign.pass.cpp b/test/std/re/re.regex/re.regex.assign/assign.pass.cpp
index 97208c68c8d6..12b23a9fa13d 100644
--- a/test/std/re/re.regex/re.regex.assign/assign.pass.cpp
+++ b/test/std/re/re.regex/re.regex.assign/assign.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <regex>
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
@@ -27,6 +26,7 @@ int main()
assert(r2.mark_count() == 2);
assert(std::regex_search("ab", r2));
+#ifndef TEST_HAS_NO_EXCEPTIONS
bool caught = false;
try { r2.assign("(def", std::regex::extended); }
catch(std::regex_error &) { caught = true; }
@@ -34,4 +34,5 @@ int main()
assert(r2.flags() == std::regex::ECMAScript);
assert(r2.mark_count() == 2);
assert(std::regex_search("ab", r2));
+#endif
}
diff --git a/test/std/re/re.regex/re.regex.construct/bad_backref.pass.cpp b/test/std/re/re.regex/re.regex.construct/bad_backref.pass.cpp
new file mode 100644
index 000000000000..aca4d674d9f9
--- /dev/null
+++ b/test/std/re/re.regex/re.regex.construct/bad_backref.pass.cpp
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: libcpp-no-exceptions
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// template <class ST, class SA>
+// basic_regex(const basic_string<charT, ST, SA>& s);
+
+#include <regex>
+#include <cassert>
+#include "test_macros.h"
+
+static bool error_badbackref_thrown(const char *pat)
+{
+ bool result = false;
+ try {
+ std::regex re(pat);
+ } catch (const std::regex_error &ex) {
+ result = (ex.code() == std::regex_constants::error_backref);
+ }
+ return result;
+}
+
+int main()
+{
+ assert(error_badbackref_thrown("\\1abc")); // no references
+ assert(error_badbackref_thrown("ab(c)\\2def")); // only one reference
+
+// this should NOT throw, because we only should look at the '1'
+// See https://llvm.org/bugs/show_bug.cgi?id=31387
+ {
+ const char *pat1 = "a(b)c\\1234";
+ std::regex re(pat1, pat1 + 7); // extra chars after the end.
+ }
+}
diff --git a/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp b/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
index 3c7e9f5e33c7..93b21ec9e9f6 100644
--- a/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
+++ b/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <regex>
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
diff --git a/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp b/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp
index 0692a59542f6..0f30a8b2082b 100644
--- a/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp
+++ b/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <regex>
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
diff --git a/test/std/re/re.regex/re.regex.construct/ptr_size.pass.cpp b/test/std/re/re.regex/re.regex.construct/ptr_size.pass.cpp
new file mode 100644
index 000000000000..90a091a21c2a
--- /dev/null
+++ b/test/std/re/re.regex/re.regex.construct/ptr_size.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// basic_regex(const charT* p, size_t len);
+
+#include <regex>
+#include <cassert>
+
+template <class CharT>
+void
+test(const CharT* p, std::size_t len, unsigned mc)
+{
+ std::basic_regex<CharT> r(p, len);
+ assert(r.flags() == std::regex_constants::ECMAScript);
+ assert(r.mark_count() == mc);
+}
+
+int main()
+{
+ test("\\(a\\)", 5, 0);
+ test("\\(a[bc]\\)", 9, 0);
+ test("\\(a\\([bc]\\)\\)", 13, 0);
+ test("(a([bc]))", 9, 2);
+
+ test("(\0)(b)(c)(d)", 12, 4);
+ test("(\0)(b)(c)(d)", 9, 3);
+ test("(\0)(b)(c)(d)", 3, 1);
+ test("(\0)(b)(c)(d)", 0, 0);
+}
diff --git a/test/std/re/re.regex/types.pass.cpp b/test/std/re/re.regex/types.pass.cpp
index 5c0a5920d201..2e48b4e841ca 100644
--- a/test/std/re/re.regex/types.pass.cpp
+++ b/test/std/re/re.regex/types.pass.cpp
@@ -15,6 +15,8 @@
// public:
// // types:
// typedef charT value_type;
+// typedef traits traits_type;
+// typedef typename traits::string_type string_type;
// typedef regex_constants::syntax_option_type flag_type;
// typedef typename traits::locale_type locale_type;
@@ -25,11 +27,15 @@
int main()
{
static_assert((std::is_same<std::basic_regex<char>::value_type, char>::value), "");
+ static_assert((std::is_same<std::basic_regex<char>::traits_type, std::regex_traits<char> >::value), "");
+ static_assert((std::is_same<std::basic_regex<char>::string_type, std::basic_string<char> >::value), "");
static_assert((std::is_same<std::basic_regex<char>::flag_type,
std::regex_constants::syntax_option_type>::value), "");
static_assert((std::is_same<std::basic_regex<char>::locale_type, std::locale>::value), "");
static_assert((std::is_same<std::basic_regex<wchar_t>::value_type, wchar_t>::value), "");
+ static_assert((std::is_same<std::basic_regex<wchar_t>::traits_type, std::regex_traits<wchar_t> >::value), "");
+ static_assert((std::is_same<std::basic_regex<wchar_t>::string_type, std::basic_string<wchar_t> >::value), "");
static_assert((std::is_same<std::basic_regex<wchar_t>::flag_type,
std::regex_constants::syntax_option_type>::value), "");
static_assert((std::is_same<std::basic_regex<wchar_t>::locale_type, std::locale>::value), "");
diff --git a/test/std/re/re.results/re.results.acc/begin_end.pass.cpp b/test/std/re/re.results/re.results.acc/begin_end.pass.cpp
index a5ed051265cc..85b5134266dc 100644
--- a/test/std/re/re.results/re.results.acc/begin_end.pass.cpp
+++ b/test/std/re/re.results/re.results.acc/begin_end.pass.cpp
@@ -16,6 +16,7 @@
#include <regex>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
void
@@ -28,7 +29,7 @@ test()
std::match_results<const char*>::const_iterator i = m.begin();
std::match_results<const char*>::const_iterator e = m.end();
- assert(e - i == m.size());
+ assert(static_cast<std::size_t>(e - i) == m.size());
for (int j = 0; i != e; ++i, ++j)
assert(*i == m[j]);
}
diff --git a/test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp b/test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp
index 67ec606e9060..16ba38c61041 100644
--- a/test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp
+++ b/test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp
@@ -16,6 +16,7 @@
#include <regex>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
void
@@ -28,7 +29,7 @@ test()
std::match_results<const char*>::const_iterator i = m.cbegin();
std::match_results<const char*>::const_iterator e = m.cend();
- assert(e - i == m.size());
+ assert(static_cast<std::size_t>(e - i) == m.size());
for (int j = 0; i != e; ++i, ++j)
assert(*i == m[j]);
}
diff --git a/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp b/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp
index be05afd4cf88..1634c5a39f34 100644
--- a/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp
+++ b/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp
@@ -24,7 +24,6 @@ int main()
typedef std::sub_match<const CharT*> SM;
typedef SM::string_type string;
SM sm = SM();
- SM sm2 = SM();
assert(sm.compare(string()) == 0);
const CharT s[] = {'1', '2', '3', 0};
sm.first = s;
@@ -38,7 +37,6 @@ int main()
typedef std::sub_match<const CharT*> SM;
typedef SM::string_type string;
SM sm = SM();
- SM sm2 = SM();
assert(sm.compare(string()) == 0);
const CharT s[] = {'1', '2', '3', 0};
sm.first = s;
diff --git a/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp b/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp
index 097a3918ed13..5e2ea8fb5322 100644
--- a/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp
+++ b/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp
@@ -23,7 +23,6 @@ int main()
typedef char CharT;
typedef std::sub_match<const CharT*> SM;
SM sm = SM();
- SM sm2 = SM();
assert(sm.compare("") == 0);
const CharT s[] = {'1', '2', '3', 0};
sm.first = s;
@@ -36,7 +35,6 @@ int main()
typedef wchar_t CharT;
typedef std::sub_match<const CharT*> SM;
SM sm = SM();
- SM sm2 = SM();
assert(sm.compare(L"") == 0);
const CharT s[] = {'1', '2', '3', 0};
sm.first = s;
diff --git a/test/std/re/re.traits/value.pass.cpp b/test/std/re/re.traits/value.pass.cpp
index dfed66c35c46..3a25f35df653 100644
--- a/test/std/re/re.traits/value.pass.cpp
+++ b/test/std/re/re.traits/value.pass.cpp
@@ -82,15 +82,15 @@ int main()
}
for (wchar_t c = '0'; c < '8'; ++c)
{
- assert(t.value(c, 8) == c - '0');
- assert(t.value(c, 10) == c - '0');
- assert(t.value(c, 16) == c - '0');
+ assert(t.value(c, 8) == static_cast<int>(c - '0'));
+ assert(t.value(c, 10) == static_cast<int>(c - '0'));
+ assert(t.value(c, 16) == static_cast<int>(c - '0'));
}
for (wchar_t c = '8'; c < ':'; ++c)
{
assert(t.value(c, 8) == -1);
- assert(t.value(c, 10) == c - '0');
- assert(t.value(c, 16) == c - '0');
+ assert(t.value(c, 10) == static_cast<int>(c - '0'));
+ assert(t.value(c, 16) == static_cast<int>(c - '0'));
}
for (wchar_t c = ':'; c < 'A'; ++c)
{
@@ -102,7 +102,7 @@ int main()
{
assert(t.value(c, 8) == -1);
assert(t.value(c, 10) == -1);
- assert(t.value(c, 16) == c - 'A' +10);
+ assert(t.value(c, 16) == static_cast<int>(c - 'A' +10));
}
for (wchar_t c = 'G'; c < 'a'; ++c)
{
@@ -114,9 +114,9 @@ int main()
{
assert(t.value(c, 8) == -1);
assert(t.value(c, 10) == -1);
- assert(t.value(c, 16) == c - 'a' +10);
+ assert(t.value(c, 16) == static_cast<int>(c - 'a' +10));
}
- for (int c = 'g'; c < 0xFFFF; ++c)
+ for (wchar_t c = 'g'; c < 0xFFFF; ++c)
{
assert(t.value(c, 8) == -1);
assert(t.value(c, 10) == -1);
diff --git a/test/std/strings/basic.string/string.access/at.pass.cpp b/test/std/strings/basic.string/string.access/at.pass.cpp
index 8dc0c57cb7b4..891648930e3c 100644
--- a/test/std/strings/basic.string/string.access/at.pass.cpp
+++ b/test/std/strings/basic.string/string.access/at.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// const_reference at(size_type pos) const;
@@ -19,21 +18,41 @@
#include "min_allocator.h"
+#include "test_macros.h"
+
template <class S>
void
test(S s, typename S::size_type pos)
{
- try
+ const S& cs = s;
+ if (pos < s.size())
{
- const S& cs = s;
assert(s.at(pos) == s[pos]);
assert(cs.at(pos) == cs[pos]);
- assert(pos < cs.size());
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos >= s.size());
+ try
+ {
+ s.at(pos);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos >= s.size());
+ }
+ try
+ {
+ cs.at(pos);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos >= s.size());
+ }
}
+#endif
}
int main()
diff --git a/test/std/strings/basic.string/string.access/index.pass.cpp b/test/std/strings/basic.string/string.access/index.pass.cpp
index b45a399320ba..f4053dff19e5 100644
--- a/test/std/strings/basic.string/string.access/index.pass.cpp
+++ b/test/std/strings/basic.string/string.access/index.pass.cpp
@@ -29,7 +29,7 @@ int main()
const S& cs = s;
for (S::size_type i = 0; i < cs.size(); ++i)
{
- assert(s[i] == '0' + i);
+ assert(s[i] == static_cast<char>('0' + i));
assert(cs[i] == s[i]);
}
assert(cs[cs.size()] == '\0');
@@ -43,7 +43,7 @@ int main()
const S& cs = s;
for (S::size_type i = 0; i < cs.size(); ++i)
{
- assert(s[i] == '0' + i);
+ assert(s[i] == static_cast<char>('0' + i));
assert(cs[i] == s[i]);
}
assert(cs[cs.size()] == '\0');
diff --git a/test/std/strings/basic.string/string.capacity/capacity.pass.cpp b/test/std/strings/basic.string/string.capacity/capacity.pass.cpp
index 4b09c096792c..79fbd2e96322 100644
--- a/test/std/strings/basic.string/string.capacity/capacity.pass.cpp
+++ b/test/std/strings/basic.string/string.capacity/capacity.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// size_type capacity() const;
@@ -18,21 +17,27 @@
#include "test_allocator.h"
#include "min_allocator.h"
+#include "test_macros.h"
+
template <class S>
void
test(S s)
{
S::allocator_type::throw_after = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
while (s.size() < s.capacity())
s.push_back(typename S::value_type());
assert(s.size() == s.capacity());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (...)
{
assert(false);
}
+#endif
S::allocator_type::throw_after = INT_MAX;
}
diff --git a/test/std/strings/basic.string/string.capacity/max_size.pass.cpp b/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
index fca14ddca561..a8f8126f7e6b 100644
--- a/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
+++ b/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <string>
// size_type max_size() const;
diff --git a/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp b/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
index e92a0e1054f6..59267f245d82 100644
--- a/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
+++ b/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <string>
// size_type max_size() const;
diff --git a/test/std/strings/basic.string/string.capacity/reserve.pass.cpp b/test/std/strings/basic.string/string.capacity/reserve.pass.cpp
index b2c254d1fb25..7210152ea3cb 100644
--- a/test/std/strings/basic.string/string.capacity/reserve.pass.cpp
+++ b/test/std/strings/basic.string/string.capacity/reserve.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// void reserve(size_type res_arg=0);
@@ -37,19 +36,29 @@ void
test(S s, typename S::size_type res_arg)
{
typename S::size_type old_cap = s.capacity();
+ ((void)old_cap); // Prevent unused warning
S s0 = s;
- try
+ if (res_arg <= s.max_size())
{
s.reserve(res_arg);
- assert(res_arg <= s.max_size());
assert(s == s0);
assert(s.capacity() >= res_arg);
assert(s.capacity() >= s.size());
}
- catch (std::length_error&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(res_arg > s.max_size());
+ try
+ {
+ s.reserve(res_arg);
+ assert(false);
+ }
+ catch (std::length_error&)
+ {
+ assert(res_arg > s.max_size());
+ }
}
+#endif
}
int main()
diff --git a/test/std/strings/basic.string/string.capacity/resize_size.pass.cpp b/test/std/strings/basic.string/string.capacity/resize_size.pass.cpp
index 558941599578..78200d50cb3e 100644
--- a/test/std/strings/basic.string/string.capacity/resize_size.pass.cpp
+++ b/test/std/strings/basic.string/string.capacity/resize_size.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// void resize(size_type n);
@@ -23,17 +22,26 @@ template <class S>
void
test(S s, typename S::size_type n, S expected)
{
- try
+ if (n <= s.max_size())
{
s.resize(n);
LIBCPP_ASSERT(s.__invariants());
- assert(n <= s.max_size());
assert(s == expected);
}
- catch (std::length_error&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(n > s.max_size());
+ try
+ {
+ s.resize(n);
+ assert(false);
+ }
+ catch (std::length_error&)
+ {
+ assert(n > s.max_size());
+ }
}
+#endif
}
int main()
diff --git a/test/std/strings/basic.string/string.capacity/resize_size_char.pass.cpp b/test/std/strings/basic.string/string.capacity/resize_size_char.pass.cpp
index 79f972b2fee3..288eb325252b 100644
--- a/test/std/strings/basic.string/string.capacity/resize_size_char.pass.cpp
+++ b/test/std/strings/basic.string/string.capacity/resize_size_char.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// void resize(size_type n, charT c);
@@ -23,17 +22,26 @@ template <class S>
void
test(S s, typename S::size_type n, typename S::value_type c, S expected)
{
- try
+ if (n <= s.max_size())
{
s.resize(n, c);
LIBCPP_ASSERT(s.__invariants());
- assert(n <= s.max_size());
assert(s == expected);
}
- catch (std::length_error&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(n > s.max_size());
+ try
+ {
+ s.resize(n, c);
+ assert(false);
+ }
+ catch (std::length_error&)
+ {
+ assert(n > s.max_size());
+ }
}
+#endif
}
int main()
diff --git a/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp b/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
new file mode 100644
index 000000000000..312e4d27fef1
--- /dev/null
+++ b/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
@@ -0,0 +1,186 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class _Tp>
+// basic_string(const _Tp& __t, size_type __pos, size_type __n,
+// const allocator_type& __a = allocator_type());
+//
+// Mostly we're testing string_view here
+
+#include <string>
+#include <string_view>
+#include <stdexcept>
+#include <algorithm>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(SV sv, unsigned pos, unsigned n)
+{
+ typedef typename S::traits_type T;
+ typedef typename S::allocator_type A;
+ if (pos <= sv.size())
+ {
+ S s2(sv, pos, n);
+ LIBCPP_ASSERT(s2.__invariants());
+ assert(pos <= sv.size());
+ unsigned rlen = std::min<unsigned>(sv.size() - pos, n);
+ assert(s2.size() == rlen);
+ assert(T::compare(s2.data(), sv.data() + pos, rlen) == 0);
+ assert(s2.get_allocator() == A());
+ assert(s2.capacity() >= s2.size());
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ S s2(sv, pos, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > sv.size());
+ }
+ }
+#endif
+}
+
+template <class S, class SV>
+void
+test(SV sv, unsigned pos, unsigned n, const typename S::allocator_type& a)
+{
+ typedef typename S::traits_type T;
+ typedef typename S::allocator_type A;
+ if (pos <= sv.size())
+ {
+ S s2(sv, pos, n, a);
+ LIBCPP_ASSERT(s2.__invariants());
+ assert(pos <= sv.size());
+ unsigned rlen = std::min<unsigned>(sv.size() - pos, n);
+ assert(s2.size() == rlen);
+ assert(T::compare(s2.data(), sv.data() + pos, rlen) == 0);
+ assert(s2.get_allocator() == a);
+ assert(s2.capacity() >= s2.size());
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ S s2(sv, pos, n, a);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > sv.size());
+ }
+ }
+#endif
+}
+
+int main()
+{
+
+ {
+ typedef test_allocator<char> A;
+ typedef std::basic_string_view<char, std::char_traits<char> > SV;
+ typedef std::basic_string <char, std::char_traits<char>, A> S;
+
+ test<S,SV>(SV(), 0, 0);
+ test<S,SV>(SV(), 0, 1);
+ test<S,SV>(SV(), 1, 0);
+ test<S,SV>(SV(), 1, 1);
+ test<S,SV>(SV(), 1, 2);
+ test<S,SV>(SV("1"), 0, 0);
+ test<S,SV>(SV("1"), 0, 1);
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 0);
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 1);
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 10);
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 100);
+
+ test<S,SV>(SV(), 0, 0, A(4));
+ test<S,SV>(SV(), 0, 1, A(4));
+ test<S,SV>(SV(), 1, 0, A(4));
+ test<S,SV>(SV(), 1, 1, A(4));
+ test<S,SV>(SV(), 1, 2, A(4));
+ test<S,SV>(SV("1"), 0, 0, A(6));
+ test<S,SV>(SV("1"), 0, 1, A(6));
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 0, A(8));
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 1, A(8));
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 10, A(8));
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 100, A(8));
+ }
+
+#if TEST_STD_VER >= 11
+ {
+ typedef min_allocator<char> A;
+ typedef std::basic_string_view<char, std::char_traits<char> > SV;
+ typedef std::basic_string <char, std::char_traits<char>, A> S;
+
+ test<S,SV>(SV(), 0, 0);
+ test<S,SV>(SV(), 0, 1);
+ test<S,SV>(SV(), 1, 0);
+ test<S,SV>(SV(), 1, 1);
+ test<S,SV>(SV(), 1, 2);
+ test<S,SV>(SV("1"), 0, 0);
+ test<S,SV>(SV("1"), 0, 1);
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 0);
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 1);
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 10);
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 100);
+
+ test<S,SV>(SV(), 0, 0, A());
+ test<S,SV>(SV(), 0, 1, A());
+ test<S,SV>(SV(), 1, 0, A());
+ test<S,SV>(SV(), 1, 1, A());
+ test<S,SV>(SV(), 1, 2, A());
+ test<S,SV>(SV("1"), 0, 0, A());
+ test<S,SV>(SV("1"), 0, 1, A());
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 0, A());
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 1, A());
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 10, A());
+ test<S,SV>(SV("1234567890123456789012345678901234567890123456789012345678901234567890"), 50, 100, A());
+ }
+#endif
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ S s = "ABCD";
+ SV sv = "EFGH";
+ char arr[] = "IJKL";
+
+ S s1("CDEF", 4); // calls ctor(const char *, len)
+ assert(s1 == "CDEF");
+
+ S s2("QRST", 0, 3); // calls ctor(string("QRST", pos, len)
+ assert(s2 == "QRS");
+
+ S s3(sv, 0, std::string::npos); // calls ctor(T, pos, npos)
+ assert(s3 == sv);
+
+ S s4(sv, 0, 3); // calls ctor(T, pos, len)
+ assert(s4 == "EFG");
+
+ S s5(arr, 0, 2); // calls ctor(const char *, len)
+ assert(s5 == "IJ");
+
+ S s6(arr, 0); // calls ctor(const char *, len)
+ assert(s6 == "");
+
+ S s7(s.data(), 2); // calls ctor(const char *, len)
+ assert(s7 == "AB");
+ }
+}
diff --git a/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
index c4ac1f1a47bb..0c6362d96863 100644
--- a/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
@@ -16,6 +16,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
template <class T>
@@ -26,6 +27,11 @@ struct some_alloc
~some_alloc() noexcept(false);
};
+// Test that it's possible to take the address of basic_string's destructors
+// by creating globals which will register their destructors with cxa_atexit.
+std::string s;
+std::wstring ws;
+
int main()
{
{
@@ -38,6 +44,6 @@ int main()
}
{
typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C;
- static_assert(!std::is_nothrow_destructible<C>::value, "");
+ LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, "");
}
}
diff --git a/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp b/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp
index cb0792ab23b3..1b10224cd9e7 100644
--- a/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp
@@ -16,6 +16,7 @@
#include <string>
#include <iterator>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "test_allocator.h"
@@ -32,7 +33,7 @@ test(It first, It last)
typedef typename S::allocator_type A;
S s2(first, last);
LIBCPP_ASSERT(s2.__invariants());
- assert(s2.size() == std::distance(first, last));
+ assert(s2.size() == static_cast<std::size_t>(std::distance(first, last)));
unsigned i = 0;
for (It it = first; it != last; ++it, ++i)
assert(s2[i] == *it);
@@ -49,7 +50,7 @@ test(It first, It last, const A& a)
typedef typename S::traits_type T;
S s2(first, last, a);
LIBCPP_ASSERT(s2.__invariants());
- assert(s2.size() == std::distance(first, last));
+ assert(s2.size() == static_cast<std::size_t>(std::distance(first, last)));
unsigned i = 0;
for (It it = first; it != last; ++it, ++i)
assert(s2[i] == *it);
diff --git a/test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp b/test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp
index b678247fb241..f56780095b7f 100644
--- a/test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp
@@ -15,6 +15,7 @@
#include <stdexcept>
#include <algorithm>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "test_allocator.h"
@@ -27,7 +28,7 @@ test(const charT* s)
typedef std::basic_string<charT, std::char_traits<charT>, test_allocator<charT> > S;
typedef typename S::traits_type T;
typedef typename S::allocator_type A;
- unsigned n = T::length(s);
+ std::size_t n = T::length(s);
S s2(s);
LIBCPP_ASSERT(s2.__invariants());
assert(s2.size() == n);
@@ -42,7 +43,7 @@ test(const charT* s, const A& a)
{
typedef std::basic_string<charT, std::char_traits<charT>, A> S;
typedef typename S::traits_type T;
- unsigned n = T::length(s);
+ std::size_t n = T::length(s);
S s2(s, a);
LIBCPP_ASSERT(s2.__invariants());
assert(s2.size() == n);
diff --git a/test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp b/test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
index 60d41b1d35be..60443e9f358d 100644
--- a/test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
@@ -15,6 +15,7 @@
#include <stdexcept>
#include <algorithm>
#include <cassert>
+#include <cstddef>
#include "test_macros.h"
#include "test_allocator.h"
@@ -61,8 +62,8 @@ test(Tp n, Tp c)
typedef typename S::allocator_type A;
S s2(n, c);
LIBCPP_ASSERT(s2.__invariants());
- assert(s2.size() == n);
- for (unsigned i = 0; i < n; ++i)
+ assert(s2.size() == static_cast<std::size_t>(n));
+ for (int i = 0; i < n; ++i)
assert(s2[i] == c);
assert(s2.get_allocator() == A());
assert(s2.capacity() >= s2.size());
@@ -77,8 +78,8 @@ test(Tp n, Tp c, const A& a)
typedef typename S::traits_type T;
S s2(n, c, a);
LIBCPP_ASSERT(s2.__invariants());
- assert(s2.size() == n);
- for (unsigned i = 0; i < n; ++i)
+ assert(s2.size() == static_cast<std::size_t>(n));
+ for (int i = 0; i < n; ++i)
assert(s2[i] == c);
assert(s2.get_allocator() == a);
assert(s2.capacity() >= s2.size());
@@ -102,8 +103,8 @@ int main()
test(100, 'a');
test(100, 'a', A(2));
- test(100, 65);
- test(100, 65, A(3));
+ test(static_cast<char>(100), static_cast<char>(65));
+ test(static_cast<char>(100), static_cast<char>(65), A(3));
}
#if TEST_STD_VER >= 11
{
@@ -122,8 +123,8 @@ int main()
test(100, 'a');
test(100, 'a', A());
- test(100, 65);
- test(100, 65, A());
+ test(static_cast<char>(100), static_cast<char>(65));
+ test(static_cast<char>(100), static_cast<char>(65), A());
}
#endif
}
diff --git a/test/std/strings/basic.string/string.cons/string_view.fail.cpp b/test/std/strings/basic.string/string.cons/string_view.fail.cpp
new file mode 100644
index 000000000000..70459b2dcfb4
--- /dev/null
+++ b/test/std/strings/basic.string/string.cons/string_view.fail.cpp
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// explicit basic_string(basic_string_view<CharT, traits> sv, const Allocator& a = Allocator());
+
+#include <string>
+#include <string_view>
+
+void foo ( const string &s ) {}
+
+int main()
+{
+ std::string_view sv = "ABCDE";
+ foo(sv); // requires implicit conversion from string_view to string
+}
diff --git a/test/std/strings/basic.string/string.cons/string_view.pass.cpp b/test/std/strings/basic.string/string.cons/string_view.pass.cpp
new file mode 100644
index 000000000000..d0e1a1699a22
--- /dev/null
+++ b/test/std/strings/basic.string/string.cons/string_view.pass.cpp
@@ -0,0 +1,89 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// explicit basic_string(basic_string_view<CharT, traits> sv, const Allocator& a = Allocator());
+
+#include <string>
+#include <string_view>
+#include <stdexcept>
+#include <algorithm>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_allocator.h"
+#include "min_allocator.h"
+
+template <class charT>
+void
+test(std::basic_string_view<charT> sv)
+{
+ typedef std::basic_string<charT, std::char_traits<charT>, test_allocator<charT> > S;
+ typedef typename S::traits_type T;
+ typedef typename S::allocator_type A;
+ S s2(sv);
+ LIBCPP_ASSERT(s2.__invariants());
+ assert(s2.size() == sv.size());
+ assert(T::compare(s2.data(), sv.data(), sv.size()) == 0);
+ assert(s2.get_allocator() == A());
+ assert(s2.capacity() >= s2.size());
+}
+
+template <class charT, class A>
+void
+test(std::basic_string_view<charT> sv, const A& a)
+{
+ typedef std::basic_string<charT, std::char_traits<charT>, A> S;
+ typedef typename S::traits_type T;
+ S s2(sv, a);
+ LIBCPP_ASSERT(s2.__invariants());
+ assert(s2.size() == sv.size());
+ assert(T::compare(s2.data(), sv.data(), sv.size()) == 0);
+ assert(s2.get_allocator() == a);
+ assert(s2.capacity() >= s2.size());
+}
+
+int main()
+{
+ {
+ typedef test_allocator<char> A;
+ typedef std::basic_string_view<char, std::char_traits<char> > SV;
+
+ test(SV(""));
+ test(SV(""), A(2));
+
+ test(SV("1"));
+ test(SV("1") ,A(2));
+
+ test(SV("1234567980"));
+ test(SV("1234567980"), A(2));
+
+ test(SV("123456798012345679801234567980123456798012345679801234567980"));
+ test(SV("123456798012345679801234567980123456798012345679801234567980"), A(2));
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef min_allocator<char> A;
+ typedef std::basic_string_view<char, std::char_traits<char> > SV;
+
+ test(SV(""));
+ test(SV(""), A());
+
+ test(SV("1"));
+ test(SV("1") ,A());
+
+ test(SV("1234567980"));
+ test(SV("1234567980"), A());
+
+ test(SV("123456798012345679801234567980123456798012345679801234567980"));
+ test(SV("123456798012345679801234567980123456798012345679801234567980"), A());
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.cons/substr.pass.cpp b/test/std/strings/basic.string/string.cons/substr.pass.cpp
index a10239bb3414..4fd974273de9 100644
--- a/test/std/strings/basic.string/string.cons/substr.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/substr.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string(const basic_string<charT,traits,Allocator>& str,
@@ -35,21 +34,31 @@ test(S str, unsigned pos)
{
typedef typename S::traits_type T;
typedef typename S::allocator_type A;
- try
+
+ if (pos <= str.size())
{
S s2(str, pos);
LIBCPP_ASSERT(s2.__invariants());
- assert(pos <= str.size());
- unsigned rlen = str.size() - pos;
+ typename S::size_type rlen = str.size() - pos;
assert(s2.size() == rlen);
assert(T::compare(s2.data(), str.data() + pos, rlen) == 0);
assert(s2.get_allocator() == A());
assert(s2.capacity() >= s2.size());
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > str.size());
+ try
+ {
+ S s2(str, pos);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > str.size());
+ }
}
+#endif
}
template <class S>
@@ -58,21 +67,30 @@ test(S str, unsigned pos, unsigned n)
{
typedef typename S::traits_type T;
typedef typename S::allocator_type A;
- try
+ if (pos <= str.size())
{
S s2(str, pos, n);
LIBCPP_ASSERT(s2.__invariants());
- assert(pos <= str.size());
- unsigned rlen = std::min<unsigned>(str.size() - pos, n);
+ typename S::size_type rlen = std::min<typename S::size_type>(str.size() - pos, n);
assert(s2.size() == rlen);
assert(T::compare(s2.data(), str.data() + pos, rlen) == 0);
assert(s2.get_allocator() == A());
assert(s2.capacity() >= s2.size());
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > str.size());
+ try
+ {
+ S s2(str, pos, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > str.size());
+ }
}
+#endif
}
template <class S>
@@ -81,24 +99,35 @@ test(S str, unsigned pos, unsigned n, const typename S::allocator_type& a)
{
typedef typename S::traits_type T;
typedef typename S::allocator_type A;
- try
+
+ if (pos <= str.size())
{
S s2(str, pos, n, a);
LIBCPP_ASSERT(s2.__invariants());
- assert(pos <= str.size());
- unsigned rlen = std::min<unsigned>(str.size() - pos, n);
+ typename S::size_type rlen = std::min<typename S::size_type>(str.size() - pos, n);
assert(s2.size() == rlen);
assert(T::compare(s2.data(), str.data() + pos, rlen) == 0);
assert(s2.get_allocator() == a);
assert(s2.capacity() >= s2.size());
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > str.size());
+ try
+ {
+ S s2(str, pos, n, a);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > str.size());
+ }
}
+#endif
}
#if TEST_STD_VER >= 11
+#ifndef TEST_HAS_NO_EXCEPTIONS
void test2583()
{ // LWG #2583
typedef std::basic_string<char, std::char_traits<char>, test_allocator<char> > StringA;
@@ -111,6 +140,7 @@ void test2583()
assert(false);
}
#endif
+#endif
int main()
{
@@ -192,6 +222,8 @@ int main()
test(S("1234567890123456789012345678901234567890123456789012345678901234567890", A()), 50, 100, A());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
test2583();
#endif
+#endif
}
diff --git a/test/std/strings/basic.string/string.iterators/end.pass.cpp b/test/std/strings/basic.string/string.iterators/end.pass.cpp
index abd0c2d853dc..3ad60269b3a9 100644
--- a/test/std/strings/basic.string/string.iterators/end.pass.cpp
+++ b/test/std/strings/basic.string/string.iterators/end.pass.cpp
@@ -14,6 +14,7 @@
#include <string>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -29,8 +30,8 @@ test(S s)
assert(e == s.begin());
assert(ce == cs.begin());
}
- assert(e - s.begin() == s.size());
- assert(ce - cs.begin() == cs.size());
+ assert(static_cast<std::size_t>(e - s.begin()) == s.size());
+ assert(static_cast<std::size_t>(ce - cs.begin()) == cs.size());
}
int main()
diff --git a/test/std/strings/basic.string/string.iterators/rend.pass.cpp b/test/std/strings/basic.string/string.iterators/rend.pass.cpp
index c8c2d9ccadca..93c47e6bb398 100644
--- a/test/std/strings/basic.string/string.iterators/rend.pass.cpp
+++ b/test/std/strings/basic.string/string.iterators/rend.pass.cpp
@@ -14,6 +14,7 @@
#include <string>
#include <cassert>
+#include <cstddef>
#include "min_allocator.h"
@@ -29,8 +30,8 @@ test(S s)
assert(e == s.rbegin());
assert(ce == cs.rbegin());
}
- assert(e - s.rbegin() == s.size());
- assert(ce - cs.rbegin() == cs.size());
+ assert(static_cast<std::size_t>(e - s.rbegin()) == s.size());
+ assert(static_cast<std::size_t>(ce - cs.rbegin()) == cs.size());
}
int main()
diff --git a/test/std/strings/basic.string/string.modifiers/string_append/T_size_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/T_size_size.pass.cpp
new file mode 100644
index 000000000000..fcd18b7f05be
--- /dev/null
+++ b/test/std/strings/basic.string/string.modifiers/string_append/T_size_size.pass.cpp
@@ -0,0 +1,200 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template <class T>
+// basic_string& append(const T& t, size_type pos, size_type n=npos); // C++17
+
+#include <string>
+#include <string>
+#include <stdexcept>
+#include <cassert>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(S s, SV sv, typename S::size_type pos, typename S::size_type n, S expected)
+{
+ if (pos <= sv.size())
+ {
+ s.append(sv, pos, n);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == expected);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ s.append(sv, pos, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > sv.size());
+ }
+ }
+#endif
+}
+
+template <class S, class SV>
+void
+test_npos(S s, SV sv, typename S::size_type pos, S expected)
+{
+ if (pos <= sv.size())
+ {
+ s.append(sv, pos);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == expected);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ s.append(sv, pos);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > sv.size());
+ }
+ }
+#endif
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(S(), SV(), 0, 0, S());
+ test(S(), SV(), 1, 0, S());
+ test(S(), SV("12345"), 0, 3, S("123"));
+ test(S(), SV("12345"), 1, 4, S("2345"));
+ test(S(), SV("12345"), 3, 15, S("45"));
+ test(S(), SV("12345"), 5, 15, S(""));
+ test(S(), SV("12345"), 6, 15, S("not happening"));
+ test(S(), SV("12345678901234567890"), 0, 0, S());
+ test(S(), SV("12345678901234567890"), 1, 1, S("2"));
+ test(S(), SV("12345678901234567890"), 2, 3, S("345"));
+ test(S(), SV("12345678901234567890"), 12, 13, S("34567890"));
+ test(S(), SV("12345678901234567890"), 21, 13, S("not happening"));
+
+ test(S("12345"), SV(), 0, 0, S("12345"));
+ test(S("12345"), SV("12345"), 2, 2, S("1234534"));
+ test(S("12345"), SV("1234567890"), 0, 100, S("123451234567890"));
+
+ test(S("12345678901234567890"), SV(), 0, 0, S("12345678901234567890"));
+ test(S("12345678901234567890"), SV("12345"), 1, 3, S("12345678901234567890234"));
+ test(S("12345678901234567890"), SV("12345678901234567890"), 5, 10,
+ S("123456789012345678906789012345"));
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string <char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char> > SV;
+ test(S(), SV(), 0, 0, S());
+ test(S(), SV(), 1, 0, S());
+ test(S(), SV("12345"), 0, 3, S("123"));
+ test(S(), SV("12345"), 1, 4, S("2345"));
+ test(S(), SV("12345"), 3, 15, S("45"));
+ test(S(), SV("12345"), 5, 15, S(""));
+ test(S(), SV("12345"), 6, 15, S("not happening"));
+ test(S(), SV("12345678901234567890"), 0, 0, S());
+ test(S(), SV("12345678901234567890"), 1, 1, S("2"));
+ test(S(), SV("12345678901234567890"), 2, 3, S("345"));
+ test(S(), SV("12345678901234567890"), 12, 13, S("34567890"));
+ test(S(), SV("12345678901234567890"), 21, 13, S("not happening"));
+
+ test(S("12345"), SV(), 0, 0, S("12345"));
+ test(S("12345"), SV("12345"), 2, 2, S("1234534"));
+ test(S("12345"), SV("1234567890"), 0, 100, S("123451234567890"));
+
+ test(S("12345678901234567890"), SV(), 0, 0, S("12345678901234567890"));
+ test(S("12345678901234567890"), SV("12345"), 1, 3, S("12345678901234567890234"));
+ test(S("12345678901234567890"), SV("12345678901234567890"), 5, 10,
+ S("123456789012345678906789012345"));
+ }
+#endif
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test_npos(S(), SV(), 0, S());
+ test_npos(S(), SV(), 1, S());
+ test_npos(S(), SV("12345"), 0, S("12345"));
+ test_npos(S(), SV("12345"), 1, S("2345"));
+ test_npos(S(), SV("12345"), 3, S("45"));
+ test_npos(S(), SV("12345"), 5, S(""));
+ test_npos(S(), SV("12345"), 6, S("not happening"));
+ }
+
+ {
+ std::string s;
+ std::string_view sv = "EFGH";
+ char arr[] = "IJKL";
+
+ s.append("CDEF", 0); // calls append(const char *, len)
+ assert(s == "");
+ s.clear();
+
+ s.append("QRST", 0, std::string::npos); // calls append(string("QRST"), pos, npos)
+ assert(s == "QRST");
+ s.clear();
+
+ s.append(sv, 0); // calls append(T, pos, npos)
+ assert(s == sv);
+ s.clear();
+
+ s.append(sv, 0, std::string::npos); // calls append(T, pos, npos)
+ assert(s == sv);
+ s.clear();
+
+ s.append(arr, 0); // calls append(const char *, len)
+ assert(s == "");
+ s.clear();
+
+ s.append(arr, 0, std::string::npos); // calls append(string("IJKL"), pos, npos)
+ assert(s == "IJKL");
+ s.clear();
+
+ s.append(arr, 0); // calls append(const char *, len)
+ assert(s == "");
+ s.clear();
+ }
+
+ {
+ std::string s = "ABCD";
+ std::string_view sv = s;
+ s.append(sv);
+ assert(s == "ABCDABCD");
+
+ sv = s;
+ s.append(sv, 0, std::string::npos);
+ assert(s == "ABCDABCDABCDABCD");
+
+ sv = s;
+ s.append(sv, sv.size());
+ assert(s == "ABCDABCDABCDABCD");
+ }
+
+ {
+ std::string s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ std::string_view sv = s;
+ s.append(sv);
+ assert(s == "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ");
+
+ sv = s;
+ s.append(sv, 0, std::string::npos);
+ assert(s == "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ }
+}
diff --git a/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
index 55fc63d06214..dac8860f9a64 100644
--- a/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
@@ -178,4 +178,30 @@ int main()
test_exceptions(S(), TIter(s, s+10, 6, TIter::TAComparison), TIter());
}
#endif
+
+ { // test appending to self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.append(s_short.begin(), s_short.end());
+ assert(s_short == "123/123/");
+ s_short.append(s_short.begin(), s_short.end());
+ assert(s_short == "123/123/123/123/");
+ s_short.append(s_short.begin(), s_short.end());
+ assert(s_short == "123/123/123/123/123/123/123/123/");
+
+ s_long.append(s_long.begin(), s_long.end());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
+ }
+
+ { // test appending a different type
+ typedef std::string S;
+ const uint8_t p[] = "ABCD";
+
+ S s;
+ s.append(p, p + 4);
+ assert(s == "ABCD");
+ }
+
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_append/pointer.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/pointer.pass.cpp
index 7c45068a53e1..eb552ca83928 100644
--- a/test/std/strings/basic.string/string.modifiers/string_append/pointer.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_append/pointer.pass.cpp
@@ -61,4 +61,20 @@ int main()
S("1234567890123456789012345678901234567890"));
}
#endif
+
+ { // test appending to self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.append(s_short.c_str());
+ assert(s_short == "123/123/");
+ s_short.append(s_short.c_str());
+ assert(s_short == "123/123/123/123/");
+ s_short.append(s_short.c_str());
+ assert(s_short == "123/123/123/123/123/123/123/123/");
+
+ s_long.append(s_long.c_str());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_append/pointer_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/pointer_size.pass.cpp
index 6c594ebac3be..fc80d7cccce6 100644
--- a/test/std/strings/basic.string/string.modifiers/string_append/pointer_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_append/pointer_size.pass.cpp
@@ -70,4 +70,20 @@ int main()
S("1234567890123456789012345678901234567890"));
}
#endif
+
+ { // test appending to self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.append(s_short.data(), s_short.size());
+ assert(s_short == "123/123/");
+ s_short.append(s_short.data(), s_short.size());
+ assert(s_short == "123/123/123/123/");
+ s_short.append(s_short.data(), s_short.size());
+ assert(s_short == "123/123/123/123/123/123/123/123/");
+
+ s_long.append(s_long.data(), s_long.size());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_append/string_size_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/string_size_size.pass.cpp
index 9e8158c3e43e..588c15ab8d6a 100644
--- a/test/std/strings/basic.string/string.modifiers/string_append/string_size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_append/string_size_size.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -25,34 +24,52 @@ template <class S>
void
test(S s, S str, typename S::size_type pos, typename S::size_type n, S expected)
{
- try
+ if (pos <= str.size())
{
s.append(str, pos, n);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= str.size());
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > str.size());
+ try
+ {
+ s.append(str, pos, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > str.size());
+ }
}
+#endif
}
template <class S>
void
test_npos(S s, S str, typename S::size_type pos, S expected)
{
- try
+ if (pos <= str.size())
{
s.append(str, pos);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= str.size());
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > str.size());
+ try
+ {
+ s.append(str, pos);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > str.size());
+ }
}
+#endif
}
int main()
diff --git a/test/std/strings/basic.string/string.modifiers/string_append/string_view.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/string_view.pass.cpp
new file mode 100644
index 000000000000..2d85b15fa373
--- /dev/null
+++ b/test/std/strings/basic.string/string.modifiers/string_append/string_view.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// basic_string<charT,traits,Allocator>&
+// append(basic_string_view<charT,traits> sv);
+
+#include <string>
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(S s, SV sv, S expected)
+{
+ s.append(sv);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == expected);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(S(), SV(), S());
+ test(S(), SV("12345"), S("12345"));
+ test(S(), SV("1234567890"), S("1234567890"));
+ test(S(), SV("12345678901234567890"), S("12345678901234567890"));
+
+ test(S("12345"), SV(), S("12345"));
+ test(S("12345"), SV("12345"), S("1234512345"));
+ test(S("12345"), SV("1234567890"), S("123451234567890"));
+ test(S("12345"), SV("12345678901234567890"), S("1234512345678901234567890"));
+
+ test(S("1234567890"), SV(), S("1234567890"));
+ test(S("1234567890"), SV("12345"), S("123456789012345"));
+ test(S("1234567890"), SV("1234567890"), S("12345678901234567890"));
+ test(S("1234567890"), SV("12345678901234567890"), S("123456789012345678901234567890"));
+
+ test(S("12345678901234567890"), SV(), S("12345678901234567890"));
+ test(S("12345678901234567890"), SV("12345"), S("1234567890123456789012345"));
+ test(S("12345678901234567890"), SV("1234567890"), S("123456789012345678901234567890"));
+ test(S("12345678901234567890"), SV("12345678901234567890"),
+ S("1234567890123456789012345678901234567890"));
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string <char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char> > SV;
+ test(S(), SV(), S());
+ test(S(), SV("12345"), S("12345"));
+ test(S(), SV("1234567890"), S("1234567890"));
+ test(S(), SV("12345678901234567890"), S("12345678901234567890"));
+
+ test(S("12345"), SV(), S("12345"));
+ test(S("12345"), SV("12345"), S("1234512345"));
+ test(S("12345"), SV("1234567890"), S("123451234567890"));
+ test(S("12345"), SV("12345678901234567890"), S("1234512345678901234567890"));
+
+ test(S("1234567890"), SV(), S("1234567890"));
+ test(S("1234567890"), SV("12345"), S("123456789012345"));
+ test(S("1234567890"), SV("1234567890"), S("12345678901234567890"));
+ test(S("1234567890"), SV("12345678901234567890"), S("123456789012345678901234567890"));
+
+ test(S("12345678901234567890"), SV(), S("12345678901234567890"));
+ test(S("12345678901234567890"), SV("12345"), S("1234567890123456789012345"));
+ test(S("12345678901234567890"), SV("1234567890"), S("123456789012345678901234567890"));
+ test(S("12345678901234567890"), SV("12345678901234567890"),
+ S("1234567890123456789012345678901234567890"));
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/T_size_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/T_size_size.pass.cpp
new file mode 100644
index 000000000000..bf51d816e86e
--- /dev/null
+++ b/test/std/strings/basic.string/string.modifiers/string_assign/T_size_size.pass.cpp
@@ -0,0 +1,195 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template <class T>
+// basic_string& assign(const T& t, size_type pos, size_type n=npos); // C++17
+
+#include <string>
+#include <stdexcept>
+#include <cassert>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(S s, SV sv, typename S::size_type pos, typename S::size_type n, S expected)
+{
+ if (pos <= sv.size())
+ {
+ s.assign(sv, pos, n);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == expected);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ s.assign(sv, pos, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > sv.size());
+ }
+ }
+#endif
+}
+
+template <class S, class SV>
+void
+test_npos(S s, SV sv, typename S::size_type pos, S expected)
+{
+ if (pos <= sv.size())
+ {
+ s.assign(sv, pos);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == expected);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ s.assign(sv, pos);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > sv.size());
+ }
+ }
+#endif
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(S(), SV(), 0, 0, S());
+ test(S(), SV(), 1, 0, S());
+ test(S(), SV("12345"), 0, 3, S("123"));
+ test(S(), SV("12345"), 1, 4, S("2345"));
+ test(S(), SV("12345"), 3, 15, S("45"));
+ test(S(), SV("12345"), 5, 15, S(""));
+ test(S(), SV("12345"), 6, 15, S("not happening"));
+ test(S(), SV("12345678901234567890"), 0, 0, S());
+ test(S(), SV("12345678901234567890"), 1, 1, S("2"));
+ test(S(), SV("12345678901234567890"), 2, 3, S("345"));
+ test(S(), SV("12345678901234567890"), 12, 13, S("34567890"));
+ test(S(), SV("12345678901234567890"), 21, 13, S("not happening"));
+
+ test(S("12345"), SV(), 0, 0, S());
+ test(S("12345"), SV("12345"), 2, 2, S("34"));
+ test(S("12345"), SV("1234567890"), 0, 100, S("1234567890"));
+
+ test(S("12345678901234567890"), SV(), 0, 0, S());
+ test(S("12345678901234567890"), SV("12345"), 1, 3, S("234"));
+ test(S("12345678901234567890"), SV("12345678901234567890"), 5, 10,
+ S("6789012345"));
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string <char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char> > SV;
+ test(S(), SV(), 0, 0, S());
+ test(S(), SV(), 1, 0, S());
+ test(S(), SV("12345"), 0, 3, S("123"));
+ test(S(), SV("12345"), 1, 4, S("2345"));
+ test(S(), SV("12345"), 3, 15, S("45"));
+ test(S(), SV("12345"), 5, 15, S(""));
+ test(S(), SV("12345"), 6, 15, S("not happening"));
+ test(S(), SV("12345678901234567890"), 0, 0, S());
+ test(S(), SV("12345678901234567890"), 1, 1, S("2"));
+ test(S(), SV("12345678901234567890"), 2, 3, S("345"));
+ test(S(), SV("12345678901234567890"), 12, 13, S("34567890"));
+ test(S(), SV("12345678901234567890"), 21, 13, S("not happening"));
+
+ test(S("12345"), SV(), 0, 0, S());
+ test(S("12345"), SV("12345"), 2, 2, S("34"));
+ test(S("12345"), SV("1234567890"), 0, 100, S("1234567890"));
+
+ test(S("12345678901234567890"), SV(), 0, 0, S());
+ test(S("12345678901234567890"), SV("12345"), 1, 3, S("234"));
+ test(S("12345678901234567890"), SV("12345678901234567890"), 5, 10,
+ S("6789012345"));
+ }
+#endif
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test_npos(S(), SV(), 0, S());
+ test_npos(S(), SV(), 1, S());
+ test_npos(S(), SV("12345"), 0, S("12345"));
+ test_npos(S(), SV("12345"), 1, S("2345"));
+ test_npos(S(), SV("12345"), 3, S("45"));
+ test_npos(S(), SV("12345"), 5, S(""));
+ test_npos(S(), SV("12345"), 6, S("not happening"));
+ }
+
+ {
+ std::string s = "ABCD";
+ std::string_view sv = "EFGH";
+ char arr[] = "IJKL";
+
+ s.assign("CDEF", 0); // calls assign(const char *, len)
+ assert(s == "");
+ s.clear();
+
+ s.assign("QRST", 0, std::string::npos); // calls assign(string("QRST", pos, len)
+ assert(s == "QRST");
+ s.clear();
+
+ s.assign(sv, 0); // calls assign(T, pos, npos)
+ assert(s == sv);
+ s.clear();
+
+ s.assign(sv, 0, std::string::npos); // calls assign(T, pos, npos)
+ assert(s == sv);
+ s.clear();
+
+ s.assign(arr, 0); // calls assign(const char *, len)
+ assert(s == "");
+ s.clear();
+
+ s.assign(arr, 0, std::string::npos); // calls assign(string("IJKL"), pos, npos)
+ assert(s == "IJKL");
+ s.clear();
+
+ s.assign(arr, 0); // calls assign(const char *, len)
+ assert(s == "");
+ s.clear();
+ }
+
+ {
+ std::string s = "ABCD";
+ std::string_view sv = s;
+ s.assign(sv);
+ assert(s == "ABCD");
+
+ sv = s;
+ s.assign(sv, 0, std::string::npos);
+ assert(s == "ABCD");
+ }
+
+ {
+ std::string s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ std::string_view sv = s;
+ s.assign(sv);
+ assert(s == "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+
+ sv = s;
+ s.assign(sv, 0, std::string::npos);
+ assert(s == "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ }
+}
diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
index e6a57519f34b..e5312e6db6ce 100644
--- a/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
@@ -179,4 +179,30 @@ int main()
test_exceptions(S(), TIter(s, s+10, 6, TIter::TAComparison), TIter());
}
#endif
+
+ { // test assigning to self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.assign(s_short.begin(), s_short.end());
+ assert(s_short == "123/");
+ s_short.assign(s_short.begin() + 2, s_short.end());
+ assert(s_short == "3/");
+
+ s_long.assign(s_long.begin(), s_long.end());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/");
+
+ s_long.assign(s_long.begin() + 30, s_long.end());
+ assert(s_long == "nsectetur/");
+ }
+
+ { // test assigning a different type
+ typedef std::string S;
+ const uint8_t p[] = "ABCD";
+
+ S s;
+ s.assign(p, p + 4);
+ assert(s == "ABCD");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp
index 386dee6d5808..b0876b388d83 100644
--- a/test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp
@@ -61,4 +61,18 @@ int main()
S("12345678901234567890"));
}
#endif
+
+ { // test assignment to self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.assign(s_short.c_str());
+ assert(s_short == "123/");
+ s_short.assign(s_short.c_str() + 2);
+ assert(s_short == "3/");
+
+ s_long.assign(s_long.c_str() + 30);
+ assert(s_long == "nsectetur/");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp
index 0eeb9266f40f..97a9990f5180 100644
--- a/test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp
@@ -70,4 +70,20 @@ int main()
S("12345678901234567890"));
}
#endif
+ { // test assign to self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.assign(s_short.data(), s_short.size());
+ assert(s_short == "123/");
+ s_short.assign(s_short.data() + 2, s_short.size() - 2);
+ assert(s_short == "3/");
+
+ s_long.assign(s_long.data(), s_long.size());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/");
+
+ s_long.assign(s_long.data() + 2, 8 );
+ assert(s_long == "rem ipsu");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/string_size_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/string_size_size.pass.cpp
index d9d3cb422ae5..2ad37f311de5 100644
--- a/test/std/strings/basic.string/string.modifiers/string_assign/string_size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_assign/string_size_size.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -25,34 +24,52 @@ template <class S>
void
test(S s, S str, typename S::size_type pos, typename S::size_type n, S expected)
{
- try
+ if (pos <= str.size())
{
s.assign(str, pos, n);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= str.size());
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > str.size());
+ try
+ {
+ s.assign(str, pos, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > str.size());
+ }
}
+#endif
}
template <class S>
void
test_npos(S s, S str, typename S::size_type pos, S expected)
{
- try
+ if (pos <= str.size())
{
s.assign(str, pos);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= str.size());
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > str.size());
+ try
+ {
+ s.assign(str, pos);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > str.size());
+ }
}
+#endif
}
int main()
diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/string_view.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/string_view.pass.cpp
new file mode 100644
index 000000000000..e56b094a36e9
--- /dev/null
+++ b/test/std/strings/basic.string/string.modifiers/string_assign/string_view.pass.cpp
@@ -0,0 +1,105 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// basic_string<charT,traits,Allocator>&
+// assign(basic_string_view<charT,traits> sv);
+
+#include <string>
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+#include "test_allocator.h"
+
+template <class S, class SV>
+void
+test(S s, SV sv, S expected)
+{
+ s.assign(sv);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == expected);
+}
+
+template <class S, class SV>
+void
+testAlloc(S s, SV sv, const typename S::allocator_type& a)
+{
+ s.assign(sv);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == sv);
+ assert(s.get_allocator() == a);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(S(), SV(), S());
+ test(S(), SV("12345"), S("12345"));
+ test(S(), SV("1234567890"), S("1234567890"));
+ test(S(), SV("12345678901234567890"), S("12345678901234567890"));
+
+ test(S("12345"), SV(), S());
+ test(S("12345"), SV("12345"), S("12345"));
+ test(S("12345"), SV("1234567890"), S("1234567890"));
+ test(S("12345"), SV("12345678901234567890"), S("12345678901234567890"));
+
+ test(S("1234567890"), SV(), S());
+ test(S("1234567890"), SV("12345"), S("12345"));
+ test(S("1234567890"), SV("1234567890"), S("1234567890"));
+ test(S("1234567890"), SV("12345678901234567890"), S("12345678901234567890"));
+
+ test(S("12345678901234567890"), SV(), S());
+ test(S("12345678901234567890"), SV("12345"), S("12345"));
+ test(S("12345678901234567890"), SV("1234567890"), S("1234567890"));
+ test(S("12345678901234567890"), SV("12345678901234567890"),
+ S("12345678901234567890"));
+
+ testAlloc(S(), SV(), std::allocator<char>());
+ testAlloc(S(), SV("12345"), std::allocator<char>());
+ testAlloc(S(), SV("1234567890"), std::allocator<char>());
+ testAlloc(S(), SV("12345678901234567890"), std::allocator<char>());
+ }
+
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string <char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char> > SV;
+ test(S(), SV(), S());
+ test(S(), SV("12345"), S("12345"));
+ test(S(), SV("1234567890"), S("1234567890"));
+ test(S(), SV("12345678901234567890"), S("12345678901234567890"));
+
+ test(S("12345"), SV(), S());
+ test(S("12345"), SV("12345"), S("12345"));
+ test(S("12345"), SV("1234567890"), S("1234567890"));
+ test(S("12345"), SV("12345678901234567890"), S("12345678901234567890"));
+
+ test(S("1234567890"), SV(), S());
+ test(S("1234567890"), SV("12345"), S("12345"));
+ test(S("1234567890"), SV("1234567890"), S("1234567890"));
+ test(S("1234567890"), SV("12345678901234567890"), S("12345678901234567890"));
+
+ test(S("12345678901234567890"), SV(), S());
+ test(S("12345678901234567890"), SV("12345"), S("12345"));
+ test(S("12345678901234567890"), SV("1234567890"), S("1234567890"));
+ test(S("12345678901234567890"), SV("12345678901234567890"),
+ S("12345678901234567890"));
+
+ testAlloc(S(), SV(), min_allocator<char>());
+ testAlloc(S(), SV("12345"), min_allocator<char>());
+ testAlloc(S(), SV("1234567890"), min_allocator<char>());
+ testAlloc(S(), SV("12345678901234567890"), min_allocator<char>());
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp
index b66877652837..664d2049be99 100644
--- a/test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// size_type copy(charT* s, size_type n, size_type pos = 0) const;
@@ -25,20 +24,30 @@ void
test(S str, typename S::value_type* s, typename S::size_type n,
typename S::size_type pos)
{
- try
+ const S& cs = str;
+ if (pos <= cs.size())
{
- const S& cs = str;
typename S::size_type r = cs.copy(s, n, pos);
- assert(pos <= cs.size());
typename S::size_type rlen = std::min(n, cs.size() - pos);
assert(r == rlen);
for (r = 0; r < rlen; ++r)
assert(S::traits_type::eq(cs[pos+r], s[r]));
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > str.size());
+ try
+ {
+ typename S::size_type r = cs.copy(s, n, pos);
+ ((void)r); // Prevent unused warning
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > str.size());
+ }
}
+#endif
}
int main()
diff --git a/test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp
index 5db97ec2cf5f..eb6be202a350 100644
--- a/test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -24,40 +23,58 @@ template <class S>
void
test(S s, typename S::size_type pos, typename S::size_type n, S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos <= old_size)
{
s.erase(pos, n);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= old_size);
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > old_size);
- assert(s == s0);
+ try
+ {
+ s.erase(pos, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > old_size);
+ assert(s == s0);
+ }
}
+#endif
}
template <class S>
void
test(S s, typename S::size_type pos, S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos <= old_size)
{
s.erase(pos);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= old_size);
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > old_size);
- assert(s == s0);
+ try
+ {
+ s.erase(pos);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > old_size);
+ assert(s == s0);
+ }
}
+#endif
}
template <class S>
diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
index bbae39419da4..e5ce8e51e1d6 100644
--- a/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
@@ -169,4 +169,29 @@ int main()
assert(false);
}
#endif
+
+ { // test inserting into self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.insert(s_short.begin(), s_short.begin(), s_short.end());
+ assert(s_short == "123/123/");
+ s_short.insert(s_short.begin(), s_short.begin(), s_short.end());
+ assert(s_short == "123/123/123/123/");
+ s_short.insert(s_short.begin(), s_short.begin(), s_short.end());
+ assert(s_short == "123/123/123/123/123/123/123/123/");
+
+ s_long.insert(s_long.begin(), s_long.begin(), s_long.end());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
+ }
+
+ { // test assigning a different type
+ typedef std::string S;
+ const uint8_t p[] = "ABCD";
+
+ S s;
+ s.insert(s.begin(), p, p + 4);
+ assert(s == "ABCD");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/size_T_size_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/size_T_size_size.pass.cpp
new file mode 100644
index 000000000000..e9476f48f358
--- /dev/null
+++ b/test/std/strings/basic.string/string.modifiers/string_insert/size_T_size_size.pass.cpp
@@ -0,0 +1,1842 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template <class T>
+// basic_string& assign(size_type pos1, const T& t, size_type pos2, size_type n=npos); // C++17
+//
+// Mostly we're testing string_view here
+
+#include <string>
+#include <stdexcept>
+#include <cassert>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(S s, typename S::size_type pos1, SV sv, typename S::size_type pos2,
+ typename S::size_type n, S expected)
+{
+ static_assert((!std::is_same<S, SV>::value), "");
+ const typename S::size_type old_size = s.size();
+ S s0 = s;
+ if (pos1 <= old_size && pos2 <= sv.size())
+ {
+ s.insert(pos1, sv, pos2, n);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == expected);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ s.insert(pos1, sv, pos2, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > old_size || pos2 > sv.size());
+ assert(s == s0);
+ }
+ }
+#endif
+}
+
+template <class S, class SV>
+void
+test_npos(S s, typename S::size_type pos1, SV sv, typename S::size_type pos2, S expected)
+{
+ static_assert((!std::is_same<S, SV>::value), "");
+ const typename S::size_type old_size = s.size();
+ S s0 = s;
+ if (pos1 <= old_size && pos2 <= sv.size())
+ {
+ s.insert(pos1, sv, pos2);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == expected);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ s.insert(pos1, sv, pos2);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > old_size || pos2 > sv.size());
+ assert(s == s0);
+ }
+ }
+#endif
+}
+
+
+template <class S, class SV>
+void test0()
+{
+ test(S(""), 0, SV(""), 0, 0, S(""));
+ test(S(""), 0, SV(""), 0, 1, S(""));
+ test(S(""), 0, SV(""), 1, 0, S("can't happen"));
+ test(S(""), 0, SV("12345"), 0, 0, S(""));
+ test(S(""), 0, SV("12345"), 0, 1, S("1"));
+ test(S(""), 0, SV("12345"), 0, 2, S("12"));
+ test(S(""), 0, SV("12345"), 0, 4, S("1234"));
+ test(S(""), 0, SV("12345"), 0, 5, S("12345"));
+ test(S(""), 0, SV("12345"), 0, 6, S("12345"));
+ test(S(""), 0, SV("12345"), 1, 0, S(""));
+ test(S(""), 0, SV("12345"), 1, 1, S("2"));
+ test(S(""), 0, SV("12345"), 1, 2, S("23"));
+ test(S(""), 0, SV("12345"), 1, 3, S("234"));
+ test(S(""), 0, SV("12345"), 1, 4, S("2345"));
+ test(S(""), 0, SV("12345"), 1, 5, S("2345"));
+ test(S(""), 0, SV("12345"), 2, 0, S(""));
+ test(S(""), 0, SV("12345"), 2, 1, S("3"));
+ test(S(""), 0, SV("12345"), 2, 2, S("34"));
+ test(S(""), 0, SV("12345"), 2, 3, S("345"));
+ test(S(""), 0, SV("12345"), 2, 4, S("345"));
+ test(S(""), 0, SV("12345"), 4, 0, S(""));
+ test(S(""), 0, SV("12345"), 4, 1, S("5"));
+ test(S(""), 0, SV("12345"), 4, 2, S("5"));
+ test(S(""), 0, SV("12345"), 5, 0, S(""));
+ test(S(""), 0, SV("12345"), 5, 1, S(""));
+ test(S(""), 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S(""), 0, SV("1234567890"), 0, 0, S(""));
+ test(S(""), 0, SV("1234567890"), 0, 1, S("1"));
+ test(S(""), 0, SV("1234567890"), 0, 5, S("12345"));
+ test(S(""), 0, SV("1234567890"), 0, 9, S("123456789"));
+ test(S(""), 0, SV("1234567890"), 0, 10, S("1234567890"));
+ test(S(""), 0, SV("1234567890"), 0, 11, S("1234567890"));
+ test(S(""), 0, SV("1234567890"), 1, 0, S(""));
+ test(S(""), 0, SV("1234567890"), 1, 1, S("2"));
+ test(S(""), 0, SV("1234567890"), 1, 4, S("2345"));
+ test(S(""), 0, SV("1234567890"), 1, 8, S("23456789"));
+ test(S(""), 0, SV("1234567890"), 1, 9, S("234567890"));
+ test(S(""), 0, SV("1234567890"), 1, 10, S("234567890"));
+ test(S(""), 0, SV("1234567890"), 5, 0, S(""));
+ test(S(""), 0, SV("1234567890"), 5, 1, S("6"));
+ test(S(""), 0, SV("1234567890"), 5, 2, S("67"));
+ test(S(""), 0, SV("1234567890"), 5, 4, S("6789"));
+ test(S(""), 0, SV("1234567890"), 5, 5, S("67890"));
+ test(S(""), 0, SV("1234567890"), 5, 6, S("67890"));
+ test(S(""), 0, SV("1234567890"), 9, 0, S(""));
+ test(S(""), 0, SV("1234567890"), 9, 1, S("0"));
+ test(S(""), 0, SV("1234567890"), 9, 2, S("0"));
+ test(S(""), 0, SV("1234567890"), 10, 0, S(""));
+ test(S(""), 0, SV("1234567890"), 10, 1, S(""));
+ test(S(""), 0, SV("1234567890"), 11, 0, S("can't happen"));
+}
+
+template <class S, class SV>
+void test1()
+{
+ test(S(""), 0, SV("12345678901234567890"), 0, 0, S(""));
+ test(S(""), 0, SV("12345678901234567890"), 0, 1, S("1"));
+ test(S(""), 0, SV("12345678901234567890"), 0, 10, S("1234567890"));
+ test(S(""), 0, SV("12345678901234567890"), 0, 19, S("1234567890123456789"));
+ test(S(""), 0, SV("12345678901234567890"), 0, 20, S("12345678901234567890"));
+ test(S(""), 0, SV("12345678901234567890"), 0, 21, S("12345678901234567890"));
+ test(S(""), 0, SV("12345678901234567890"), 1, 0, S(""));
+ test(S(""), 0, SV("12345678901234567890"), 1, 1, S("2"));
+ test(S(""), 0, SV("12345678901234567890"), 1, 9, S("234567890"));
+ test(S(""), 0, SV("12345678901234567890"), 1, 18, S("234567890123456789"));
+ test(S(""), 0, SV("12345678901234567890"), 1, 19, S("2345678901234567890"));
+ test(S(""), 0, SV("12345678901234567890"), 1, 20, S("2345678901234567890"));
+ test(S(""), 0, SV("12345678901234567890"), 10, 0, S(""));
+ test(S(""), 0, SV("12345678901234567890"), 10, 1, S("1"));
+ test(S(""), 0, SV("12345678901234567890"), 10, 5, S("12345"));
+ test(S(""), 0, SV("12345678901234567890"), 10, 9, S("123456789"));
+ test(S(""), 0, SV("12345678901234567890"), 10, 10, S("1234567890"));
+ test(S(""), 0, SV("12345678901234567890"), 10, 11, S("1234567890"));
+ test(S(""), 0, SV("12345678901234567890"), 19, 0, S(""));
+ test(S(""), 0, SV("12345678901234567890"), 19, 1, S("0"));
+ test(S(""), 0, SV("12345678901234567890"), 19, 2, S("0"));
+ test(S(""), 0, SV("12345678901234567890"), 20, 0, S(""));
+ test(S(""), 0, SV("12345678901234567890"), 20, 1, S(""));
+ test(S(""), 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S(""), 1, SV(""), 0, 0, S("can't happen"));
+ test(S(""), 1, SV(""), 0, 1, S("can't happen"));
+ test(S(""), 1, SV(""), 1, 0, S("can't happen"));
+ test(S(""), 1, SV("12345"), 0, 0, S("can't happen"));
+ test(S(""), 1, SV("12345"), 0, 1, S("can't happen"));
+ test(S(""), 1, SV("12345"), 0, 2, S("can't happen"));
+ test(S(""), 1, SV("12345"), 0, 4, S("can't happen"));
+ test(S(""), 1, SV("12345"), 0, 5, S("can't happen"));
+ test(S(""), 1, SV("12345"), 0, 6, S("can't happen"));
+ test(S(""), 1, SV("12345"), 1, 0, S("can't happen"));
+ test(S(""), 1, SV("12345"), 1, 1, S("can't happen"));
+ test(S(""), 1, SV("12345"), 1, 2, S("can't happen"));
+ test(S(""), 1, SV("12345"), 1, 3, S("can't happen"));
+ test(S(""), 1, SV("12345"), 1, 4, S("can't happen"));
+ test(S(""), 1, SV("12345"), 1, 5, S("can't happen"));
+ test(S(""), 1, SV("12345"), 2, 0, S("can't happen"));
+ test(S(""), 1, SV("12345"), 2, 1, S("can't happen"));
+ test(S(""), 1, SV("12345"), 2, 2, S("can't happen"));
+ test(S(""), 1, SV("12345"), 2, 3, S("can't happen"));
+ test(S(""), 1, SV("12345"), 2, 4, S("can't happen"));
+ test(S(""), 1, SV("12345"), 4, 0, S("can't happen"));
+ test(S(""), 1, SV("12345"), 4, 1, S("can't happen"));
+ test(S(""), 1, SV("12345"), 4, 2, S("can't happen"));
+ test(S(""), 1, SV("12345"), 5, 0, S("can't happen"));
+ test(S(""), 1, SV("12345"), 5, 1, S("can't happen"));
+ test(S(""), 1, SV("12345"), 6, 0, S("can't happen"));
+}
+
+template <class S, class SV>
+void test2()
+{
+ test(S(""), 1, SV("1234567890"), 0, 0, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 0, 1, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 0, 5, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 0, 9, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 0, 10, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 0, 11, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 1, 0, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 1, 1, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 1, 4, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 1, 8, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 1, 9, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 1, 10, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 5, 0, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 5, 1, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 5, 2, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 5, 4, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 5, 5, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 5, 6, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 9, 0, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 9, 1, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 9, 2, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 10, 0, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 10, 1, S("can't happen"));
+ test(S(""), 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 0, 0, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 0, 1, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 0, 10, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 0, 19, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 0, 20, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 0, 21, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 1, 0, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 1, 1, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 1, 9, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 1, 18, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 1, 19, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 1, 20, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 10, 0, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 10, 1, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 10, 5, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 10, 9, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 10, 10, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 10, 11, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 19, 0, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 19, 1, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 19, 2, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 20, 0, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 20, 1, S("can't happen"));
+ test(S(""), 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 0, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 0, SV(""), 0, 1, S("abcde"));
+}
+
+template <class S, class SV>
+void test3()
+{
+ test(S("abcde"), 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 0, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcde"), 0, SV("12345"), 0, 1, S("1abcde"));
+ test(S("abcde"), 0, SV("12345"), 0, 2, S("12abcde"));
+ test(S("abcde"), 0, SV("12345"), 0, 4, S("1234abcde"));
+ test(S("abcde"), 0, SV("12345"), 0, 5, S("12345abcde"));
+ test(S("abcde"), 0, SV("12345"), 0, 6, S("12345abcde"));
+ test(S("abcde"), 0, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 0, SV("12345"), 1, 1, S("2abcde"));
+ test(S("abcde"), 0, SV("12345"), 1, 2, S("23abcde"));
+ test(S("abcde"), 0, SV("12345"), 1, 3, S("234abcde"));
+ test(S("abcde"), 0, SV("12345"), 1, 4, S("2345abcde"));
+ test(S("abcde"), 0, SV("12345"), 1, 5, S("2345abcde"));
+ test(S("abcde"), 0, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 0, SV("12345"), 2, 1, S("3abcde"));
+ test(S("abcde"), 0, SV("12345"), 2, 2, S("34abcde"));
+ test(S("abcde"), 0, SV("12345"), 2, 3, S("345abcde"));
+ test(S("abcde"), 0, SV("12345"), 2, 4, S("345abcde"));
+ test(S("abcde"), 0, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 0, SV("12345"), 4, 1, S("5abcde"));
+ test(S("abcde"), 0, SV("12345"), 4, 2, S("5abcde"));
+ test(S("abcde"), 0, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcde"), 0, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 0, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 0, 1, S("1abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 0, 5, S("12345abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 0, 9, S("123456789abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 0, 10, S("1234567890abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 0, 11, S("1234567890abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 1, 1, S("2abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 1, 4, S("2345abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 1, 8, S("23456789abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 1, 9, S("234567890abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 1, 10, S("234567890abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 5, 1, S("6abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 5, 2, S("67abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 5, 4, S("6789abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 5, 5, S("67890abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 5, 6, S("67890abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 9, 1, S("0abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 9, 2, S("0abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 0, 1, S("1abcde"));
+}
+
+template <class S, class SV>
+void test4()
+{
+ test(S("abcde"), 0, SV("12345678901234567890"), 0, 10, S("1234567890abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 0, 19, S("1234567890123456789abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 0, 20, S("12345678901234567890abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 0, 21, S("12345678901234567890abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 1, 1, S("2abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 1, 9, S("234567890abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 1, 18, S("234567890123456789abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 1, 19, S("2345678901234567890abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 1, 20, S("2345678901234567890abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 10, 1, S("1abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 10, 5, S("12345abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 10, 9, S("123456789abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 10, 10, S("1234567890abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 10, 11, S("1234567890abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 19, 1, S("0abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 19, 2, S("0abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 1, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 1, SV(""), 0, 1, S("abcde"));
+ test(S("abcde"), 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 1, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcde"), 1, SV("12345"), 0, 1, S("a1bcde"));
+ test(S("abcde"), 1, SV("12345"), 0, 2, S("a12bcde"));
+ test(S("abcde"), 1, SV("12345"), 0, 4, S("a1234bcde"));
+ test(S("abcde"), 1, SV("12345"), 0, 5, S("a12345bcde"));
+ test(S("abcde"), 1, SV("12345"), 0, 6, S("a12345bcde"));
+ test(S("abcde"), 1, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 1, SV("12345"), 1, 1, S("a2bcde"));
+ test(S("abcde"), 1, SV("12345"), 1, 2, S("a23bcde"));
+ test(S("abcde"), 1, SV("12345"), 1, 3, S("a234bcde"));
+ test(S("abcde"), 1, SV("12345"), 1, 4, S("a2345bcde"));
+ test(S("abcde"), 1, SV("12345"), 1, 5, S("a2345bcde"));
+ test(S("abcde"), 1, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 1, SV("12345"), 2, 1, S("a3bcde"));
+ test(S("abcde"), 1, SV("12345"), 2, 2, S("a34bcde"));
+ test(S("abcde"), 1, SV("12345"), 2, 3, S("a345bcde"));
+ test(S("abcde"), 1, SV("12345"), 2, 4, S("a345bcde"));
+ test(S("abcde"), 1, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 1, SV("12345"), 4, 1, S("a5bcde"));
+ test(S("abcde"), 1, SV("12345"), 4, 2, S("a5bcde"));
+ test(S("abcde"), 1, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcde"), 1, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 1, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 1, SV("1234567890"), 0, 1, S("a1bcde"));
+}
+
+template <class S, class SV>
+void test5()
+{
+ test(S("abcde"), 1, SV("1234567890"), 0, 5, S("a12345bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 0, 9, S("a123456789bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 0, 10, S("a1234567890bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 0, 11, S("a1234567890bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 1, SV("1234567890"), 1, 1, S("a2bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 1, 4, S("a2345bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 1, 8, S("a23456789bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 1, 9, S("a234567890bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 1, 10, S("a234567890bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 1, SV("1234567890"), 5, 1, S("a6bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 5, 2, S("a67bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 5, 4, S("a6789bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 5, 5, S("a67890bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 5, 6, S("a67890bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 1, SV("1234567890"), 9, 1, S("a0bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 9, 2, S("a0bcde"));
+ test(S("abcde"), 1, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 1, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 0, 1, S("a1bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 0, 10, S("a1234567890bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 0, 19, S("a1234567890123456789bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 0, 20, S("a12345678901234567890bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 0, 21, S("a12345678901234567890bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 1, 1, S("a2bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 1, 9, S("a234567890bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 1, 18, S("a234567890123456789bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 1, 19, S("a2345678901234567890bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 1, 20, S("a2345678901234567890bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 10, 1, S("a1bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 10, 5, S("a12345bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 10, 9, S("a123456789bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 10, 10, S("a1234567890bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 10, 11, S("a1234567890bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 19, 1, S("a0bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 19, 2, S("a0bcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 2, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 2, SV(""), 0, 1, S("abcde"));
+ test(S("abcde"), 2, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 2, SV("12345"), 0, 0, S("abcde"));
+}
+
+template <class S, class SV>
+void test6()
+{
+ test(S("abcde"), 2, SV("12345"), 0, 1, S("ab1cde"));
+ test(S("abcde"), 2, SV("12345"), 0, 2, S("ab12cde"));
+ test(S("abcde"), 2, SV("12345"), 0, 4, S("ab1234cde"));
+ test(S("abcde"), 2, SV("12345"), 0, 5, S("ab12345cde"));
+ test(S("abcde"), 2, SV("12345"), 0, 6, S("ab12345cde"));
+ test(S("abcde"), 2, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 2, SV("12345"), 1, 1, S("ab2cde"));
+ test(S("abcde"), 2, SV("12345"), 1, 2, S("ab23cde"));
+ test(S("abcde"), 2, SV("12345"), 1, 3, S("ab234cde"));
+ test(S("abcde"), 2, SV("12345"), 1, 4, S("ab2345cde"));
+ test(S("abcde"), 2, SV("12345"), 1, 5, S("ab2345cde"));
+ test(S("abcde"), 2, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 2, SV("12345"), 2, 1, S("ab3cde"));
+ test(S("abcde"), 2, SV("12345"), 2, 2, S("ab34cde"));
+ test(S("abcde"), 2, SV("12345"), 2, 3, S("ab345cde"));
+ test(S("abcde"), 2, SV("12345"), 2, 4, S("ab345cde"));
+ test(S("abcde"), 2, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 2, SV("12345"), 4, 1, S("ab5cde"));
+ test(S("abcde"), 2, SV("12345"), 4, 2, S("ab5cde"));
+ test(S("abcde"), 2, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcde"), 2, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 2, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 2, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 2, SV("1234567890"), 0, 1, S("ab1cde"));
+ test(S("abcde"), 2, SV("1234567890"), 0, 5, S("ab12345cde"));
+ test(S("abcde"), 2, SV("1234567890"), 0, 9, S("ab123456789cde"));
+ test(S("abcde"), 2, SV("1234567890"), 0, 10, S("ab1234567890cde"));
+ test(S("abcde"), 2, SV("1234567890"), 0, 11, S("ab1234567890cde"));
+ test(S("abcde"), 2, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 2, SV("1234567890"), 1, 1, S("ab2cde"));
+ test(S("abcde"), 2, SV("1234567890"), 1, 4, S("ab2345cde"));
+ test(S("abcde"), 2, SV("1234567890"), 1, 8, S("ab23456789cde"));
+ test(S("abcde"), 2, SV("1234567890"), 1, 9, S("ab234567890cde"));
+ test(S("abcde"), 2, SV("1234567890"), 1, 10, S("ab234567890cde"));
+ test(S("abcde"), 2, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 2, SV("1234567890"), 5, 1, S("ab6cde"));
+ test(S("abcde"), 2, SV("1234567890"), 5, 2, S("ab67cde"));
+ test(S("abcde"), 2, SV("1234567890"), 5, 4, S("ab6789cde"));
+ test(S("abcde"), 2, SV("1234567890"), 5, 5, S("ab67890cde"));
+ test(S("abcde"), 2, SV("1234567890"), 5, 6, S("ab67890cde"));
+ test(S("abcde"), 2, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 2, SV("1234567890"), 9, 1, S("ab0cde"));
+ test(S("abcde"), 2, SV("1234567890"), 9, 2, S("ab0cde"));
+ test(S("abcde"), 2, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 2, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 2, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 0, 1, S("ab1cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 0, 10, S("ab1234567890cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 0, 19, S("ab1234567890123456789cde"));
+}
+
+template <class S, class SV>
+void test7()
+{
+ test(S("abcde"), 2, SV("12345678901234567890"), 0, 20, S("ab12345678901234567890cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 0, 21, S("ab12345678901234567890cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 1, 1, S("ab2cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 1, 9, S("ab234567890cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 1, 18, S("ab234567890123456789cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 1, 19, S("ab2345678901234567890cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 1, 20, S("ab2345678901234567890cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 10, 1, S("ab1cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 10, 5, S("ab12345cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 10, 9, S("ab123456789cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 10, 10, S("ab1234567890cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 10, 11, S("ab1234567890cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 19, 1, S("ab0cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 19, 2, S("ab0cde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 2, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 4, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 4, SV(""), 0, 1, S("abcde"));
+ test(S("abcde"), 4, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 4, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcde"), 4, SV("12345"), 0, 1, S("abcd1e"));
+ test(S("abcde"), 4, SV("12345"), 0, 2, S("abcd12e"));
+ test(S("abcde"), 4, SV("12345"), 0, 4, S("abcd1234e"));
+ test(S("abcde"), 4, SV("12345"), 0, 5, S("abcd12345e"));
+ test(S("abcde"), 4, SV("12345"), 0, 6, S("abcd12345e"));
+ test(S("abcde"), 4, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 4, SV("12345"), 1, 1, S("abcd2e"));
+ test(S("abcde"), 4, SV("12345"), 1, 2, S("abcd23e"));
+ test(S("abcde"), 4, SV("12345"), 1, 3, S("abcd234e"));
+ test(S("abcde"), 4, SV("12345"), 1, 4, S("abcd2345e"));
+ test(S("abcde"), 4, SV("12345"), 1, 5, S("abcd2345e"));
+ test(S("abcde"), 4, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 4, SV("12345"), 2, 1, S("abcd3e"));
+ test(S("abcde"), 4, SV("12345"), 2, 2, S("abcd34e"));
+ test(S("abcde"), 4, SV("12345"), 2, 3, S("abcd345e"));
+ test(S("abcde"), 4, SV("12345"), 2, 4, S("abcd345e"));
+ test(S("abcde"), 4, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 4, SV("12345"), 4, 1, S("abcd5e"));
+ test(S("abcde"), 4, SV("12345"), 4, 2, S("abcd5e"));
+ test(S("abcde"), 4, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcde"), 4, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 4, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 4, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 4, SV("1234567890"), 0, 1, S("abcd1e"));
+ test(S("abcde"), 4, SV("1234567890"), 0, 5, S("abcd12345e"));
+ test(S("abcde"), 4, SV("1234567890"), 0, 9, S("abcd123456789e"));
+}
+
+template <class S, class SV>
+void test8()
+{
+ test(S("abcde"), 4, SV("1234567890"), 0, 10, S("abcd1234567890e"));
+ test(S("abcde"), 4, SV("1234567890"), 0, 11, S("abcd1234567890e"));
+ test(S("abcde"), 4, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 4, SV("1234567890"), 1, 1, S("abcd2e"));
+ test(S("abcde"), 4, SV("1234567890"), 1, 4, S("abcd2345e"));
+ test(S("abcde"), 4, SV("1234567890"), 1, 8, S("abcd23456789e"));
+ test(S("abcde"), 4, SV("1234567890"), 1, 9, S("abcd234567890e"));
+ test(S("abcde"), 4, SV("1234567890"), 1, 10, S("abcd234567890e"));
+ test(S("abcde"), 4, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 4, SV("1234567890"), 5, 1, S("abcd6e"));
+ test(S("abcde"), 4, SV("1234567890"), 5, 2, S("abcd67e"));
+ test(S("abcde"), 4, SV("1234567890"), 5, 4, S("abcd6789e"));
+ test(S("abcde"), 4, SV("1234567890"), 5, 5, S("abcd67890e"));
+ test(S("abcde"), 4, SV("1234567890"), 5, 6, S("abcd67890e"));
+ test(S("abcde"), 4, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 4, SV("1234567890"), 9, 1, S("abcd0e"));
+ test(S("abcde"), 4, SV("1234567890"), 9, 2, S("abcd0e"));
+ test(S("abcde"), 4, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 4, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 4, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 0, 1, S("abcd1e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 0, 10, S("abcd1234567890e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 0, 19, S("abcd1234567890123456789e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 0, 20, S("abcd12345678901234567890e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 0, 21, S("abcd12345678901234567890e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 1, 1, S("abcd2e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 1, 9, S("abcd234567890e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 1, 18, S("abcd234567890123456789e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 1, 19, S("abcd2345678901234567890e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 1, 20, S("abcd2345678901234567890e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 10, 1, S("abcd1e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 10, 5, S("abcd12345e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 10, 9, S("abcd123456789e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 10, 10, S("abcd1234567890e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 10, 11, S("abcd1234567890e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 19, 1, S("abcd0e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 19, 2, S("abcd0e"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 4, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 5, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 5, SV(""), 0, 1, S("abcde"));
+ test(S("abcde"), 5, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 5, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcde"), 5, SV("12345"), 0, 1, S("abcde1"));
+ test(S("abcde"), 5, SV("12345"), 0, 2, S("abcde12"));
+}
+
+template <class S, class SV>
+void test9()
+{
+ test(S("abcde"), 5, SV("12345"), 0, 4, S("abcde1234"));
+ test(S("abcde"), 5, SV("12345"), 0, 5, S("abcde12345"));
+ test(S("abcde"), 5, SV("12345"), 0, 6, S("abcde12345"));
+ test(S("abcde"), 5, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 5, SV("12345"), 1, 1, S("abcde2"));
+ test(S("abcde"), 5, SV("12345"), 1, 2, S("abcde23"));
+ test(S("abcde"), 5, SV("12345"), 1, 3, S("abcde234"));
+ test(S("abcde"), 5, SV("12345"), 1, 4, S("abcde2345"));
+ test(S("abcde"), 5, SV("12345"), 1, 5, S("abcde2345"));
+ test(S("abcde"), 5, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 5, SV("12345"), 2, 1, S("abcde3"));
+ test(S("abcde"), 5, SV("12345"), 2, 2, S("abcde34"));
+ test(S("abcde"), 5, SV("12345"), 2, 3, S("abcde345"));
+ test(S("abcde"), 5, SV("12345"), 2, 4, S("abcde345"));
+ test(S("abcde"), 5, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 5, SV("12345"), 4, 1, S("abcde5"));
+ test(S("abcde"), 5, SV("12345"), 4, 2, S("abcde5"));
+ test(S("abcde"), 5, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcde"), 5, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 5, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 5, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 5, SV("1234567890"), 0, 1, S("abcde1"));
+ test(S("abcde"), 5, SV("1234567890"), 0, 5, S("abcde12345"));
+ test(S("abcde"), 5, SV("1234567890"), 0, 9, S("abcde123456789"));
+ test(S("abcde"), 5, SV("1234567890"), 0, 10, S("abcde1234567890"));
+ test(S("abcde"), 5, SV("1234567890"), 0, 11, S("abcde1234567890"));
+ test(S("abcde"), 5, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 5, SV("1234567890"), 1, 1, S("abcde2"));
+ test(S("abcde"), 5, SV("1234567890"), 1, 4, S("abcde2345"));
+ test(S("abcde"), 5, SV("1234567890"), 1, 8, S("abcde23456789"));
+ test(S("abcde"), 5, SV("1234567890"), 1, 9, S("abcde234567890"));
+ test(S("abcde"), 5, SV("1234567890"), 1, 10, S("abcde234567890"));
+ test(S("abcde"), 5, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 5, SV("1234567890"), 5, 1, S("abcde6"));
+ test(S("abcde"), 5, SV("1234567890"), 5, 2, S("abcde67"));
+ test(S("abcde"), 5, SV("1234567890"), 5, 4, S("abcde6789"));
+ test(S("abcde"), 5, SV("1234567890"), 5, 5, S("abcde67890"));
+ test(S("abcde"), 5, SV("1234567890"), 5, 6, S("abcde67890"));
+ test(S("abcde"), 5, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 5, SV("1234567890"), 9, 1, S("abcde0"));
+ test(S("abcde"), 5, SV("1234567890"), 9, 2, S("abcde0"));
+ test(S("abcde"), 5, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 5, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 5, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 0, 1, S("abcde1"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 0, 10, S("abcde1234567890"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 0, 19, S("abcde1234567890123456789"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 0, 20, S("abcde12345678901234567890"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 0, 21, S("abcde12345678901234567890"));
+}
+
+template <class S, class SV>
+void test10()
+{
+ test(S("abcde"), 5, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 1, 1, S("abcde2"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 1, 9, S("abcde234567890"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 1, 18, S("abcde234567890123456789"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 1, 19, S("abcde2345678901234567890"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 1, 20, S("abcde2345678901234567890"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 10, 1, S("abcde1"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 10, 5, S("abcde12345"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 10, 9, S("abcde123456789"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 10, 10, S("abcde1234567890"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 10, 11, S("abcde1234567890"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 19, 1, S("abcde0"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 19, 2, S("abcde0"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 5, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 6, SV(""), 0, 0, S("can't happen"));
+ test(S("abcde"), 6, SV(""), 0, 1, S("can't happen"));
+ test(S("abcde"), 6, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 0, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 0, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 0, 2, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 0, 4, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 0, 5, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 0, 6, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 1, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 1, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 1, 2, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 1, 3, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 1, 4, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 1, 5, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 2, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 2, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 2, 2, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 2, 3, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 2, 4, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 4, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 4, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 4, 2, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 5, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 5, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 0, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 0, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 0, 5, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 0, 9, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 0, 10, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 0, 11, S("can't happen"));
+}
+
+template <class S, class SV>
+void test11()
+{
+ test(S("abcde"), 6, SV("1234567890"), 1, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 1, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 1, 4, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 1, 8, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 1, 9, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 1, 10, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 5, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 5, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 5, 2, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 5, 4, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 5, 5, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 5, 6, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 9, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 9, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 9, 2, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 10, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 10, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 0, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 0, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 0, 10, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 0, 19, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 0, 20, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 0, 21, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 1, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 1, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 1, 9, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 1, 18, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 1, 19, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 1, 20, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 10, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 10, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 10, 5, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 10, 9, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 10, 10, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 10, 11, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 19, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 19, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 19, 2, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 20, 0, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 20, 1, S("can't happen"));
+ test(S("abcde"), 6, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 0, 1, S("1abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 0, 2, S("12abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 0, 4, S("1234abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 0, 5, S("12345abcdefghij"));
+}
+
+template <class S, class SV>
+void test12()
+{
+ test(S("abcdefghij"), 0, SV("12345"), 0, 6, S("12345abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 1, 1, S("2abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 1, 2, S("23abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 1, 3, S("234abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 1, 4, S("2345abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 1, 5, S("2345abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 2, 1, S("3abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 2, 2, S("34abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 2, 3, S("345abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 2, 4, S("345abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 4, 1, S("5abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 4, 2, S("5abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 0, 1, S("1abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 0, 5, S("12345abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 0, 9, S("123456789abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 0, 10, S("1234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 0, 11, S("1234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 1, 1, S("2abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 1, 4, S("2345abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 1, 8, S("23456789abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 1, 9, S("234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 1, 10, S("234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 5, 1, S("6abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 5, 2, S("67abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 5, 4, S("6789abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 5, 5, S("67890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 5, 6, S("67890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 9, 1, S("0abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 9, 2, S("0abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 0, 1, S("1abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 0, 10, S("1234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 0, 19, S("1234567890123456789abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 0, 20, S("12345678901234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 0, 21, S("12345678901234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 1, 1, S("2abcdefghij"));
+}
+
+template <class S, class SV>
+void test13()
+{
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 1, 9, S("234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 1, 18, S("234567890123456789abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 1, 19, S("2345678901234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 1, 20, S("2345678901234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 10, 1, S("1abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 10, 5, S("12345abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 10, 9, S("123456789abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 10, 10, S("1234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 10, 11, S("1234567890abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 19, 1, S("0abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 19, 2, S("0abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 0, 1, S("a1bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 0, 2, S("a12bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 0, 4, S("a1234bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 0, 5, S("a12345bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 0, 6, S("a12345bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 1, 1, S("a2bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 1, 2, S("a23bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 1, 3, S("a234bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 1, 4, S("a2345bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 1, 5, S("a2345bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 2, 1, S("a3bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 2, 2, S("a34bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 2, 3, S("a345bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 2, 4, S("a345bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 4, 1, S("a5bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 4, 2, S("a5bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 0, 1, S("a1bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 0, 5, S("a12345bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 0, 9, S("a123456789bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 0, 10, S("a1234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 0, 11, S("a1234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 1, 1, S("a2bcdefghij"));
+}
+
+template <class S, class SV>
+void test14()
+{
+ test(S("abcdefghij"), 1, SV("1234567890"), 1, 4, S("a2345bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 1, 8, S("a23456789bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 1, 9, S("a234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 1, 10, S("a234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 5, 1, S("a6bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 5, 2, S("a67bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 5, 4, S("a6789bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 5, 5, S("a67890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 5, 6, S("a67890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 9, 1, S("a0bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 9, 2, S("a0bcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 0, 1, S("a1bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 0, 10, S("a1234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 0, 19, S("a1234567890123456789bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 0, 20, S("a12345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 0, 21, S("a12345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 1, 1, S("a2bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 1, 9, S("a234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 1, 18, S("a234567890123456789bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 1, 19, S("a2345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 1, 20, S("a2345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 10, 1, S("a1bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 10, 5, S("a12345bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 10, 9, S("a123456789bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 10, 10, S("a1234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 10, 11, S("a1234567890bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 19, 1, S("a0bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 19, 2, S("a0bcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 0, 1, S("abcde1fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 0, 2, S("abcde12fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 0, 4, S("abcde1234fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 0, 5, S("abcde12345fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 0, 6, S("abcde12345fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 1, 0, S("abcdefghij"));
+}
+
+template <class S, class SV>
+void test15()
+{
+ test(S("abcdefghij"), 5, SV("12345"), 1, 1, S("abcde2fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 1, 2, S("abcde23fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 1, 3, S("abcde234fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 1, 4, S("abcde2345fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 1, 5, S("abcde2345fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 2, 1, S("abcde3fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 2, 2, S("abcde34fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 2, 3, S("abcde345fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 2, 4, S("abcde345fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 4, 1, S("abcde5fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 4, 2, S("abcde5fghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 0, 1, S("abcde1fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 0, 5, S("abcde12345fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 0, 9, S("abcde123456789fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 0, 10, S("abcde1234567890fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 0, 11, S("abcde1234567890fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 1, 1, S("abcde2fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 1, 4, S("abcde2345fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 1, 8, S("abcde23456789fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 1, 9, S("abcde234567890fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 1, 10, S("abcde234567890fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 5, 1, S("abcde6fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 5, 2, S("abcde67fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 5, 4, S("abcde6789fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 5, 5, S("abcde67890fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 5, 6, S("abcde67890fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 9, 1, S("abcde0fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 9, 2, S("abcde0fghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 0, 1, S("abcde1fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 0, 10, S("abcde1234567890fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 0, 19, S("abcde1234567890123456789fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 0, 20, S("abcde12345678901234567890fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 0, 21, S("abcde12345678901234567890fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 1, 1, S("abcde2fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 1, 9, S("abcde234567890fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 1, 18, S("abcde234567890123456789fghij"));
+}
+
+template <class S, class SV>
+void test16()
+{
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 1, 19, S("abcde2345678901234567890fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 1, 20, S("abcde2345678901234567890fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 10, 1, S("abcde1fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 10, 5, S("abcde12345fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 10, 9, S("abcde123456789fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 10, 10, S("abcde1234567890fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 10, 11, S("abcde1234567890fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 19, 1, S("abcde0fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 19, 2, S("abcde0fghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 5, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345"), 0, 1, S("abcdefghi1j"));
+ test(S("abcdefghij"), 9, SV("12345"), 0, 2, S("abcdefghi12j"));
+ test(S("abcdefghij"), 9, SV("12345"), 0, 4, S("abcdefghi1234j"));
+ test(S("abcdefghij"), 9, SV("12345"), 0, 5, S("abcdefghi12345j"));
+ test(S("abcdefghij"), 9, SV("12345"), 0, 6, S("abcdefghi12345j"));
+ test(S("abcdefghij"), 9, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345"), 1, 1, S("abcdefghi2j"));
+ test(S("abcdefghij"), 9, SV("12345"), 1, 2, S("abcdefghi23j"));
+ test(S("abcdefghij"), 9, SV("12345"), 1, 3, S("abcdefghi234j"));
+ test(S("abcdefghij"), 9, SV("12345"), 1, 4, S("abcdefghi2345j"));
+ test(S("abcdefghij"), 9, SV("12345"), 1, 5, S("abcdefghi2345j"));
+ test(S("abcdefghij"), 9, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345"), 2, 1, S("abcdefghi3j"));
+ test(S("abcdefghij"), 9, SV("12345"), 2, 2, S("abcdefghi34j"));
+ test(S("abcdefghij"), 9, SV("12345"), 2, 3, S("abcdefghi345j"));
+ test(S("abcdefghij"), 9, SV("12345"), 2, 4, S("abcdefghi345j"));
+ test(S("abcdefghij"), 9, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345"), 4, 1, S("abcdefghi5j"));
+ test(S("abcdefghij"), 9, SV("12345"), 4, 2, S("abcdefghi5j"));
+ test(S("abcdefghij"), 9, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 0, 1, S("abcdefghi1j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 0, 5, S("abcdefghi12345j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 0, 9, S("abcdefghi123456789j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 0, 10, S("abcdefghi1234567890j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 0, 11, S("abcdefghi1234567890j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 1, 1, S("abcdefghi2j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 1, 4, S("abcdefghi2345j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 1, 8, S("abcdefghi23456789j"));
+}
+
+template <class S, class SV>
+void test17()
+{
+ test(S("abcdefghij"), 9, SV("1234567890"), 1, 9, S("abcdefghi234567890j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 1, 10, S("abcdefghi234567890j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 5, 1, S("abcdefghi6j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 5, 2, S("abcdefghi67j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 5, 4, S("abcdefghi6789j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 5, 5, S("abcdefghi67890j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 5, 6, S("abcdefghi67890j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 9, 1, S("abcdefghi0j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 9, 2, S("abcdefghi0j"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 0, 1, S("abcdefghi1j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 0, 10, S("abcdefghi1234567890j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 0, 19, S("abcdefghi1234567890123456789j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 0, 20, S("abcdefghi12345678901234567890j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 0, 21, S("abcdefghi12345678901234567890j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 1, 1, S("abcdefghi2j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 1, 9, S("abcdefghi234567890j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 1, 18, S("abcdefghi234567890123456789j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 1, 19, S("abcdefghi2345678901234567890j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 1, 20, S("abcdefghi2345678901234567890j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 10, 1, S("abcdefghi1j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 10, 5, S("abcdefghi12345j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 10, 9, S("abcdefghi123456789j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 10, 10, S("abcdefghi1234567890j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 10, 11, S("abcdefghi1234567890j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 19, 1, S("abcdefghi0j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 19, 2, S("abcdefghi0j"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 9, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, SV("12345"), 0, 2, S("abcdefghij12"));
+ test(S("abcdefghij"), 10, SV("12345"), 0, 4, S("abcdefghij1234"));
+ test(S("abcdefghij"), 10, SV("12345"), 0, 5, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, SV("12345"), 0, 6, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghij"), 10, SV("12345"), 1, 2, S("abcdefghij23"));
+}
+
+template <class S, class SV>
+void test18()
+{
+ test(S("abcdefghij"), 10, SV("12345"), 1, 3, S("abcdefghij234"));
+ test(S("abcdefghij"), 10, SV("12345"), 1, 4, S("abcdefghij2345"));
+ test(S("abcdefghij"), 10, SV("12345"), 1, 5, S("abcdefghij2345"));
+ test(S("abcdefghij"), 10, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345"), 2, 1, S("abcdefghij3"));
+ test(S("abcdefghij"), 10, SV("12345"), 2, 2, S("abcdefghij34"));
+ test(S("abcdefghij"), 10, SV("12345"), 2, 3, S("abcdefghij345"));
+ test(S("abcdefghij"), 10, SV("12345"), 2, 4, S("abcdefghij345"));
+ test(S("abcdefghij"), 10, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345"), 4, 1, S("abcdefghij5"));
+ test(S("abcdefghij"), 10, SV("12345"), 4, 2, S("abcdefghij5"));
+ test(S("abcdefghij"), 10, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 0, 5, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 0, 9, S("abcdefghij123456789"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 0, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 0, 11, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 1, 4, S("abcdefghij2345"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 1, 8, S("abcdefghij23456789"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 1, 9, S("abcdefghij234567890"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 1, 10, S("abcdefghij234567890"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 5, 1, S("abcdefghij6"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 5, 2, S("abcdefghij67"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 5, 4, S("abcdefghij6789"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 5, 5, S("abcdefghij67890"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 5, 6, S("abcdefghij67890"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 9, 1, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 9, 2, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 0, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 0, 19, S("abcdefghij1234567890123456789"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 0, 20, S("abcdefghij12345678901234567890"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 0, 21, S("abcdefghij12345678901234567890"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 1, 9, S("abcdefghij234567890"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 1, 18, S("abcdefghij234567890123456789"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 1, 19, S("abcdefghij2345678901234567890"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 1, 20, S("abcdefghij2345678901234567890"));
+}
+
+template <class S, class SV>
+void test19()
+{
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 10, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 10, 5, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 10, 9, S("abcdefghij123456789"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 10, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 10, 11, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 19, 1, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 19, 2, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV(""), 0, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV(""), 0, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 0, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 0, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 0, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 0, 4, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 0, 5, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 0, 6, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 1, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 1, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 1, 3, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 1, 4, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 1, 5, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 2, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 2, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 2, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 2, 3, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 2, 4, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 4, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 4, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 4, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 5, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 5, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 0, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 0, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 0, 5, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 0, 9, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 0, 10, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 0, 11, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 1, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 1, 4, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 1, 8, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 1, 9, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 1, 10, S("can't happen"));
+}
+
+template <class S, class SV>
+void test20()
+{
+ test(S("abcdefghij"), 11, SV("1234567890"), 5, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 5, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 5, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 5, 4, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 5, 5, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 5, 6, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 9, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 9, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 9, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 10, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 10, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 0, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 0, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 0, 10, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 0, 19, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 0, 20, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 0, 21, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 1, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 1, 9, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 1, 18, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 1, 19, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 1, 20, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 10, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 10, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 10, 5, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 10, 9, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 10, 10, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 10, 11, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 19, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 19, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 19, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 20, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 20, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 0, 1, S("1abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 0, 2, S("12abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 0, 4, S("1234abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 0, 5, S("12345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 0, 6, S("12345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 1, 1, S("2abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 1, 2, S("23abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 1, 3, S("234abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 1, 4, S("2345abcdefghijklmnopqrst"));
+}
+
+template <class S, class SV>
+void test21()
+{
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 1, 5, S("2345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 2, 1, S("3abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 2, 2, S("34abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 2, 3, S("345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 2, 4, S("345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 4, 1, S("5abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 4, 2, S("5abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 0, 1, S("1abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 0, 5, S("12345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 0, 9, S("123456789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 0, 10, S("1234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 0, 11, S("1234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 1, 1, S("2abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 1, 4, S("2345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 1, 8, S("23456789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 1, 9, S("234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 1, 10, S("234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 5, 1, S("6abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 5, 2, S("67abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 5, 4, S("6789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 5, 5, S("67890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 5, 6, S("67890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 9, 1, S("0abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 9, 2, S("0abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 0, 1, S("1abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 0, 10, S("1234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 0, 19, S("1234567890123456789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 0, 20, S("12345678901234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 0, 21, S("12345678901234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 1, 1, S("2abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 1, 9, S("234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 1, 18, S("234567890123456789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 1, 19, S("2345678901234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 1, 20, S("2345678901234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 10, 1, S("1abcdefghijklmnopqrst"));
+}
+
+template <class S, class SV>
+void test22()
+{
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 10, 5, S("12345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 10, 9, S("123456789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 10, 10, S("1234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 10, 11, S("1234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 19, 1, S("0abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 19, 2, S("0abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 0, 1, S("a1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 0, 2, S("a12bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 0, 4, S("a1234bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 0, 5, S("a12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 0, 6, S("a12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 1, 1, S("a2bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 1, 2, S("a23bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 1, 3, S("a234bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 1, 4, S("a2345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 1, 5, S("a2345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 2, 1, S("a3bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 2, 2, S("a34bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 2, 3, S("a345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 2, 4, S("a345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 4, 1, S("a5bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 4, 2, S("a5bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 0, 1, S("a1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 0, 5, S("a12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 0, 9, S("a123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 0, 10, S("a1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 0, 11, S("a1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 1, 1, S("a2bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 1, 4, S("a2345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 1, 8, S("a23456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 1, 9, S("a234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 1, 10, S("a234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 5, 1, S("a6bcdefghijklmnopqrst"));
+}
+
+template <class S, class SV>
+void test23()
+{
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 5, 2, S("a67bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 5, 4, S("a6789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 5, 5, S("a67890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 5, 6, S("a67890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 9, 1, S("a0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 9, 2, S("a0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 0, 1, S("a1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 0, 10, S("a1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 0, 19, S("a1234567890123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 0, 20, S("a12345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 0, 21, S("a12345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 1, 1, S("a2bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 1, 9, S("a234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 1, 18, S("a234567890123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 1, 19, S("a2345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 1, 20, S("a2345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 10, 1, S("a1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 10, 5, S("a12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 10, 9, S("a123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 10, 10, S("a1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 10, 11, S("a1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 19, 1, S("a0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 19, 2, S("a0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 0, 1, S("abcdefghij1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 0, 2, S("abcdefghij12klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 0, 4, S("abcdefghij1234klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 0, 5, S("abcdefghij12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 0, 6, S("abcdefghij12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 1, 1, S("abcdefghij2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 1, 2, S("abcdefghij23klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 1, 3, S("abcdefghij234klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 1, 4, S("abcdefghij2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 1, 5, S("abcdefghij2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+}
+
+template <class S, class SV>
+void test24()
+{
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 2, 1, S("abcdefghij3klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 2, 2, S("abcdefghij34klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 2, 3, S("abcdefghij345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 2, 4, S("abcdefghij345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 4, 1, S("abcdefghij5klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 4, 2, S("abcdefghij5klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 0, 1, S("abcdefghij1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 0, 5, S("abcdefghij12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 0, 9, S("abcdefghij123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 0, 10, S("abcdefghij1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 0, 11, S("abcdefghij1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 1, 1, S("abcdefghij2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 1, 4, S("abcdefghij2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 1, 8, S("abcdefghij23456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 1, 9, S("abcdefghij234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 1, 10, S("abcdefghij234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 5, 1, S("abcdefghij6klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 5, 2, S("abcdefghij67klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 5, 4, S("abcdefghij6789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 5, 5, S("abcdefghij67890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 5, 6, S("abcdefghij67890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 9, 1, S("abcdefghij0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 9, 2, S("abcdefghij0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 0, 1, S("abcdefghij1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 0, 10, S("abcdefghij1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 0, 19, S("abcdefghij1234567890123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 0, 20, S("abcdefghij12345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 0, 21, S("abcdefghij12345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 1, 1, S("abcdefghij2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 1, 9, S("abcdefghij234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 1, 18, S("abcdefghij234567890123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 1, 19, S("abcdefghij2345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 1, 20, S("abcdefghij2345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 10, 1, S("abcdefghij1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 10, 5, S("abcdefghij12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 10, 9, S("abcdefghij123456789klmnopqrst"));
+}
+
+template <class S, class SV>
+void test25()
+{
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 10, 10, S("abcdefghij1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 10, 11, S("abcdefghij1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 19, 1, S("abcdefghij0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 19, 2, S("abcdefghij0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 0, 1, S("abcdefghijklmnopqrs1t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 0, 2, S("abcdefghijklmnopqrs12t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 0, 4, S("abcdefghijklmnopqrs1234t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 0, 5, S("abcdefghijklmnopqrs12345t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 0, 6, S("abcdefghijklmnopqrs12345t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 1, 1, S("abcdefghijklmnopqrs2t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 1, 2, S("abcdefghijklmnopqrs23t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 1, 3, S("abcdefghijklmnopqrs234t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 1, 4, S("abcdefghijklmnopqrs2345t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 1, 5, S("abcdefghijklmnopqrs2345t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 2, 1, S("abcdefghijklmnopqrs3t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 2, 2, S("abcdefghijklmnopqrs34t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 2, 3, S("abcdefghijklmnopqrs345t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 2, 4, S("abcdefghijklmnopqrs345t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 4, 1, S("abcdefghijklmnopqrs5t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 4, 2, S("abcdefghijklmnopqrs5t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 0, 1, S("abcdefghijklmnopqrs1t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 0, 5, S("abcdefghijklmnopqrs12345t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 0, 9, S("abcdefghijklmnopqrs123456789t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 0, 10, S("abcdefghijklmnopqrs1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 0, 11, S("abcdefghijklmnopqrs1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 1, 1, S("abcdefghijklmnopqrs2t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 1, 4, S("abcdefghijklmnopqrs2345t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 1, 8, S("abcdefghijklmnopqrs23456789t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 1, 9, S("abcdefghijklmnopqrs234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 1, 10, S("abcdefghijklmnopqrs234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 5, 1, S("abcdefghijklmnopqrs6t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 5, 2, S("abcdefghijklmnopqrs67t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 5, 4, S("abcdefghijklmnopqrs6789t"));
+}
+
+template <class S, class SV>
+void test26()
+{
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 5, 5, S("abcdefghijklmnopqrs67890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 5, 6, S("abcdefghijklmnopqrs67890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 9, 1, S("abcdefghijklmnopqrs0t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 9, 2, S("abcdefghijklmnopqrs0t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 0, 1, S("abcdefghijklmnopqrs1t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 0, 10, S("abcdefghijklmnopqrs1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 0, 19, S("abcdefghijklmnopqrs1234567890123456789t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 0, 20, S("abcdefghijklmnopqrs12345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 0, 21, S("abcdefghijklmnopqrs12345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 1, 1, S("abcdefghijklmnopqrs2t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 1, 9, S("abcdefghijklmnopqrs234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 1, 18, S("abcdefghijklmnopqrs234567890123456789t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 1, 19, S("abcdefghijklmnopqrs2345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 1, 20, S("abcdefghijklmnopqrs2345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 10, 1, S("abcdefghijklmnopqrs1t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 10, 5, S("abcdefghijklmnopqrs12345t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 10, 9, S("abcdefghijklmnopqrs123456789t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 10, 10, S("abcdefghijklmnopqrs1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 10, 11, S("abcdefghijklmnopqrs1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 19, 1, S("abcdefghijklmnopqrs0t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 19, 2, S("abcdefghijklmnopqrs0t"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 0, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 0, 2, S("abcdefghijklmnopqrst12"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 0, 4, S("abcdefghijklmnopqrst1234"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 0, 5, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 0, 6, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 1, 1, S("abcdefghijklmnopqrst2"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 1, 2, S("abcdefghijklmnopqrst23"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 1, 3, S("abcdefghijklmnopqrst234"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 1, 4, S("abcdefghijklmnopqrst2345"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 1, 5, S("abcdefghijklmnopqrst2345"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 2, 1, S("abcdefghijklmnopqrst3"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 2, 2, S("abcdefghijklmnopqrst34"));
+}
+
+template <class S, class SV>
+void test27()
+{
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 2, 3, S("abcdefghijklmnopqrst345"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 2, 4, S("abcdefghijklmnopqrst345"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 4, 1, S("abcdefghijklmnopqrst5"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 4, 2, S("abcdefghijklmnopqrst5"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 0, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 0, 5, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 0, 9, S("abcdefghijklmnopqrst123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 0, 10, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 0, 11, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 1, 1, S("abcdefghijklmnopqrst2"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 1, 4, S("abcdefghijklmnopqrst2345"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 1, 8, S("abcdefghijklmnopqrst23456789"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 1, 9, S("abcdefghijklmnopqrst234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 1, 10, S("abcdefghijklmnopqrst234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 5, 1, S("abcdefghijklmnopqrst6"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 5, 2, S("abcdefghijklmnopqrst67"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 5, 4, S("abcdefghijklmnopqrst6789"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 5, 5, S("abcdefghijklmnopqrst67890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 5, 6, S("abcdefghijklmnopqrst67890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 9, 1, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 9, 2, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 0, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 0, 10, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 0, 19, S("abcdefghijklmnopqrst1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 0, 20, S("abcdefghijklmnopqrst12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 0, 21, S("abcdefghijklmnopqrst12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 1, 1, S("abcdefghijklmnopqrst2"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 1, 9, S("abcdefghijklmnopqrst234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 1, 18, S("abcdefghijklmnopqrst234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 1, 19, S("abcdefghijklmnopqrst2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 1, 20, S("abcdefghijklmnopqrst2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 10, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 10, 5, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 10, 9, S("abcdefghijklmnopqrst123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 10, 10, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 10, 11, S("abcdefghijklmnopqrst1234567890"));
+}
+
+template <class S, class SV>
+void test28()
+{
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 19, 1, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 19, 2, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV(""), 0, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV(""), 0, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 0, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 0, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 0, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 0, 4, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 0, 5, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 0, 6, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 1, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 1, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 1, 3, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 1, 4, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 1, 5, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 2, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 2, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 2, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 2, 3, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 2, 4, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 4, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 4, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 4, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 5, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 5, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 0, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 0, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 0, 5, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 0, 9, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 0, 10, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 0, 11, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 1, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 1, 4, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 1, 8, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 1, 9, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 1, 10, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 5, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 5, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 5, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 5, 4, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 5, 5, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 5, 6, S("can't happen"));
+}
+
+template <class S, class SV>
+void test29()
+{
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 9, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 9, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 9, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 10, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 10, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 0, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 0, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 0, 10, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 0, 19, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 0, 20, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 0, 21, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 1, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 1, 9, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 1, 18, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 1, 19, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 1, 20, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 10, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 10, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 10, 5, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 10, 9, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 10, 10, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 10, 11, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 19, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 19, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 19, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 20, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 20, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, SV("12345678901234567890"), 21, 0, S("can't happen"));
+}
+
+template <class S, class SV>
+void test30()
+{
+ test_npos(S(""), 0, SV("12345678901234567890"), 0, S("12345678901234567890"));
+ test_npos(S(""), 0, SV("12345678901234567890"), 1, S( "2345678901234567890"));
+ test_npos(S(""), 0, SV("12345678901234567890"), 2, S( "345678901234567890"));
+ test_npos(S(""), 0, SV("12345678901234567890"), 3, S( "45678901234567890"));
+ test_npos(S(""), 0, SV("12345678901234567890"), 5, S( "678901234567890"));
+ test_npos(S(""), 0, SV("12345678901234567890"), 10, S( "1234567890"));
+ test_npos(S(""), 0, SV("12345678901234567890"), 21, S("can't happen"));
+ test_npos(S("abcdefghijklmnopqrst"), 10, SV("12345"), 0, S("abcdefghij12345klmnopqrst"));
+ test_npos(S("abcdefghijklmnopqrst"), 10, SV("12345"), 1, S("abcdefghij2345klmnopqrst"));
+ test_npos(S("abcdefghijklmnopqrst"), 10, SV("12345"), 3, S("abcdefghij45klmnopqrst"));
+ test_npos(S("abcdefghijklmnopqrst"), 10, SV("12345"), 5, S("abcdefghijklmnopqrst"));
+ test_npos(S("abcdefghijklmnopqrst"), 10, SV("12345"), 6, S("can't happen"));
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test0<S, SV>();
+ test1<S, SV>();
+ test2<S, SV>();
+ test3<S, SV>();
+ test4<S, SV>();
+ test5<S, SV>();
+ test6<S, SV>();
+ test7<S, SV>();
+ test8<S, SV>();
+ test9<S, SV>();
+ test10<S, SV>();
+ test11<S, SV>();
+ test12<S, SV>();
+ test13<S, SV>();
+ test14<S, SV>();
+ test15<S, SV>();
+ test16<S, SV>();
+ test17<S, SV>();
+ test18<S, SV>();
+ test19<S, SV>();
+ test20<S, SV>();
+ test21<S, SV>();
+ test22<S, SV>();
+ test23<S, SV>();
+ test24<S, SV>();
+ test25<S, SV>();
+ test26<S, SV>();
+ test27<S, SV>();
+ test28<S, SV>();
+ test29<S, SV>();
+ test30<S, SV>();
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test0<S, SV>();
+ test1<S, SV>();
+ test2<S, SV>();
+ test3<S, SV>();
+ test4<S, SV>();
+ test5<S, SV>();
+ test6<S, SV>();
+ test7<S, SV>();
+ test8<S, SV>();
+ test9<S, SV>();
+ test10<S, SV>();
+ test11<S, SV>();
+ test12<S, SV>();
+ test13<S, SV>();
+ test14<S, SV>();
+ test15<S, SV>();
+ test16<S, SV>();
+ test17<S, SV>();
+ test18<S, SV>();
+ test19<S, SV>();
+ test20<S, SV>();
+ test21<S, SV>();
+ test22<S, SV>();
+ test23<S, SV>();
+ test24<S, SV>();
+ test25<S, SV>();
+ test26<S, SV>();
+ test27<S, SV>();
+ test28<S, SV>();
+ test29<S, SV>();
+ test30<S, SV>();
+ }
+#endif
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ S s;
+ SV sv = "EFGH";
+ char arr[] = "IJKL";
+
+ s.insert(0, "CDEF", 0); // calls insert(const char *, len)
+ assert(s == "");
+ s.clear();
+
+ s.insert(0, "QRST", 0, std::string::npos); // calls insert(string("QRST"), pos, npos)
+ assert(s == "QRST");
+ s.clear();
+
+ s.insert(0, sv, 0); // calls insert(T, pos, npos)
+ assert(s == sv);
+ s.clear();
+
+ s.insert(0, sv, 0, std::string::npos); // calls insert(T, pos, npos)
+ assert(s == sv);
+ s.clear();
+
+ s.insert(0, arr, 0); // calls insert(const char *, len)
+ assert(s == "");
+ s.clear();
+
+ s.insert(0, arr, 0, std::string::npos); // calls insert(string("IJKL"), pos, npos)
+ assert(s == "IJKL");
+ s.clear();
+
+ s.insert(0, arr, 0); // calls insert(const char *, len)
+ assert(s == "");
+ s.clear();
+ }
+}
diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/size_pointer.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/size_pointer.pass.cpp
index faab5bd92672..e49f57a7f9ad 100644
--- a/test/std/strings/basic.string/string.modifiers/string_insert/size_pointer.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_insert/size_pointer.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -24,20 +23,29 @@ template <class S>
void
test(S s, typename S::size_type pos, const typename S::value_type* str, S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos <= old_size)
{
s.insert(pos, str);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= old_size);
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > old_size);
- assert(s == s0);
+ try
+ {
+ s.insert(pos, str);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > old_size);
+ assert(s == s0);
+ }
}
+#endif
}
int main()
@@ -210,4 +218,20 @@ int main()
test(S("abcdefghijklmnopqrst"), 21, "12345678901234567890", S("can't happen"));
}
#endif
+
+ { // test inserting into self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.insert(0, s_short.c_str());
+ assert(s_short == "123/123/");
+ s_short.insert(0, s_short.c_str());
+ assert(s_short == "123/123/123/123/");
+ s_short.insert(0, s_short.c_str());
+ assert(s_short == "123/123/123/123/123/123/123/123/");
+
+ s_long.insert(0, s_long.c_str());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/size_pointer_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/size_pointer_size.pass.cpp
index 30d3df9f259f..a42a60ddcdb4 100644
--- a/test/std/strings/basic.string/string.modifiers/string_insert/size_pointer_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_insert/size_pointer_size.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -25,20 +24,29 @@ void
test(S s, typename S::size_type pos, const typename S::value_type* str,
typename S::size_type n, S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos <= old_size)
{
s.insert(pos, str, n);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= old_size);
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > old_size);
- assert(s == s0);
+ try
+ {
+ s.insert(pos, str, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > old_size);
+ assert(s == s0);
+ }
}
+#endif
}
int main()
@@ -691,4 +699,20 @@ int main()
test(S("abcdefghijklmnopqrst"), 21, "12345678901234567890", 20, S("can't happen"));
}
#endif
+
+ { // test inserting into self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.insert(0, s_short.data(), s_short.size());
+ assert(s_short == "123/123/");
+ s_short.insert(0, s_short.data(), s_short.size());
+ assert(s_short == "123/123/123/123/");
+ s_short.insert(0, s_short.data(), s_short.size());
+ assert(s_short == "123/123/123/123/123/123/123/123/");
+
+ s_long.insert(0, s_long.data(), s_long.size());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/size_size_char.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/size_size_char.pass.cpp
index 04ea1d376940..a769604c6ff9 100644
--- a/test/std/strings/basic.string/string.modifiers/string_insert/size_size_char.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_insert/size_size_char.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -25,20 +24,29 @@ void
test(S s, typename S::size_type pos, typename S::size_type n,
typename S::value_type str, S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos <= old_size)
{
s.insert(pos, n, str);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= old_size);
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > old_size);
- assert(s == s0);
+ try
+ {
+ s.insert(pos, n, str);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > old_size);
+ assert(s == s0);
+ }
}
+#endif
}
int main()
diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp
index 1945871b99ac..e7c5ecdc9c1b 100644
--- a/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -24,20 +23,29 @@ template <class S>
void
test(S s, typename S::size_type pos, S str, S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos <= old_size)
{
s.insert(pos, str);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= old_size);
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > old_size);
- assert(s == s0);
+ try
+ {
+ s.insert(pos, str);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > old_size);
+ assert(s == s0);
+ }
}
+#endif
}
int main()
diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/size_string_size_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/size_string_size_size.pass.cpp
index 32485db478d8..67ba7ec108f1 100644
--- a/test/std/strings/basic.string/string.modifiers/string_insert/size_string_size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_insert/size_string_size_size.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -27,40 +26,58 @@ void
test(S s, typename S::size_type pos1, S str, typename S::size_type pos2,
typename S::size_type n, S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos1 <= old_size && pos2 <= str.size())
{
s.insert(pos1, str, pos2, n);
LIBCPP_ASSERT(s.__invariants());
- assert(pos1 <= old_size && pos2 <= str.size());
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos1 > old_size || pos2 > str.size());
- assert(s == s0);
+ try
+ {
+ s.insert(pos1, str, pos2, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > old_size || pos2 > str.size());
+ assert(s == s0);
+ }
}
+#endif
}
template <class S>
void
test_npos(S s, typename S::size_type pos1, S str, typename S::size_type pos2, S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos1 <= old_size && pos2 <= str.size())
{
s.insert(pos1, str, pos2);
LIBCPP_ASSERT(s.__invariants());
- assert(pos1 <= old_size && pos2 <= str.size());
assert(s == expected);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos1 > old_size || pos2 > str.size());
- assert(s == s0);
+ try
+ {
+ s.insert(pos1, str, pos2);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > old_size || pos2 > str.size());
+ assert(s == s0);
+ }
}
+#endif
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
index cc37e79c7932..e456d395220b 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
@@ -1007,4 +1007,34 @@ int main()
test_exceptions(S("abcdefghijklmnopqrst"), 10, 5, TIter(s, s+10, 6, TIter::TAComparison), TIter());
}
#endif
+
+ { // test replacing into self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.replace(s_short.begin(), s_short.begin(), s_short.begin(), s_short.end());
+ assert(s_short == "123/123/");
+ s_short.replace(s_short.begin(), s_short.begin(), s_short.begin(), s_short.end());
+ assert(s_short == "123/123/123/123/");
+ s_short.replace(s_short.begin(), s_short.begin(), s_short.begin(), s_short.end());
+ assert(s_short == "123/123/123/123/123/123/123/123/");
+
+ s_long.replace(s_long.begin(), s_long.begin(), s_long.begin(), s_long.end());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
+ }
+
+ { // test assigning a different type
+ typedef std::string S;
+ const uint8_t pc[] = "ABCD";
+ uint8_t p[] = "EFGH";
+
+ S s;
+ s.replace(s.begin(), s.end(), pc, pc + 4);
+ assert(s == "ABCD");
+
+ s.clear();
+ s.replace(s.begin(), s.end(), p, p + 4);
+ assert(s == "EFGH");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp
index 730fc1a501cf..f642d3a4f921 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp
@@ -282,4 +282,20 @@ int main()
test2<S>();
}
#endif
+
+ { // test replacing into self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.replace(s_short.begin(), s_short.begin(), s_short.c_str());
+ assert(s_short == "123/123/");
+ s_short.replace(s_short.begin(), s_short.begin(), s_short.c_str());
+ assert(s_short == "123/123/123/123/");
+ s_short.replace(s_short.begin(), s_short.begin(), s_short.c_str());
+ assert(s_short == "123/123/123/123/123/123/123/123/");
+
+ s_long.replace(s_long.begin(), s_long.begin(), s_long.c_str());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp
index 4a910e499819..695036807223 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp
@@ -972,4 +972,20 @@ int main()
test8<S>();
}
#endif
+
+ { // test replacing into self
+ typedef std::string S;
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+
+ s_short.replace(s_short.begin(), s_short.begin(), s_short.data(), s_short.size());
+ assert(s_short == "123/123/");
+ s_short.replace(s_short.begin(), s_short.begin(), s_short.data(), s_short.size());
+ assert(s_short == "123/123/123/123/");
+ s_short.replace(s_short.begin(), s_short.begin(), s_short.data(), s_short.size());
+ assert(s_short == "123/123/123/123/123/123/123/123/");
+
+ s_long.replace(s_long.begin(), s_long.begin(), s_long.data(), s_long.size());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_T_size_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_T_size_size.pass.cpp
new file mode 100644
index 000000000000..840b7614f482
--- /dev/null
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_T_size_size.pass.cpp
@@ -0,0 +1,6022 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template <class T>
+// basic_string& replace(size_type pos1, size_type n1, const T& t,
+// size_type pos2, size_type n=npos);
+//
+// Mostly we're testing string_view here
+
+#include <string>
+#include <stdexcept>
+#include <algorithm>
+#include <cassert>
+
+#include "test_macros.h"
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(S s, typename S::size_type pos1, typename S::size_type n1,
+ SV sv, typename S::size_type pos2, typename S::size_type n2,
+ S expected)
+{
+ static_assert((!std::is_same<S, SV>::value), "");
+ const typename S::size_type old_size = s.size();
+ S s0 = s;
+ if (pos1 <= old_size && pos2 <= sv.size())
+ {
+ s.replace(pos1, n1, sv, pos2, n2);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == expected);
+ typename S::size_type xlen = std::min(n1, old_size - pos1);
+ typename S::size_type rlen = std::min(n2, sv.size() - pos2);
+ assert(s.size() == old_size - xlen + rlen);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ s.replace(pos1, n1, sv, pos2, n2);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > old_size || pos2 > sv.size());
+ assert(s == s0);
+ }
+ }
+#endif
+}
+
+template <class S, class SV>
+void
+test_npos(S s, typename S::size_type pos1, typename S::size_type n1,
+ SV sv, typename S::size_type pos2,
+ S expected)
+{
+ static_assert((!std::is_same<S, SV>::value), "");
+ const typename S::size_type old_size = s.size();
+ S s0 = s;
+ if (pos1 <= old_size && pos2 <= sv.size())
+ {
+ s.replace(pos1, n1, sv, pos2);
+ LIBCPP_ASSERT(s.__invariants());
+ assert(s == expected);
+ typename S::size_type xlen = std::min(n1, old_size - pos1);
+ typename S::size_type rlen = std::min(S::npos, sv.size() - pos2);
+ assert(s.size() == old_size - xlen + rlen);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ s.replace(pos1, n1, sv, pos2);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > old_size || pos2 > sv.size());
+ assert(s == s0);
+ }
+ }
+#endif
+}
+
+
+template <class S, class SV>
+void test0()
+{
+ test(S(""), 0, 0, SV(""), 0, 0, S(""));
+ test(S(""), 0, 0, SV(""), 0, 1, S(""));
+ test(S(""), 0, 0, SV(""), 1, 0, S("can't happen"));
+ test(S(""), 0, 0, SV("12345"), 0, 0, S(""));
+ test(S(""), 0, 0, SV("12345"), 0, 1, S("1"));
+ test(S(""), 0, 0, SV("12345"), 0, 2, S("12"));
+ test(S(""), 0, 0, SV("12345"), 0, 4, S("1234"));
+ test(S(""), 0, 0, SV("12345"), 0, 5, S("12345"));
+ test(S(""), 0, 0, SV("12345"), 0, 6, S("12345"));
+ test(S(""), 0, 0, SV("12345"), 1, 0, S(""));
+ test(S(""), 0, 0, SV("12345"), 1, 1, S("2"));
+ test(S(""), 0, 0, SV("12345"), 1, 2, S("23"));
+ test(S(""), 0, 0, SV("12345"), 1, 3, S("234"));
+ test(S(""), 0, 0, SV("12345"), 1, 4, S("2345"));
+ test(S(""), 0, 0, SV("12345"), 1, 5, S("2345"));
+ test(S(""), 0, 0, SV("12345"), 2, 0, S(""));
+ test(S(""), 0, 0, SV("12345"), 2, 1, S("3"));
+ test(S(""), 0, 0, SV("12345"), 2, 2, S("34"));
+ test(S(""), 0, 0, SV("12345"), 2, 3, S("345"));
+ test(S(""), 0, 0, SV("12345"), 2, 4, S("345"));
+ test(S(""), 0, 0, SV("12345"), 4, 0, S(""));
+ test(S(""), 0, 0, SV("12345"), 4, 1, S("5"));
+ test(S(""), 0, 0, SV("12345"), 4, 2, S("5"));
+ test(S(""), 0, 0, SV("12345"), 5, 0, S(""));
+ test(S(""), 0, 0, SV("12345"), 5, 1, S(""));
+ test(S(""), 0, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S(""), 0, 0, SV("1234567890"), 0, 0, S(""));
+ test(S(""), 0, 0, SV("1234567890"), 0, 1, S("1"));
+ test(S(""), 0, 0, SV("1234567890"), 0, 5, S("12345"));
+ test(S(""), 0, 0, SV("1234567890"), 0, 9, S("123456789"));
+ test(S(""), 0, 0, SV("1234567890"), 0, 10, S("1234567890"));
+ test(S(""), 0, 0, SV("1234567890"), 0, 11, S("1234567890"));
+ test(S(""), 0, 0, SV("1234567890"), 1, 0, S(""));
+ test(S(""), 0, 0, SV("1234567890"), 1, 1, S("2"));
+ test(S(""), 0, 0, SV("1234567890"), 1, 4, S("2345"));
+ test(S(""), 0, 0, SV("1234567890"), 1, 8, S("23456789"));
+ test(S(""), 0, 0, SV("1234567890"), 1, 9, S("234567890"));
+ test(S(""), 0, 0, SV("1234567890"), 1, 10, S("234567890"));
+ test(S(""), 0, 0, SV("1234567890"), 5, 0, S(""));
+ test(S(""), 0, 0, SV("1234567890"), 5, 1, S("6"));
+ test(S(""), 0, 0, SV("1234567890"), 5, 2, S("67"));
+ test(S(""), 0, 0, SV("1234567890"), 5, 4, S("6789"));
+ test(S(""), 0, 0, SV("1234567890"), 5, 5, S("67890"));
+ test(S(""), 0, 0, SV("1234567890"), 5, 6, S("67890"));
+ test(S(""), 0, 0, SV("1234567890"), 9, 0, S(""));
+ test(S(""), 0, 0, SV("1234567890"), 9, 1, S("0"));
+ test(S(""), 0, 0, SV("1234567890"), 9, 2, S("0"));
+ test(S(""), 0, 0, SV("1234567890"), 10, 0, S(""));
+ test(S(""), 0, 0, SV("1234567890"), 10, 1, S(""));
+ test(S(""), 0, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 0, 0, S(""));
+ test(S(""), 0, 0, SV("12345678901234567890"), 0, 1, S("1"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 0, 10, S("1234567890"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 0, 19, S("1234567890123456789"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 0, 20, S("12345678901234567890"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 0, 21, S("12345678901234567890"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 1, 0, S(""));
+ test(S(""), 0, 0, SV("12345678901234567890"), 1, 1, S("2"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 1, 9, S("234567890"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 1, 18, S("234567890123456789"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 1, 19, S("2345678901234567890"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 1, 20, S("2345678901234567890"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 10, 0, S(""));
+ test(S(""), 0, 0, SV("12345678901234567890"), 10, 1, S("1"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 10, 5, S("12345"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 10, 9, S("123456789"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 10, 10, S("1234567890"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 10, 11, S("1234567890"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 19, 0, S(""));
+ test(S(""), 0, 0, SV("12345678901234567890"), 19, 1, S("0"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 19, 2, S("0"));
+ test(S(""), 0, 0, SV("12345678901234567890"), 20, 0, S(""));
+ test(S(""), 0, 0, SV("12345678901234567890"), 20, 1, S(""));
+ test(S(""), 0, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S(""), 0, 1, SV(""), 0, 0, S(""));
+ test(S(""), 0, 1, SV(""), 0, 1, S(""));
+ test(S(""), 0, 1, SV(""), 1, 0, S("can't happen"));
+ test(S(""), 0, 1, SV("12345"), 0, 0, S(""));
+ test(S(""), 0, 1, SV("12345"), 0, 1, S("1"));
+ test(S(""), 0, 1, SV("12345"), 0, 2, S("12"));
+ test(S(""), 0, 1, SV("12345"), 0, 4, S("1234"));
+ test(S(""), 0, 1, SV("12345"), 0, 5, S("12345"));
+ test(S(""), 0, 1, SV("12345"), 0, 6, S("12345"));
+ test(S(""), 0, 1, SV("12345"), 1, 0, S(""));
+ test(S(""), 0, 1, SV("12345"), 1, 1, S("2"));
+ test(S(""), 0, 1, SV("12345"), 1, 2, S("23"));
+ test(S(""), 0, 1, SV("12345"), 1, 3, S("234"));
+ test(S(""), 0, 1, SV("12345"), 1, 4, S("2345"));
+ test(S(""), 0, 1, SV("12345"), 1, 5, S("2345"));
+ test(S(""), 0, 1, SV("12345"), 2, 0, S(""));
+ test(S(""), 0, 1, SV("12345"), 2, 1, S("3"));
+ test(S(""), 0, 1, SV("12345"), 2, 2, S("34"));
+ test(S(""), 0, 1, SV("12345"), 2, 3, S("345"));
+ test(S(""), 0, 1, SV("12345"), 2, 4, S("345"));
+ test(S(""), 0, 1, SV("12345"), 4, 0, S(""));
+ test(S(""), 0, 1, SV("12345"), 4, 1, S("5"));
+ test(S(""), 0, 1, SV("12345"), 4, 2, S("5"));
+ test(S(""), 0, 1, SV("12345"), 5, 0, S(""));
+ test(S(""), 0, 1, SV("12345"), 5, 1, S(""));
+ test(S(""), 0, 1, SV("12345"), 6, 0, S("can't happen"));
+}
+
+template <class S, class SV>
+void test1()
+{
+ test(S(""), 0, 1, SV("1234567890"), 0, 0, S(""));
+ test(S(""), 0, 1, SV("1234567890"), 0, 1, S("1"));
+ test(S(""), 0, 1, SV("1234567890"), 0, 5, S("12345"));
+ test(S(""), 0, 1, SV("1234567890"), 0, 9, S("123456789"));
+ test(S(""), 0, 1, SV("1234567890"), 0, 10, S("1234567890"));
+ test(S(""), 0, 1, SV("1234567890"), 0, 11, S("1234567890"));
+ test(S(""), 0, 1, SV("1234567890"), 1, 0, S(""));
+ test(S(""), 0, 1, SV("1234567890"), 1, 1, S("2"));
+ test(S(""), 0, 1, SV("1234567890"), 1, 4, S("2345"));
+ test(S(""), 0, 1, SV("1234567890"), 1, 8, S("23456789"));
+ test(S(""), 0, 1, SV("1234567890"), 1, 9, S("234567890"));
+ test(S(""), 0, 1, SV("1234567890"), 1, 10, S("234567890"));
+ test(S(""), 0, 1, SV("1234567890"), 5, 0, S(""));
+ test(S(""), 0, 1, SV("1234567890"), 5, 1, S("6"));
+ test(S(""), 0, 1, SV("1234567890"), 5, 2, S("67"));
+ test(S(""), 0, 1, SV("1234567890"), 5, 4, S("6789"));
+ test(S(""), 0, 1, SV("1234567890"), 5, 5, S("67890"));
+ test(S(""), 0, 1, SV("1234567890"), 5, 6, S("67890"));
+ test(S(""), 0, 1, SV("1234567890"), 9, 0, S(""));
+ test(S(""), 0, 1, SV("1234567890"), 9, 1, S("0"));
+ test(S(""), 0, 1, SV("1234567890"), 9, 2, S("0"));
+ test(S(""), 0, 1, SV("1234567890"), 10, 0, S(""));
+ test(S(""), 0, 1, SV("1234567890"), 10, 1, S(""));
+ test(S(""), 0, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 0, 0, S(""));
+ test(S(""), 0, 1, SV("12345678901234567890"), 0, 1, S("1"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 0, 10, S("1234567890"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 0, 19, S("1234567890123456789"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 0, 20, S("12345678901234567890"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 0, 21, S("12345678901234567890"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 1, 0, S(""));
+ test(S(""), 0, 1, SV("12345678901234567890"), 1, 1, S("2"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 1, 9, S("234567890"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 1, 18, S("234567890123456789"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 1, 19, S("2345678901234567890"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 1, 20, S("2345678901234567890"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 10, 0, S(""));
+ test(S(""), 0, 1, SV("12345678901234567890"), 10, 1, S("1"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 10, 5, S("12345"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 10, 9, S("123456789"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 10, 10, S("1234567890"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 10, 11, S("1234567890"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 19, 0, S(""));
+ test(S(""), 0, 1, SV("12345678901234567890"), 19, 1, S("0"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 19, 2, S("0"));
+ test(S(""), 0, 1, SV("12345678901234567890"), 20, 0, S(""));
+ test(S(""), 0, 1, SV("12345678901234567890"), 20, 1, S(""));
+ test(S(""), 0, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S(""), 1, 0, SV(""), 0, 0, S("can't happen"));
+ test(S(""), 1, 0, SV(""), 0, 1, S("can't happen"));
+ test(S(""), 1, 0, SV(""), 1, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 0, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 0, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 0, 2, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 0, 4, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 0, 5, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 0, 6, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 1, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 1, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 1, 2, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 1, 3, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 1, 4, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 1, 5, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 2, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 2, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 2, 2, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 2, 3, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 2, 4, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 4, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 4, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 4, 2, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 5, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 5, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 0, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 0, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 0, 5, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 0, 9, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 0, 10, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 0, 11, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 1, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 1, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 1, 4, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 1, 8, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 1, 9, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 1, 10, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 5, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 5, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 5, 2, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 5, 4, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 5, 5, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 5, 6, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 9, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 9, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 9, 2, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 10, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 10, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 0, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 0, 1, S("can't happen"));
+}
+
+template <class S, class SV>
+void test2()
+{
+ test(S(""), 1, 0, SV("12345678901234567890"), 0, 10, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 0, 19, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 0, 20, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 0, 21, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 1, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 1, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 1, 9, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 1, 18, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 1, 19, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 1, 20, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 10, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 10, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 10, 5, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 10, 9, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 10, 10, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 10, 11, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 19, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 19, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 19, 2, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 20, 0, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 20, 1, S("can't happen"));
+ test(S(""), 1, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 0, 0, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV(""), 0, 1, S("abcde"));
+ test(S("abcde"), 0, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 0, 0, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 0, 1, S("1abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 0, 2, S("12abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 0, 4, S("1234abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 0, 5, S("12345abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 0, 6, S("12345abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 1, 1, S("2abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 1, 2, S("23abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 1, 3, S("234abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 1, 4, S("2345abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 1, 5, S("2345abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 2, 1, S("3abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 2, 2, S("34abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 2, 3, S("345abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 2, 4, S("345abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 4, 1, S("5abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 4, 2, S("5abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 0, 1, S("1abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 0, 5, S("12345abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 0, 9, S("123456789abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 0, 10, S("1234567890abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 0, 11, S("1234567890abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 1, 1, S("2abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 1, 4, S("2345abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 1, 8, S("23456789abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 1, 9, S("234567890abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 1, 10, S("234567890abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 5, 1, S("6abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 5, 2, S("67abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 5, 4, S("6789abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 5, 5, S("67890abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 5, 6, S("67890abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 9, 1, S("0abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 9, 2, S("0abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 0, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 0, 1, S("1abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 0, 10, S("1234567890abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 0, 19, S("1234567890123456789abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 0, 20, S("12345678901234567890abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 0, 21, S("12345678901234567890abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 1, 1, S("2abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 1, 9, S("234567890abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 1, 18, S("234567890123456789abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 1, 19, S("2345678901234567890abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 1, 20, S("2345678901234567890abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 10, 1, S("1abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 10, 5, S("12345abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 10, 9, S("123456789abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 10, 10, S("1234567890abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 10, 11, S("1234567890abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 19, 1, S("0abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 19, 2, S("0abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 0, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 0, 1, SV(""), 0, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV(""), 0, 1, S("bcde"));
+ test(S("abcde"), 0, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 0, 1, SV("12345"), 0, 0, S("bcde"));
+}
+
+template <class S, class SV>
+void test3()
+{
+ test(S("abcde"), 0, 1, SV("12345"), 0, 1, S("1bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 0, 2, S("12bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 0, 4, S("1234bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 0, 5, S("12345bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 0, 6, S("12345bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 1, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 1, 1, S("2bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 1, 2, S("23bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 1, 3, S("234bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 1, 4, S("2345bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 1, 5, S("2345bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 2, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 2, 1, S("3bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 2, 2, S("34bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 2, 3, S("345bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 2, 4, S("345bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 4, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 4, 1, S("5bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 4, 2, S("5bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 5, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 5, 1, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 0, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 0, 1, S("1bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 0, 5, S("12345bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 0, 9, S("123456789bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 0, 10, S("1234567890bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 0, 11, S("1234567890bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 1, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 1, 1, S("2bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 1, 4, S("2345bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 1, 8, S("23456789bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 1, 9, S("234567890bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 1, 10, S("234567890bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 5, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 5, 1, S("6bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 5, 2, S("67bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 5, 4, S("6789bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 5, 5, S("67890bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 5, 6, S("67890bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 9, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 9, 1, S("0bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 9, 2, S("0bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 10, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 10, 1, S("bcde"));
+ test(S("abcde"), 0, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 0, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 0, 1, S("1bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 0, 10, S("1234567890bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 0, 19, S("1234567890123456789bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 0, 20, S("12345678901234567890bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 0, 21, S("12345678901234567890bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 1, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 1, 1, S("2bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 1, 9, S("234567890bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 1, 18, S("234567890123456789bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 1, 19, S("2345678901234567890bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 1, 20, S("2345678901234567890bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 10, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 10, 1, S("1bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 10, 5, S("12345bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 10, 9, S("123456789bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 10, 10, S("1234567890bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 10, 11, S("1234567890bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 19, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 19, 1, S("0bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 19, 2, S("0bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 20, 0, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 20, 1, S("bcde"));
+ test(S("abcde"), 0, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 0, 2, SV(""), 0, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV(""), 0, 1, S("cde"));
+ test(S("abcde"), 0, 2, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 0, 2, SV("12345"), 0, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 0, 1, S("1cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 0, 2, S("12cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 0, 4, S("1234cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 0, 5, S("12345cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 0, 6, S("12345cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 1, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 1, 1, S("2cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 1, 2, S("23cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 1, 3, S("234cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 1, 4, S("2345cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 1, 5, S("2345cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 2, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 2, 1, S("3cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 2, 2, S("34cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 2, 3, S("345cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 2, 4, S("345cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 4, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 4, 1, S("5cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 4, 2, S("5cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 5, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 5, 1, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 0, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 0, 1, S("1cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 0, 5, S("12345cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 0, 9, S("123456789cde"));
+}
+
+template <class S, class SV>
+void test4()
+{
+ test(S("abcde"), 0, 2, SV("1234567890"), 0, 10, S("1234567890cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 0, 11, S("1234567890cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 1, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 1, 1, S("2cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 1, 4, S("2345cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 1, 8, S("23456789cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 1, 9, S("234567890cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 1, 10, S("234567890cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 5, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 5, 1, S("6cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 5, 2, S("67cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 5, 4, S("6789cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 5, 5, S("67890cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 5, 6, S("67890cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 9, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 9, 1, S("0cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 9, 2, S("0cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 10, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 10, 1, S("cde"));
+ test(S("abcde"), 0, 2, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 0, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 0, 1, S("1cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 0, 10, S("1234567890cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 0, 19, S("1234567890123456789cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 0, 20, S("12345678901234567890cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 0, 21, S("12345678901234567890cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 1, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 1, 1, S("2cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 1, 9, S("234567890cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 1, 18, S("234567890123456789cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 1, 19, S("2345678901234567890cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 1, 20, S("2345678901234567890cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 10, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 10, 1, S("1cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 10, 5, S("12345cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 10, 9, S("123456789cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 10, 10, S("1234567890cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 10, 11, S("1234567890cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 19, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 19, 1, S("0cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 19, 2, S("0cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 20, 0, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 20, 1, S("cde"));
+ test(S("abcde"), 0, 2, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 0, 4, SV(""), 0, 0, S("e"));
+ test(S("abcde"), 0, 4, SV(""), 0, 1, S("e"));
+ test(S("abcde"), 0, 4, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 0, 4, SV("12345"), 0, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("12345"), 0, 1, S("1e"));
+ test(S("abcde"), 0, 4, SV("12345"), 0, 2, S("12e"));
+ test(S("abcde"), 0, 4, SV("12345"), 0, 4, S("1234e"));
+ test(S("abcde"), 0, 4, SV("12345"), 0, 5, S("12345e"));
+ test(S("abcde"), 0, 4, SV("12345"), 0, 6, S("12345e"));
+ test(S("abcde"), 0, 4, SV("12345"), 1, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("12345"), 1, 1, S("2e"));
+ test(S("abcde"), 0, 4, SV("12345"), 1, 2, S("23e"));
+ test(S("abcde"), 0, 4, SV("12345"), 1, 3, S("234e"));
+ test(S("abcde"), 0, 4, SV("12345"), 1, 4, S("2345e"));
+ test(S("abcde"), 0, 4, SV("12345"), 1, 5, S("2345e"));
+ test(S("abcde"), 0, 4, SV("12345"), 2, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("12345"), 2, 1, S("3e"));
+ test(S("abcde"), 0, 4, SV("12345"), 2, 2, S("34e"));
+ test(S("abcde"), 0, 4, SV("12345"), 2, 3, S("345e"));
+ test(S("abcde"), 0, 4, SV("12345"), 2, 4, S("345e"));
+ test(S("abcde"), 0, 4, SV("12345"), 4, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("12345"), 4, 1, S("5e"));
+ test(S("abcde"), 0, 4, SV("12345"), 4, 2, S("5e"));
+ test(S("abcde"), 0, 4, SV("12345"), 5, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("12345"), 5, 1, S("e"));
+ test(S("abcde"), 0, 4, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 0, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 0, 1, S("1e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 0, 5, S("12345e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 0, 9, S("123456789e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 0, 10, S("1234567890e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 0, 11, S("1234567890e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 1, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 1, 1, S("2e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 1, 4, S("2345e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 1, 8, S("23456789e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 1, 9, S("234567890e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 1, 10, S("234567890e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 5, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 5, 1, S("6e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 5, 2, S("67e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 5, 4, S("6789e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 5, 5, S("67890e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 5, 6, S("67890e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 9, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 9, 1, S("0e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 9, 2, S("0e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 10, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 10, 1, S("e"));
+ test(S("abcde"), 0, 4, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 0, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 0, 1, S("1e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 0, 10, S("1234567890e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 0, 19, S("1234567890123456789e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 0, 20, S("12345678901234567890e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 0, 21, S("12345678901234567890e"));
+}
+
+template <class S, class SV>
+void test5()
+{
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 1, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 1, 1, S("2e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 1, 9, S("234567890e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 1, 18, S("234567890123456789e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 1, 19, S("2345678901234567890e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 1, 20, S("2345678901234567890e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 10, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 10, 1, S("1e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 10, 5, S("12345e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 10, 9, S("123456789e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 10, 10, S("1234567890e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 10, 11, S("1234567890e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 19, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 19, 1, S("0e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 19, 2, S("0e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 20, 0, S("e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 20, 1, S("e"));
+ test(S("abcde"), 0, 4, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 0, 5, SV(""), 0, 0, S(""));
+ test(S("abcde"), 0, 5, SV(""), 0, 1, S(""));
+ test(S("abcde"), 0, 5, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 0, 5, SV("12345"), 0, 0, S(""));
+ test(S("abcde"), 0, 5, SV("12345"), 0, 1, S("1"));
+ test(S("abcde"), 0, 5, SV("12345"), 0, 2, S("12"));
+ test(S("abcde"), 0, 5, SV("12345"), 0, 4, S("1234"));
+ test(S("abcde"), 0, 5, SV("12345"), 0, 5, S("12345"));
+ test(S("abcde"), 0, 5, SV("12345"), 0, 6, S("12345"));
+ test(S("abcde"), 0, 5, SV("12345"), 1, 0, S(""));
+ test(S("abcde"), 0, 5, SV("12345"), 1, 1, S("2"));
+ test(S("abcde"), 0, 5, SV("12345"), 1, 2, S("23"));
+ test(S("abcde"), 0, 5, SV("12345"), 1, 3, S("234"));
+ test(S("abcde"), 0, 5, SV("12345"), 1, 4, S("2345"));
+ test(S("abcde"), 0, 5, SV("12345"), 1, 5, S("2345"));
+ test(S("abcde"), 0, 5, SV("12345"), 2, 0, S(""));
+ test(S("abcde"), 0, 5, SV("12345"), 2, 1, S("3"));
+ test(S("abcde"), 0, 5, SV("12345"), 2, 2, S("34"));
+ test(S("abcde"), 0, 5, SV("12345"), 2, 3, S("345"));
+ test(S("abcde"), 0, 5, SV("12345"), 2, 4, S("345"));
+ test(S("abcde"), 0, 5, SV("12345"), 4, 0, S(""));
+ test(S("abcde"), 0, 5, SV("12345"), 4, 1, S("5"));
+ test(S("abcde"), 0, 5, SV("12345"), 4, 2, S("5"));
+ test(S("abcde"), 0, 5, SV("12345"), 5, 0, S(""));
+ test(S("abcde"), 0, 5, SV("12345"), 5, 1, S(""));
+ test(S("abcde"), 0, 5, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 0, 0, S(""));
+ test(S("abcde"), 0, 5, SV("1234567890"), 0, 1, S("1"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 0, 5, S("12345"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 0, 9, S("123456789"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 0, 10, S("1234567890"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 0, 11, S("1234567890"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 1, 0, S(""));
+ test(S("abcde"), 0, 5, SV("1234567890"), 1, 1, S("2"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 1, 4, S("2345"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 1, 8, S("23456789"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 1, 9, S("234567890"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 1, 10, S("234567890"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 5, 0, S(""));
+ test(S("abcde"), 0, 5, SV("1234567890"), 5, 1, S("6"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 5, 2, S("67"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 5, 4, S("6789"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 5, 5, S("67890"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 5, 6, S("67890"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 9, 0, S(""));
+ test(S("abcde"), 0, 5, SV("1234567890"), 9, 1, S("0"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 9, 2, S("0"));
+ test(S("abcde"), 0, 5, SV("1234567890"), 10, 0, S(""));
+ test(S("abcde"), 0, 5, SV("1234567890"), 10, 1, S(""));
+ test(S("abcde"), 0, 5, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 0, 0, S(""));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 0, 1, S("1"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 0, 10, S("1234567890"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 0, 19, S("1234567890123456789"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 0, 20, S("12345678901234567890"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 0, 21, S("12345678901234567890"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 1, 0, S(""));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 1, 1, S("2"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 1, 9, S("234567890"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 1, 18, S("234567890123456789"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 1, 19, S("2345678901234567890"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 1, 20, S("2345678901234567890"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 10, 0, S(""));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 10, 1, S("1"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 10, 5, S("12345"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 10, 9, S("123456789"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 10, 10, S("1234567890"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 10, 11, S("1234567890"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 19, 0, S(""));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 19, 1, S("0"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 19, 2, S("0"));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 20, 0, S(""));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 20, 1, S(""));
+ test(S("abcde"), 0, 5, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 0, 6, SV(""), 0, 0, S(""));
+ test(S("abcde"), 0, 6, SV(""), 0, 1, S(""));
+ test(S("abcde"), 0, 6, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 0, 6, SV("12345"), 0, 0, S(""));
+ test(S("abcde"), 0, 6, SV("12345"), 0, 1, S("1"));
+ test(S("abcde"), 0, 6, SV("12345"), 0, 2, S("12"));
+ test(S("abcde"), 0, 6, SV("12345"), 0, 4, S("1234"));
+ test(S("abcde"), 0, 6, SV("12345"), 0, 5, S("12345"));
+}
+
+template <class S, class SV>
+void test6()
+{
+ test(S("abcde"), 0, 6, SV("12345"), 0, 6, S("12345"));
+ test(S("abcde"), 0, 6, SV("12345"), 1, 0, S(""));
+ test(S("abcde"), 0, 6, SV("12345"), 1, 1, S("2"));
+ test(S("abcde"), 0, 6, SV("12345"), 1, 2, S("23"));
+ test(S("abcde"), 0, 6, SV("12345"), 1, 3, S("234"));
+ test(S("abcde"), 0, 6, SV("12345"), 1, 4, S("2345"));
+ test(S("abcde"), 0, 6, SV("12345"), 1, 5, S("2345"));
+ test(S("abcde"), 0, 6, SV("12345"), 2, 0, S(""));
+ test(S("abcde"), 0, 6, SV("12345"), 2, 1, S("3"));
+ test(S("abcde"), 0, 6, SV("12345"), 2, 2, S("34"));
+ test(S("abcde"), 0, 6, SV("12345"), 2, 3, S("345"));
+ test(S("abcde"), 0, 6, SV("12345"), 2, 4, S("345"));
+ test(S("abcde"), 0, 6, SV("12345"), 4, 0, S(""));
+ test(S("abcde"), 0, 6, SV("12345"), 4, 1, S("5"));
+ test(S("abcde"), 0, 6, SV("12345"), 4, 2, S("5"));
+ test(S("abcde"), 0, 6, SV("12345"), 5, 0, S(""));
+ test(S("abcde"), 0, 6, SV("12345"), 5, 1, S(""));
+ test(S("abcde"), 0, 6, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 0, 0, S(""));
+ test(S("abcde"), 0, 6, SV("1234567890"), 0, 1, S("1"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 0, 5, S("12345"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 0, 9, S("123456789"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 0, 10, S("1234567890"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 0, 11, S("1234567890"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 1, 0, S(""));
+ test(S("abcde"), 0, 6, SV("1234567890"), 1, 1, S("2"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 1, 4, S("2345"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 1, 8, S("23456789"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 1, 9, S("234567890"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 1, 10, S("234567890"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 5, 0, S(""));
+ test(S("abcde"), 0, 6, SV("1234567890"), 5, 1, S("6"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 5, 2, S("67"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 5, 4, S("6789"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 5, 5, S("67890"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 5, 6, S("67890"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 9, 0, S(""));
+ test(S("abcde"), 0, 6, SV("1234567890"), 9, 1, S("0"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 9, 2, S("0"));
+ test(S("abcde"), 0, 6, SV("1234567890"), 10, 0, S(""));
+ test(S("abcde"), 0, 6, SV("1234567890"), 10, 1, S(""));
+ test(S("abcde"), 0, 6, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 0, 0, S(""));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 0, 1, S("1"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 0, 10, S("1234567890"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 0, 19, S("1234567890123456789"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 0, 20, S("12345678901234567890"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 0, 21, S("12345678901234567890"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 1, 0, S(""));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 1, 1, S("2"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 1, 9, S("234567890"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 1, 18, S("234567890123456789"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 1, 19, S("2345678901234567890"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 1, 20, S("2345678901234567890"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 10, 0, S(""));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 10, 1, S("1"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 10, 5, S("12345"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 10, 9, S("123456789"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 10, 10, S("1234567890"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 10, 11, S("1234567890"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 19, 0, S(""));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 19, 1, S("0"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 19, 2, S("0"));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 20, 0, S(""));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 20, 1, S(""));
+ test(S("abcde"), 0, 6, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 1, 0, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV(""), 0, 1, S("abcde"));
+ test(S("abcde"), 1, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 1, 0, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 0, 1, S("a1bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 0, 2, S("a12bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 0, 4, S("a1234bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 0, 5, S("a12345bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 0, 6, S("a12345bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 1, 1, S("a2bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 1, 2, S("a23bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 1, 3, S("a234bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 1, 4, S("a2345bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 1, 5, S("a2345bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 2, 1, S("a3bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 2, 2, S("a34bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 2, 3, S("a345bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 2, 4, S("a345bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 4, 1, S("a5bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 4, 2, S("a5bcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 0, 1, S("a1bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 0, 5, S("a12345bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 0, 9, S("a123456789bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 0, 10, S("a1234567890bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 0, 11, S("a1234567890bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 1, 1, S("a2bcde"));
+}
+
+template <class S, class SV>
+void test7()
+{
+ test(S("abcde"), 1, 0, SV("1234567890"), 1, 4, S("a2345bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 1, 8, S("a23456789bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 1, 9, S("a234567890bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 1, 10, S("a234567890bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 5, 1, S("a6bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 5, 2, S("a67bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 5, 4, S("a6789bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 5, 5, S("a67890bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 5, 6, S("a67890bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 9, 1, S("a0bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 9, 2, S("a0bcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 1, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 0, 1, S("a1bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 0, 10, S("a1234567890bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 0, 19, S("a1234567890123456789bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 0, 20, S("a12345678901234567890bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 0, 21, S("a12345678901234567890bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 1, 1, S("a2bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 1, 9, S("a234567890bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 1, 18, S("a234567890123456789bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 1, 19, S("a2345678901234567890bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 1, 20, S("a2345678901234567890bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 10, 1, S("a1bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 10, 5, S("a12345bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 10, 9, S("a123456789bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 10, 10, S("a1234567890bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 10, 11, S("a1234567890bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 19, 1, S("a0bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 19, 2, S("a0bcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 1, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 1, 1, SV(""), 0, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV(""), 0, 1, S("acde"));
+ test(S("abcde"), 1, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 1, 1, SV("12345"), 0, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345"), 0, 1, S("a1cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 0, 2, S("a12cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 0, 4, S("a1234cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 0, 5, S("a12345cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 0, 6, S("a12345cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 1, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345"), 1, 1, S("a2cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 1, 2, S("a23cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 1, 3, S("a234cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 1, 4, S("a2345cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 1, 5, S("a2345cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 2, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345"), 2, 1, S("a3cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 2, 2, S("a34cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 2, 3, S("a345cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 2, 4, S("a345cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 4, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345"), 4, 1, S("a5cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 4, 2, S("a5cde"));
+ test(S("abcde"), 1, 1, SV("12345"), 5, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345"), 5, 1, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 0, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 0, 1, S("a1cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 0, 5, S("a12345cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 0, 9, S("a123456789cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 0, 10, S("a1234567890cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 0, 11, S("a1234567890cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 1, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 1, 1, S("a2cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 1, 4, S("a2345cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 1, 8, S("a23456789cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 1, 9, S("a234567890cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 1, 10, S("a234567890cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 5, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 5, 1, S("a6cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 5, 2, S("a67cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 5, 4, S("a6789cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 5, 5, S("a67890cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 5, 6, S("a67890cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 9, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 9, 1, S("a0cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 9, 2, S("a0cde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 10, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 10, 1, S("acde"));
+ test(S("abcde"), 1, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 0, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 0, 1, S("a1cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 0, 10, S("a1234567890cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 0, 19, S("a1234567890123456789cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 0, 20, S("a12345678901234567890cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 0, 21, S("a12345678901234567890cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 1, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 1, 1, S("a2cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 1, 9, S("a234567890cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 1, 18, S("a234567890123456789cde"));
+}
+
+template <class S, class SV>
+void test8()
+{
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 1, 19, S("a2345678901234567890cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 1, 20, S("a2345678901234567890cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 10, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 10, 1, S("a1cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 10, 5, S("a12345cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 10, 9, S("a123456789cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 10, 10, S("a1234567890cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 10, 11, S("a1234567890cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 19, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 19, 1, S("a0cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 19, 2, S("a0cde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 20, 0, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 20, 1, S("acde"));
+ test(S("abcde"), 1, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 1, 2, SV(""), 0, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV(""), 0, 1, S("ade"));
+ test(S("abcde"), 1, 2, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 1, 2, SV("12345"), 0, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345"), 0, 1, S("a1de"));
+ test(S("abcde"), 1, 2, SV("12345"), 0, 2, S("a12de"));
+ test(S("abcde"), 1, 2, SV("12345"), 0, 4, S("a1234de"));
+ test(S("abcde"), 1, 2, SV("12345"), 0, 5, S("a12345de"));
+ test(S("abcde"), 1, 2, SV("12345"), 0, 6, S("a12345de"));
+ test(S("abcde"), 1, 2, SV("12345"), 1, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345"), 1, 1, S("a2de"));
+ test(S("abcde"), 1, 2, SV("12345"), 1, 2, S("a23de"));
+ test(S("abcde"), 1, 2, SV("12345"), 1, 3, S("a234de"));
+ test(S("abcde"), 1, 2, SV("12345"), 1, 4, S("a2345de"));
+ test(S("abcde"), 1, 2, SV("12345"), 1, 5, S("a2345de"));
+ test(S("abcde"), 1, 2, SV("12345"), 2, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345"), 2, 1, S("a3de"));
+ test(S("abcde"), 1, 2, SV("12345"), 2, 2, S("a34de"));
+ test(S("abcde"), 1, 2, SV("12345"), 2, 3, S("a345de"));
+ test(S("abcde"), 1, 2, SV("12345"), 2, 4, S("a345de"));
+ test(S("abcde"), 1, 2, SV("12345"), 4, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345"), 4, 1, S("a5de"));
+ test(S("abcde"), 1, 2, SV("12345"), 4, 2, S("a5de"));
+ test(S("abcde"), 1, 2, SV("12345"), 5, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345"), 5, 1, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 0, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 0, 1, S("a1de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 0, 5, S("a12345de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 0, 9, S("a123456789de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 0, 10, S("a1234567890de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 0, 11, S("a1234567890de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 1, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 1, 1, S("a2de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 1, 4, S("a2345de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 1, 8, S("a23456789de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 1, 9, S("a234567890de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 1, 10, S("a234567890de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 5, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 5, 1, S("a6de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 5, 2, S("a67de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 5, 4, S("a6789de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 5, 5, S("a67890de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 5, 6, S("a67890de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 9, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 9, 1, S("a0de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 9, 2, S("a0de"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 10, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 10, 1, S("ade"));
+ test(S("abcde"), 1, 2, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 0, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 0, 1, S("a1de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 0, 10, S("a1234567890de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 0, 19, S("a1234567890123456789de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 0, 20, S("a12345678901234567890de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 0, 21, S("a12345678901234567890de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 1, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 1, 1, S("a2de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 1, 9, S("a234567890de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 1, 18, S("a234567890123456789de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 1, 19, S("a2345678901234567890de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 1, 20, S("a2345678901234567890de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 10, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 10, 1, S("a1de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 10, 5, S("a12345de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 10, 9, S("a123456789de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 10, 10, S("a1234567890de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 10, 11, S("a1234567890de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 19, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 19, 1, S("a0de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 19, 2, S("a0de"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 20, 0, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 20, 1, S("ade"));
+ test(S("abcde"), 1, 2, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 1, 3, SV(""), 0, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV(""), 0, 1, S("ae"));
+ test(S("abcde"), 1, 3, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 1, 3, SV("12345"), 0, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345"), 0, 1, S("a1e"));
+ test(S("abcde"), 1, 3, SV("12345"), 0, 2, S("a12e"));
+ test(S("abcde"), 1, 3, SV("12345"), 0, 4, S("a1234e"));
+ test(S("abcde"), 1, 3, SV("12345"), 0, 5, S("a12345e"));
+ test(S("abcde"), 1, 3, SV("12345"), 0, 6, S("a12345e"));
+ test(S("abcde"), 1, 3, SV("12345"), 1, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345"), 1, 1, S("a2e"));
+ test(S("abcde"), 1, 3, SV("12345"), 1, 2, S("a23e"));
+}
+
+template <class S, class SV>
+void test9()
+{
+ test(S("abcde"), 1, 3, SV("12345"), 1, 3, S("a234e"));
+ test(S("abcde"), 1, 3, SV("12345"), 1, 4, S("a2345e"));
+ test(S("abcde"), 1, 3, SV("12345"), 1, 5, S("a2345e"));
+ test(S("abcde"), 1, 3, SV("12345"), 2, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345"), 2, 1, S("a3e"));
+ test(S("abcde"), 1, 3, SV("12345"), 2, 2, S("a34e"));
+ test(S("abcde"), 1, 3, SV("12345"), 2, 3, S("a345e"));
+ test(S("abcde"), 1, 3, SV("12345"), 2, 4, S("a345e"));
+ test(S("abcde"), 1, 3, SV("12345"), 4, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345"), 4, 1, S("a5e"));
+ test(S("abcde"), 1, 3, SV("12345"), 4, 2, S("a5e"));
+ test(S("abcde"), 1, 3, SV("12345"), 5, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345"), 5, 1, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 0, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 0, 1, S("a1e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 0, 5, S("a12345e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 0, 9, S("a123456789e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 0, 10, S("a1234567890e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 0, 11, S("a1234567890e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 1, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 1, 1, S("a2e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 1, 4, S("a2345e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 1, 8, S("a23456789e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 1, 9, S("a234567890e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 1, 10, S("a234567890e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 5, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 5, 1, S("a6e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 5, 2, S("a67e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 5, 4, S("a6789e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 5, 5, S("a67890e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 5, 6, S("a67890e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 9, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 9, 1, S("a0e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 9, 2, S("a0e"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 10, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 10, 1, S("ae"));
+ test(S("abcde"), 1, 3, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 0, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 0, 1, S("a1e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 0, 10, S("a1234567890e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 0, 19, S("a1234567890123456789e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 0, 20, S("a12345678901234567890e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 0, 21, S("a12345678901234567890e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 1, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 1, 1, S("a2e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 1, 9, S("a234567890e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 1, 18, S("a234567890123456789e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 1, 19, S("a2345678901234567890e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 1, 20, S("a2345678901234567890e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 10, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 10, 1, S("a1e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 10, 5, S("a12345e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 10, 9, S("a123456789e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 10, 10, S("a1234567890e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 10, 11, S("a1234567890e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 19, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 19, 1, S("a0e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 19, 2, S("a0e"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 20, 0, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 20, 1, S("ae"));
+ test(S("abcde"), 1, 3, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 1, 4, SV(""), 0, 0, S("a"));
+ test(S("abcde"), 1, 4, SV(""), 0, 1, S("a"));
+ test(S("abcde"), 1, 4, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 1, 4, SV("12345"), 0, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("12345"), 0, 1, S("a1"));
+ test(S("abcde"), 1, 4, SV("12345"), 0, 2, S("a12"));
+ test(S("abcde"), 1, 4, SV("12345"), 0, 4, S("a1234"));
+ test(S("abcde"), 1, 4, SV("12345"), 0, 5, S("a12345"));
+ test(S("abcde"), 1, 4, SV("12345"), 0, 6, S("a12345"));
+ test(S("abcde"), 1, 4, SV("12345"), 1, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("12345"), 1, 1, S("a2"));
+ test(S("abcde"), 1, 4, SV("12345"), 1, 2, S("a23"));
+ test(S("abcde"), 1, 4, SV("12345"), 1, 3, S("a234"));
+ test(S("abcde"), 1, 4, SV("12345"), 1, 4, S("a2345"));
+ test(S("abcde"), 1, 4, SV("12345"), 1, 5, S("a2345"));
+ test(S("abcde"), 1, 4, SV("12345"), 2, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("12345"), 2, 1, S("a3"));
+ test(S("abcde"), 1, 4, SV("12345"), 2, 2, S("a34"));
+ test(S("abcde"), 1, 4, SV("12345"), 2, 3, S("a345"));
+ test(S("abcde"), 1, 4, SV("12345"), 2, 4, S("a345"));
+ test(S("abcde"), 1, 4, SV("12345"), 4, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("12345"), 4, 1, S("a5"));
+ test(S("abcde"), 1, 4, SV("12345"), 4, 2, S("a5"));
+ test(S("abcde"), 1, 4, SV("12345"), 5, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("12345"), 5, 1, S("a"));
+ test(S("abcde"), 1, 4, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 0, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 0, 1, S("a1"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 0, 5, S("a12345"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 0, 9, S("a123456789"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 0, 10, S("a1234567890"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 0, 11, S("a1234567890"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 1, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 1, 1, S("a2"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 1, 4, S("a2345"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 1, 8, S("a23456789"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 1, 9, S("a234567890"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 1, 10, S("a234567890"));
+}
+
+template <class S, class SV>
+void test10()
+{
+ test(S("abcde"), 1, 4, SV("1234567890"), 5, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 5, 1, S("a6"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 5, 2, S("a67"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 5, 4, S("a6789"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 5, 5, S("a67890"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 5, 6, S("a67890"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 9, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 9, 1, S("a0"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 9, 2, S("a0"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 10, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 10, 1, S("a"));
+ test(S("abcde"), 1, 4, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 0, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 0, 1, S("a1"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 0, 10, S("a1234567890"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 0, 19, S("a1234567890123456789"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 0, 20, S("a12345678901234567890"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 0, 21, S("a12345678901234567890"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 1, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 1, 1, S("a2"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 1, 9, S("a234567890"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 1, 18, S("a234567890123456789"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 1, 19, S("a2345678901234567890"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 1, 20, S("a2345678901234567890"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 10, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 10, 1, S("a1"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 10, 5, S("a12345"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 10, 9, S("a123456789"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 10, 10, S("a1234567890"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 10, 11, S("a1234567890"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 19, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 19, 1, S("a0"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 19, 2, S("a0"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 20, 0, S("a"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 20, 1, S("a"));
+ test(S("abcde"), 1, 4, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 1, 5, SV(""), 0, 0, S("a"));
+ test(S("abcde"), 1, 5, SV(""), 0, 1, S("a"));
+ test(S("abcde"), 1, 5, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 1, 5, SV("12345"), 0, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("12345"), 0, 1, S("a1"));
+ test(S("abcde"), 1, 5, SV("12345"), 0, 2, S("a12"));
+ test(S("abcde"), 1, 5, SV("12345"), 0, 4, S("a1234"));
+ test(S("abcde"), 1, 5, SV("12345"), 0, 5, S("a12345"));
+ test(S("abcde"), 1, 5, SV("12345"), 0, 6, S("a12345"));
+ test(S("abcde"), 1, 5, SV("12345"), 1, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("12345"), 1, 1, S("a2"));
+ test(S("abcde"), 1, 5, SV("12345"), 1, 2, S("a23"));
+ test(S("abcde"), 1, 5, SV("12345"), 1, 3, S("a234"));
+ test(S("abcde"), 1, 5, SV("12345"), 1, 4, S("a2345"));
+ test(S("abcde"), 1, 5, SV("12345"), 1, 5, S("a2345"));
+ test(S("abcde"), 1, 5, SV("12345"), 2, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("12345"), 2, 1, S("a3"));
+ test(S("abcde"), 1, 5, SV("12345"), 2, 2, S("a34"));
+ test(S("abcde"), 1, 5, SV("12345"), 2, 3, S("a345"));
+ test(S("abcde"), 1, 5, SV("12345"), 2, 4, S("a345"));
+ test(S("abcde"), 1, 5, SV("12345"), 4, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("12345"), 4, 1, S("a5"));
+ test(S("abcde"), 1, 5, SV("12345"), 4, 2, S("a5"));
+ test(S("abcde"), 1, 5, SV("12345"), 5, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("12345"), 5, 1, S("a"));
+ test(S("abcde"), 1, 5, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 0, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 0, 1, S("a1"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 0, 5, S("a12345"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 0, 9, S("a123456789"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 0, 10, S("a1234567890"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 0, 11, S("a1234567890"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 1, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 1, 1, S("a2"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 1, 4, S("a2345"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 1, 8, S("a23456789"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 1, 9, S("a234567890"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 1, 10, S("a234567890"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 5, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 5, 1, S("a6"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 5, 2, S("a67"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 5, 4, S("a6789"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 5, 5, S("a67890"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 5, 6, S("a67890"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 9, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 9, 1, S("a0"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 9, 2, S("a0"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 10, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 10, 1, S("a"));
+ test(S("abcde"), 1, 5, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 0, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 0, 1, S("a1"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 0, 10, S("a1234567890"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 0, 19, S("a1234567890123456789"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 0, 20, S("a12345678901234567890"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 0, 21, S("a12345678901234567890"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 1, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 1, 1, S("a2"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 1, 9, S("a234567890"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 1, 18, S("a234567890123456789"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 1, 19, S("a2345678901234567890"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 1, 20, S("a2345678901234567890"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 10, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 10, 1, S("a1"));
+}
+
+template <class S, class SV>
+void test11()
+{
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 10, 5, S("a12345"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 10, 9, S("a123456789"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 10, 10, S("a1234567890"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 10, 11, S("a1234567890"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 19, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 19, 1, S("a0"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 19, 2, S("a0"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 20, 0, S("a"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 20, 1, S("a"));
+ test(S("abcde"), 1, 5, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 2, 0, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV(""), 0, 1, S("abcde"));
+ test(S("abcde"), 2, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 2, 0, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345"), 0, 1, S("ab1cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 0, 2, S("ab12cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 0, 4, S("ab1234cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 0, 5, S("ab12345cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 0, 6, S("ab12345cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345"), 1, 1, S("ab2cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 1, 2, S("ab23cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 1, 3, S("ab234cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 1, 4, S("ab2345cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 1, 5, S("ab2345cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345"), 2, 1, S("ab3cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 2, 2, S("ab34cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 2, 3, S("ab345cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 2, 4, S("ab345cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345"), 4, 1, S("ab5cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 4, 2, S("ab5cde"));
+ test(S("abcde"), 2, 0, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 0, 1, S("ab1cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 0, 5, S("ab12345cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 0, 9, S("ab123456789cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 0, 10, S("ab1234567890cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 0, 11, S("ab1234567890cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 1, 1, S("ab2cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 1, 4, S("ab2345cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 1, 8, S("ab23456789cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 1, 9, S("ab234567890cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 1, 10, S("ab234567890cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 5, 1, S("ab6cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 5, 2, S("ab67cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 5, 4, S("ab6789cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 5, 5, S("ab67890cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 5, 6, S("ab67890cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 9, 1, S("ab0cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 9, 2, S("ab0cde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 2, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 0, 1, S("ab1cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 0, 10, S("ab1234567890cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 0, 19, S("ab1234567890123456789cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 0, 20, S("ab12345678901234567890cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 0, 21, S("ab12345678901234567890cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 1, 1, S("ab2cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 1, 9, S("ab234567890cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 1, 18, S("ab234567890123456789cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 1, 19, S("ab2345678901234567890cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 1, 20, S("ab2345678901234567890cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 10, 1, S("ab1cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 10, 5, S("ab12345cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 10, 9, S("ab123456789cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 10, 10, S("ab1234567890cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 10, 11, S("ab1234567890cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 19, 1, S("ab0cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 19, 2, S("ab0cde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 2, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 2, 1, SV(""), 0, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV(""), 0, 1, S("abde"));
+ test(S("abcde"), 2, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 2, 1, SV("12345"), 0, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345"), 0, 1, S("ab1de"));
+ test(S("abcde"), 2, 1, SV("12345"), 0, 2, S("ab12de"));
+ test(S("abcde"), 2, 1, SV("12345"), 0, 4, S("ab1234de"));
+ test(S("abcde"), 2, 1, SV("12345"), 0, 5, S("ab12345de"));
+ test(S("abcde"), 2, 1, SV("12345"), 0, 6, S("ab12345de"));
+ test(S("abcde"), 2, 1, SV("12345"), 1, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345"), 1, 1, S("ab2de"));
+ test(S("abcde"), 2, 1, SV("12345"), 1, 2, S("ab23de"));
+ test(S("abcde"), 2, 1, SV("12345"), 1, 3, S("ab234de"));
+ test(S("abcde"), 2, 1, SV("12345"), 1, 4, S("ab2345de"));
+ test(S("abcde"), 2, 1, SV("12345"), 1, 5, S("ab2345de"));
+ test(S("abcde"), 2, 1, SV("12345"), 2, 0, S("abde"));
+}
+
+template <class S, class SV>
+void test12()
+{
+ test(S("abcde"), 2, 1, SV("12345"), 2, 1, S("ab3de"));
+ test(S("abcde"), 2, 1, SV("12345"), 2, 2, S("ab34de"));
+ test(S("abcde"), 2, 1, SV("12345"), 2, 3, S("ab345de"));
+ test(S("abcde"), 2, 1, SV("12345"), 2, 4, S("ab345de"));
+ test(S("abcde"), 2, 1, SV("12345"), 4, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345"), 4, 1, S("ab5de"));
+ test(S("abcde"), 2, 1, SV("12345"), 4, 2, S("ab5de"));
+ test(S("abcde"), 2, 1, SV("12345"), 5, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345"), 5, 1, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 0, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 0, 1, S("ab1de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 0, 5, S("ab12345de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 0, 9, S("ab123456789de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 0, 10, S("ab1234567890de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 0, 11, S("ab1234567890de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 1, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 1, 1, S("ab2de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 1, 4, S("ab2345de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 1, 8, S("ab23456789de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 1, 9, S("ab234567890de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 1, 10, S("ab234567890de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 5, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 5, 1, S("ab6de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 5, 2, S("ab67de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 5, 4, S("ab6789de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 5, 5, S("ab67890de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 5, 6, S("ab67890de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 9, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 9, 1, S("ab0de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 9, 2, S("ab0de"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 10, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 10, 1, S("abde"));
+ test(S("abcde"), 2, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 0, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 0, 1, S("ab1de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 0, 10, S("ab1234567890de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 0, 19, S("ab1234567890123456789de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 0, 20, S("ab12345678901234567890de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 0, 21, S("ab12345678901234567890de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 1, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 1, 1, S("ab2de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 1, 9, S("ab234567890de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 1, 18, S("ab234567890123456789de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 1, 19, S("ab2345678901234567890de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 1, 20, S("ab2345678901234567890de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 10, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 10, 1, S("ab1de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 10, 5, S("ab12345de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 10, 9, S("ab123456789de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 10, 10, S("ab1234567890de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 10, 11, S("ab1234567890de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 19, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 19, 1, S("ab0de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 19, 2, S("ab0de"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 20, 0, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 20, 1, S("abde"));
+ test(S("abcde"), 2, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 2, 2, SV(""), 0, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV(""), 0, 1, S("abe"));
+ test(S("abcde"), 2, 2, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 2, 2, SV("12345"), 0, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345"), 0, 1, S("ab1e"));
+ test(S("abcde"), 2, 2, SV("12345"), 0, 2, S("ab12e"));
+ test(S("abcde"), 2, 2, SV("12345"), 0, 4, S("ab1234e"));
+ test(S("abcde"), 2, 2, SV("12345"), 0, 5, S("ab12345e"));
+ test(S("abcde"), 2, 2, SV("12345"), 0, 6, S("ab12345e"));
+ test(S("abcde"), 2, 2, SV("12345"), 1, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345"), 1, 1, S("ab2e"));
+ test(S("abcde"), 2, 2, SV("12345"), 1, 2, S("ab23e"));
+ test(S("abcde"), 2, 2, SV("12345"), 1, 3, S("ab234e"));
+ test(S("abcde"), 2, 2, SV("12345"), 1, 4, S("ab2345e"));
+ test(S("abcde"), 2, 2, SV("12345"), 1, 5, S("ab2345e"));
+ test(S("abcde"), 2, 2, SV("12345"), 2, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345"), 2, 1, S("ab3e"));
+ test(S("abcde"), 2, 2, SV("12345"), 2, 2, S("ab34e"));
+ test(S("abcde"), 2, 2, SV("12345"), 2, 3, S("ab345e"));
+ test(S("abcde"), 2, 2, SV("12345"), 2, 4, S("ab345e"));
+ test(S("abcde"), 2, 2, SV("12345"), 4, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345"), 4, 1, S("ab5e"));
+ test(S("abcde"), 2, 2, SV("12345"), 4, 2, S("ab5e"));
+ test(S("abcde"), 2, 2, SV("12345"), 5, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345"), 5, 1, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 0, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 0, 1, S("ab1e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 0, 5, S("ab12345e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 0, 9, S("ab123456789e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 0, 10, S("ab1234567890e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 0, 11, S("ab1234567890e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 1, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 1, 1, S("ab2e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 1, 4, S("ab2345e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 1, 8, S("ab23456789e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 1, 9, S("ab234567890e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 1, 10, S("ab234567890e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 5, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 5, 1, S("ab6e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 5, 2, S("ab67e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 5, 4, S("ab6789e"));
+}
+
+template <class S, class SV>
+void test13()
+{
+ test(S("abcde"), 2, 2, SV("1234567890"), 5, 5, S("ab67890e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 5, 6, S("ab67890e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 9, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 9, 1, S("ab0e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 9, 2, S("ab0e"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 10, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 10, 1, S("abe"));
+ test(S("abcde"), 2, 2, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 0, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 0, 1, S("ab1e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 0, 10, S("ab1234567890e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 0, 19, S("ab1234567890123456789e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 0, 20, S("ab12345678901234567890e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 0, 21, S("ab12345678901234567890e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 1, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 1, 1, S("ab2e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 1, 9, S("ab234567890e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 1, 18, S("ab234567890123456789e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 1, 19, S("ab2345678901234567890e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 1, 20, S("ab2345678901234567890e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 10, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 10, 1, S("ab1e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 10, 5, S("ab12345e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 10, 9, S("ab123456789e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 10, 10, S("ab1234567890e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 10, 11, S("ab1234567890e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 19, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 19, 1, S("ab0e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 19, 2, S("ab0e"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 20, 0, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 20, 1, S("abe"));
+ test(S("abcde"), 2, 2, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 2, 3, SV(""), 0, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV(""), 0, 1, S("ab"));
+ test(S("abcde"), 2, 3, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 2, 3, SV("12345"), 0, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345"), 0, 1, S("ab1"));
+ test(S("abcde"), 2, 3, SV("12345"), 0, 2, S("ab12"));
+ test(S("abcde"), 2, 3, SV("12345"), 0, 4, S("ab1234"));
+ test(S("abcde"), 2, 3, SV("12345"), 0, 5, S("ab12345"));
+ test(S("abcde"), 2, 3, SV("12345"), 0, 6, S("ab12345"));
+ test(S("abcde"), 2, 3, SV("12345"), 1, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345"), 1, 1, S("ab2"));
+ test(S("abcde"), 2, 3, SV("12345"), 1, 2, S("ab23"));
+ test(S("abcde"), 2, 3, SV("12345"), 1, 3, S("ab234"));
+ test(S("abcde"), 2, 3, SV("12345"), 1, 4, S("ab2345"));
+ test(S("abcde"), 2, 3, SV("12345"), 1, 5, S("ab2345"));
+ test(S("abcde"), 2, 3, SV("12345"), 2, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345"), 2, 1, S("ab3"));
+ test(S("abcde"), 2, 3, SV("12345"), 2, 2, S("ab34"));
+ test(S("abcde"), 2, 3, SV("12345"), 2, 3, S("ab345"));
+ test(S("abcde"), 2, 3, SV("12345"), 2, 4, S("ab345"));
+ test(S("abcde"), 2, 3, SV("12345"), 4, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345"), 4, 1, S("ab5"));
+ test(S("abcde"), 2, 3, SV("12345"), 4, 2, S("ab5"));
+ test(S("abcde"), 2, 3, SV("12345"), 5, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345"), 5, 1, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 0, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 0, 1, S("ab1"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 0, 5, S("ab12345"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 0, 9, S("ab123456789"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 0, 10, S("ab1234567890"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 0, 11, S("ab1234567890"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 1, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 1, 1, S("ab2"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 1, 4, S("ab2345"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 1, 8, S("ab23456789"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 1, 9, S("ab234567890"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 1, 10, S("ab234567890"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 5, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 5, 1, S("ab6"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 5, 2, S("ab67"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 5, 4, S("ab6789"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 5, 5, S("ab67890"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 5, 6, S("ab67890"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 9, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 9, 1, S("ab0"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 9, 2, S("ab0"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 10, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 10, 1, S("ab"));
+ test(S("abcde"), 2, 3, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 0, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 0, 1, S("ab1"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 0, 10, S("ab1234567890"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 0, 19, S("ab1234567890123456789"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 0, 20, S("ab12345678901234567890"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 0, 21, S("ab12345678901234567890"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 1, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 1, 1, S("ab2"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 1, 9, S("ab234567890"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 1, 18, S("ab234567890123456789"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 1, 19, S("ab2345678901234567890"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 1, 20, S("ab2345678901234567890"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 10, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 10, 1, S("ab1"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 10, 5, S("ab12345"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 10, 9, S("ab123456789"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 10, 10, S("ab1234567890"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 10, 11, S("ab1234567890"));
+}
+
+template <class S, class SV>
+void test14()
+{
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 19, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 19, 1, S("ab0"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 19, 2, S("ab0"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 20, 0, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 20, 1, S("ab"));
+ test(S("abcde"), 2, 3, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 2, 4, SV(""), 0, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV(""), 0, 1, S("ab"));
+ test(S("abcde"), 2, 4, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 2, 4, SV("12345"), 0, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345"), 0, 1, S("ab1"));
+ test(S("abcde"), 2, 4, SV("12345"), 0, 2, S("ab12"));
+ test(S("abcde"), 2, 4, SV("12345"), 0, 4, S("ab1234"));
+ test(S("abcde"), 2, 4, SV("12345"), 0, 5, S("ab12345"));
+ test(S("abcde"), 2, 4, SV("12345"), 0, 6, S("ab12345"));
+ test(S("abcde"), 2, 4, SV("12345"), 1, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345"), 1, 1, S("ab2"));
+ test(S("abcde"), 2, 4, SV("12345"), 1, 2, S("ab23"));
+ test(S("abcde"), 2, 4, SV("12345"), 1, 3, S("ab234"));
+ test(S("abcde"), 2, 4, SV("12345"), 1, 4, S("ab2345"));
+ test(S("abcde"), 2, 4, SV("12345"), 1, 5, S("ab2345"));
+ test(S("abcde"), 2, 4, SV("12345"), 2, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345"), 2, 1, S("ab3"));
+ test(S("abcde"), 2, 4, SV("12345"), 2, 2, S("ab34"));
+ test(S("abcde"), 2, 4, SV("12345"), 2, 3, S("ab345"));
+ test(S("abcde"), 2, 4, SV("12345"), 2, 4, S("ab345"));
+ test(S("abcde"), 2, 4, SV("12345"), 4, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345"), 4, 1, S("ab5"));
+ test(S("abcde"), 2, 4, SV("12345"), 4, 2, S("ab5"));
+ test(S("abcde"), 2, 4, SV("12345"), 5, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345"), 5, 1, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 0, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 0, 1, S("ab1"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 0, 5, S("ab12345"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 0, 9, S("ab123456789"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 0, 10, S("ab1234567890"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 0, 11, S("ab1234567890"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 1, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 1, 1, S("ab2"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 1, 4, S("ab2345"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 1, 8, S("ab23456789"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 1, 9, S("ab234567890"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 1, 10, S("ab234567890"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 5, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 5, 1, S("ab6"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 5, 2, S("ab67"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 5, 4, S("ab6789"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 5, 5, S("ab67890"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 5, 6, S("ab67890"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 9, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 9, 1, S("ab0"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 9, 2, S("ab0"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 10, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 10, 1, S("ab"));
+ test(S("abcde"), 2, 4, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 0, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 0, 1, S("ab1"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 0, 10, S("ab1234567890"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 0, 19, S("ab1234567890123456789"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 0, 20, S("ab12345678901234567890"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 0, 21, S("ab12345678901234567890"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 1, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 1, 1, S("ab2"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 1, 9, S("ab234567890"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 1, 18, S("ab234567890123456789"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 1, 19, S("ab2345678901234567890"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 1, 20, S("ab2345678901234567890"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 10, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 10, 1, S("ab1"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 10, 5, S("ab12345"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 10, 9, S("ab123456789"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 10, 10, S("ab1234567890"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 10, 11, S("ab1234567890"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 19, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 19, 1, S("ab0"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 19, 2, S("ab0"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 20, 0, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 20, 1, S("ab"));
+ test(S("abcde"), 2, 4, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 4, 0, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV(""), 0, 1, S("abcde"));
+ test(S("abcde"), 4, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 4, 0, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345"), 0, 1, S("abcd1e"));
+ test(S("abcde"), 4, 0, SV("12345"), 0, 2, S("abcd12e"));
+ test(S("abcde"), 4, 0, SV("12345"), 0, 4, S("abcd1234e"));
+ test(S("abcde"), 4, 0, SV("12345"), 0, 5, S("abcd12345e"));
+ test(S("abcde"), 4, 0, SV("12345"), 0, 6, S("abcd12345e"));
+ test(S("abcde"), 4, 0, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345"), 1, 1, S("abcd2e"));
+ test(S("abcde"), 4, 0, SV("12345"), 1, 2, S("abcd23e"));
+ test(S("abcde"), 4, 0, SV("12345"), 1, 3, S("abcd234e"));
+ test(S("abcde"), 4, 0, SV("12345"), 1, 4, S("abcd2345e"));
+ test(S("abcde"), 4, 0, SV("12345"), 1, 5, S("abcd2345e"));
+ test(S("abcde"), 4, 0, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345"), 2, 1, S("abcd3e"));
+ test(S("abcde"), 4, 0, SV("12345"), 2, 2, S("abcd34e"));
+ test(S("abcde"), 4, 0, SV("12345"), 2, 3, S("abcd345e"));
+ test(S("abcde"), 4, 0, SV("12345"), 2, 4, S("abcd345e"));
+}
+
+template <class S, class SV>
+void test15()
+{
+ test(S("abcde"), 4, 0, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345"), 4, 1, S("abcd5e"));
+ test(S("abcde"), 4, 0, SV("12345"), 4, 2, S("abcd5e"));
+ test(S("abcde"), 4, 0, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 0, 1, S("abcd1e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 0, 5, S("abcd12345e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 0, 9, S("abcd123456789e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 0, 10, S("abcd1234567890e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 0, 11, S("abcd1234567890e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 1, 1, S("abcd2e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 1, 4, S("abcd2345e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 1, 8, S("abcd23456789e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 1, 9, S("abcd234567890e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 1, 10, S("abcd234567890e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 5, 1, S("abcd6e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 5, 2, S("abcd67e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 5, 4, S("abcd6789e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 5, 5, S("abcd67890e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 5, 6, S("abcd67890e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 9, 1, S("abcd0e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 9, 2, S("abcd0e"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 4, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 0, 1, S("abcd1e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 0, 10, S("abcd1234567890e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 0, 19, S("abcd1234567890123456789e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 0, 20, S("abcd12345678901234567890e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 0, 21, S("abcd12345678901234567890e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 1, 1, S("abcd2e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 1, 9, S("abcd234567890e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 1, 18, S("abcd234567890123456789e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 1, 19, S("abcd2345678901234567890e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 1, 20, S("abcd2345678901234567890e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 10, 1, S("abcd1e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 10, 5, S("abcd12345e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 10, 9, S("abcd123456789e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 10, 10, S("abcd1234567890e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 10, 11, S("abcd1234567890e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 19, 1, S("abcd0e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 19, 2, S("abcd0e"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 4, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 4, 1, SV(""), 0, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV(""), 0, 1, S("abcd"));
+ test(S("abcde"), 4, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 4, 1, SV("12345"), 0, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345"), 0, 1, S("abcd1"));
+ test(S("abcde"), 4, 1, SV("12345"), 0, 2, S("abcd12"));
+ test(S("abcde"), 4, 1, SV("12345"), 0, 4, S("abcd1234"));
+ test(S("abcde"), 4, 1, SV("12345"), 0, 5, S("abcd12345"));
+ test(S("abcde"), 4, 1, SV("12345"), 0, 6, S("abcd12345"));
+ test(S("abcde"), 4, 1, SV("12345"), 1, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345"), 1, 1, S("abcd2"));
+ test(S("abcde"), 4, 1, SV("12345"), 1, 2, S("abcd23"));
+ test(S("abcde"), 4, 1, SV("12345"), 1, 3, S("abcd234"));
+ test(S("abcde"), 4, 1, SV("12345"), 1, 4, S("abcd2345"));
+ test(S("abcde"), 4, 1, SV("12345"), 1, 5, S("abcd2345"));
+ test(S("abcde"), 4, 1, SV("12345"), 2, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345"), 2, 1, S("abcd3"));
+ test(S("abcde"), 4, 1, SV("12345"), 2, 2, S("abcd34"));
+ test(S("abcde"), 4, 1, SV("12345"), 2, 3, S("abcd345"));
+ test(S("abcde"), 4, 1, SV("12345"), 2, 4, S("abcd345"));
+ test(S("abcde"), 4, 1, SV("12345"), 4, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345"), 4, 1, S("abcd5"));
+ test(S("abcde"), 4, 1, SV("12345"), 4, 2, S("abcd5"));
+ test(S("abcde"), 4, 1, SV("12345"), 5, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345"), 5, 1, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 0, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 0, 1, S("abcd1"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 0, 5, S("abcd12345"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 0, 9, S("abcd123456789"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 0, 10, S("abcd1234567890"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 0, 11, S("abcd1234567890"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 1, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 1, 1, S("abcd2"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 1, 4, S("abcd2345"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 1, 8, S("abcd23456789"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 1, 9, S("abcd234567890"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 1, 10, S("abcd234567890"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 5, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 5, 1, S("abcd6"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 5, 2, S("abcd67"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 5, 4, S("abcd6789"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 5, 5, S("abcd67890"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 5, 6, S("abcd67890"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 9, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 9, 1, S("abcd0"));
+}
+
+template <class S, class SV>
+void test16()
+{
+ test(S("abcde"), 4, 1, SV("1234567890"), 9, 2, S("abcd0"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 10, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 10, 1, S("abcd"));
+ test(S("abcde"), 4, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 0, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 0, 1, S("abcd1"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 0, 10, S("abcd1234567890"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 0, 19, S("abcd1234567890123456789"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 0, 20, S("abcd12345678901234567890"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 0, 21, S("abcd12345678901234567890"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 1, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 1, 1, S("abcd2"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 1, 9, S("abcd234567890"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 1, 18, S("abcd234567890123456789"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 1, 19, S("abcd2345678901234567890"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 1, 20, S("abcd2345678901234567890"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 10, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 10, 1, S("abcd1"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 10, 5, S("abcd12345"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 10, 9, S("abcd123456789"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 10, 10, S("abcd1234567890"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 10, 11, S("abcd1234567890"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 19, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 19, 1, S("abcd0"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 19, 2, S("abcd0"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 20, 0, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 20, 1, S("abcd"));
+ test(S("abcde"), 4, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 4, 2, SV(""), 0, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV(""), 0, 1, S("abcd"));
+ test(S("abcde"), 4, 2, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 4, 2, SV("12345"), 0, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345"), 0, 1, S("abcd1"));
+ test(S("abcde"), 4, 2, SV("12345"), 0, 2, S("abcd12"));
+ test(S("abcde"), 4, 2, SV("12345"), 0, 4, S("abcd1234"));
+ test(S("abcde"), 4, 2, SV("12345"), 0, 5, S("abcd12345"));
+ test(S("abcde"), 4, 2, SV("12345"), 0, 6, S("abcd12345"));
+ test(S("abcde"), 4, 2, SV("12345"), 1, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345"), 1, 1, S("abcd2"));
+ test(S("abcde"), 4, 2, SV("12345"), 1, 2, S("abcd23"));
+ test(S("abcde"), 4, 2, SV("12345"), 1, 3, S("abcd234"));
+ test(S("abcde"), 4, 2, SV("12345"), 1, 4, S("abcd2345"));
+ test(S("abcde"), 4, 2, SV("12345"), 1, 5, S("abcd2345"));
+ test(S("abcde"), 4, 2, SV("12345"), 2, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345"), 2, 1, S("abcd3"));
+ test(S("abcde"), 4, 2, SV("12345"), 2, 2, S("abcd34"));
+ test(S("abcde"), 4, 2, SV("12345"), 2, 3, S("abcd345"));
+ test(S("abcde"), 4, 2, SV("12345"), 2, 4, S("abcd345"));
+ test(S("abcde"), 4, 2, SV("12345"), 4, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345"), 4, 1, S("abcd5"));
+ test(S("abcde"), 4, 2, SV("12345"), 4, 2, S("abcd5"));
+ test(S("abcde"), 4, 2, SV("12345"), 5, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345"), 5, 1, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 0, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 0, 1, S("abcd1"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 0, 5, S("abcd12345"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 0, 9, S("abcd123456789"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 0, 10, S("abcd1234567890"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 0, 11, S("abcd1234567890"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 1, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 1, 1, S("abcd2"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 1, 4, S("abcd2345"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 1, 8, S("abcd23456789"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 1, 9, S("abcd234567890"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 1, 10, S("abcd234567890"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 5, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 5, 1, S("abcd6"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 5, 2, S("abcd67"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 5, 4, S("abcd6789"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 5, 5, S("abcd67890"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 5, 6, S("abcd67890"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 9, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 9, 1, S("abcd0"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 9, 2, S("abcd0"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 10, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 10, 1, S("abcd"));
+ test(S("abcde"), 4, 2, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 0, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 0, 1, S("abcd1"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 0, 10, S("abcd1234567890"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 0, 19, S("abcd1234567890123456789"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 0, 20, S("abcd12345678901234567890"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 0, 21, S("abcd12345678901234567890"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 1, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 1, 1, S("abcd2"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 1, 9, S("abcd234567890"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 1, 18, S("abcd234567890123456789"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 1, 19, S("abcd2345678901234567890"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 1, 20, S("abcd2345678901234567890"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 10, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 10, 1, S("abcd1"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 10, 5, S("abcd12345"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 10, 9, S("abcd123456789"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 10, 10, S("abcd1234567890"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 10, 11, S("abcd1234567890"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 19, 0, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 19, 1, S("abcd0"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 19, 2, S("abcd0"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 20, 0, S("abcd"));
+}
+
+template <class S, class SV>
+void test17()
+{
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 20, 1, S("abcd"));
+ test(S("abcde"), 4, 2, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 5, 0, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV(""), 0, 1, S("abcde"));
+ test(S("abcde"), 5, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 5, 0, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345"), 0, 1, S("abcde1"));
+ test(S("abcde"), 5, 0, SV("12345"), 0, 2, S("abcde12"));
+ test(S("abcde"), 5, 0, SV("12345"), 0, 4, S("abcde1234"));
+ test(S("abcde"), 5, 0, SV("12345"), 0, 5, S("abcde12345"));
+ test(S("abcde"), 5, 0, SV("12345"), 0, 6, S("abcde12345"));
+ test(S("abcde"), 5, 0, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345"), 1, 1, S("abcde2"));
+ test(S("abcde"), 5, 0, SV("12345"), 1, 2, S("abcde23"));
+ test(S("abcde"), 5, 0, SV("12345"), 1, 3, S("abcde234"));
+ test(S("abcde"), 5, 0, SV("12345"), 1, 4, S("abcde2345"));
+ test(S("abcde"), 5, 0, SV("12345"), 1, 5, S("abcde2345"));
+ test(S("abcde"), 5, 0, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345"), 2, 1, S("abcde3"));
+ test(S("abcde"), 5, 0, SV("12345"), 2, 2, S("abcde34"));
+ test(S("abcde"), 5, 0, SV("12345"), 2, 3, S("abcde345"));
+ test(S("abcde"), 5, 0, SV("12345"), 2, 4, S("abcde345"));
+ test(S("abcde"), 5, 0, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345"), 4, 1, S("abcde5"));
+ test(S("abcde"), 5, 0, SV("12345"), 4, 2, S("abcde5"));
+ test(S("abcde"), 5, 0, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 0, 1, S("abcde1"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 0, 5, S("abcde12345"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 0, 9, S("abcde123456789"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 0, 10, S("abcde1234567890"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 0, 11, S("abcde1234567890"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 1, 1, S("abcde2"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 1, 4, S("abcde2345"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 1, 8, S("abcde23456789"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 1, 9, S("abcde234567890"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 1, 10, S("abcde234567890"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 5, 1, S("abcde6"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 5, 2, S("abcde67"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 5, 4, S("abcde6789"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 5, 5, S("abcde67890"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 5, 6, S("abcde67890"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 9, 1, S("abcde0"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 9, 2, S("abcde0"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 5, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 0, 1, S("abcde1"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 0, 10, S("abcde1234567890"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 0, 19, S("abcde1234567890123456789"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 0, 20, S("abcde12345678901234567890"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 0, 21, S("abcde12345678901234567890"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 1, 1, S("abcde2"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 1, 9, S("abcde234567890"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 1, 18, S("abcde234567890123456789"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 1, 19, S("abcde2345678901234567890"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 1, 20, S("abcde2345678901234567890"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 10, 1, S("abcde1"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 10, 5, S("abcde12345"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 10, 9, S("abcde123456789"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 10, 10, S("abcde1234567890"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 10, 11, S("abcde1234567890"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 19, 1, S("abcde0"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 19, 2, S("abcde0"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 5, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 5, 1, SV(""), 0, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV(""), 0, 1, S("abcde"));
+ test(S("abcde"), 5, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 5, 1, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345"), 0, 1, S("abcde1"));
+ test(S("abcde"), 5, 1, SV("12345"), 0, 2, S("abcde12"));
+ test(S("abcde"), 5, 1, SV("12345"), 0, 4, S("abcde1234"));
+ test(S("abcde"), 5, 1, SV("12345"), 0, 5, S("abcde12345"));
+ test(S("abcde"), 5, 1, SV("12345"), 0, 6, S("abcde12345"));
+ test(S("abcde"), 5, 1, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345"), 1, 1, S("abcde2"));
+ test(S("abcde"), 5, 1, SV("12345"), 1, 2, S("abcde23"));
+ test(S("abcde"), 5, 1, SV("12345"), 1, 3, S("abcde234"));
+ test(S("abcde"), 5, 1, SV("12345"), 1, 4, S("abcde2345"));
+ test(S("abcde"), 5, 1, SV("12345"), 1, 5, S("abcde2345"));
+ test(S("abcde"), 5, 1, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345"), 2, 1, S("abcde3"));
+ test(S("abcde"), 5, 1, SV("12345"), 2, 2, S("abcde34"));
+ test(S("abcde"), 5, 1, SV("12345"), 2, 3, S("abcde345"));
+ test(S("abcde"), 5, 1, SV("12345"), 2, 4, S("abcde345"));
+ test(S("abcde"), 5, 1, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345"), 4, 1, S("abcde5"));
+ test(S("abcde"), 5, 1, SV("12345"), 4, 2, S("abcde5"));
+ test(S("abcde"), 5, 1, SV("12345"), 5, 0, S("abcde"));
+}
+
+template <class S, class SV>
+void test18()
+{
+ test(S("abcde"), 5, 1, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 0, 1, S("abcde1"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 0, 5, S("abcde12345"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 0, 9, S("abcde123456789"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 0, 10, S("abcde1234567890"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 0, 11, S("abcde1234567890"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 1, 1, S("abcde2"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 1, 4, S("abcde2345"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 1, 8, S("abcde23456789"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 1, 9, S("abcde234567890"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 1, 10, S("abcde234567890"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 5, 1, S("abcde6"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 5, 2, S("abcde67"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 5, 4, S("abcde6789"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 5, 5, S("abcde67890"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 5, 6, S("abcde67890"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 9, 1, S("abcde0"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 9, 2, S("abcde0"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcde"), 5, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 0, 1, S("abcde1"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 0, 10, S("abcde1234567890"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 0, 19, S("abcde1234567890123456789"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 0, 20, S("abcde12345678901234567890"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 0, 21, S("abcde12345678901234567890"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 1, 1, S("abcde2"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 1, 9, S("abcde234567890"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 1, 18, S("abcde234567890123456789"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 1, 19, S("abcde2345678901234567890"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 1, 20, S("abcde2345678901234567890"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 10, 1, S("abcde1"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 10, 5, S("abcde12345"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 10, 9, S("abcde123456789"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 10, 10, S("abcde1234567890"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 10, 11, S("abcde1234567890"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 19, 1, S("abcde0"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 19, 2, S("abcde0"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcde"), 5, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV(""), 0, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV(""), 0, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 0, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 0, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 0, 2, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 0, 4, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 0, 5, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 0, 6, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 1, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 1, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 1, 2, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 1, 3, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 1, 4, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 1, 5, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 2, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 2, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 2, 2, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 2, 3, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 2, 4, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 4, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 4, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 4, 2, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 5, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 5, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 0, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 0, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 0, 5, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 0, 9, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 0, 10, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 0, 11, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 1, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 1, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 1, 4, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 1, 8, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 1, 9, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 1, 10, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 5, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 5, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 5, 2, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 5, 4, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 5, 5, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 5, 6, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 9, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 9, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 9, 2, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 10, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 10, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("1234567890"), 11, 0, S("can't happen"));
+}
+
+template <class S, class SV>
+void test19()
+{
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 0, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 0, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 0, 10, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 0, 19, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 0, 20, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 0, 21, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 1, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 1, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 1, 9, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 1, 18, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 1, 19, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 1, 20, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 10, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 10, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 10, 5, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 10, 9, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 10, 10, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 10, 11, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 19, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 19, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 19, 2, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 20, 0, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 20, 1, S("can't happen"));
+ test(S("abcde"), 6, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 0, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 0, 1, S("1abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 0, 2, S("12abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 0, 4, S("1234abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 0, 5, S("12345abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 0, 6, S("12345abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 1, 1, S("2abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 1, 2, S("23abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 1, 3, S("234abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 1, 4, S("2345abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 1, 5, S("2345abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 2, 1, S("3abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 2, 2, S("34abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 2, 3, S("345abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 2, 4, S("345abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 4, 1, S("5abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 4, 2, S("5abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 0, 1, S("1abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 0, 5, S("12345abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 0, 9, S("123456789abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 0, 10, S("1234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 0, 11, S("1234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 1, 1, S("2abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 1, 4, S("2345abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 1, 8, S("23456789abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 1, 9, S("234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 1, 10, S("234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 5, 1, S("6abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 5, 2, S("67abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 5, 4, S("6789abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 5, 5, S("67890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 5, 6, S("67890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 9, 1, S("0abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 9, 2, S("0abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 0, 1, S("1abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 0, 10, S("1234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 0, 19, S("1234567890123456789abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 0, 20, S("12345678901234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 0, 21, S("12345678901234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 1, 1, S("2abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 1, 9, S("234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 1, 18, S("234567890123456789abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 1, 19, S("2345678901234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 1, 20, S("2345678901234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 10, 1, S("1abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 10, 5, S("12345abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 10, 9, S("123456789abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 10, 10, S("1234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 10, 11, S("1234567890abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 19, 1, S("0abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 19, 2, S("0abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 0, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 1, SV(""), 0, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV(""), 0, 1, S("bcdefghij"));
+}
+
+template <class S, class SV>
+void test20()
+{
+ test(S("abcdefghij"), 0, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 0, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 0, 1, S("1bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 0, 2, S("12bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 0, 4, S("1234bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 0, 5, S("12345bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 0, 6, S("12345bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 1, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 1, 1, S("2bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 1, 2, S("23bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 1, 3, S("234bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 1, 4, S("2345bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 1, 5, S("2345bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 2, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 2, 1, S("3bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 2, 2, S("34bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 2, 3, S("345bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 2, 4, S("345bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 4, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 4, 1, S("5bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 4, 2, S("5bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 5, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 5, 1, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 0, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 0, 1, S("1bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 0, 5, S("12345bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 0, 9, S("123456789bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 0, 10, S("1234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 0, 11, S("1234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 1, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 1, 1, S("2bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 1, 4, S("2345bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 1, 8, S("23456789bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 1, 9, S("234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 1, 10, S("234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 5, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 5, 1, S("6bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 5, 2, S("67bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 5, 4, S("6789bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 5, 5, S("67890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 5, 6, S("67890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 9, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 9, 1, S("0bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 9, 2, S("0bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 10, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 10, 1, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 0, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 0, 1, S("1bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 0, 10, S("1234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 0, 19, S("1234567890123456789bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 0, 20, S("12345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 0, 21, S("12345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 1, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 1, 1, S("2bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 1, 9, S("234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 1, 18, S("234567890123456789bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 1, 19, S("2345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 1, 20, S("2345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 10, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 10, 1, S("1bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 10, 5, S("12345bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 10, 9, S("123456789bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 10, 10, S("1234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 10, 11, S("1234567890bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 19, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 19, 1, S("0bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 19, 2, S("0bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 20, 0, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 20, 1, S("bcdefghij"));
+ test(S("abcdefghij"), 0, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 5, SV(""), 0, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV(""), 0, 1, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 0, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 0, 1, S("1fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 0, 2, S("12fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 0, 4, S("1234fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 0, 5, S("12345fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 0, 6, S("12345fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 1, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 1, 1, S("2fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 1, 2, S("23fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 1, 3, S("234fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 1, 4, S("2345fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 1, 5, S("2345fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 2, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 2, 1, S("3fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 2, 2, S("34fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 2, 3, S("345fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 2, 4, S("345fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 4, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 4, 1, S("5fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 4, 2, S("5fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 5, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 5, 1, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 0, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 0, 1, S("1fghij"));
+}
+
+template <class S, class SV>
+void test21()
+{
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 0, 5, S("12345fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 0, 9, S("123456789fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 0, 10, S("1234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 0, 11, S("1234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 1, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 1, 1, S("2fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 1, 4, S("2345fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 1, 8, S("23456789fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 1, 9, S("234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 1, 10, S("234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 5, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 5, 1, S("6fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 5, 2, S("67fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 5, 4, S("6789fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 5, 5, S("67890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 5, 6, S("67890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 9, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 9, 1, S("0fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 9, 2, S("0fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 10, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 10, 1, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 0, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 0, 1, S("1fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 0, 10, S("1234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 0, 19, S("1234567890123456789fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 0, 20, S("12345678901234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 0, 21, S("12345678901234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 1, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 1, 1, S("2fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 1, 9, S("234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 1, 18, S("234567890123456789fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 1, 19, S("2345678901234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 1, 20, S("2345678901234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 10, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 10, 1, S("1fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 10, 5, S("12345fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 10, 9, S("123456789fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 10, 10, S("1234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 10, 11, S("1234567890fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 19, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 19, 1, S("0fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 19, 2, S("0fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 20, 0, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 20, 1, S("fghij"));
+ test(S("abcdefghij"), 0, 5, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 9, SV(""), 0, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV(""), 0, 1, S("j"));
+ test(S("abcdefghij"), 0, 9, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 0, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 0, 1, S("1j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 0, 2, S("12j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 0, 4, S("1234j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 0, 5, S("12345j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 0, 6, S("12345j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 1, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 1, 1, S("2j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 1, 2, S("23j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 1, 3, S("234j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 1, 4, S("2345j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 1, 5, S("2345j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 2, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 2, 1, S("3j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 2, 2, S("34j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 2, 3, S("345j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 2, 4, S("345j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 4, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 4, 1, S("5j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 4, 2, S("5j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 5, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 5, 1, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 0, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 0, 1, S("1j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 0, 5, S("12345j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 0, 9, S("123456789j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 0, 10, S("1234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 0, 11, S("1234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 1, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 1, 1, S("2j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 1, 4, S("2345j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 1, 8, S("23456789j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 1, 9, S("234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 1, 10, S("234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 5, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 5, 1, S("6j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 5, 2, S("67j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 5, 4, S("6789j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 5, 5, S("67890j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 5, 6, S("67890j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 9, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 9, 1, S("0j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 9, 2, S("0j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 10, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 10, 1, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 0, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 0, 1, S("1j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 0, 10, S("1234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 0, 19, S("1234567890123456789j"));
+}
+
+template <class S, class SV>
+void test22()
+{
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 0, 20, S("12345678901234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 0, 21, S("12345678901234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 1, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 1, 1, S("2j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 1, 9, S("234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 1, 18, S("234567890123456789j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 1, 19, S("2345678901234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 1, 20, S("2345678901234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 10, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 10, 1, S("1j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 10, 5, S("12345j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 10, 9, S("123456789j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 10, 10, S("1234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 10, 11, S("1234567890j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 19, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 19, 1, S("0j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 19, 2, S("0j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 20, 0, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 20, 1, S("j"));
+ test(S("abcdefghij"), 0, 9, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 10, SV(""), 0, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV(""), 0, 1, S(""));
+ test(S("abcdefghij"), 0, 10, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 0, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 0, 1, S("1"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 0, 2, S("12"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 0, 4, S("1234"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 0, 5, S("12345"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 0, 6, S("12345"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 1, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 1, 1, S("2"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 1, 2, S("23"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 1, 3, S("234"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 1, 4, S("2345"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 1, 5, S("2345"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 2, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 2, 1, S("3"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 2, 2, S("34"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 2, 3, S("345"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 2, 4, S("345"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 4, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 4, 1, S("5"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 4, 2, S("5"));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 5, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 5, 1, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 0, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 0, 1, S("1"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 0, 5, S("12345"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 0, 9, S("123456789"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 0, 10, S("1234567890"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 0, 11, S("1234567890"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 1, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 1, 1, S("2"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 1, 4, S("2345"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 1, 8, S("23456789"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 1, 9, S("234567890"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 1, 10, S("234567890"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 5, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 5, 1, S("6"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 5, 2, S("67"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 5, 4, S("6789"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 5, 5, S("67890"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 5, 6, S("67890"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 9, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 9, 1, S("0"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 9, 2, S("0"));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 10, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 10, 1, S(""));
+ test(S("abcdefghij"), 0, 10, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 0, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 0, 1, S("1"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 0, 10, S("1234567890"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 0, 19, S("1234567890123456789"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 0, 20, S("12345678901234567890"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 0, 21, S("12345678901234567890"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 1, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 1, 1, S("2"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 1, 9, S("234567890"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 1, 18, S("234567890123456789"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 1, 19, S("2345678901234567890"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 1, 20, S("2345678901234567890"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 10, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 10, 1, S("1"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 10, 5, S("12345"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 10, 9, S("123456789"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 10, 10, S("1234567890"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 10, 11, S("1234567890"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 19, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 19, 1, S("0"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 19, 2, S("0"));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 20, 0, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 20, 1, S(""));
+ test(S("abcdefghij"), 0, 10, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 11, SV(""), 0, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV(""), 0, 1, S(""));
+ test(S("abcdefghij"), 0, 11, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 0, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 0, 1, S("1"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 0, 2, S("12"));
+}
+
+template <class S, class SV>
+void test23()
+{
+ test(S("abcdefghij"), 0, 11, SV("12345"), 0, 4, S("1234"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 0, 5, S("12345"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 0, 6, S("12345"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 1, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 1, 1, S("2"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 1, 2, S("23"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 1, 3, S("234"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 1, 4, S("2345"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 1, 5, S("2345"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 2, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 2, 1, S("3"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 2, 2, S("34"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 2, 3, S("345"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 2, 4, S("345"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 4, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 4, 1, S("5"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 4, 2, S("5"));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 5, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 5, 1, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 0, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 0, 1, S("1"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 0, 5, S("12345"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 0, 9, S("123456789"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 0, 10, S("1234567890"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 0, 11, S("1234567890"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 1, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 1, 1, S("2"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 1, 4, S("2345"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 1, 8, S("23456789"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 1, 9, S("234567890"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 1, 10, S("234567890"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 5, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 5, 1, S("6"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 5, 2, S("67"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 5, 4, S("6789"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 5, 5, S("67890"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 5, 6, S("67890"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 9, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 9, 1, S("0"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 9, 2, S("0"));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 10, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 10, 1, S(""));
+ test(S("abcdefghij"), 0, 11, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 0, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 0, 1, S("1"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 0, 10, S("1234567890"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 0, 19, S("1234567890123456789"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 0, 20, S("12345678901234567890"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 0, 21, S("12345678901234567890"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 1, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 1, 1, S("2"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 1, 9, S("234567890"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 1, 18, S("234567890123456789"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 1, 19, S("2345678901234567890"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 1, 20, S("2345678901234567890"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 10, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 10, 1, S("1"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 10, 5, S("12345"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 10, 9, S("123456789"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 10, 10, S("1234567890"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 10, 11, S("1234567890"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 19, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 19, 1, S("0"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 19, 2, S("0"));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 20, 0, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 20, 1, S(""));
+ test(S("abcdefghij"), 0, 11, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 0, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 0, 1, S("a1bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 0, 2, S("a12bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 0, 4, S("a1234bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 0, 5, S("a12345bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 0, 6, S("a12345bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 1, 1, S("a2bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 1, 2, S("a23bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 1, 3, S("a234bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 1, 4, S("a2345bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 1, 5, S("a2345bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 2, 1, S("a3bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 2, 2, S("a34bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 2, 3, S("a345bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 2, 4, S("a345bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 4, 1, S("a5bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 4, 2, S("a5bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 0, 1, S("a1bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 0, 5, S("a12345bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 0, 9, S("a123456789bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 0, 10, S("a1234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 0, 11, S("a1234567890bcdefghij"));
+}
+
+template <class S, class SV>
+void test24()
+{
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 1, 1, S("a2bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 1, 4, S("a2345bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 1, 8, S("a23456789bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 1, 9, S("a234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 1, 10, S("a234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 5, 1, S("a6bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 5, 2, S("a67bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 5, 4, S("a6789bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 5, 5, S("a67890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 5, 6, S("a67890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 9, 1, S("a0bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 9, 2, S("a0bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 0, 1, S("a1bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 0, 10, S("a1234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 0, 19, S("a1234567890123456789bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 0, 20, S("a12345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 0, 21, S("a12345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 1, 1, S("a2bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 1, 9, S("a234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 1, 18, S("a234567890123456789bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 1, 19, S("a2345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 1, 20, S("a2345678901234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 10, 1, S("a1bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 10, 5, S("a12345bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 10, 9, S("a123456789bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 10, 10, S("a1234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 10, 11, S("a1234567890bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 19, 1, S("a0bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 19, 2, S("a0bcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 1, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 1, SV(""), 0, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV(""), 0, 1, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 0, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 0, 1, S("a1cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 0, 2, S("a12cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 0, 4, S("a1234cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 0, 5, S("a12345cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 0, 6, S("a12345cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 1, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 1, 1, S("a2cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 1, 2, S("a23cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 1, 3, S("a234cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 1, 4, S("a2345cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 1, 5, S("a2345cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 2, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 2, 1, S("a3cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 2, 2, S("a34cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 2, 3, S("a345cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 2, 4, S("a345cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 4, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 4, 1, S("a5cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 4, 2, S("a5cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 5, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 5, 1, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 0, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 0, 1, S("a1cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 0, 5, S("a12345cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 0, 9, S("a123456789cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 0, 10, S("a1234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 0, 11, S("a1234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 1, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 1, 1, S("a2cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 1, 4, S("a2345cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 1, 8, S("a23456789cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 1, 9, S("a234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 1, 10, S("a234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 5, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 5, 1, S("a6cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 5, 2, S("a67cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 5, 4, S("a6789cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 5, 5, S("a67890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 5, 6, S("a67890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 9, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 9, 1, S("a0cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 9, 2, S("a0cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 10, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 10, 1, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 0, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 0, 1, S("a1cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 0, 10, S("a1234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 0, 19, S("a1234567890123456789cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 0, 20, S("a12345678901234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 0, 21, S("a12345678901234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 1, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 1, 1, S("a2cdefghij"));
+}
+
+template <class S, class SV>
+void test25()
+{
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 1, 9, S("a234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 1, 18, S("a234567890123456789cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 1, 19, S("a2345678901234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 1, 20, S("a2345678901234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 10, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 10, 1, S("a1cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 10, 5, S("a12345cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 10, 9, S("a123456789cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 10, 10, S("a1234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 10, 11, S("a1234567890cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 19, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 19, 1, S("a0cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 19, 2, S("a0cdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 20, 0, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 20, 1, S("acdefghij"));
+ test(S("abcdefghij"), 1, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 4, SV(""), 0, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV(""), 0, 1, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 0, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 0, 1, S("a1fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 0, 2, S("a12fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 0, 4, S("a1234fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 0, 5, S("a12345fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 0, 6, S("a12345fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 1, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 1, 1, S("a2fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 1, 2, S("a23fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 1, 3, S("a234fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 1, 4, S("a2345fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 1, 5, S("a2345fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 2, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 2, 1, S("a3fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 2, 2, S("a34fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 2, 3, S("a345fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 2, 4, S("a345fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 4, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 4, 1, S("a5fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 4, 2, S("a5fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 5, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 5, 1, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 0, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 0, 1, S("a1fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 0, 5, S("a12345fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 0, 9, S("a123456789fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 0, 10, S("a1234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 0, 11, S("a1234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 1, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 1, 1, S("a2fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 1, 4, S("a2345fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 1, 8, S("a23456789fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 1, 9, S("a234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 1, 10, S("a234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 5, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 5, 1, S("a6fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 5, 2, S("a67fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 5, 4, S("a6789fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 5, 5, S("a67890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 5, 6, S("a67890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 9, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 9, 1, S("a0fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 9, 2, S("a0fghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 10, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 10, 1, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 0, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 0, 1, S("a1fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 0, 10, S("a1234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 0, 19, S("a1234567890123456789fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 0, 20, S("a12345678901234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 0, 21, S("a12345678901234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 1, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 1, 1, S("a2fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 1, 9, S("a234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 1, 18, S("a234567890123456789fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 1, 19, S("a2345678901234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 1, 20, S("a2345678901234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 10, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 10, 1, S("a1fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 10, 5, S("a12345fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 10, 9, S("a123456789fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 10, 10, S("a1234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 10, 11, S("a1234567890fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 19, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 19, 1, S("a0fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 19, 2, S("a0fghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 20, 0, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 20, 1, S("afghij"));
+ test(S("abcdefghij"), 1, 4, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 8, SV(""), 0, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV(""), 0, 1, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 0, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 0, 1, S("a1j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 0, 2, S("a12j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 0, 4, S("a1234j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 0, 5, S("a12345j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 0, 6, S("a12345j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 1, 0, S("aj"));
+}
+
+template <class S, class SV>
+void test26()
+{
+ test(S("abcdefghij"), 1, 8, SV("12345"), 1, 1, S("a2j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 1, 2, S("a23j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 1, 3, S("a234j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 1, 4, S("a2345j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 1, 5, S("a2345j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 2, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 2, 1, S("a3j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 2, 2, S("a34j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 2, 3, S("a345j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 2, 4, S("a345j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 4, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 4, 1, S("a5j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 4, 2, S("a5j"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 5, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 5, 1, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 0, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 0, 1, S("a1j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 0, 5, S("a12345j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 0, 9, S("a123456789j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 0, 10, S("a1234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 0, 11, S("a1234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 1, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 1, 1, S("a2j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 1, 4, S("a2345j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 1, 8, S("a23456789j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 1, 9, S("a234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 1, 10, S("a234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 5, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 5, 1, S("a6j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 5, 2, S("a67j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 5, 4, S("a6789j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 5, 5, S("a67890j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 5, 6, S("a67890j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 9, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 9, 1, S("a0j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 9, 2, S("a0j"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 10, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 10, 1, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 0, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 0, 1, S("a1j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 0, 10, S("a1234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 0, 19, S("a1234567890123456789j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 0, 20, S("a12345678901234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 0, 21, S("a12345678901234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 1, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 1, 1, S("a2j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 1, 9, S("a234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 1, 18, S("a234567890123456789j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 1, 19, S("a2345678901234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 1, 20, S("a2345678901234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 10, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 10, 1, S("a1j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 10, 5, S("a12345j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 10, 9, S("a123456789j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 10, 10, S("a1234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 10, 11, S("a1234567890j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 19, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 19, 1, S("a0j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 19, 2, S("a0j"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 20, 0, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 20, 1, S("aj"));
+ test(S("abcdefghij"), 1, 8, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 9, SV(""), 0, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV(""), 0, 1, S("a"));
+ test(S("abcdefghij"), 1, 9, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 0, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 0, 1, S("a1"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 0, 2, S("a12"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 0, 4, S("a1234"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 0, 5, S("a12345"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 0, 6, S("a12345"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 1, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 1, 1, S("a2"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 1, 2, S("a23"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 1, 3, S("a234"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 1, 4, S("a2345"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 1, 5, S("a2345"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 2, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 2, 1, S("a3"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 2, 2, S("a34"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 2, 3, S("a345"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 2, 4, S("a345"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 4, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 4, 1, S("a5"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 4, 2, S("a5"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 5, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 5, 1, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 0, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 0, 1, S("a1"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 0, 5, S("a12345"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 0, 9, S("a123456789"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 0, 10, S("a1234567890"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 0, 11, S("a1234567890"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 1, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 1, 1, S("a2"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 1, 4, S("a2345"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 1, 8, S("a23456789"));
+}
+
+template <class S, class SV>
+void test27()
+{
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 1, 9, S("a234567890"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 1, 10, S("a234567890"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 5, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 5, 1, S("a6"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 5, 2, S("a67"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 5, 4, S("a6789"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 5, 5, S("a67890"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 5, 6, S("a67890"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 9, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 9, 1, S("a0"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 9, 2, S("a0"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 10, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 10, 1, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 0, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 0, 1, S("a1"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 0, 10, S("a1234567890"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 0, 19, S("a1234567890123456789"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 0, 20, S("a12345678901234567890"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 0, 21, S("a12345678901234567890"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 1, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 1, 1, S("a2"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 1, 9, S("a234567890"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 1, 18, S("a234567890123456789"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 1, 19, S("a2345678901234567890"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 1, 20, S("a2345678901234567890"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 10, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 10, 1, S("a1"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 10, 5, S("a12345"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 10, 9, S("a123456789"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 10, 10, S("a1234567890"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 10, 11, S("a1234567890"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 19, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 19, 1, S("a0"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 19, 2, S("a0"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 20, 0, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 20, 1, S("a"));
+ test(S("abcdefghij"), 1, 9, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 10, SV(""), 0, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV(""), 0, 1, S("a"));
+ test(S("abcdefghij"), 1, 10, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 0, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 0, 1, S("a1"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 0, 2, S("a12"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 0, 4, S("a1234"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 0, 5, S("a12345"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 0, 6, S("a12345"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 1, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 1, 1, S("a2"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 1, 2, S("a23"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 1, 3, S("a234"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 1, 4, S("a2345"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 1, 5, S("a2345"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 2, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 2, 1, S("a3"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 2, 2, S("a34"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 2, 3, S("a345"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 2, 4, S("a345"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 4, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 4, 1, S("a5"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 4, 2, S("a5"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 5, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 5, 1, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 0, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 0, 1, S("a1"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 0, 5, S("a12345"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 0, 9, S("a123456789"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 0, 10, S("a1234567890"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 0, 11, S("a1234567890"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 1, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 1, 1, S("a2"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 1, 4, S("a2345"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 1, 8, S("a23456789"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 1, 9, S("a234567890"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 1, 10, S("a234567890"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 5, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 5, 1, S("a6"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 5, 2, S("a67"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 5, 4, S("a6789"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 5, 5, S("a67890"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 5, 6, S("a67890"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 9, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 9, 1, S("a0"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 9, 2, S("a0"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 10, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 10, 1, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 0, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 0, 1, S("a1"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 0, 10, S("a1234567890"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 0, 19, S("a1234567890123456789"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 0, 20, S("a12345678901234567890"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 0, 21, S("a12345678901234567890"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 1, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 1, 1, S("a2"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 1, 9, S("a234567890"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 1, 18, S("a234567890123456789"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 1, 19, S("a2345678901234567890"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 1, 20, S("a2345678901234567890"));
+}
+
+template <class S, class SV>
+void test28()
+{
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 10, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 10, 1, S("a1"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 10, 5, S("a12345"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 10, 9, S("a123456789"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 10, 10, S("a1234567890"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 10, 11, S("a1234567890"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 19, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 19, 1, S("a0"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 19, 2, S("a0"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 20, 0, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 20, 1, S("a"));
+ test(S("abcdefghij"), 1, 10, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 0, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 0, 1, S("abcde1fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 0, 2, S("abcde12fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 0, 4, S("abcde1234fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 0, 5, S("abcde12345fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 0, 6, S("abcde12345fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 1, 1, S("abcde2fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 1, 2, S("abcde23fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 1, 3, S("abcde234fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 1, 4, S("abcde2345fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 1, 5, S("abcde2345fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 2, 1, S("abcde3fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 2, 2, S("abcde34fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 2, 3, S("abcde345fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 2, 4, S("abcde345fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 4, 1, S("abcde5fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 4, 2, S("abcde5fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 0, 1, S("abcde1fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 0, 5, S("abcde12345fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 0, 9, S("abcde123456789fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 0, 10, S("abcde1234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 0, 11, S("abcde1234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 1, 1, S("abcde2fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 1, 4, S("abcde2345fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 1, 8, S("abcde23456789fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 1, 9, S("abcde234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 1, 10, S("abcde234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 5, 1, S("abcde6fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 5, 2, S("abcde67fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 5, 4, S("abcde6789fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 5, 5, S("abcde67890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 5, 6, S("abcde67890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 9, 1, S("abcde0fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 9, 2, S("abcde0fghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 0, 1, S("abcde1fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 0, 10, S("abcde1234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 0, 19, S("abcde1234567890123456789fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 0, 20, S("abcde12345678901234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 0, 21, S("abcde12345678901234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 1, 1, S("abcde2fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 1, 9, S("abcde234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 1, 18, S("abcde234567890123456789fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 1, 19, S("abcde2345678901234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 1, 20, S("abcde2345678901234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 10, 1, S("abcde1fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 10, 5, S("abcde12345fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 10, 9, S("abcde123456789fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 10, 10, S("abcde1234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 10, 11, S("abcde1234567890fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 19, 1, S("abcde0fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 19, 2, S("abcde0fghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 5, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 1, SV(""), 0, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV(""), 0, 1, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 0, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 0, 1, S("abcde1ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 0, 2, S("abcde12ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 0, 4, S("abcde1234ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 0, 5, S("abcde12345ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 0, 6, S("abcde12345ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 1, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 1, 1, S("abcde2ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 1, 2, S("abcde23ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 1, 3, S("abcde234ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 1, 4, S("abcde2345ghij"));
+}
+
+template <class S, class SV>
+void test29()
+{
+ test(S("abcdefghij"), 5, 1, SV("12345"), 1, 5, S("abcde2345ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 2, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 2, 1, S("abcde3ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 2, 2, S("abcde34ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 2, 3, S("abcde345ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 2, 4, S("abcde345ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 4, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 4, 1, S("abcde5ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 4, 2, S("abcde5ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 5, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 5, 1, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 0, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 0, 1, S("abcde1ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 0, 5, S("abcde12345ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 0, 9, S("abcde123456789ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 0, 10, S("abcde1234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 0, 11, S("abcde1234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 1, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 1, 1, S("abcde2ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 1, 4, S("abcde2345ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 1, 8, S("abcde23456789ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 1, 9, S("abcde234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 1, 10, S("abcde234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 5, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 5, 1, S("abcde6ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 5, 2, S("abcde67ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 5, 4, S("abcde6789ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 5, 5, S("abcde67890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 5, 6, S("abcde67890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 9, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 9, 1, S("abcde0ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 9, 2, S("abcde0ghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 10, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 10, 1, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 0, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 0, 1, S("abcde1ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 0, 10, S("abcde1234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 0, 19, S("abcde1234567890123456789ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 0, 20, S("abcde12345678901234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 0, 21, S("abcde12345678901234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 1, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 1, 1, S("abcde2ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 1, 9, S("abcde234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 1, 18, S("abcde234567890123456789ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 1, 19, S("abcde2345678901234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 1, 20, S("abcde2345678901234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 10, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 10, 1, S("abcde1ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 10, 5, S("abcde12345ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 10, 9, S("abcde123456789ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 10, 10, S("abcde1234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 10, 11, S("abcde1234567890ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 19, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 19, 1, S("abcde0ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 19, 2, S("abcde0ghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 20, 0, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 20, 1, S("abcdeghij"));
+ test(S("abcdefghij"), 5, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 2, SV(""), 0, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV(""), 0, 1, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 0, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 0, 1, S("abcde1hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 0, 2, S("abcde12hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 0, 4, S("abcde1234hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 0, 5, S("abcde12345hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 0, 6, S("abcde12345hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 1, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 1, 1, S("abcde2hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 1, 2, S("abcde23hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 1, 3, S("abcde234hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 1, 4, S("abcde2345hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 1, 5, S("abcde2345hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 2, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 2, 1, S("abcde3hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 2, 2, S("abcde34hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 2, 3, S("abcde345hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 2, 4, S("abcde345hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 4, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 4, 1, S("abcde5hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 4, 2, S("abcde5hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 5, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 5, 1, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 0, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 0, 1, S("abcde1hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 0, 5, S("abcde12345hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 0, 9, S("abcde123456789hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 0, 10, S("abcde1234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 0, 11, S("abcde1234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 1, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 1, 1, S("abcde2hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 1, 4, S("abcde2345hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 1, 8, S("abcde23456789hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 1, 9, S("abcde234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 1, 10, S("abcde234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 5, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 5, 1, S("abcde6hij"));
+}
+
+template <class S, class SV>
+void test30()
+{
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 5, 2, S("abcde67hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 5, 4, S("abcde6789hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 5, 5, S("abcde67890hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 5, 6, S("abcde67890hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 9, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 9, 1, S("abcde0hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 9, 2, S("abcde0hij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 10, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 10, 1, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 0, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 0, 1, S("abcde1hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 0, 10, S("abcde1234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 0, 19, S("abcde1234567890123456789hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 0, 20, S("abcde12345678901234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 0, 21, S("abcde12345678901234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 1, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 1, 1, S("abcde2hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 1, 9, S("abcde234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 1, 18, S("abcde234567890123456789hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 1, 19, S("abcde2345678901234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 1, 20, S("abcde2345678901234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 10, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 10, 1, S("abcde1hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 10, 5, S("abcde12345hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 10, 9, S("abcde123456789hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 10, 10, S("abcde1234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 10, 11, S("abcde1234567890hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 19, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 19, 1, S("abcde0hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 19, 2, S("abcde0hij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 20, 0, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 20, 1, S("abcdehij"));
+ test(S("abcdefghij"), 5, 2, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 4, SV(""), 0, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV(""), 0, 1, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 0, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 0, 1, S("abcde1j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 0, 2, S("abcde12j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 0, 4, S("abcde1234j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 0, 5, S("abcde12345j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 0, 6, S("abcde12345j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 1, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 1, 1, S("abcde2j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 1, 2, S("abcde23j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 1, 3, S("abcde234j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 1, 4, S("abcde2345j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 1, 5, S("abcde2345j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 2, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 2, 1, S("abcde3j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 2, 2, S("abcde34j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 2, 3, S("abcde345j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 2, 4, S("abcde345j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 4, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 4, 1, S("abcde5j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 4, 2, S("abcde5j"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 5, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 5, 1, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 0, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 0, 1, S("abcde1j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 0, 5, S("abcde12345j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 0, 9, S("abcde123456789j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 0, 10, S("abcde1234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 0, 11, S("abcde1234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 1, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 1, 1, S("abcde2j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 1, 4, S("abcde2345j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 1, 8, S("abcde23456789j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 1, 9, S("abcde234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 1, 10, S("abcde234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 5, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 5, 1, S("abcde6j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 5, 2, S("abcde67j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 5, 4, S("abcde6789j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 5, 5, S("abcde67890j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 5, 6, S("abcde67890j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 9, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 9, 1, S("abcde0j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 9, 2, S("abcde0j"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 10, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 10, 1, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 0, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 0, 1, S("abcde1j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 0, 10, S("abcde1234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 0, 19, S("abcde1234567890123456789j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 0, 20, S("abcde12345678901234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 0, 21, S("abcde12345678901234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 1, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 1, 1, S("abcde2j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 1, 9, S("abcde234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 1, 18, S("abcde234567890123456789j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 1, 19, S("abcde2345678901234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 1, 20, S("abcde2345678901234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 10, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 10, 1, S("abcde1j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 10, 5, S("abcde12345j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 10, 9, S("abcde123456789j"));
+}
+
+template <class S, class SV>
+void test31()
+{
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 10, 10, S("abcde1234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 10, 11, S("abcde1234567890j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 19, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 19, 1, S("abcde0j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 19, 2, S("abcde0j"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 20, 0, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 20, 1, S("abcdej"));
+ test(S("abcdefghij"), 5, 4, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 5, SV(""), 0, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV(""), 0, 1, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 0, 1, S("abcde1"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 0, 2, S("abcde12"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 0, 4, S("abcde1234"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 0, 5, S("abcde12345"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 0, 6, S("abcde12345"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 1, 1, S("abcde2"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 1, 2, S("abcde23"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 1, 3, S("abcde234"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 1, 4, S("abcde2345"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 1, 5, S("abcde2345"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 2, 1, S("abcde3"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 2, 2, S("abcde34"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 2, 3, S("abcde345"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 2, 4, S("abcde345"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 4, 1, S("abcde5"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 4, 2, S("abcde5"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 0, 1, S("abcde1"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 0, 5, S("abcde12345"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 0, 9, S("abcde123456789"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 0, 10, S("abcde1234567890"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 0, 11, S("abcde1234567890"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 1, 1, S("abcde2"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 1, 4, S("abcde2345"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 1, 8, S("abcde23456789"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 1, 9, S("abcde234567890"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 1, 10, S("abcde234567890"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 5, 1, S("abcde6"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 5, 2, S("abcde67"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 5, 4, S("abcde6789"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 5, 5, S("abcde67890"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 5, 6, S("abcde67890"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 9, 1, S("abcde0"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 9, 2, S("abcde0"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 0, 1, S("abcde1"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 0, 10, S("abcde1234567890"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 0, 19, S("abcde1234567890123456789"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 0, 20, S("abcde12345678901234567890"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 0, 21, S("abcde12345678901234567890"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 1, 1, S("abcde2"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 1, 9, S("abcde234567890"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 1, 18, S("abcde234567890123456789"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 1, 19, S("abcde2345678901234567890"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 1, 20, S("abcde2345678901234567890"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 10, 1, S("abcde1"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 10, 5, S("abcde12345"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 10, 9, S("abcde123456789"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 10, 10, S("abcde1234567890"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 10, 11, S("abcde1234567890"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 19, 1, S("abcde0"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 19, 2, S("abcde0"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcdefghij"), 5, 5, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 6, SV(""), 0, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV(""), 0, 1, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 0, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 0, 1, S("abcde1"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 0, 2, S("abcde12"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 0, 4, S("abcde1234"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 0, 5, S("abcde12345"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 0, 6, S("abcde12345"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 1, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 1, 1, S("abcde2"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 1, 2, S("abcde23"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 1, 3, S("abcde234"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 1, 4, S("abcde2345"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 1, 5, S("abcde2345"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 2, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 2, 1, S("abcde3"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 2, 2, S("abcde34"));
+}
+
+template <class S, class SV>
+void test32()
+{
+ test(S("abcdefghij"), 5, 6, SV("12345"), 2, 3, S("abcde345"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 2, 4, S("abcde345"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 4, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 4, 1, S("abcde5"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 4, 2, S("abcde5"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 5, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 5, 1, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 0, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 0, 1, S("abcde1"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 0, 5, S("abcde12345"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 0, 9, S("abcde123456789"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 0, 10, S("abcde1234567890"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 0, 11, S("abcde1234567890"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 1, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 1, 1, S("abcde2"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 1, 4, S("abcde2345"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 1, 8, S("abcde23456789"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 1, 9, S("abcde234567890"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 1, 10, S("abcde234567890"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 5, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 5, 1, S("abcde6"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 5, 2, S("abcde67"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 5, 4, S("abcde6789"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 5, 5, S("abcde67890"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 5, 6, S("abcde67890"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 9, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 9, 1, S("abcde0"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 9, 2, S("abcde0"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 10, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 10, 1, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 0, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 0, 1, S("abcde1"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 0, 10, S("abcde1234567890"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 0, 19, S("abcde1234567890123456789"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 0, 20, S("abcde12345678901234567890"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 0, 21, S("abcde12345678901234567890"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 1, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 1, 1, S("abcde2"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 1, 9, S("abcde234567890"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 1, 18, S("abcde234567890123456789"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 1, 19, S("abcde2345678901234567890"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 1, 20, S("abcde2345678901234567890"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 10, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 10, 1, S("abcde1"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 10, 5, S("abcde12345"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 10, 9, S("abcde123456789"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 10, 10, S("abcde1234567890"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 10, 11, S("abcde1234567890"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 19, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 19, 1, S("abcde0"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 19, 2, S("abcde0"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 20, 0, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 20, 1, S("abcde"));
+ test(S("abcdefghij"), 5, 6, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 0, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 0, 1, S("abcdefghi1j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 0, 2, S("abcdefghi12j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 0, 4, S("abcdefghi1234j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 0, 5, S("abcdefghi12345j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 0, 6, S("abcdefghi12345j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 1, 1, S("abcdefghi2j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 1, 2, S("abcdefghi23j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 1, 3, S("abcdefghi234j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 1, 4, S("abcdefghi2345j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 1, 5, S("abcdefghi2345j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 2, 1, S("abcdefghi3j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 2, 2, S("abcdefghi34j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 2, 3, S("abcdefghi345j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 2, 4, S("abcdefghi345j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 4, 1, S("abcdefghi5j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 4, 2, S("abcdefghi5j"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 0, 1, S("abcdefghi1j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 0, 5, S("abcdefghi12345j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 0, 9, S("abcdefghi123456789j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 0, 10, S("abcdefghi1234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 0, 11, S("abcdefghi1234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 1, 1, S("abcdefghi2j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 1, 4, S("abcdefghi2345j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 1, 8, S("abcdefghi23456789j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 1, 9, S("abcdefghi234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 1, 10, S("abcdefghi234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 5, 1, S("abcdefghi6j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 5, 2, S("abcdefghi67j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 5, 4, S("abcdefghi6789j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 5, 5, S("abcdefghi67890j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 5, 6, S("abcdefghi67890j"));
+}
+
+template <class S, class SV>
+void test33()
+{
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 9, 1, S("abcdefghi0j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 9, 2, S("abcdefghi0j"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 0, 1, S("abcdefghi1j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 0, 10, S("abcdefghi1234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 0, 19, S("abcdefghi1234567890123456789j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 0, 20, S("abcdefghi12345678901234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 0, 21, S("abcdefghi12345678901234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 1, 1, S("abcdefghi2j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 1, 9, S("abcdefghi234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 1, 18, S("abcdefghi234567890123456789j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 1, 19, S("abcdefghi2345678901234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 1, 20, S("abcdefghi2345678901234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 10, 1, S("abcdefghi1j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 10, 5, S("abcdefghi12345j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 10, 9, S("abcdefghi123456789j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 10, 10, S("abcdefghi1234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 10, 11, S("abcdefghi1234567890j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 19, 1, S("abcdefghi0j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 19, 2, S("abcdefghi0j"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 9, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 1, SV(""), 0, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV(""), 0, 1, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 0, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 0, 1, S("abcdefghi1"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 0, 2, S("abcdefghi12"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 0, 4, S("abcdefghi1234"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 0, 5, S("abcdefghi12345"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 0, 6, S("abcdefghi12345"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 1, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 1, 1, S("abcdefghi2"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 1, 2, S("abcdefghi23"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 1, 3, S("abcdefghi234"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 1, 4, S("abcdefghi2345"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 1, 5, S("abcdefghi2345"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 2, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 2, 1, S("abcdefghi3"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 2, 2, S("abcdefghi34"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 2, 3, S("abcdefghi345"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 2, 4, S("abcdefghi345"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 4, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 4, 1, S("abcdefghi5"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 4, 2, S("abcdefghi5"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 5, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 5, 1, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 0, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 0, 1, S("abcdefghi1"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 0, 5, S("abcdefghi12345"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 0, 9, S("abcdefghi123456789"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 0, 10, S("abcdefghi1234567890"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 0, 11, S("abcdefghi1234567890"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 1, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 1, 1, S("abcdefghi2"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 1, 4, S("abcdefghi2345"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 1, 8, S("abcdefghi23456789"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 1, 9, S("abcdefghi234567890"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 1, 10, S("abcdefghi234567890"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 5, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 5, 1, S("abcdefghi6"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 5, 2, S("abcdefghi67"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 5, 4, S("abcdefghi6789"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 5, 5, S("abcdefghi67890"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 5, 6, S("abcdefghi67890"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 9, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 9, 1, S("abcdefghi0"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 9, 2, S("abcdefghi0"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 10, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 10, 1, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 0, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 0, 1, S("abcdefghi1"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 0, 10, S("abcdefghi1234567890"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 0, 19, S("abcdefghi1234567890123456789"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 0, 20, S("abcdefghi12345678901234567890"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 0, 21, S("abcdefghi12345678901234567890"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 1, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 1, 1, S("abcdefghi2"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 1, 9, S("abcdefghi234567890"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 1, 18, S("abcdefghi234567890123456789"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 1, 19, S("abcdefghi2345678901234567890"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 1, 20, S("abcdefghi2345678901234567890"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 10, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 10, 1, S("abcdefghi1"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 10, 5, S("abcdefghi12345"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 10, 9, S("abcdefghi123456789"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 10, 10, S("abcdefghi1234567890"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 10, 11, S("abcdefghi1234567890"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 19, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 19, 1, S("abcdefghi0"));
+}
+
+template <class S, class SV>
+void test34()
+{
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 19, 2, S("abcdefghi0"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 20, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 20, 1, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 2, SV(""), 0, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV(""), 0, 1, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 0, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 0, 1, S("abcdefghi1"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 0, 2, S("abcdefghi12"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 0, 4, S("abcdefghi1234"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 0, 5, S("abcdefghi12345"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 0, 6, S("abcdefghi12345"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 1, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 1, 1, S("abcdefghi2"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 1, 2, S("abcdefghi23"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 1, 3, S("abcdefghi234"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 1, 4, S("abcdefghi2345"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 1, 5, S("abcdefghi2345"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 2, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 2, 1, S("abcdefghi3"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 2, 2, S("abcdefghi34"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 2, 3, S("abcdefghi345"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 2, 4, S("abcdefghi345"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 4, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 4, 1, S("abcdefghi5"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 4, 2, S("abcdefghi5"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 5, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 5, 1, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 0, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 0, 1, S("abcdefghi1"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 0, 5, S("abcdefghi12345"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 0, 9, S("abcdefghi123456789"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 0, 10, S("abcdefghi1234567890"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 0, 11, S("abcdefghi1234567890"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 1, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 1, 1, S("abcdefghi2"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 1, 4, S("abcdefghi2345"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 1, 8, S("abcdefghi23456789"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 1, 9, S("abcdefghi234567890"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 1, 10, S("abcdefghi234567890"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 5, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 5, 1, S("abcdefghi6"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 5, 2, S("abcdefghi67"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 5, 4, S("abcdefghi6789"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 5, 5, S("abcdefghi67890"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 5, 6, S("abcdefghi67890"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 9, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 9, 1, S("abcdefghi0"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 9, 2, S("abcdefghi0"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 10, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 10, 1, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 0, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 0, 1, S("abcdefghi1"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 0, 10, S("abcdefghi1234567890"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 0, 19, S("abcdefghi1234567890123456789"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 0, 20, S("abcdefghi12345678901234567890"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 0, 21, S("abcdefghi12345678901234567890"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 1, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 1, 1, S("abcdefghi2"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 1, 9, S("abcdefghi234567890"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 1, 18, S("abcdefghi234567890123456789"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 1, 19, S("abcdefghi2345678901234567890"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 1, 20, S("abcdefghi2345678901234567890"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 10, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 10, 1, S("abcdefghi1"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 10, 5, S("abcdefghi12345"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 10, 9, S("abcdefghi123456789"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 10, 10, S("abcdefghi1234567890"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 10, 11, S("abcdefghi1234567890"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 19, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 19, 1, S("abcdefghi0"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 19, 2, S("abcdefghi0"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 20, 0, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 20, 1, S("abcdefghi"));
+ test(S("abcdefghij"), 9, 2, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, 0, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 0, 2, S("abcdefghij12"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 0, 4, S("abcdefghij1234"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 0, 5, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 0, 6, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 1, 2, S("abcdefghij23"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 1, 3, S("abcdefghij234"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 1, 4, S("abcdefghij2345"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 1, 5, S("abcdefghij2345"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 2, 1, S("abcdefghij3"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 2, 2, S("abcdefghij34"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 2, 3, S("abcdefghij345"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 2, 4, S("abcdefghij345"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 4, 1, S("abcdefghij5"));
+}
+
+template <class S, class SV>
+void test35()
+{
+ test(S("abcdefghij"), 10, 0, SV("12345"), 4, 2, S("abcdefghij5"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 0, 5, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 0, 9, S("abcdefghij123456789"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 0, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 0, 11, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 1, 4, S("abcdefghij2345"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 1, 8, S("abcdefghij23456789"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 1, 9, S("abcdefghij234567890"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 1, 10, S("abcdefghij234567890"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 5, 1, S("abcdefghij6"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 5, 2, S("abcdefghij67"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 5, 4, S("abcdefghij6789"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 5, 5, S("abcdefghij67890"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 5, 6, S("abcdefghij67890"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 9, 1, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 9, 2, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 0, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 0, 19, S("abcdefghij1234567890123456789"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 0, 20, S("abcdefghij12345678901234567890"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 0, 21, S("abcdefghij12345678901234567890"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 1, 9, S("abcdefghij234567890"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 1, 18, S("abcdefghij234567890123456789"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 1, 19, S("abcdefghij2345678901234567890"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 1, 20, S("abcdefghij2345678901234567890"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 10, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 10, 5, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 10, 9, S("abcdefghij123456789"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 10, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 10, 11, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 19, 1, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 19, 2, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, 1, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 0, 2, S("abcdefghij12"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 0, 4, S("abcdefghij1234"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 0, 5, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 0, 6, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 1, 2, S("abcdefghij23"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 1, 3, S("abcdefghij234"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 1, 4, S("abcdefghij2345"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 1, 5, S("abcdefghij2345"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 2, 1, S("abcdefghij3"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 2, 2, S("abcdefghij34"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 2, 3, S("abcdefghij345"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 2, 4, S("abcdefghij345"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 4, 1, S("abcdefghij5"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 4, 2, S("abcdefghij5"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 0, 5, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 0, 9, S("abcdefghij123456789"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 0, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 0, 11, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 1, 4, S("abcdefghij2345"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 1, 8, S("abcdefghij23456789"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 1, 9, S("abcdefghij234567890"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 1, 10, S("abcdefghij234567890"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 5, 1, S("abcdefghij6"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 5, 2, S("abcdefghij67"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 5, 4, S("abcdefghij6789"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 5, 5, S("abcdefghij67890"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 5, 6, S("abcdefghij67890"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 9, 1, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 9, 2, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 10, 0, S("abcdefghij"));
+}
+
+template <class S, class SV>
+void test36()
+{
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 0, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 0, 19, S("abcdefghij1234567890123456789"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 0, 20, S("abcdefghij12345678901234567890"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 0, 21, S("abcdefghij12345678901234567890"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 1, 9, S("abcdefghij234567890"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 1, 18, S("abcdefghij234567890123456789"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 1, 19, S("abcdefghij2345678901234567890"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 1, 20, S("abcdefghij2345678901234567890"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 10, 1, S("abcdefghij1"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 10, 5, S("abcdefghij12345"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 10, 9, S("abcdefghij123456789"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 10, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 10, 11, S("abcdefghij1234567890"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 19, 1, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 19, 2, S("abcdefghij0"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghij"), 10, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV(""), 0, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV(""), 0, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 0, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 0, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 0, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 0, 4, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 0, 5, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 0, 6, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 1, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 1, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 1, 3, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 1, 4, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 1, 5, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 2, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 2, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 2, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 2, 3, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 2, 4, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 4, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 4, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 4, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 5, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 5, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 0, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 0, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 0, 5, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 0, 9, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 0, 10, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 0, 11, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 1, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 1, 4, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 1, 8, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 1, 9, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 1, 10, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 5, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 5, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 5, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 5, 4, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 5, 5, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 5, 6, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 9, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 9, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 9, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 10, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 10, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 0, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 0, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 0, 10, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 0, 19, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 0, 20, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 0, 21, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 1, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 1, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 1, 9, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 1, 18, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 1, 19, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 1, 20, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 10, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 10, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 10, 5, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 10, 9, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 10, 10, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 10, 11, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 19, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 19, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 19, 2, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 20, 0, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 20, 1, S("can't happen"));
+ test(S("abcdefghij"), 11, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+}
+
+template <class S, class SV>
+void test37()
+{
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 0, 1, S("1abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 0, 2, S("12abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 0, 4, S("1234abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 0, 5, S("12345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 0, 6, S("12345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 1, 1, S("2abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 1, 2, S("23abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 1, 3, S("234abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 1, 4, S("2345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 1, 5, S("2345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 2, 1, S("3abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 2, 2, S("34abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 2, 3, S("345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 2, 4, S("345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 4, 1, S("5abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 4, 2, S("5abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 0, 1, S("1abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 0, 5, S("12345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 0, 9, S("123456789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 0, 10, S("1234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 0, 11, S("1234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 1, 1, S("2abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 1, 4, S("2345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 1, 8, S("23456789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 1, 9, S("234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 1, 10, S("234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 5, 1, S("6abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 5, 2, S("67abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 5, 4, S("6789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 5, 5, S("67890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 5, 6, S("67890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 9, 1, S("0abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 9, 2, S("0abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 0, 1, S("1abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 0, 10, S("1234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 0, 19, S("1234567890123456789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 0, 20, S("12345678901234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 0, 21, S("12345678901234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 1, 1, S("2abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 1, 9, S("234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 1, 18, S("234567890123456789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 1, 19, S("2345678901234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 1, 20, S("2345678901234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 10, 1, S("1abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 10, 5, S("12345abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 10, 9, S("123456789abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 10, 10, S("1234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 10, 11, S("1234567890abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 19, 1, S("0abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 19, 2, S("0abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV(""), 0, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV(""), 0, 1, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 0, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 0, 1, S("1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 0, 2, S("12bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 0, 4, S("1234bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 0, 5, S("12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 0, 6, S("12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 1, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 1, 1, S("2bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 1, 2, S("23bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 1, 3, S("234bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 1, 4, S("2345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 1, 5, S("2345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 2, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 2, 1, S("3bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 2, 2, S("34bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 2, 3, S("345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 2, 4, S("345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 4, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 4, 1, S("5bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 4, 2, S("5bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 5, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 5, 1, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345"), 6, 0, S("can't happen"));
+}
+
+template <class S, class SV>
+void test38()
+{
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 0, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 0, 1, S("1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 0, 5, S("12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 0, 9, S("123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 0, 10, S("1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 0, 11, S("1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 1, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 1, 1, S("2bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 1, 4, S("2345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 1, 8, S("23456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 1, 9, S("234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 1, 10, S("234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 5, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 5, 1, S("6bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 5, 2, S("67bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 5, 4, S("6789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 5, 5, S("67890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 5, 6, S("67890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 9, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 9, 1, S("0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 9, 2, S("0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 10, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 10, 1, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 0, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 0, 1, S("1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 0, 10, S("1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 0, 19, S("1234567890123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 0, 20, S("12345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 0, 21, S("12345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 1, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 1, 1, S("2bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 1, 9, S("234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 1, 18, S("234567890123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 1, 19, S("2345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 1, 20, S("2345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 10, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 10, 1, S("1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 10, 5, S("12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 10, 9, S("123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 10, 10, S("1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 10, 11, S("1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 19, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 19, 1, S("0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 19, 2, S("0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 20, 0, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 20, 1, S("bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV(""), 0, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV(""), 0, 1, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 0, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 0, 1, S("1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 0, 2, S("12klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 0, 4, S("1234klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 0, 5, S("12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 0, 6, S("12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 1, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 1, 1, S("2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 1, 2, S("23klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 1, 3, S("234klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 1, 4, S("2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 1, 5, S("2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 2, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 2, 1, S("3klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 2, 2, S("34klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 2, 3, S("345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 2, 4, S("345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 4, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 4, 1, S("5klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 4, 2, S("5klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 5, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 5, 1, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 0, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 0, 1, S("1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 0, 5, S("12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 0, 9, S("123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 0, 10, S("1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 0, 11, S("1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 1, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 1, 1, S("2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 1, 4, S("2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 1, 8, S("23456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 1, 9, S("234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 1, 10, S("234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 5, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 5, 1, S("6klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 5, 2, S("67klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 5, 4, S("6789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 5, 5, S("67890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 5, 6, S("67890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 9, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 9, 1, S("0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 9, 2, S("0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 10, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 10, 1, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 0, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 0, 1, S("1klmnopqrst"));
+}
+
+template <class S, class SV>
+void test39()
+{
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 0, 10, S("1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 0, 19, S("1234567890123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 0, 20, S("12345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 0, 21, S("12345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 1, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 1, 1, S("2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 1, 9, S("234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 1, 18, S("234567890123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 1, 19, S("2345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 1, 20, S("2345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 10, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 10, 1, S("1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 10, 5, S("12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 10, 9, S("123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 10, 10, S("1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 10, 11, S("1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 19, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 19, 1, S("0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 19, 2, S("0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 20, 0, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 20, 1, S("klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV(""), 0, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV(""), 0, 1, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 0, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 0, 1, S("1t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 0, 2, S("12t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 0, 4, S("1234t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 0, 5, S("12345t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 0, 6, S("12345t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 1, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 1, 1, S("2t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 1, 2, S("23t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 1, 3, S("234t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 1, 4, S("2345t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 1, 5, S("2345t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 2, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 2, 1, S("3t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 2, 2, S("34t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 2, 3, S("345t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 2, 4, S("345t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 4, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 4, 1, S("5t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 4, 2, S("5t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 5, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 5, 1, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 0, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 0, 1, S("1t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 0, 5, S("12345t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 0, 9, S("123456789t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 0, 10, S("1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 0, 11, S("1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 1, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 1, 1, S("2t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 1, 4, S("2345t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 1, 8, S("23456789t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 1, 9, S("234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 1, 10, S("234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 5, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 5, 1, S("6t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 5, 2, S("67t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 5, 4, S("6789t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 5, 5, S("67890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 5, 6, S("67890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 9, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 9, 1, S("0t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 9, 2, S("0t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 10, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 10, 1, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 0, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 0, 1, S("1t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 0, 10, S("1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 0, 19, S("1234567890123456789t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 0, 20, S("12345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 0, 21, S("12345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 1, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 1, 1, S("2t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 1, 9, S("234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 1, 18, S("234567890123456789t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 1, 19, S("2345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 1, 20, S("2345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 10, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 10, 1, S("1t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 10, 5, S("12345t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 10, 9, S("123456789t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 10, 10, S("1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 10, 11, S("1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 19, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 19, 1, S("0t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 19, 2, S("0t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 20, 0, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 20, 1, S("t"));
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV(""), 0, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV(""), 0, 1, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 0, 0, S(""));
+}
+
+template <class S, class SV>
+void test40()
+{
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 0, 1, S("1"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 0, 2, S("12"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 0, 4, S("1234"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 0, 5, S("12345"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 0, 6, S("12345"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 1, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 1, 1, S("2"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 1, 2, S("23"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 1, 3, S("234"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 1, 4, S("2345"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 1, 5, S("2345"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 2, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 2, 1, S("3"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 2, 2, S("34"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 2, 3, S("345"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 2, 4, S("345"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 4, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 4, 1, S("5"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 4, 2, S("5"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 5, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 5, 1, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 0, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 0, 1, S("1"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 0, 5, S("12345"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 0, 9, S("123456789"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 0, 10, S("1234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 0, 11, S("1234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 1, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 1, 1, S("2"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 1, 4, S("2345"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 1, 8, S("23456789"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 1, 9, S("234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 1, 10, S("234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 5, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 5, 1, S("6"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 5, 2, S("67"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 5, 4, S("6789"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 5, 5, S("67890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 5, 6, S("67890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 9, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 9, 1, S("0"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 9, 2, S("0"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 10, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 10, 1, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 0, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 0, 1, S("1"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 0, 10, S("1234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 0, 19, S("1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 0, 20, S("12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 0, 21, S("12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 1, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 1, 1, S("2"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 1, 9, S("234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 1, 18, S("234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 1, 19, S("2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 1, 20, S("2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 10, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 10, 1, S("1"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 10, 5, S("12345"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 10, 9, S("123456789"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 10, 10, S("1234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 10, 11, S("1234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 19, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 19, 1, S("0"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 19, 2, S("0"));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 20, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 20, 1, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV(""), 0, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV(""), 0, 1, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 0, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 0, 1, S("1"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 0, 2, S("12"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 0, 4, S("1234"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 0, 5, S("12345"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 0, 6, S("12345"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 1, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 1, 1, S("2"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 1, 2, S("23"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 1, 3, S("234"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 1, 4, S("2345"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 1, 5, S("2345"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 2, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 2, 1, S("3"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 2, 2, S("34"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 2, 3, S("345"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 2, 4, S("345"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 4, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 4, 1, S("5"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 4, 2, S("5"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 5, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 5, 1, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 0, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 0, 1, S("1"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 0, 5, S("12345"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 0, 9, S("123456789"));
+}
+
+template <class S, class SV>
+void test41()
+{
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 0, 10, S("1234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 0, 11, S("1234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 1, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 1, 1, S("2"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 1, 4, S("2345"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 1, 8, S("23456789"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 1, 9, S("234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 1, 10, S("234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 5, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 5, 1, S("6"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 5, 2, S("67"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 5, 4, S("6789"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 5, 5, S("67890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 5, 6, S("67890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 9, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 9, 1, S("0"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 9, 2, S("0"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 10, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 10, 1, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 0, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 0, 1, S("1"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 0, 10, S("1234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 0, 19, S("1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 0, 20, S("12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 0, 21, S("12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 1, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 1, 1, S("2"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 1, 9, S("234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 1, 18, S("234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 1, 19, S("2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 1, 20, S("2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 10, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 10, 1, S("1"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 10, 5, S("12345"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 10, 9, S("123456789"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 10, 10, S("1234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 10, 11, S("1234567890"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 19, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 19, 1, S("0"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 19, 2, S("0"));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 20, 0, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 20, 1, S(""));
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 0, 1, S("a1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 0, 2, S("a12bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 0, 4, S("a1234bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 0, 5, S("a12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 0, 6, S("a12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 1, 1, S("a2bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 1, 2, S("a23bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 1, 3, S("a234bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 1, 4, S("a2345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 1, 5, S("a2345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 2, 1, S("a3bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 2, 2, S("a34bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 2, 3, S("a345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 2, 4, S("a345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 4, 1, S("a5bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 4, 2, S("a5bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 0, 1, S("a1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 0, 5, S("a12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 0, 9, S("a123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 0, 10, S("a1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 0, 11, S("a1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 1, 1, S("a2bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 1, 4, S("a2345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 1, 8, S("a23456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 1, 9, S("a234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 1, 10, S("a234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 5, 1, S("a6bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 5, 2, S("a67bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 5, 4, S("a6789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 5, 5, S("a67890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 5, 6, S("a67890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 9, 1, S("a0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 9, 2, S("a0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 0, 1, S("a1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 0, 10, S("a1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 0, 19, S("a1234567890123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 0, 20, S("a12345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 0, 21, S("a12345678901234567890bcdefghijklmnopqrst"));
+}
+
+template <class S, class SV>
+void test42()
+{
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 1, 1, S("a2bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 1, 9, S("a234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 1, 18, S("a234567890123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 1, 19, S("a2345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 1, 20, S("a2345678901234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 10, 1, S("a1bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 10, 5, S("a12345bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 10, 9, S("a123456789bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 10, 10, S("a1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 10, 11, S("a1234567890bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 19, 1, S("a0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 19, 2, S("a0bcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV(""), 0, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV(""), 0, 1, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 0, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 0, 1, S("a1cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 0, 2, S("a12cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 0, 4, S("a1234cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 0, 5, S("a12345cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 0, 6, S("a12345cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 1, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 1, 1, S("a2cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 1, 2, S("a23cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 1, 3, S("a234cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 1, 4, S("a2345cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 1, 5, S("a2345cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 2, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 2, 1, S("a3cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 2, 2, S("a34cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 2, 3, S("a345cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 2, 4, S("a345cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 4, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 4, 1, S("a5cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 4, 2, S("a5cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 5, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 5, 1, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 0, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 0, 1, S("a1cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 0, 5, S("a12345cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 0, 9, S("a123456789cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 0, 10, S("a1234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 0, 11, S("a1234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 1, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 1, 1, S("a2cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 1, 4, S("a2345cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 1, 8, S("a23456789cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 1, 9, S("a234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 1, 10, S("a234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 5, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 5, 1, S("a6cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 5, 2, S("a67cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 5, 4, S("a6789cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 5, 5, S("a67890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 5, 6, S("a67890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 9, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 9, 1, S("a0cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 9, 2, S("a0cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 10, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 10, 1, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 0, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 0, 1, S("a1cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 0, 10, S("a1234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 0, 19, S("a1234567890123456789cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 0, 20, S("a12345678901234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 0, 21, S("a12345678901234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 1, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 1, 1, S("a2cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 1, 9, S("a234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 1, 18, S("a234567890123456789cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 1, 19, S("a2345678901234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 1, 20, S("a2345678901234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 10, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 10, 1, S("a1cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 10, 5, S("a12345cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 10, 9, S("a123456789cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 10, 10, S("a1234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 10, 11, S("a1234567890cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 19, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 19, 1, S("a0cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 19, 2, S("a0cdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 20, 0, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 20, 1, S("acdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV(""), 0, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV(""), 0, 1, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 0, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 0, 1, S("a1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 0, 2, S("a12klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 0, 4, S("a1234klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 0, 5, S("a12345klmnopqrst"));
+}
+
+template <class S, class SV>
+void test43()
+{
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 0, 6, S("a12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 1, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 1, 1, S("a2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 1, 2, S("a23klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 1, 3, S("a234klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 1, 4, S("a2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 1, 5, S("a2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 2, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 2, 1, S("a3klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 2, 2, S("a34klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 2, 3, S("a345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 2, 4, S("a345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 4, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 4, 1, S("a5klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 4, 2, S("a5klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 5, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 5, 1, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 0, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 0, 1, S("a1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 0, 5, S("a12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 0, 9, S("a123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 0, 10, S("a1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 0, 11, S("a1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 1, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 1, 1, S("a2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 1, 4, S("a2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 1, 8, S("a23456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 1, 9, S("a234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 1, 10, S("a234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 5, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 5, 1, S("a6klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 5, 2, S("a67klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 5, 4, S("a6789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 5, 5, S("a67890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 5, 6, S("a67890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 9, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 9, 1, S("a0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 9, 2, S("a0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 10, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 10, 1, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 0, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 0, 1, S("a1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 0, 10, S("a1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 0, 19, S("a1234567890123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 0, 20, S("a12345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 0, 21, S("a12345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 1, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 1, 1, S("a2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 1, 9, S("a234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 1, 18, S("a234567890123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 1, 19, S("a2345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 1, 20, S("a2345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 10, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 10, 1, S("a1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 10, 5, S("a12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 10, 9, S("a123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 10, 10, S("a1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 10, 11, S("a1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 19, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 19, 1, S("a0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 19, 2, S("a0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 20, 0, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 20, 1, S("aklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV(""), 0, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV(""), 0, 1, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 0, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 0, 1, S("a1t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 0, 2, S("a12t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 0, 4, S("a1234t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 0, 5, S("a12345t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 0, 6, S("a12345t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 1, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 1, 1, S("a2t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 1, 2, S("a23t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 1, 3, S("a234t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 1, 4, S("a2345t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 1, 5, S("a2345t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 2, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 2, 1, S("a3t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 2, 2, S("a34t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 2, 3, S("a345t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 2, 4, S("a345t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 4, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 4, 1, S("a5t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 4, 2, S("a5t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 5, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 5, 1, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 0, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 0, 1, S("a1t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 0, 5, S("a12345t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 0, 9, S("a123456789t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 0, 10, S("a1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 0, 11, S("a1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 1, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 1, 1, S("a2t"));
+}
+
+template <class S, class SV>
+void test44()
+{
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 1, 4, S("a2345t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 1, 8, S("a23456789t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 1, 9, S("a234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 1, 10, S("a234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 5, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 5, 1, S("a6t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 5, 2, S("a67t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 5, 4, S("a6789t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 5, 5, S("a67890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 5, 6, S("a67890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 9, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 9, 1, S("a0t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 9, 2, S("a0t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 10, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 10, 1, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 0, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 0, 1, S("a1t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 0, 10, S("a1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 0, 19, S("a1234567890123456789t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 0, 20, S("a12345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 0, 21, S("a12345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 1, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 1, 1, S("a2t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 1, 9, S("a234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 1, 18, S("a234567890123456789t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 1, 19, S("a2345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 1, 20, S("a2345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 10, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 10, 1, S("a1t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 10, 5, S("a12345t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 10, 9, S("a123456789t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 10, 10, S("a1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 10, 11, S("a1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 19, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 19, 1, S("a0t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 19, 2, S("a0t"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 20, 0, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 20, 1, S("at"));
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV(""), 0, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV(""), 0, 1, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 0, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 0, 1, S("a1"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 0, 2, S("a12"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 0, 4, S("a1234"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 0, 5, S("a12345"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 0, 6, S("a12345"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 1, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 1, 1, S("a2"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 1, 2, S("a23"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 1, 3, S("a234"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 1, 4, S("a2345"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 1, 5, S("a2345"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 2, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 2, 1, S("a3"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 2, 2, S("a34"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 2, 3, S("a345"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 2, 4, S("a345"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 4, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 4, 1, S("a5"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 4, 2, S("a5"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 5, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 5, 1, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 0, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 0, 1, S("a1"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 0, 5, S("a12345"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 0, 9, S("a123456789"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 0, 10, S("a1234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 0, 11, S("a1234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 1, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 1, 1, S("a2"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 1, 4, S("a2345"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 1, 8, S("a23456789"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 1, 9, S("a234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 1, 10, S("a234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 5, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 5, 1, S("a6"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 5, 2, S("a67"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 5, 4, S("a6789"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 5, 5, S("a67890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 5, 6, S("a67890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 9, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 9, 1, S("a0"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 9, 2, S("a0"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 10, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 10, 1, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 0, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 0, 1, S("a1"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 0, 10, S("a1234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 0, 19, S("a1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 0, 20, S("a12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 0, 21, S("a12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 1, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 1, 1, S("a2"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 1, 9, S("a234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 1, 18, S("a234567890123456789"));
+}
+
+template <class S, class SV>
+void test45()
+{
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 1, 19, S("a2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 1, 20, S("a2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 10, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 10, 1, S("a1"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 10, 5, S("a12345"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 10, 9, S("a123456789"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 10, 10, S("a1234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 10, 11, S("a1234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 19, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 19, 1, S("a0"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 19, 2, S("a0"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 20, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 20, 1, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV(""), 0, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV(""), 0, 1, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 0, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 0, 1, S("a1"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 0, 2, S("a12"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 0, 4, S("a1234"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 0, 5, S("a12345"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 0, 6, S("a12345"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 1, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 1, 1, S("a2"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 1, 2, S("a23"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 1, 3, S("a234"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 1, 4, S("a2345"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 1, 5, S("a2345"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 2, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 2, 1, S("a3"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 2, 2, S("a34"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 2, 3, S("a345"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 2, 4, S("a345"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 4, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 4, 1, S("a5"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 4, 2, S("a5"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 5, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 5, 1, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 0, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 0, 1, S("a1"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 0, 5, S("a12345"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 0, 9, S("a123456789"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 0, 10, S("a1234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 0, 11, S("a1234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 1, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 1, 1, S("a2"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 1, 4, S("a2345"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 1, 8, S("a23456789"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 1, 9, S("a234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 1, 10, S("a234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 5, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 5, 1, S("a6"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 5, 2, S("a67"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 5, 4, S("a6789"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 5, 5, S("a67890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 5, 6, S("a67890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 9, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 9, 1, S("a0"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 9, 2, S("a0"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 10, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 10, 1, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 0, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 0, 1, S("a1"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 0, 10, S("a1234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 0, 19, S("a1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 0, 20, S("a12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 0, 21, S("a12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 1, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 1, 1, S("a2"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 1, 9, S("a234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 1, 18, S("a234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 1, 19, S("a2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 1, 20, S("a2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 10, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 10, 1, S("a1"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 10, 5, S("a12345"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 10, 9, S("a123456789"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 10, 10, S("a1234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 10, 11, S("a1234567890"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 19, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 19, 1, S("a0"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 19, 2, S("a0"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 20, 0, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 20, 1, S("a"));
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 0, 1, S("abcdefghij1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 0, 2, S("abcdefghij12klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 0, 4, S("abcdefghij1234klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 0, 5, S("abcdefghij12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 0, 6, S("abcdefghij12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 1, 1, S("abcdefghij2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 1, 2, S("abcdefghij23klmnopqrst"));
+}
+
+template <class S, class SV>
+void test46()
+{
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 1, 3, S("abcdefghij234klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 1, 4, S("abcdefghij2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 1, 5, S("abcdefghij2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 2, 1, S("abcdefghij3klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 2, 2, S("abcdefghij34klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 2, 3, S("abcdefghij345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 2, 4, S("abcdefghij345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 4, 1, S("abcdefghij5klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 4, 2, S("abcdefghij5klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 0, 1, S("abcdefghij1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 0, 5, S("abcdefghij12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 0, 9, S("abcdefghij123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 0, 10, S("abcdefghij1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 0, 11, S("abcdefghij1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 1, 1, S("abcdefghij2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 1, 4, S("abcdefghij2345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 1, 8, S("abcdefghij23456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 1, 9, S("abcdefghij234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 1, 10, S("abcdefghij234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 5, 1, S("abcdefghij6klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 5, 2, S("abcdefghij67klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 5, 4, S("abcdefghij6789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 5, 5, S("abcdefghij67890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 5, 6, S("abcdefghij67890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 9, 1, S("abcdefghij0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 9, 2, S("abcdefghij0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 0, 1, S("abcdefghij1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 0, 10, S("abcdefghij1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 0, 19, S("abcdefghij1234567890123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 0, 20, S("abcdefghij12345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 0, 21, S("abcdefghij12345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 1, 1, S("abcdefghij2klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 1, 9, S("abcdefghij234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 1, 18, S("abcdefghij234567890123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 1, 19, S("abcdefghij2345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 1, 20, S("abcdefghij2345678901234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 10, 1, S("abcdefghij1klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 10, 5, S("abcdefghij12345klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 10, 9, S("abcdefghij123456789klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 10, 10, S("abcdefghij1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 10, 11, S("abcdefghij1234567890klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 19, 1, S("abcdefghij0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 19, 2, S("abcdefghij0klmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV(""), 0, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV(""), 0, 1, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 0, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 0, 1, S("abcdefghij1lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 0, 2, S("abcdefghij12lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 0, 4, S("abcdefghij1234lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 0, 5, S("abcdefghij12345lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 0, 6, S("abcdefghij12345lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 1, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 1, 1, S("abcdefghij2lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 1, 2, S("abcdefghij23lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 1, 3, S("abcdefghij234lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 1, 4, S("abcdefghij2345lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 1, 5, S("abcdefghij2345lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 2, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 2, 1, S("abcdefghij3lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 2, 2, S("abcdefghij34lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 2, 3, S("abcdefghij345lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 2, 4, S("abcdefghij345lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 4, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 4, 1, S("abcdefghij5lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 4, 2, S("abcdefghij5lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 5, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 5, 1, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 0, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 0, 1, S("abcdefghij1lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 0, 5, S("abcdefghij12345lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 0, 9, S("abcdefghij123456789lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 0, 10, S("abcdefghij1234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 0, 11, S("abcdefghij1234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 1, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 1, 1, S("abcdefghij2lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 1, 4, S("abcdefghij2345lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 1, 8, S("abcdefghij23456789lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 1, 9, S("abcdefghij234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 1, 10, S("abcdefghij234567890lmnopqrst"));
+}
+
+template <class S, class SV>
+void test47()
+{
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 5, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 5, 1, S("abcdefghij6lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 5, 2, S("abcdefghij67lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 5, 4, S("abcdefghij6789lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 5, 5, S("abcdefghij67890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 5, 6, S("abcdefghij67890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 9, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 9, 1, S("abcdefghij0lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 9, 2, S("abcdefghij0lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 10, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 10, 1, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 0, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 0, 1, S("abcdefghij1lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 0, 10, S("abcdefghij1234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 0, 19, S("abcdefghij1234567890123456789lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 0, 20, S("abcdefghij12345678901234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 0, 21, S("abcdefghij12345678901234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 1, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 1, 1, S("abcdefghij2lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 1, 9, S("abcdefghij234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 1, 18, S("abcdefghij234567890123456789lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 1, 19, S("abcdefghij2345678901234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 1, 20, S("abcdefghij2345678901234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 10, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 10, 1, S("abcdefghij1lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 10, 5, S("abcdefghij12345lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 10, 9, S("abcdefghij123456789lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 10, 10, S("abcdefghij1234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 10, 11, S("abcdefghij1234567890lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 19, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 19, 1, S("abcdefghij0lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 19, 2, S("abcdefghij0lmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 20, 0, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 20, 1, S("abcdefghijlmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV(""), 0, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV(""), 0, 1, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 0, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 0, 1, S("abcdefghij1pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 0, 2, S("abcdefghij12pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 0, 4, S("abcdefghij1234pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 0, 5, S("abcdefghij12345pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 0, 6, S("abcdefghij12345pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 1, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 1, 1, S("abcdefghij2pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 1, 2, S("abcdefghij23pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 1, 3, S("abcdefghij234pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 1, 4, S("abcdefghij2345pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 1, 5, S("abcdefghij2345pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 2, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 2, 1, S("abcdefghij3pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 2, 2, S("abcdefghij34pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 2, 3, S("abcdefghij345pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 2, 4, S("abcdefghij345pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 4, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 4, 1, S("abcdefghij5pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 4, 2, S("abcdefghij5pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 5, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 5, 1, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 0, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 0, 1, S("abcdefghij1pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 0, 5, S("abcdefghij12345pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 0, 9, S("abcdefghij123456789pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 0, 10, S("abcdefghij1234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 0, 11, S("abcdefghij1234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 1, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 1, 1, S("abcdefghij2pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 1, 4, S("abcdefghij2345pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 1, 8, S("abcdefghij23456789pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 1, 9, S("abcdefghij234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 1, 10, S("abcdefghij234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 5, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 5, 1, S("abcdefghij6pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 5, 2, S("abcdefghij67pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 5, 4, S("abcdefghij6789pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 5, 5, S("abcdefghij67890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 5, 6, S("abcdefghij67890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 9, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 9, 1, S("abcdefghij0pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 9, 2, S("abcdefghij0pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 10, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 10, 1, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 0, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 0, 1, S("abcdefghij1pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 0, 10, S("abcdefghij1234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 0, 19, S("abcdefghij1234567890123456789pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 0, 20, S("abcdefghij12345678901234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 0, 21, S("abcdefghij12345678901234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 1, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 1, 1, S("abcdefghij2pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 1, 9, S("abcdefghij234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 1, 18, S("abcdefghij234567890123456789pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 1, 19, S("abcdefghij2345678901234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 1, 20, S("abcdefghij2345678901234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 10, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 10, 1, S("abcdefghij1pqrst"));
+}
+
+template <class S, class SV>
+void test48()
+{
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 10, 5, S("abcdefghij12345pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 10, 9, S("abcdefghij123456789pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 10, 10, S("abcdefghij1234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 10, 11, S("abcdefghij1234567890pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 19, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 19, 1, S("abcdefghij0pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 19, 2, S("abcdefghij0pqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 20, 0, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 20, 1, S("abcdefghijpqrst"));
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV(""), 0, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV(""), 0, 1, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 0, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 0, 1, S("abcdefghij1t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 0, 2, S("abcdefghij12t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 0, 4, S("abcdefghij1234t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 0, 5, S("abcdefghij12345t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 0, 6, S("abcdefghij12345t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 1, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 1, 1, S("abcdefghij2t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 1, 2, S("abcdefghij23t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 1, 3, S("abcdefghij234t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 1, 4, S("abcdefghij2345t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 1, 5, S("abcdefghij2345t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 2, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 2, 1, S("abcdefghij3t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 2, 2, S("abcdefghij34t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 2, 3, S("abcdefghij345t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 2, 4, S("abcdefghij345t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 4, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 4, 1, S("abcdefghij5t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 4, 2, S("abcdefghij5t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 5, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 5, 1, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 0, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 0, 1, S("abcdefghij1t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 0, 5, S("abcdefghij12345t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 0, 9, S("abcdefghij123456789t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 0, 10, S("abcdefghij1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 0, 11, S("abcdefghij1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 1, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 1, 1, S("abcdefghij2t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 1, 4, S("abcdefghij2345t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 1, 8, S("abcdefghij23456789t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 1, 9, S("abcdefghij234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 1, 10, S("abcdefghij234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 5, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 5, 1, S("abcdefghij6t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 5, 2, S("abcdefghij67t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 5, 4, S("abcdefghij6789t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 5, 5, S("abcdefghij67890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 5, 6, S("abcdefghij67890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 9, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 9, 1, S("abcdefghij0t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 9, 2, S("abcdefghij0t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 10, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 10, 1, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 0, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 0, 1, S("abcdefghij1t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 0, 10, S("abcdefghij1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 0, 19, S("abcdefghij1234567890123456789t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 0, 20, S("abcdefghij12345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 0, 21, S("abcdefghij12345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 1, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 1, 1, S("abcdefghij2t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 1, 9, S("abcdefghij234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 1, 18, S("abcdefghij234567890123456789t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 1, 19, S("abcdefghij2345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 1, 20, S("abcdefghij2345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 10, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 10, 1, S("abcdefghij1t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 10, 5, S("abcdefghij12345t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 10, 9, S("abcdefghij123456789t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 10, 10, S("abcdefghij1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 10, 11, S("abcdefghij1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 19, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 19, 1, S("abcdefghij0t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 19, 2, S("abcdefghij0t"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 20, 0, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 20, 1, S("abcdefghijt"));
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 0, 2, S("abcdefghij12"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 0, 4, S("abcdefghij1234"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 0, 5, S("abcdefghij12345"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 0, 6, S("abcdefghij12345"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 1, 2, S("abcdefghij23"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 1, 3, S("abcdefghij234"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 1, 4, S("abcdefghij2345"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 1, 5, S("abcdefghij2345"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 2, 0, S("abcdefghij"));
+}
+
+template <class S, class SV>
+void test49()
+{
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 2, 1, S("abcdefghij3"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 2, 2, S("abcdefghij34"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 2, 3, S("abcdefghij345"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 2, 4, S("abcdefghij345"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 4, 1, S("abcdefghij5"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 4, 2, S("abcdefghij5"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 0, 5, S("abcdefghij12345"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 0, 9, S("abcdefghij123456789"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 0, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 0, 11, S("abcdefghij1234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 1, 4, S("abcdefghij2345"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 1, 8, S("abcdefghij23456789"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 1, 9, S("abcdefghij234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 1, 10, S("abcdefghij234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 5, 1, S("abcdefghij6"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 5, 2, S("abcdefghij67"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 5, 4, S("abcdefghij6789"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 5, 5, S("abcdefghij67890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 5, 6, S("abcdefghij67890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 9, 1, S("abcdefghij0"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 9, 2, S("abcdefghij0"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 0, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 0, 19, S("abcdefghij1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 0, 20, S("abcdefghij12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 0, 21, S("abcdefghij12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 1, 9, S("abcdefghij234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 1, 18, S("abcdefghij234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 1, 19, S("abcdefghij2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 1, 20, S("abcdefghij2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 10, 1, S("abcdefghij1"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 10, 5, S("abcdefghij12345"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 10, 9, S("abcdefghij123456789"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 10, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 10, 11, S("abcdefghij1234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 19, 1, S("abcdefghij0"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 19, 2, S("abcdefghij0"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV(""), 0, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV(""), 0, 1, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 0, 2, S("abcdefghij12"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 0, 4, S("abcdefghij1234"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 0, 5, S("abcdefghij12345"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 0, 6, S("abcdefghij12345"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 1, 2, S("abcdefghij23"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 1, 3, S("abcdefghij234"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 1, 4, S("abcdefghij2345"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 1, 5, S("abcdefghij2345"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 2, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 2, 1, S("abcdefghij3"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 2, 2, S("abcdefghij34"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 2, 3, S("abcdefghij345"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 2, 4, S("abcdefghij345"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 4, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 4, 1, S("abcdefghij5"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 4, 2, S("abcdefghij5"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 5, 1, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 0, 5, S("abcdefghij12345"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 0, 9, S("abcdefghij123456789"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 0, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 0, 11, S("abcdefghij1234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 1, 4, S("abcdefghij2345"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 1, 8, S("abcdefghij23456789"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 1, 9, S("abcdefghij234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 1, 10, S("abcdefghij234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 5, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 5, 1, S("abcdefghij6"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 5, 2, S("abcdefghij67"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 5, 4, S("abcdefghij6789"));
+}
+
+template <class S, class SV>
+void test50()
+{
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 5, 5, S("abcdefghij67890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 5, 6, S("abcdefghij67890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 9, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 9, 1, S("abcdefghij0"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 9, 2, S("abcdefghij0"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 10, 1, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 0, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 0, 1, S("abcdefghij1"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 0, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 0, 19, S("abcdefghij1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 0, 20, S("abcdefghij12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 0, 21, S("abcdefghij12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 1, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 1, 1, S("abcdefghij2"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 1, 9, S("abcdefghij234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 1, 18, S("abcdefghij234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 1, 19, S("abcdefghij2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 1, 20, S("abcdefghij2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 10, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 10, 1, S("abcdefghij1"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 10, 5, S("abcdefghij12345"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 10, 9, S("abcdefghij123456789"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 10, 10, S("abcdefghij1234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 10, 11, S("abcdefghij1234567890"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 19, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 19, 1, S("abcdefghij0"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 19, 2, S("abcdefghij0"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 20, 0, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 20, 1, S("abcdefghij"));
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 0, 1, S("abcdefghijklmnopqrs1t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 0, 2, S("abcdefghijklmnopqrs12t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 0, 4, S("abcdefghijklmnopqrs1234t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 0, 5, S("abcdefghijklmnopqrs12345t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 0, 6, S("abcdefghijklmnopqrs12345t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 1, 1, S("abcdefghijklmnopqrs2t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 1, 2, S("abcdefghijklmnopqrs23t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 1, 3, S("abcdefghijklmnopqrs234t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 1, 4, S("abcdefghijklmnopqrs2345t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 1, 5, S("abcdefghijklmnopqrs2345t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 2, 1, S("abcdefghijklmnopqrs3t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 2, 2, S("abcdefghijklmnopqrs34t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 2, 3, S("abcdefghijklmnopqrs345t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 2, 4, S("abcdefghijklmnopqrs345t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 4, 1, S("abcdefghijklmnopqrs5t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 4, 2, S("abcdefghijklmnopqrs5t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 0, 1, S("abcdefghijklmnopqrs1t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 0, 5, S("abcdefghijklmnopqrs12345t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 0, 9, S("abcdefghijklmnopqrs123456789t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 0, 10, S("abcdefghijklmnopqrs1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 0, 11, S("abcdefghijklmnopqrs1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 1, 1, S("abcdefghijklmnopqrs2t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 1, 4, S("abcdefghijklmnopqrs2345t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 1, 8, S("abcdefghijklmnopqrs23456789t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 1, 9, S("abcdefghijklmnopqrs234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 1, 10, S("abcdefghijklmnopqrs234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 5, 1, S("abcdefghijklmnopqrs6t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 5, 2, S("abcdefghijklmnopqrs67t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 5, 4, S("abcdefghijklmnopqrs6789t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 5, 5, S("abcdefghijklmnopqrs67890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 5, 6, S("abcdefghijklmnopqrs67890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 9, 1, S("abcdefghijklmnopqrs0t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 9, 2, S("abcdefghijklmnopqrs0t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 0, 1, S("abcdefghijklmnopqrs1t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 0, 10, S("abcdefghijklmnopqrs1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 0, 19, S("abcdefghijklmnopqrs1234567890123456789t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 0, 20, S("abcdefghijklmnopqrs12345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 0, 21, S("abcdefghijklmnopqrs12345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 1, 1, S("abcdefghijklmnopqrs2t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 1, 9, S("abcdefghijklmnopqrs234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 1, 18, S("abcdefghijklmnopqrs234567890123456789t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 1, 19, S("abcdefghijklmnopqrs2345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 1, 20, S("abcdefghijklmnopqrs2345678901234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 10, 1, S("abcdefghijklmnopqrs1t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 10, 5, S("abcdefghijklmnopqrs12345t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 10, 9, S("abcdefghijklmnopqrs123456789t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 10, 10, S("abcdefghijklmnopqrs1234567890t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 10, 11, S("abcdefghijklmnopqrs1234567890t"));
+}
+
+template <class S, class SV>
+void test51()
+{
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 19, 1, S("abcdefghijklmnopqrs0t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 19, 2, S("abcdefghijklmnopqrs0t"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV(""), 0, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV(""), 0, 1, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 0, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 0, 1, S("abcdefghijklmnopqrs1"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 0, 2, S("abcdefghijklmnopqrs12"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 0, 4, S("abcdefghijklmnopqrs1234"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 0, 5, S("abcdefghijklmnopqrs12345"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 0, 6, S("abcdefghijklmnopqrs12345"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 1, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 1, 1, S("abcdefghijklmnopqrs2"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 1, 2, S("abcdefghijklmnopqrs23"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 1, 3, S("abcdefghijklmnopqrs234"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 1, 4, S("abcdefghijklmnopqrs2345"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 1, 5, S("abcdefghijklmnopqrs2345"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 2, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 2, 1, S("abcdefghijklmnopqrs3"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 2, 2, S("abcdefghijklmnopqrs34"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 2, 3, S("abcdefghijklmnopqrs345"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 2, 4, S("abcdefghijklmnopqrs345"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 4, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 4, 1, S("abcdefghijklmnopqrs5"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 4, 2, S("abcdefghijklmnopqrs5"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 5, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 5, 1, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 0, 1, S("abcdefghijklmnopqrs1"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 0, 5, S("abcdefghijklmnopqrs12345"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 0, 9, S("abcdefghijklmnopqrs123456789"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 0, 10, S("abcdefghijklmnopqrs1234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 0, 11, S("abcdefghijklmnopqrs1234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 1, 1, S("abcdefghijklmnopqrs2"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 1, 4, S("abcdefghijklmnopqrs2345"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 1, 8, S("abcdefghijklmnopqrs23456789"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 1, 9, S("abcdefghijklmnopqrs234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 1, 10, S("abcdefghijklmnopqrs234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 5, 1, S("abcdefghijklmnopqrs6"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 5, 2, S("abcdefghijklmnopqrs67"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 5, 4, S("abcdefghijklmnopqrs6789"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 5, 5, S("abcdefghijklmnopqrs67890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 5, 6, S("abcdefghijklmnopqrs67890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 9, 1, S("abcdefghijklmnopqrs0"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 9, 2, S("abcdefghijklmnopqrs0"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 0, 1, S("abcdefghijklmnopqrs1"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 0, 10, S("abcdefghijklmnopqrs1234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 0, 19, S("abcdefghijklmnopqrs1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 0, 20, S("abcdefghijklmnopqrs12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 0, 21, S("abcdefghijklmnopqrs12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 1, 1, S("abcdefghijklmnopqrs2"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 1, 9, S("abcdefghijklmnopqrs234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 1, 18, S("abcdefghijklmnopqrs234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 1, 19, S("abcdefghijklmnopqrs2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 1, 20, S("abcdefghijklmnopqrs2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 10, 1, S("abcdefghijklmnopqrs1"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 10, 5, S("abcdefghijklmnopqrs12345"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 10, 9, S("abcdefghijklmnopqrs123456789"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 10, 10, S("abcdefghijklmnopqrs1234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 10, 11, S("abcdefghijklmnopqrs1234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 19, 1, S("abcdefghijklmnopqrs0"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 19, 2, S("abcdefghijklmnopqrs0"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV(""), 0, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV(""), 0, 1, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 0, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 0, 1, S("abcdefghijklmnopqrs1"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 0, 2, S("abcdefghijklmnopqrs12"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 0, 4, S("abcdefghijklmnopqrs1234"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 0, 5, S("abcdefghijklmnopqrs12345"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 0, 6, S("abcdefghijklmnopqrs12345"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 1, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 1, 1, S("abcdefghijklmnopqrs2"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 1, 2, S("abcdefghijklmnopqrs23"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 1, 3, S("abcdefghijklmnopqrs234"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 1, 4, S("abcdefghijklmnopqrs2345"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 1, 5, S("abcdefghijklmnopqrs2345"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 2, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 2, 1, S("abcdefghijklmnopqrs3"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 2, 2, S("abcdefghijklmnopqrs34"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 2, 3, S("abcdefghijklmnopqrs345"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 2, 4, S("abcdefghijklmnopqrs345"));
+}
+
+template <class S, class SV>
+void test52()
+{
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 4, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 4, 1, S("abcdefghijklmnopqrs5"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 4, 2, S("abcdefghijklmnopqrs5"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 5, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 5, 1, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 0, 1, S("abcdefghijklmnopqrs1"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 0, 5, S("abcdefghijklmnopqrs12345"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 0, 9, S("abcdefghijklmnopqrs123456789"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 0, 10, S("abcdefghijklmnopqrs1234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 0, 11, S("abcdefghijklmnopqrs1234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 1, 1, S("abcdefghijklmnopqrs2"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 1, 4, S("abcdefghijklmnopqrs2345"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 1, 8, S("abcdefghijklmnopqrs23456789"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 1, 9, S("abcdefghijklmnopqrs234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 1, 10, S("abcdefghijklmnopqrs234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 5, 1, S("abcdefghijklmnopqrs6"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 5, 2, S("abcdefghijklmnopqrs67"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 5, 4, S("abcdefghijklmnopqrs6789"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 5, 5, S("abcdefghijklmnopqrs67890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 5, 6, S("abcdefghijklmnopqrs67890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 9, 1, S("abcdefghijklmnopqrs0"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 9, 2, S("abcdefghijklmnopqrs0"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 0, 1, S("abcdefghijklmnopqrs1"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 0, 10, S("abcdefghijklmnopqrs1234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 0, 19, S("abcdefghijklmnopqrs1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 0, 20, S("abcdefghijklmnopqrs12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 0, 21, S("abcdefghijklmnopqrs12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 1, 1, S("abcdefghijklmnopqrs2"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 1, 9, S("abcdefghijklmnopqrs234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 1, 18, S("abcdefghijklmnopqrs234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 1, 19, S("abcdefghijklmnopqrs2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 1, 20, S("abcdefghijklmnopqrs2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 10, 1, S("abcdefghijklmnopqrs1"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 10, 5, S("abcdefghijklmnopqrs12345"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 10, 9, S("abcdefghijklmnopqrs123456789"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 10, 10, S("abcdefghijklmnopqrs1234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 10, 11, S("abcdefghijklmnopqrs1234567890"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 19, 1, S("abcdefghijklmnopqrs0"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 19, 2, S("abcdefghijklmnopqrs0"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrs"));
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 0, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 0, 2, S("abcdefghijklmnopqrst12"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 0, 4, S("abcdefghijklmnopqrst1234"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 0, 5, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 0, 6, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 1, 1, S("abcdefghijklmnopqrst2"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 1, 2, S("abcdefghijklmnopqrst23"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 1, 3, S("abcdefghijklmnopqrst234"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 1, 4, S("abcdefghijklmnopqrst2345"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 1, 5, S("abcdefghijklmnopqrst2345"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 2, 1, S("abcdefghijklmnopqrst3"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 2, 2, S("abcdefghijklmnopqrst34"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 2, 3, S("abcdefghijklmnopqrst345"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 2, 4, S("abcdefghijklmnopqrst345"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 4, 1, S("abcdefghijklmnopqrst5"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 4, 2, S("abcdefghijklmnopqrst5"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 0, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 0, 5, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 0, 9, S("abcdefghijklmnopqrst123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 0, 10, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 0, 11, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 1, 1, S("abcdefghijklmnopqrst2"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 1, 4, S("abcdefghijklmnopqrst2345"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 1, 8, S("abcdefghijklmnopqrst23456789"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 1, 9, S("abcdefghijklmnopqrst234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 1, 10, S("abcdefghijklmnopqrst234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 5, 1, S("abcdefghijklmnopqrst6"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 5, 2, S("abcdefghijklmnopqrst67"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 5, 4, S("abcdefghijklmnopqrst6789"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 5, 5, S("abcdefghijklmnopqrst67890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 5, 6, S("abcdefghijklmnopqrst67890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 9, 1, S("abcdefghijklmnopqrst0"));
+}
+
+template <class S, class SV>
+void test53()
+{
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 9, 2, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 0, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 0, 10, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 0, 19, S("abcdefghijklmnopqrst1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 0, 20, S("abcdefghijklmnopqrst12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 0, 21, S("abcdefghijklmnopqrst12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 1, 1, S("abcdefghijklmnopqrst2"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 1, 9, S("abcdefghijklmnopqrst234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 1, 18, S("abcdefghijklmnopqrst234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 1, 19, S("abcdefghijklmnopqrst2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 1, 20, S("abcdefghijklmnopqrst2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 10, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 10, 5, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 10, 9, S("abcdefghijklmnopqrst123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 10, 10, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 10, 11, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 19, 1, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 19, 2, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV(""), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV(""), 0, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 0, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 0, 2, S("abcdefghijklmnopqrst12"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 0, 4, S("abcdefghijklmnopqrst1234"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 0, 5, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 0, 6, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 1, 1, S("abcdefghijklmnopqrst2"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 1, 2, S("abcdefghijklmnopqrst23"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 1, 3, S("abcdefghijklmnopqrst234"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 1, 4, S("abcdefghijklmnopqrst2345"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 1, 5, S("abcdefghijklmnopqrst2345"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 2, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 2, 1, S("abcdefghijklmnopqrst3"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 2, 2, S("abcdefghijklmnopqrst34"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 2, 3, S("abcdefghijklmnopqrst345"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 2, 4, S("abcdefghijklmnopqrst345"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 4, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 4, 1, S("abcdefghijklmnopqrst5"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 4, 2, S("abcdefghijklmnopqrst5"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 5, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 0, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 0, 5, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 0, 9, S("abcdefghijklmnopqrst123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 0, 10, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 0, 11, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 1, 1, S("abcdefghijklmnopqrst2"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 1, 4, S("abcdefghijklmnopqrst2345"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 1, 8, S("abcdefghijklmnopqrst23456789"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 1, 9, S("abcdefghijklmnopqrst234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 1, 10, S("abcdefghijklmnopqrst234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 5, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 5, 1, S("abcdefghijklmnopqrst6"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 5, 2, S("abcdefghijklmnopqrst67"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 5, 4, S("abcdefghijklmnopqrst6789"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 5, 5, S("abcdefghijklmnopqrst67890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 5, 6, S("abcdefghijklmnopqrst67890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 9, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 9, 1, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 9, 2, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 10, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 0, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 0, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 0, 10, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 0, 19, S("abcdefghijklmnopqrst1234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 0, 20, S("abcdefghijklmnopqrst12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 0, 21, S("abcdefghijklmnopqrst12345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 1, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 1, 1, S("abcdefghijklmnopqrst2"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 1, 9, S("abcdefghijklmnopqrst234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 1, 18, S("abcdefghijklmnopqrst234567890123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 1, 19, S("abcdefghijklmnopqrst2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 1, 20, S("abcdefghijklmnopqrst2345678901234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 10, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 10, 1, S("abcdefghijklmnopqrst1"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 10, 5, S("abcdefghijklmnopqrst12345"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 10, 9, S("abcdefghijklmnopqrst123456789"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 10, 10, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 10, 11, S("abcdefghijklmnopqrst1234567890"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 19, 0, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 19, 1, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 19, 2, S("abcdefghijklmnopqrst0"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 20, 0, S("abcdefghijklmnopqrst"));
+}
+
+template <class S, class SV>
+void test54()
+{
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 20, 1, S("abcdefghijklmnopqrst"));
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("12345678901234567890"), 21, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV(""), 0, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV(""), 0, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV(""), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 0, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 0, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 0, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 0, 4, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 0, 5, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 0, 6, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 1, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 1, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 1, 3, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 1, 4, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 1, 5, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 2, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 2, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 2, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 2, 3, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 2, 4, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 4, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 4, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 4, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 5, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 5, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345"), 6, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 0, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 0, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 0, 5, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 0, 9, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 0, 10, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 0, 11, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 1, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 1, 4, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 1, 8, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 1, 9, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 1, 10, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 5, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 5, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 5, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 5, 4, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 5, 5, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 5, 6, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 9, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 9, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 9, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 10, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 10, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("1234567890"), 11, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 0, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 0, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 0, 10, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 0, 19, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 0, 20, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 0, 21, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 1, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 1, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 1, 9, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 1, 18, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 1, 19, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 1, 20, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 10, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 10, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 10, 5, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 10, 9, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 10, 10, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 10, 11, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 19, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 19, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 19, 2, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 20, 0, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 20, 1, S("can't happen"));
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("12345678901234567890"), 21, 0, S("can't happen"));
+}
+
+template <class S, class SV>
+void test55()
+{
+ test_npos(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 10, S("abcdefghi1234567890"));
+ test_npos(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 19, S("abcdefghi0"));
+ test_npos(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 20, S("abcdefghi"));
+ test_npos(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 20, S("abcdefghi"));
+ test_npos(S("abcdefghij"), 9, 1, SV("12345678901234567890"), 21, S("can't happen"));
+ test_npos(S("abcdefghij"), 9, 2, SV(""), 0, S("abcdefghi"));
+ test_npos(S("abcdefghij"), 9, 2, SV(""), 1, S("can't happen"));
+ test_npos(S("abcdefghij"), 9, 2, SV("12345"), 0, S("abcdefghi12345"));
+ test_npos(S("abcdefghij"), 9, 2, SV("12345"), 1, S("abcdefghi2345"));
+ test_npos(S("abcdefghij"), 9, 2, SV("12345"), 2, S("abcdefghi345"));
+ test_npos(S("abcdefghij"), 9, 2, SV("12345"), 4, S("abcdefghi5"));
+ test_npos(S("abcdefghij"), 9, 2, SV("12345"), 5, S("abcdefghi"));
+ test_npos(S("abcdefghij"), 9, 2, SV("12345"), 6, S("can't happen"));
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test0<S, SV>();
+ test1<S, SV>();
+ test2<S, SV>();
+ test3<S, SV>();
+ test4<S, SV>();
+ test5<S, SV>();
+ test6<S, SV>();
+ test7<S, SV>();
+ test8<S, SV>();
+ test9<S, SV>();
+ test10<S, SV>();
+ test11<S, SV>();
+ test12<S, SV>();
+ test13<S, SV>();
+ test14<S, SV>();
+ test15<S, SV>();
+ test16<S, SV>();
+ test17<S, SV>();
+ test18<S, SV>();
+ test19<S, SV>();
+ test20<S, SV>();
+ test21<S, SV>();
+ test22<S, SV>();
+ test23<S, SV>();
+ test24<S, SV>();
+ test25<S, SV>();
+ test26<S, SV>();
+ test27<S, SV>();
+ test28<S, SV>();
+ test29<S, SV>();
+ test30<S, SV>();
+ test31<S, SV>();
+ test32<S, SV>();
+ test33<S, SV>();
+ test34<S, SV>();
+ test35<S, SV>();
+ test36<S, SV>();
+ test37<S, SV>();
+ test38<S, SV>();
+ test39<S, SV>();
+ test40<S, SV>();
+ test41<S, SV>();
+ test42<S, SV>();
+ test43<S, SV>();
+ test44<S, SV>();
+ test45<S, SV>();
+ test46<S, SV>();
+ test47<S, SV>();
+ test48<S, SV>();
+ test49<S, SV>();
+ test50<S, SV>();
+ test51<S, SV>();
+ test52<S, SV>();
+ test53<S, SV>();
+ test54<S, SV>();
+ test55<S, SV>();
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test0<S, SV>();
+ test1<S, SV>();
+ test2<S, SV>();
+ test3<S, SV>();
+ test4<S, SV>();
+ test5<S, SV>();
+ test6<S, SV>();
+ test7<S, SV>();
+ test8<S, SV>();
+ test9<S, SV>();
+ test10<S, SV>();
+ test11<S, SV>();
+ test12<S, SV>();
+ test13<S, SV>();
+ test14<S, SV>();
+ test15<S, SV>();
+ test16<S, SV>();
+ test17<S, SV>();
+ test18<S, SV>();
+ test19<S, SV>();
+ test20<S, SV>();
+ test21<S, SV>();
+ test22<S, SV>();
+ test23<S, SV>();
+ test24<S, SV>();
+ test25<S, SV>();
+ test26<S, SV>();
+ test27<S, SV>();
+ test28<S, SV>();
+ test29<S, SV>();
+ test30<S, SV>();
+ test31<S, SV>();
+ test32<S, SV>();
+ test33<S, SV>();
+ test34<S, SV>();
+ test35<S, SV>();
+ test36<S, SV>();
+ test37<S, SV>();
+ test38<S, SV>();
+ test39<S, SV>();
+ test40<S, SV>();
+ test41<S, SV>();
+ test42<S, SV>();
+ test43<S, SV>();
+ test44<S, SV>();
+ test45<S, SV>();
+ test46<S, SV>();
+ test47<S, SV>();
+ test48<S, SV>();
+ test49<S, SV>();
+ test50<S, SV>();
+ test51<S, SV>();
+ test52<S, SV>();
+ test53<S, SV>();
+ test54<S, SV>();
+ test55<S, SV>();
+ }
+#endif
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ S s0 = "ABCD";
+ S s;
+ SV sv = "EFGH";
+ char arr[] = "IJKL";
+
+ s = s0;
+ s.replace(0, 4, "CDEF", 0); // calls replace(pos1, n1, const char *, len)
+ assert(s == "");
+
+ s = s0;
+ s.replace(0, 4, "QRST", 0, std::string::npos); // calls replace(pos1, n1, string("QRST"), pos, npos)
+ assert(s == "QRST");
+
+ s = s0;
+ s.replace(0, 4, sv, 0); // calls replace(pos1, n1, T, pos, npos)
+ assert(s == sv);
+
+ s = s0;
+ s.replace(0, 4, sv, 0, std::string::npos); // calls replace(pos1, n1, T, pos, npos)
+ assert(s == sv);
+
+ s = s0;
+ s.replace(0, 4, arr, 0); // calls replace(pos1, n1, const char *, len)
+ assert(s == "");
+
+ s = s0;
+ s.replace(0, 4, arr, 0, std::string::npos); // calls replace(pos1, n1, string("IJKL"), pos, npos)
+ assert(s == "IJKL");
+ }
+}
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp
index 3beb074c0fd3..d09c9c2efd62 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -26,23 +25,32 @@ void
test(S s, typename S::size_type pos, typename S::size_type n1,
const typename S::value_type* str, S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos <= old_size)
{
s.replace(pos, n1, str);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos);
typename S::size_type rlen = S::traits_type::length(str);
assert(s.size() == old_size - xlen + rlen);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > old_size);
- assert(s == s0);
+ try
+ {
+ s.replace(pos, n1, str);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > old_size);
+ assert(s == s0);
+ }
}
+#endif
}
template <class S>
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp
index d961e9e8f76f..5c751285cb06 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -27,23 +26,32 @@ test(S s, typename S::size_type pos, typename S::size_type n1,
const typename S::value_type* str, typename S::size_type n2,
S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos <= old_size)
{
s.replace(pos, n1, str, n2);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos);
typename S::size_type rlen = n2;
assert(s.size() == old_size - xlen + rlen);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > old_size);
- assert(s == s0);
+ try
+ {
+ s.replace(pos, n1, str, n2);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > old_size);
+ assert(s == s0);
+ }
}
+#endif
}
template <class S>
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp
index d4696fba8a83..75745dab61f6 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -27,23 +26,32 @@ test(S s, typename S::size_type pos, typename S::size_type n1,
typename S::size_type n2, typename S::value_type c,
S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos <= old_size)
{
s.replace(pos, n1, n2, c);
LIBCPP_ASSERT(s.__invariants());
- assert(pos <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos);
typename S::size_type rlen = n2;
assert(s.size() == old_size - xlen + rlen);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > old_size);
- assert(s == s0);
+ try
+ {
+ s.replace(pos, n1, n2, c);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > old_size);
+ assert(s == s0);
+ }
}
+#endif
}
template <class S>
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp
index 1be45d8a6624..612e1e200c90 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -25,23 +24,32 @@ template <class S>
void
test(S s, typename S::size_type pos1, typename S::size_type n1, S str, S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos1 <= old_size)
{
s.replace(pos1, n1, str);
LIBCPP_ASSERT(s.__invariants());
- assert(pos1 <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos1);
typename S::size_type rlen = str.size();
assert(s.size() == old_size - xlen + rlen);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos1 > old_size);
- assert(s == s0);
+ try
+ {
+ s.replace(pos1, n1, str);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > old_size);
+ assert(s == s0);
+ }
}
+#endif
}
template <class S>
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp
index 3f4bf450d858..b49b6f987b01 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -29,23 +28,32 @@ test(S s, typename S::size_type pos1, typename S::size_type n1,
S str, typename S::size_type pos2, typename S::size_type n2,
S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos1 <= old_size && pos2 <= str.size())
{
s.replace(pos1, n1, str, pos2, n2);
LIBCPP_ASSERT(s.__invariants());
- assert(pos1 <= old_size && pos2 <= str.size());
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos1);
typename S::size_type rlen = std::min(n2, str.size() - pos2);
assert(s.size() == old_size - xlen + rlen);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos1 > old_size || pos2 > str.size());
- assert(s == s0);
+ try
+ {
+ s.replace(pos1, n1, str, pos2, n2);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > old_size || pos2 > str.size());
+ assert(s == s0);
+ }
}
+#endif
}
template <class S>
@@ -54,23 +62,32 @@ test_npos(S s, typename S::size_type pos1, typename S::size_type n1,
S str, typename S::size_type pos2,
S expected)
{
- typename S::size_type old_size = s.size();
+ const typename S::size_type old_size = s.size();
S s0 = s;
- try
+ if (pos1 <= old_size && pos2 <= str.size())
{
s.replace(pos1, n1, str, pos2);
LIBCPP_ASSERT(s.__invariants());
- assert(pos1 <= old_size && pos2 <= str.size());
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos1);
typename S::size_type rlen = std::min(S::npos, str.size() - pos2);
assert(s.size() == old_size - xlen + rlen);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos1 > old_size || pos2 > str.size());
- assert(s == s0);
+ try
+ {
+ s.replace(pos1, n1, str, pos2);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > old_size || pos2 > str.size());
+ assert(s == s0);
+ }
}
+#endif
}
diff --git a/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
index 4ac13d10e670..757d5eeb2dc3 100644
--- a/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
+++ b/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
@@ -22,6 +22,7 @@
// This tests a conforming extension
#include <string>
+#include <utility>
#include <cassert>
#include "test_macros.h"
@@ -56,30 +57,26 @@ int main()
{
{
typedef std::string C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::basic_string<char, std::char_traits<char>, test_allocator<char>> C;
- C c1, c2;
- static_assert(noexcept(swap(c1, c2)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C;
- C c1, c2;
#if TEST_STD_VER >= 14
// In c++14, if POCS is set, swapping the allocator is required not to throw
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#else
- static_assert(!noexcept(swap(c1, c2)), "");
+ static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#endif
}
#if TEST_STD_VER >= 14
{
typedef std::basic_string<char, std::char_traits<char>, some_alloc2<char>> C;
- C c1, c2;
// if the allocators are always equal, then the swap can be noexcept
- static_assert( noexcept(swap(c1, c2)), "");
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#endif
}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_op!=/string_string_view.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op!=/string_string_view.pass.cpp
new file mode 100644
index 000000000000..65649465da29
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_op!=/string_string_view.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(const S& lhs, SV rhs, bool x)
+{
+ assert((lhs != rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string SV;
+ test(S(""), SV(""), false);
+ test(S(""), SV("abcde"), true);
+ test(S(""), SV("abcdefghij"), true);
+ test(S(""), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcde"), SV(""), true);
+ test(S("abcde"), SV("abcde"), false);
+ test(S("abcde"), SV("abcdefghij"), true);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghij"), SV(""), true);
+ test(S("abcdefghij"), SV("abcde"), true);
+ test(S("abcdefghij"), SV("abcdefghij"), false);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghijklmnopqrst"), SV(""), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), false);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(S(""), SV(""), false);
+ test(S(""), SV("abcde"), true);
+ test(S(""), SV("abcdefghij"), true);
+ test(S(""), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcde"), SV(""), true);
+ test(S("abcde"), SV("abcde"), false);
+ test(S("abcde"), SV("abcdefghij"), true);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghij"), SV(""), true);
+ test(S("abcdefghij"), SV("abcde"), true);
+ test(S("abcdefghij"), SV("abcdefghij"), false);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghijklmnopqrst"), SV(""), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), false);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_op!=/string_view_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op!=/string_view_string.pass.cpp
new file mode 100644
index 000000000000..88c758c7aa70
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_op!=/string_view_string.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(SV lhs, const S& rhs, bool x)
+{
+ assert((lhs != rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(SV(""), S(""), false);
+ test(SV(""), S("abcde"), true);
+ test(SV(""), S("abcdefghij"), true);
+ test(SV(""), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcde"), S(""), true);
+ test(SV("abcde"), S("abcde"), false);
+ test(SV("abcde"), S("abcdefghij"), true);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghij"), S(""), true);
+ test(SV("abcdefghij"), S("abcde"), true);
+ test(SV("abcdefghij"), S("abcdefghij"), false);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghijklmnopqrst"), S(""), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(SV(""), S(""), false);
+ test(SV(""), S("abcde"), true);
+ test(SV(""), S("abcdefghij"), true);
+ test(SV(""), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcde"), S(""), true);
+ test(SV("abcde"), S("abcde"), false);
+ test(SV("abcde"), S("abcdefghij"), true);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghij"), S(""), true);
+ test(SV("abcdefghij"), S("abcde"), true);
+ test(SV("abcdefghij"), S("abcdefghij"), false);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghijklmnopqrst"), S(""), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_operator==/string_string_view.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_operator==/string_string_view.pass.cpp
new file mode 100644
index 000000000000..dec8f6f5af80
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_operator==/string_string_view.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(const S& lhs, SV rhs, bool x)
+{
+ assert((lhs == rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(S(""), SV(""), true);
+ test(S(""), SV("abcde"), false);
+ test(S(""), SV("abcdefghij"), false);
+ test(S(""), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcde"), SV(""), false);
+ test(S("abcde"), SV("abcde"), true);
+ test(S("abcde"), SV("abcdefghij"), false);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghij"), SV(""), false);
+ test(S("abcdefghij"), SV("abcde"), false);
+ test(S("abcdefghij"), SV("abcdefghij"), true);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghijklmnopqrst"), SV(""), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), true);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string <char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(S(""), SV(""), true);
+ test(S(""), SV("abcde"), false);
+ test(S(""), SV("abcdefghij"), false);
+ test(S(""), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcde"), SV(""), false);
+ test(S("abcde"), SV("abcde"), true);
+ test(S("abcde"), SV("abcdefghij"), false);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghij"), SV(""), false);
+ test(S("abcdefghij"), SV("abcde"), false);
+ test(S("abcdefghij"), SV("abcdefghij"), true);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghijklmnopqrst"), SV(""), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), true);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_operator==/string_view_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_operator==/string_view_string.pass.cpp
new file mode 100644
index 000000000000..2cd808659058
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_operator==/string_view_string.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(SV lhs, const S& rhs, bool x)
+{
+ assert((lhs == rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(SV(""), S(""), true);
+ test(SV(""), S("abcde"), false);
+ test(SV(""), S("abcdefghij"), false);
+ test(SV(""), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcde"), S(""), false);
+ test(SV("abcde"), S("abcde"), true);
+ test(SV("abcde"), S("abcdefghij"), false);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghij"), S(""), false);
+ test(SV("abcdefghij"), S("abcde"), false);
+ test(SV("abcdefghij"), S("abcdefghij"), true);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghijklmnopqrst"), S(""), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(SV(""), S(""), true);
+ test(SV(""), S("abcde"), false);
+ test(SV(""), S("abcdefghij"), false);
+ test(SV(""), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcde"), S(""), false);
+ test(SV("abcde"), S("abcde"), true);
+ test(SV("abcde"), S("abcdefghij"), false);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghij"), S(""), false);
+ test(SV("abcdefghij"), S("abcde"), false);
+ test(SV("abcdefghij"), S("abcdefghij"), true);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghijklmnopqrst"), S(""), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_opgt/string_string_view.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_opgt/string_string_view.pass.cpp
new file mode 100644
index 000000000000..d9f5d7106dbb
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_opgt/string_string_view.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(const S& lhs, SV rhs, bool x)
+{
+ assert((lhs > rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(S(""), SV(""), false);
+ test(S(""), SV("abcde"), false);
+ test(S(""), SV("abcdefghij"), false);
+ test(S(""), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcde"), SV(""), true);
+ test(S("abcde"), SV("abcde"), false);
+ test(S("abcde"), SV("abcdefghij"), false);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghij"), SV(""), true);
+ test(S("abcdefghij"), SV("abcde"), true);
+ test(S("abcdefghij"), SV("abcdefghij"), false);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghijklmnopqrst"), SV(""), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), false);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string <char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(S(""), SV(""), false);
+ test(S(""), SV("abcde"), false);
+ test(S(""), SV("abcdefghij"), false);
+ test(S(""), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcde"), SV(""), true);
+ test(S("abcde"), SV("abcde"), false);
+ test(S("abcde"), SV("abcdefghij"), false);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghij"), SV(""), true);
+ test(S("abcdefghij"), SV("abcde"), true);
+ test(S("abcdefghij"), SV("abcdefghij"), false);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghijklmnopqrst"), SV(""), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), false);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_opgt/string_view_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_opgt/string_view_string.pass.cpp
new file mode 100644
index 000000000000..c685bab8fc1e
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_opgt/string_view_string.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(SV lhs, const S& rhs, bool x)
+{
+ assert((lhs > rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(SV(""), S(""), false);
+ test(SV(""), S("abcde"), false);
+ test(SV(""), S("abcdefghij"), false);
+ test(SV(""), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcde"), S(""), true);
+ test(SV("abcde"), S("abcde"), false);
+ test(SV("abcde"), S("abcdefghij"), false);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghij"), S(""), true);
+ test(SV("abcdefghij"), S("abcde"), true);
+ test(SV("abcdefghij"), S("abcdefghij"), false);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghijklmnopqrst"), S(""), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string <char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(SV(""), S(""), false);
+ test(SV(""), S("abcde"), false);
+ test(SV(""), S("abcdefghij"), false);
+ test(SV(""), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcde"), S(""), true);
+ test(SV("abcde"), S("abcde"), false);
+ test(SV("abcde"), S("abcdefghij"), false);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghij"), S(""), true);
+ test(SV("abcdefghij"), S("abcde"), true);
+ test(SV("abcdefghij"), S("abcdefghij"), false);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghijklmnopqrst"), S(""), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_opgt=/string_string_view.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_opgt=/string_string_view.pass.cpp
new file mode 100644
index 000000000000..5b9671fca1d3
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_opgt=/string_string_view.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(const S& lhs, SV rhs, bool x)
+{
+ assert((lhs >= rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(S(""), SV(""), true);
+ test(S(""), SV("abcde"), false);
+ test(S(""), SV("abcdefghij"), false);
+ test(S(""), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcde"), SV(""), true);
+ test(S("abcde"), SV("abcde"), true);
+ test(S("abcde"), SV("abcdefghij"), false);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghij"), SV(""), true);
+ test(S("abcdefghij"), SV("abcde"), true);
+ test(S("abcdefghij"), SV("abcdefghij"), true);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghijklmnopqrst"), SV(""), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), true);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(S(""), SV(""), true);
+ test(S(""), SV("abcde"), false);
+ test(S(""), SV("abcdefghij"), false);
+ test(S(""), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcde"), SV(""), true);
+ test(S("abcde"), SV("abcde"), true);
+ test(S("abcde"), SV("abcdefghij"), false);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghij"), SV(""), true);
+ test(S("abcdefghij"), SV("abcde"), true);
+ test(S("abcdefghij"), SV("abcdefghij"), true);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghijklmnopqrst"), SV(""), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), true);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), true);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_opgt=/string_view_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_opgt=/string_view_string.pass.cpp
new file mode 100644
index 000000000000..07c8282a740f
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_opgt=/string_view_string.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(SV lhs, const S& rhs, bool x)
+{
+ assert((lhs >= rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(SV(""), S(""), true);
+ test(SV(""), S("abcde"), false);
+ test(SV(""), S("abcdefghij"), false);
+ test(SV(""), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcde"), S(""), true);
+ test(SV("abcde"), S("abcde"), true);
+ test(SV("abcde"), S("abcdefghij"), false);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghij"), S(""), true);
+ test(SV("abcdefghij"), S("abcde"), true);
+ test(SV("abcdefghij"), S("abcdefghij"), true);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghijklmnopqrst"), S(""), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(SV(""), S(""), true);
+ test(SV(""), S("abcde"), false);
+ test(SV(""), S("abcdefghij"), false);
+ test(SV(""), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcde"), S(""), true);
+ test(SV("abcde"), S("abcde"), true);
+ test(SV("abcde"), S("abcdefghij"), false);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghij"), S(""), true);
+ test(SV("abcdefghij"), S("abcde"), true);
+ test(SV("abcdefghij"), S("abcdefghij"), true);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), false);
+ test(SV("abcdefghijklmnopqrst"), S(""), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), true);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_oplt/string_string_view.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_oplt/string_string_view.pass.cpp
new file mode 100644
index 000000000000..8fef8e60a96b
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_oplt/string_string_view.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(const S& lhs, SV rhs, bool x)
+{
+ assert((lhs < rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(S(""), SV(""), false);
+ test(S(""), SV("abcde"), true);
+ test(S(""), SV("abcdefghij"), true);
+ test(S(""), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcde"), SV(""), false);
+ test(S("abcde"), SV("abcde"), false);
+ test(S("abcde"), SV("abcdefghij"), true);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghij"), SV(""), false);
+ test(S("abcdefghij"), SV("abcde"), false);
+ test(S("abcdefghij"), SV("abcdefghij"), false);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghijklmnopqrst"), SV(""), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), false);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(S(""), SV(""), false);
+ test(S(""), SV("abcde"), true);
+ test(S(""), SV("abcdefghij"), true);
+ test(S(""), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcde"), SV(""), false);
+ test(S("abcde"), SV("abcde"), false);
+ test(S("abcde"), SV("abcdefghij"), true);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghij"), SV(""), false);
+ test(S("abcdefghij"), SV("abcde"), false);
+ test(S("abcdefghij"), SV("abcdefghij"), false);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghijklmnopqrst"), SV(""), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), false);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_oplt/string_view_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_oplt/string_view_string.pass.cpp
new file mode 100644
index 000000000000..80da8cd00480
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_oplt/string_view_string.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(SV lhs, const S& rhs, bool x)
+{
+ assert((lhs < rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(SV(""), S(""), false);
+ test(SV(""), S("abcde"), true);
+ test(SV(""), S("abcdefghij"), true);
+ test(SV(""), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcde"), S(""), false);
+ test(SV("abcde"), S("abcde"), false);
+ test(SV("abcde"), S("abcdefghij"), true);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghij"), S(""), false);
+ test(SV("abcdefghij"), S("abcde"), false);
+ test(SV("abcdefghij"), S("abcdefghij"), false);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghijklmnopqrst"), S(""), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(SV(""), S(""), false);
+ test(SV(""), S("abcde"), true);
+ test(SV(""), S("abcdefghij"), true);
+ test(SV(""), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcde"), S(""), false);
+ test(SV("abcde"), S("abcde"), false);
+ test(SV("abcde"), S("abcdefghij"), true);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghij"), S(""), false);
+ test(SV("abcdefghij"), S("abcde"), false);
+ test(SV("abcdefghij"), S("abcdefghij"), false);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghijklmnopqrst"), S(""), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_oplt=/string_string_view.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_oplt=/string_string_view.pass.cpp
new file mode 100644
index 000000000000..97a9d7cc7175
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_oplt=/string_string_view.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(const S& lhs, SV rhs, bool x)
+{
+ assert((lhs <= rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(S(""), SV(""), true);
+ test(S(""), SV("abcde"), true);
+ test(S(""), SV("abcdefghij"), true);
+ test(S(""), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcde"), SV(""), false);
+ test(S("abcde"), SV("abcde"), true);
+ test(S("abcde"), SV("abcdefghij"), true);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghij"), SV(""), false);
+ test(S("abcdefghij"), SV("abcde"), false);
+ test(S("abcdefghij"), SV("abcdefghij"), true);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghijklmnopqrst"), SV(""), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), true);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(S(""), SV(""), true);
+ test(S(""), SV("abcde"), true);
+ test(S(""), SV("abcdefghij"), true);
+ test(S(""), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcde"), SV(""), false);
+ test(S("abcde"), SV("abcde"), true);
+ test(S("abcde"), SV("abcdefghij"), true);
+ test(S("abcde"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghij"), SV(""), false);
+ test(S("abcdefghij"), SV("abcde"), false);
+ test(S("abcdefghij"), SV("abcdefghij"), true);
+ test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghijklmnopqrst"), SV(""), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcde"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), false);
+ test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), true);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.nonmembers/string_oplt=/string_view_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_oplt=/string_view_string.pass.cpp
new file mode 100644
index 000000000000..f19a4aa0fd5b
--- /dev/null
+++ b/test/std/strings/basic.string/string.nonmembers/string_oplt=/string_view_string.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// we get this comparison "for free" because the string implicitly converts to the string_view
+
+#include <string>
+#include <cassert>
+
+#include "min_allocator.h"
+
+template <class S, class SV>
+void
+test(SV lhs, const S& rhs, bool x)
+{
+ assert((lhs <= rhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test(SV(""), S(""), true);
+ test(SV(""), S("abcde"), true);
+ test(SV(""), S("abcdefghij"), true);
+ test(SV(""), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcde"), S(""), false);
+ test(SV("abcde"), S("abcde"), true);
+ test(SV("abcde"), S("abcdefghij"), true);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghij"), S(""), false);
+ test(SV("abcdefghij"), S("abcde"), false);
+ test(SV("abcdefghij"), S("abcdefghij"), true);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghijklmnopqrst"), S(""), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test(SV(""), S(""), true);
+ test(SV(""), S("abcde"), true);
+ test(SV(""), S("abcdefghij"), true);
+ test(SV(""), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcde"), S(""), false);
+ test(SV("abcde"), S("abcde"), true);
+ test(SV("abcde"), S("abcdefghij"), true);
+ test(SV("abcde"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghij"), S(""), false);
+ test(SV("abcdefghij"), S("abcde"), false);
+ test(SV("abcdefghij"), S("abcdefghij"), true);
+ test(SV("abcdefghij"), S("abcdefghijklmnopqrst"), true);
+ test(SV("abcdefghijklmnopqrst"), S(""), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcde"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghij"), false);
+ test(SV("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
+ }
+#endif
+}
diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp
new file mode 100644
index 000000000000..bc2bf656db01
--- /dev/null
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp
@@ -0,0 +1,5993 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template <typename T>
+// int compare(size_type pos1, size_type n1, const T& t,
+// size_type pos2, size_type n2=npos) const;
+//
+// Mostly we're testing string_view here
+
+#include <string>
+#include <stdexcept>
+#include <cassert>
+
+#include "min_allocator.h"
+
+#include "test_macros.h"
+
+int sign(int x)
+{
+ if (x == 0)
+ return 0;
+ if (x < 0)
+ return -1;
+ return 1;
+}
+
+template <class S, class SV>
+void
+test(const S& s, typename S::size_type pos1, typename S::size_type n1,
+ SV sv, typename S::size_type pos2, typename S::size_type n2, int x)
+{
+ static_assert((!std::is_same<S, SV>::value), "");
+ if (pos1 <= s.size() && pos2 <= sv.size())
+ assert(sign(s.compare(pos1, n1, sv, pos2, n2)) == sign(x));
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ s.compare(pos1, n1, sv, pos2, n2);
+ assert(false);
+ }
+ catch (const std::out_of_range&)
+ {
+ assert(pos1 > s.size() || pos2 > sv.size());
+ }
+ }
+#endif
+}
+
+template <class S, class SV>
+void
+test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1,
+ SV sv, typename S::size_type pos2, int x)
+{
+ static_assert((!std::is_same<S, SV>::value), "");
+ if (pos1 <= s.size() && pos2 <= sv.size())
+ assert(sign(s.compare(pos1, n1, sv, pos2)) == sign(x));
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
+ {
+ try
+ {
+ s.compare(pos1, n1, sv, pos2);
+ assert(false);
+ }
+ catch (const std::out_of_range&)
+ {
+ assert(pos1 > s.size() || pos2 > sv.size());
+ }
+ }
+#endif
+}
+
+template <class S, class SV>
+void test0()
+{
+ test(S(""), 0, 0, SV(""), 0, 0, 0);
+ test(S(""), 0, 0, SV(""), 0, 1, 0);
+ test(S(""), 0, 0, SV(""), 1, 0, 0);
+ test(S(""), 0, 0, SV("abcde"), 0, 0, 0);
+ test(S(""), 0, 0, SV("abcde"), 0, 1, -1);
+ test(S(""), 0, 0, SV("abcde"), 0, 2, -2);
+ test(S(""), 0, 0, SV("abcde"), 0, 4, -4);
+ test(S(""), 0, 0, SV("abcde"), 0, 5, -5);
+ test(S(""), 0, 0, SV("abcde"), 0, 6, -5);
+ test(S(""), 0, 0, SV("abcde"), 1, 0, 0);
+ test(S(""), 0, 0, SV("abcde"), 1, 1, -1);
+ test(S(""), 0, 0, SV("abcde"), 1, 2, -2);
+ test(S(""), 0, 0, SV("abcde"), 1, 3, -3);
+ test(S(""), 0, 0, SV("abcde"), 1, 4, -4);
+ test(S(""), 0, 0, SV("abcde"), 1, 5, -4);
+ test(S(""), 0, 0, SV("abcde"), 2, 0, 0);
+ test(S(""), 0, 0, SV("abcde"), 2, 1, -1);
+ test(S(""), 0, 0, SV("abcde"), 2, 2, -2);
+ test(S(""), 0, 0, SV("abcde"), 2, 3, -3);
+ test(S(""), 0, 0, SV("abcde"), 2, 4, -3);
+ test(S(""), 0, 0, SV("abcde"), 4, 0, 0);
+ test(S(""), 0, 0, SV("abcde"), 4, 1, -1);
+ test(S(""), 0, 0, SV("abcde"), 4, 2, -1);
+ test(S(""), 0, 0, SV("abcde"), 5, 0, 0);
+ test(S(""), 0, 0, SV("abcde"), 5, 1, 0);
+ test(S(""), 0, 0, SV("abcde"), 6, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S(""), 0, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S(""), 0, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S(""), 0, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S(""), 0, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S(""), 0, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S(""), 0, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S(""), 0, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S(""), 0, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S(""), 0, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S(""), 0, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S(""), 0, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S(""), 0, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S(""), 0, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S(""), 0, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S(""), 0, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S(""), 0, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S(""), 0, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S(""), 0, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S(""), 0, 1, SV(""), 0, 0, 0);
+ test(S(""), 0, 1, SV(""), 0, 1, 0);
+ test(S(""), 0, 1, SV(""), 1, 0, 0);
+ test(S(""), 0, 1, SV("abcde"), 0, 0, 0);
+ test(S(""), 0, 1, SV("abcde"), 0, 1, -1);
+ test(S(""), 0, 1, SV("abcde"), 0, 2, -2);
+ test(S(""), 0, 1, SV("abcde"), 0, 4, -4);
+ test(S(""), 0, 1, SV("abcde"), 0, 5, -5);
+ test(S(""), 0, 1, SV("abcde"), 0, 6, -5);
+ test(S(""), 0, 1, SV("abcde"), 1, 0, 0);
+ test(S(""), 0, 1, SV("abcde"), 1, 1, -1);
+ test(S(""), 0, 1, SV("abcde"), 1, 2, -2);
+ test(S(""), 0, 1, SV("abcde"), 1, 3, -3);
+ test(S(""), 0, 1, SV("abcde"), 1, 4, -4);
+ test(S(""), 0, 1, SV("abcde"), 1, 5, -4);
+ test(S(""), 0, 1, SV("abcde"), 2, 0, 0);
+ test(S(""), 0, 1, SV("abcde"), 2, 1, -1);
+ test(S(""), 0, 1, SV("abcde"), 2, 2, -2);
+ test(S(""), 0, 1, SV("abcde"), 2, 3, -3);
+ test(S(""), 0, 1, SV("abcde"), 2, 4, -3);
+ test(S(""), 0, 1, SV("abcde"), 4, 0, 0);
+ test(S(""), 0, 1, SV("abcde"), 4, 1, -1);
+ test(S(""), 0, 1, SV("abcde"), 4, 2, -1);
+ test(S(""), 0, 1, SV("abcde"), 5, 0, 0);
+ test(S(""), 0, 1, SV("abcde"), 5, 1, 0);
+ test(S(""), 0, 1, SV("abcde"), 6, 0, 0);
+}
+
+template <class S, class SV>
+void test1()
+{
+ test(S(""), 0, 1, SV("abcdefghij"), 0, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghij"), 0, 1, -1);
+ test(S(""), 0, 1, SV("abcdefghij"), 0, 5, -5);
+ test(S(""), 0, 1, SV("abcdefghij"), 0, 9, -9);
+ test(S(""), 0, 1, SV("abcdefghij"), 0, 10, -10);
+ test(S(""), 0, 1, SV("abcdefghij"), 0, 11, -10);
+ test(S(""), 0, 1, SV("abcdefghij"), 1, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghij"), 1, 1, -1);
+ test(S(""), 0, 1, SV("abcdefghij"), 1, 4, -4);
+ test(S(""), 0, 1, SV("abcdefghij"), 1, 8, -8);
+ test(S(""), 0, 1, SV("abcdefghij"), 1, 9, -9);
+ test(S(""), 0, 1, SV("abcdefghij"), 1, 10, -9);
+ test(S(""), 0, 1, SV("abcdefghij"), 5, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghij"), 5, 1, -1);
+ test(S(""), 0, 1, SV("abcdefghij"), 5, 2, -2);
+ test(S(""), 0, 1, SV("abcdefghij"), 5, 4, -4);
+ test(S(""), 0, 1, SV("abcdefghij"), 5, 5, -5);
+ test(S(""), 0, 1, SV("abcdefghij"), 5, 6, -5);
+ test(S(""), 0, 1, SV("abcdefghij"), 9, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghij"), 9, 1, -1);
+ test(S(""), 0, 1, SV("abcdefghij"), 9, 2, -1);
+ test(S(""), 0, 1, SV("abcdefghij"), 10, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghij"), 10, 1, 0);
+ test(S(""), 0, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S(""), 1, 0, SV(""), 0, 0, 0);
+ test(S(""), 1, 0, SV(""), 0, 1, 0);
+ test(S(""), 1, 0, SV(""), 1, 0, 0);
+ test(S(""), 1, 0, SV("abcde"), 0, 0, 0);
+ test(S(""), 1, 0, SV("abcde"), 0, 1, 0);
+ test(S(""), 1, 0, SV("abcde"), 0, 2, 0);
+ test(S(""), 1, 0, SV("abcde"), 0, 4, 0);
+ test(S(""), 1, 0, SV("abcde"), 0, 5, 0);
+ test(S(""), 1, 0, SV("abcde"), 0, 6, 0);
+ test(S(""), 1, 0, SV("abcde"), 1, 0, 0);
+ test(S(""), 1, 0, SV("abcde"), 1, 1, 0);
+ test(S(""), 1, 0, SV("abcde"), 1, 2, 0);
+ test(S(""), 1, 0, SV("abcde"), 1, 3, 0);
+ test(S(""), 1, 0, SV("abcde"), 1, 4, 0);
+ test(S(""), 1, 0, SV("abcde"), 1, 5, 0);
+ test(S(""), 1, 0, SV("abcde"), 2, 0, 0);
+ test(S(""), 1, 0, SV("abcde"), 2, 1, 0);
+ test(S(""), 1, 0, SV("abcde"), 2, 2, 0);
+ test(S(""), 1, 0, SV("abcde"), 2, 3, 0);
+ test(S(""), 1, 0, SV("abcde"), 2, 4, 0);
+ test(S(""), 1, 0, SV("abcde"), 4, 0, 0);
+ test(S(""), 1, 0, SV("abcde"), 4, 1, 0);
+ test(S(""), 1, 0, SV("abcde"), 4, 2, 0);
+ test(S(""), 1, 0, SV("abcde"), 5, 0, 0);
+ test(S(""), 1, 0, SV("abcde"), 5, 1, 0);
+ test(S(""), 1, 0, SV("abcde"), 6, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 0, 1, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 0, 5, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 0, 9, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 0, 10, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 0, 11, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 1, 1, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 1, 4, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 1, 8, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 1, 9, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 1, 10, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 5, 1, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 5, 2, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 5, 4, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 5, 5, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 5, 6, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 9, 1, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 9, 2, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S(""), 1, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 0, 1, 0);
+}
+
+template <class S, class SV>
+void test2()
+{
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 0, 10, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 0, 19, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 0, 20, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 0, 21, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 1, 1, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 1, 9, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 1, 18, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 1, 19, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 1, 20, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 10, 1, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 10, 5, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 10, 9, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 10, 10, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 10, 11, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 19, 1, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 19, 2, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 0, 0, SV(""), 0, 0, 0);
+ test(S("abcde"), 0, 0, SV(""), 0, 1, 0);
+ test(S("abcde"), 0, 0, SV(""), 1, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcde"), 0, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcde"), 0, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcde"), 0, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcde"), 0, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcde"), 0, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcde"), 0, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcde"), 0, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcde"), 0, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 0, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcde"), 0, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcde"), 0, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcde"), 0, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcde"), 0, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 0, 1, SV(""), 0, 0, 1);
+ test(S("abcde"), 0, 1, SV(""), 0, 1, 1);
+ test(S("abcde"), 0, 1, SV(""), 1, 0, 0);
+ test(S("abcde"), 0, 1, SV("abcde"), 0, 0, 1);
+}
+
+template <class S, class SV>
+void test3()
+{
+ test(S("abcde"), 0, 1, SV("abcde"), 0, 1, 0);
+ test(S("abcde"), 0, 1, SV("abcde"), 0, 2, -1);
+ test(S("abcde"), 0, 1, SV("abcde"), 0, 4, -3);
+ test(S("abcde"), 0, 1, SV("abcde"), 0, 5, -4);
+ test(S("abcde"), 0, 1, SV("abcde"), 0, 6, -4);
+ test(S("abcde"), 0, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 0, 1, SV("abcde"), 1, 2, -1);
+ test(S("abcde"), 0, 1, SV("abcde"), 1, 3, -1);
+ test(S("abcde"), 0, 1, SV("abcde"), 1, 4, -1);
+ test(S("abcde"), 0, 1, SV("abcde"), 1, 5, -1);
+ test(S("abcde"), 0, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcde"), 2, 1, -2);
+ test(S("abcde"), 0, 1, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 0, 1, SV("abcde"), 2, 3, -2);
+ test(S("abcde"), 0, 1, SV("abcde"), 2, 4, -2);
+ test(S("abcde"), 0, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcde"), 4, 1, -4);
+ test(S("abcde"), 0, 1, SV("abcde"), 4, 2, -4);
+ test(S("abcde"), 0, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcde"), 0, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 0, 1, 0);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 0, 5, -4);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 0, 9, -8);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 0, 10, -9);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 0, 11, -9);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 1, 0);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 10, -9);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 19, -18);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 20, -19);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 21, -19);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 0, 2, SV(""), 0, 0, 2);
+ test(S("abcde"), 0, 2, SV(""), 0, 1, 2);
+ test(S("abcde"), 0, 2, SV(""), 1, 0, 0);
+ test(S("abcde"), 0, 2, SV("abcde"), 0, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcde"), 0, 1, 1);
+ test(S("abcde"), 0, 2, SV("abcde"), 0, 2, 0);
+ test(S("abcde"), 0, 2, SV("abcde"), 0, 4, -2);
+ test(S("abcde"), 0, 2, SV("abcde"), 0, 5, -3);
+ test(S("abcde"), 0, 2, SV("abcde"), 0, 6, -3);
+ test(S("abcde"), 0, 2, SV("abcde"), 1, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 0, 2, SV("abcde"), 1, 2, -1);
+ test(S("abcde"), 0, 2, SV("abcde"), 1, 3, -1);
+ test(S("abcde"), 0, 2, SV("abcde"), 1, 4, -1);
+ test(S("abcde"), 0, 2, SV("abcde"), 1, 5, -1);
+ test(S("abcde"), 0, 2, SV("abcde"), 2, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcde"), 2, 1, -2);
+ test(S("abcde"), 0, 2, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 0, 2, SV("abcde"), 2, 3, -2);
+ test(S("abcde"), 0, 2, SV("abcde"), 2, 4, -2);
+ test(S("abcde"), 0, 2, SV("abcde"), 4, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcde"), 4, 1, -4);
+ test(S("abcde"), 0, 2, SV("abcde"), 4, 2, -4);
+ test(S("abcde"), 0, 2, SV("abcde"), 5, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcde"), 5, 1, 2);
+ test(S("abcde"), 0, 2, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 0, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 0, 5, -3);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 0, 9, -7);
+}
+
+template <class S, class SV>
+void test4()
+{
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 0, 10, -8);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 0, 11, -8);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 1, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 5, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 9, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 10, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 10, 1, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 0, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 0, 10, -8);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 0, 19, -17);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 0, 20, -18);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 0, 21, -18);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 1, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 10, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 19, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 20, 0, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 20, 1, 2);
+ test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 0, 4, SV(""), 0, 0, 4);
+ test(S("abcde"), 0, 4, SV(""), 0, 1, 4);
+ test(S("abcde"), 0, 4, SV(""), 1, 0, 0);
+ test(S("abcde"), 0, 4, SV("abcde"), 0, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcde"), 0, 1, 3);
+ test(S("abcde"), 0, 4, SV("abcde"), 0, 2, 2);
+ test(S("abcde"), 0, 4, SV("abcde"), 0, 4, 0);
+ test(S("abcde"), 0, 4, SV("abcde"), 0, 5, -1);
+ test(S("abcde"), 0, 4, SV("abcde"), 0, 6, -1);
+ test(S("abcde"), 0, 4, SV("abcde"), 1, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 0, 4, SV("abcde"), 1, 2, -1);
+ test(S("abcde"), 0, 4, SV("abcde"), 1, 3, -1);
+ test(S("abcde"), 0, 4, SV("abcde"), 1, 4, -1);
+ test(S("abcde"), 0, 4, SV("abcde"), 1, 5, -1);
+ test(S("abcde"), 0, 4, SV("abcde"), 2, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcde"), 2, 1, -2);
+ test(S("abcde"), 0, 4, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 0, 4, SV("abcde"), 2, 3, -2);
+ test(S("abcde"), 0, 4, SV("abcde"), 2, 4, -2);
+ test(S("abcde"), 0, 4, SV("abcde"), 4, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcde"), 4, 1, -4);
+ test(S("abcde"), 0, 4, SV("abcde"), 4, 2, -4);
+ test(S("abcde"), 0, 4, SV("abcde"), 5, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcde"), 5, 1, 4);
+ test(S("abcde"), 0, 4, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 0, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 0, 1, 3);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 0, 5, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 0, 9, -5);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 0, 10, -6);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 0, 11, -6);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 1, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 5, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 9, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 10, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 10, 1, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 0, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 0, 1, 3);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 0, 10, -6);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 0, 19, -15);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 0, 20, -16);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 0, 21, -16);
+}
+
+template <class S, class SV>
+void test5()
+{
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 1, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 10, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 19, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 20, 0, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 20, 1, 4);
+ test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 0, 5, SV(""), 0, 0, 5);
+ test(S("abcde"), 0, 5, SV(""), 0, 1, 5);
+ test(S("abcde"), 0, 5, SV(""), 1, 0, 0);
+ test(S("abcde"), 0, 5, SV("abcde"), 0, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcde"), 0, 1, 4);
+ test(S("abcde"), 0, 5, SV("abcde"), 0, 2, 3);
+ test(S("abcde"), 0, 5, SV("abcde"), 0, 4, 1);
+ test(S("abcde"), 0, 5, SV("abcde"), 0, 5, 0);
+ test(S("abcde"), 0, 5, SV("abcde"), 0, 6, 0);
+ test(S("abcde"), 0, 5, SV("abcde"), 1, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 0, 5, SV("abcde"), 1, 2, -1);
+ test(S("abcde"), 0, 5, SV("abcde"), 1, 3, -1);
+ test(S("abcde"), 0, 5, SV("abcde"), 1, 4, -1);
+ test(S("abcde"), 0, 5, SV("abcde"), 1, 5, -1);
+ test(S("abcde"), 0, 5, SV("abcde"), 2, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcde"), 2, 1, -2);
+ test(S("abcde"), 0, 5, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 0, 5, SV("abcde"), 2, 3, -2);
+ test(S("abcde"), 0, 5, SV("abcde"), 2, 4, -2);
+ test(S("abcde"), 0, 5, SV("abcde"), 4, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcde"), 4, 1, -4);
+ test(S("abcde"), 0, 5, SV("abcde"), 4, 2, -4);
+ test(S("abcde"), 0, 5, SV("abcde"), 5, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcde"), 5, 1, 5);
+ test(S("abcde"), 0, 5, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 0, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 0, 1, 4);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 0, 5, 0);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 0, 9, -4);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 0, 10, -5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 0, 11, -5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 1, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 5, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 9, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 10, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 10, 1, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 1, 4);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 10, -5);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 19, -14);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 20, -15);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 21, -15);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 19, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 20, 0, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 20, 1, 5);
+ test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 0, 6, SV(""), 0, 0, 5);
+ test(S("abcde"), 0, 6, SV(""), 0, 1, 5);
+ test(S("abcde"), 0, 6, SV(""), 1, 0, 0);
+ test(S("abcde"), 0, 6, SV("abcde"), 0, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcde"), 0, 1, 4);
+ test(S("abcde"), 0, 6, SV("abcde"), 0, 2, 3);
+ test(S("abcde"), 0, 6, SV("abcde"), 0, 4, 1);
+ test(S("abcde"), 0, 6, SV("abcde"), 0, 5, 0);
+}
+
+template <class S, class SV>
+void test6()
+{
+ test(S("abcde"), 0, 6, SV("abcde"), 0, 6, 0);
+ test(S("abcde"), 0, 6, SV("abcde"), 1, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 0, 6, SV("abcde"), 1, 2, -1);
+ test(S("abcde"), 0, 6, SV("abcde"), 1, 3, -1);
+ test(S("abcde"), 0, 6, SV("abcde"), 1, 4, -1);
+ test(S("abcde"), 0, 6, SV("abcde"), 1, 5, -1);
+ test(S("abcde"), 0, 6, SV("abcde"), 2, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcde"), 2, 1, -2);
+ test(S("abcde"), 0, 6, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 0, 6, SV("abcde"), 2, 3, -2);
+ test(S("abcde"), 0, 6, SV("abcde"), 2, 4, -2);
+ test(S("abcde"), 0, 6, SV("abcde"), 4, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcde"), 4, 1, -4);
+ test(S("abcde"), 0, 6, SV("abcde"), 4, 2, -4);
+ test(S("abcde"), 0, 6, SV("abcde"), 5, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcde"), 5, 1, 5);
+ test(S("abcde"), 0, 6, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 0, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 0, 1, 4);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 0, 5, 0);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 0, 9, -4);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 0, 10, -5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 0, 11, -5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 1, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 5, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 9, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 10, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 10, 1, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 0, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 0, 1, 4);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 0, 10, -5);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 0, 19, -14);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 0, 20, -15);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 0, 21, -15);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 1, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 10, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 19, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 20, 0, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 20, 1, 5);
+ test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 1, 0, SV(""), 0, 0, 0);
+ test(S("abcde"), 1, 0, SV(""), 0, 1, 0);
+ test(S("abcde"), 1, 0, SV(""), 1, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcde"), 1, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcde"), 1, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcde"), 1, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcde"), 1, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcde"), 1, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcde"), 1, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcde"), 1, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcde"), 1, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 1, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcde"), 1, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcde"), 1, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcde"), 1, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcde"), 1, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 1, 1, -1);
+}
+
+template <class S, class SV>
+void test7()
+{
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 1, 1, SV(""), 0, 0, 1);
+ test(S("abcde"), 1, 1, SV(""), 0, 1, 1);
+ test(S("abcde"), 1, 1, SV(""), 1, 0, 0);
+ test(S("abcde"), 1, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 0, 1, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 0, 2, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 0, 4, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 0, 5, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 0, 6, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 1, 1, 0);
+ test(S("abcde"), 1, 1, SV("abcde"), 1, 2, -1);
+ test(S("abcde"), 1, 1, SV("abcde"), 1, 3, -2);
+ test(S("abcde"), 1, 1, SV("abcde"), 1, 4, -3);
+ test(S("abcde"), 1, 1, SV("abcde"), 1, 5, -3);
+ test(S("abcde"), 1, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 1, 1, SV("abcde"), 2, 2, -1);
+ test(S("abcde"), 1, 1, SV("abcde"), 2, 3, -1);
+ test(S("abcde"), 1, 1, SV("abcde"), 2, 4, -1);
+ test(S("abcde"), 1, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 4, 1, -3);
+ test(S("abcde"), 1, 1, SV("abcde"), 4, 2, -3);
+ test(S("abcde"), 1, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcde"), 1, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 1, 1, 0);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 1, 4, -3);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 1, 8, -7);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 1, 9, -8);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 1, 10, -8);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 1, 0);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 9, -8);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 18, -17);
+}
+
+template <class S, class SV>
+void test8()
+{
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 19, -18);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 20, -18);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 1, 2, SV(""), 0, 0, 2);
+ test(S("abcde"), 1, 2, SV(""), 0, 1, 2);
+ test(S("abcde"), 1, 2, SV(""), 1, 0, 0);
+ test(S("abcde"), 1, 2, SV("abcde"), 0, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcde"), 0, 1, 1);
+ test(S("abcde"), 1, 2, SV("abcde"), 0, 2, 1);
+ test(S("abcde"), 1, 2, SV("abcde"), 0, 4, 1);
+ test(S("abcde"), 1, 2, SV("abcde"), 0, 5, 1);
+ test(S("abcde"), 1, 2, SV("abcde"), 0, 6, 1);
+ test(S("abcde"), 1, 2, SV("abcde"), 1, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcde"), 1, 1, 1);
+ test(S("abcde"), 1, 2, SV("abcde"), 1, 2, 0);
+ test(S("abcde"), 1, 2, SV("abcde"), 1, 3, -1);
+ test(S("abcde"), 1, 2, SV("abcde"), 1, 4, -2);
+ test(S("abcde"), 1, 2, SV("abcde"), 1, 5, -2);
+ test(S("abcde"), 1, 2, SV("abcde"), 2, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 1, 2, SV("abcde"), 2, 2, -1);
+ test(S("abcde"), 1, 2, SV("abcde"), 2, 3, -1);
+ test(S("abcde"), 1, 2, SV("abcde"), 2, 4, -1);
+ test(S("abcde"), 1, 2, SV("abcde"), 4, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcde"), 4, 1, -3);
+ test(S("abcde"), 1, 2, SV("abcde"), 4, 2, -3);
+ test(S("abcde"), 1, 2, SV("abcde"), 5, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcde"), 5, 1, 2);
+ test(S("abcde"), 1, 2, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 0, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 1, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 1, 1, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 1, 4, -2);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 1, 8, -6);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 1, 9, -7);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 1, 10, -7);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 5, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 9, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 10, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 10, 1, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 0, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 1, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 1, 1, 1);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 1, 9, -7);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 1, 18, -16);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 1, 19, -17);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 1, 20, -17);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 10, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 19, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 20, 0, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 20, 1, 2);
+ test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 1, 3, SV(""), 0, 0, 3);
+ test(S("abcde"), 1, 3, SV(""), 0, 1, 3);
+ test(S("abcde"), 1, 3, SV(""), 1, 0, 0);
+ test(S("abcde"), 1, 3, SV("abcde"), 0, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcde"), 0, 1, 1);
+ test(S("abcde"), 1, 3, SV("abcde"), 0, 2, 1);
+ test(S("abcde"), 1, 3, SV("abcde"), 0, 4, 1);
+ test(S("abcde"), 1, 3, SV("abcde"), 0, 5, 1);
+ test(S("abcde"), 1, 3, SV("abcde"), 0, 6, 1);
+ test(S("abcde"), 1, 3, SV("abcde"), 1, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcde"), 1, 1, 2);
+ test(S("abcde"), 1, 3, SV("abcde"), 1, 2, 1);
+}
+
+template <class S, class SV>
+void test9()
+{
+ test(S("abcde"), 1, 3, SV("abcde"), 1, 3, 0);
+ test(S("abcde"), 1, 3, SV("abcde"), 1, 4, -1);
+ test(S("abcde"), 1, 3, SV("abcde"), 1, 5, -1);
+ test(S("abcde"), 1, 3, SV("abcde"), 2, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 1, 3, SV("abcde"), 2, 2, -1);
+ test(S("abcde"), 1, 3, SV("abcde"), 2, 3, -1);
+ test(S("abcde"), 1, 3, SV("abcde"), 2, 4, -1);
+ test(S("abcde"), 1, 3, SV("abcde"), 4, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcde"), 4, 1, -3);
+ test(S("abcde"), 1, 3, SV("abcde"), 4, 2, -3);
+ test(S("abcde"), 1, 3, SV("abcde"), 5, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcde"), 5, 1, 3);
+ test(S("abcde"), 1, 3, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 0, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 1, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 1, 1, 2);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 1, 8, -5);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 1, 9, -6);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 1, 10, -6);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 5, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 9, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 10, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 10, 1, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 0, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 1, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 1, 1, 2);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 1, 9, -6);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 1, 18, -15);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 1, 19, -16);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 1, 20, -16);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 10, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 19, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 20, 0, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 20, 1, 3);
+ test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 1, 4, SV(""), 0, 0, 4);
+ test(S("abcde"), 1, 4, SV(""), 0, 1, 4);
+ test(S("abcde"), 1, 4, SV(""), 1, 0, 0);
+ test(S("abcde"), 1, 4, SV("abcde"), 0, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcde"), 0, 1, 1);
+ test(S("abcde"), 1, 4, SV("abcde"), 0, 2, 1);
+ test(S("abcde"), 1, 4, SV("abcde"), 0, 4, 1);
+ test(S("abcde"), 1, 4, SV("abcde"), 0, 5, 1);
+ test(S("abcde"), 1, 4, SV("abcde"), 0, 6, 1);
+ test(S("abcde"), 1, 4, SV("abcde"), 1, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcde"), 1, 1, 3);
+ test(S("abcde"), 1, 4, SV("abcde"), 1, 2, 2);
+ test(S("abcde"), 1, 4, SV("abcde"), 1, 3, 1);
+ test(S("abcde"), 1, 4, SV("abcde"), 1, 4, 0);
+ test(S("abcde"), 1, 4, SV("abcde"), 1, 5, 0);
+ test(S("abcde"), 1, 4, SV("abcde"), 2, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 1, 4, SV("abcde"), 2, 2, -1);
+ test(S("abcde"), 1, 4, SV("abcde"), 2, 3, -1);
+ test(S("abcde"), 1, 4, SV("abcde"), 2, 4, -1);
+ test(S("abcde"), 1, 4, SV("abcde"), 4, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcde"), 4, 1, -3);
+ test(S("abcde"), 1, 4, SV("abcde"), 4, 2, -3);
+ test(S("abcde"), 1, 4, SV("abcde"), 5, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcde"), 5, 1, 4);
+ test(S("abcde"), 1, 4, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 0, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 1, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 1, 1, 3);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 1, 4, 0);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 1, 8, -4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 1, 9, -5);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 1, 10, -5);
+}
+
+template <class S, class SV>
+void test10()
+{
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 5, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 9, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 10, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 10, 1, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 1, 3);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 9, -5);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 18, -14);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 19, -15);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 20, -15);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 19, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 20, 0, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 20, 1, 4);
+ test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 1, 5, SV(""), 0, 0, 4);
+ test(S("abcde"), 1, 5, SV(""), 0, 1, 4);
+ test(S("abcde"), 1, 5, SV(""), 1, 0, 0);
+ test(S("abcde"), 1, 5, SV("abcde"), 0, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcde"), 0, 1, 1);
+ test(S("abcde"), 1, 5, SV("abcde"), 0, 2, 1);
+ test(S("abcde"), 1, 5, SV("abcde"), 0, 4, 1);
+ test(S("abcde"), 1, 5, SV("abcde"), 0, 5, 1);
+ test(S("abcde"), 1, 5, SV("abcde"), 0, 6, 1);
+ test(S("abcde"), 1, 5, SV("abcde"), 1, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcde"), 1, 1, 3);
+ test(S("abcde"), 1, 5, SV("abcde"), 1, 2, 2);
+ test(S("abcde"), 1, 5, SV("abcde"), 1, 3, 1);
+ test(S("abcde"), 1, 5, SV("abcde"), 1, 4, 0);
+ test(S("abcde"), 1, 5, SV("abcde"), 1, 5, 0);
+ test(S("abcde"), 1, 5, SV("abcde"), 2, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 1, 5, SV("abcde"), 2, 2, -1);
+ test(S("abcde"), 1, 5, SV("abcde"), 2, 3, -1);
+ test(S("abcde"), 1, 5, SV("abcde"), 2, 4, -1);
+ test(S("abcde"), 1, 5, SV("abcde"), 4, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcde"), 4, 1, -3);
+ test(S("abcde"), 1, 5, SV("abcde"), 4, 2, -3);
+ test(S("abcde"), 1, 5, SV("abcde"), 5, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcde"), 5, 1, 4);
+ test(S("abcde"), 1, 5, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 0, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 1, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 1, 1, 3);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 1, 4, 0);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 1, 8, -4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 1, 9, -5);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 1, 10, -5);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 5, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 9, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 10, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 10, 1, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 0, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 1, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 1, 1, 3);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 1, 9, -5);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 1, 18, -14);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 1, 19, -15);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 1, 20, -15);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 10, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+}
+
+template <class S, class SV>
+void test11()
+{
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 19, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 20, 0, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 20, 1, 4);
+ test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 2, 0, SV(""), 0, 0, 0);
+ test(S("abcde"), 2, 0, SV(""), 0, 1, 0);
+ test(S("abcde"), 2, 0, SV(""), 1, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcde"), 2, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcde"), 2, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcde"), 2, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcde"), 2, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcde"), 2, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcde"), 2, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcde"), 2, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcde"), 2, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 2, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcde"), 2, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcde"), 2, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcde"), 2, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcde"), 2, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 2, 1, SV(""), 0, 0, 1);
+ test(S("abcde"), 2, 1, SV(""), 0, 1, 1);
+ test(S("abcde"), 2, 1, SV(""), 1, 0, 0);
+ test(S("abcde"), 2, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcde"), 0, 1, 2);
+ test(S("abcde"), 2, 1, SV("abcde"), 0, 2, 2);
+ test(S("abcde"), 2, 1, SV("abcde"), 0, 4, 2);
+ test(S("abcde"), 2, 1, SV("abcde"), 0, 5, 2);
+ test(S("abcde"), 2, 1, SV("abcde"), 0, 6, 2);
+ test(S("abcde"), 2, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcde"), 1, 1, 1);
+ test(S("abcde"), 2, 1, SV("abcde"), 1, 2, 1);
+ test(S("abcde"), 2, 1, SV("abcde"), 1, 3, 1);
+ test(S("abcde"), 2, 1, SV("abcde"), 1, 4, 1);
+ test(S("abcde"), 2, 1, SV("abcde"), 1, 5, 1);
+ test(S("abcde"), 2, 1, SV("abcde"), 2, 0, 1);
+}
+
+template <class S, class SV>
+void test12()
+{
+ test(S("abcde"), 2, 1, SV("abcde"), 2, 1, 0);
+ test(S("abcde"), 2, 1, SV("abcde"), 2, 2, -1);
+ test(S("abcde"), 2, 1, SV("abcde"), 2, 3, -2);
+ test(S("abcde"), 2, 1, SV("abcde"), 2, 4, -2);
+ test(S("abcde"), 2, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcde"), 4, 1, -2);
+ test(S("abcde"), 2, 1, SV("abcde"), 4, 2, -2);
+ test(S("abcde"), 2, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcde"), 2, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 0, 1, 2);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 0, 5, 2);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 0, 9, 2);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 0, 10, 2);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 0, 11, 2);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 1, 1, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 1, 4, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 1, 8, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 1, 9, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 1, 10, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 5, 1, -3);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 5, 2, -3);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 5, 4, -3);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 5, 5, -3);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 5, 6, -3);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 9, 1, -7);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 9, 2, -7);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 0, 1, 2);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 0, 10, 2);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 0, 19, 2);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 0, 20, 2);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 0, 21, 2);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 1, 1, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 1, 9, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 1, 18, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 1, 19, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 1, 20, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 10, 1, -8);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 10, 5, -8);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 10, 9, -8);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 10, 10, -8);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 10, 11, -8);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 19, 1, -17);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 19, 2, -17);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 2, 2, SV(""), 0, 0, 2);
+ test(S("abcde"), 2, 2, SV(""), 0, 1, 2);
+ test(S("abcde"), 2, 2, SV(""), 1, 0, 0);
+ test(S("abcde"), 2, 2, SV("abcde"), 0, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 0, 1, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 0, 2, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 0, 4, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 0, 5, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 0, 6, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 1, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 1, 1, 1);
+ test(S("abcde"), 2, 2, SV("abcde"), 1, 2, 1);
+ test(S("abcde"), 2, 2, SV("abcde"), 1, 3, 1);
+ test(S("abcde"), 2, 2, SV("abcde"), 1, 4, 1);
+ test(S("abcde"), 2, 2, SV("abcde"), 1, 5, 1);
+ test(S("abcde"), 2, 2, SV("abcde"), 2, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 2, 1, 1);
+ test(S("abcde"), 2, 2, SV("abcde"), 2, 2, 0);
+ test(S("abcde"), 2, 2, SV("abcde"), 2, 3, -1);
+ test(S("abcde"), 2, 2, SV("abcde"), 2, 4, -1);
+ test(S("abcde"), 2, 2, SV("abcde"), 4, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 4, 1, -2);
+ test(S("abcde"), 2, 2, SV("abcde"), 4, 2, -2);
+ test(S("abcde"), 2, 2, SV("abcde"), 5, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 5, 1, 2);
+ test(S("abcde"), 2, 2, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 0, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 0, 1, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 0, 5, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 0, 9, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 0, 10, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 0, 11, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 1, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 1, 1, 1);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 1, 4, 1);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 1, 8, 1);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 1, 9, 1);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 1, 10, 1);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 5, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 5, 1, -3);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 5, 2, -3);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 5, 4, -3);
+}
+
+template <class S, class SV>
+void test13()
+{
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 5, 5, -3);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 5, 6, -3);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 9, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 9, 1, -7);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 9, 2, -7);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 10, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 10, 1, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 0, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 0, 1, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 0, 10, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 0, 19, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 0, 20, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 0, 21, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 1, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 1, 1, 1);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 1, 9, 1);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 1, 18, 1);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 1, 19, 1);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 1, 20, 1);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 10, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 10, 1, -8);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 10, 5, -8);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 10, 9, -8);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 10, 10, -8);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 10, 11, -8);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 19, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 19, 1, -17);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 19, 2, -17);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 20, 0, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 20, 1, 2);
+ test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 2, 3, SV(""), 0, 0, 3);
+ test(S("abcde"), 2, 3, SV(""), 0, 1, 3);
+ test(S("abcde"), 2, 3, SV(""), 1, 0, 0);
+ test(S("abcde"), 2, 3, SV("abcde"), 0, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcde"), 0, 1, 2);
+ test(S("abcde"), 2, 3, SV("abcde"), 0, 2, 2);
+ test(S("abcde"), 2, 3, SV("abcde"), 0, 4, 2);
+ test(S("abcde"), 2, 3, SV("abcde"), 0, 5, 2);
+ test(S("abcde"), 2, 3, SV("abcde"), 0, 6, 2);
+ test(S("abcde"), 2, 3, SV("abcde"), 1, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcde"), 1, 1, 1);
+ test(S("abcde"), 2, 3, SV("abcde"), 1, 2, 1);
+ test(S("abcde"), 2, 3, SV("abcde"), 1, 3, 1);
+ test(S("abcde"), 2, 3, SV("abcde"), 1, 4, 1);
+ test(S("abcde"), 2, 3, SV("abcde"), 1, 5, 1);
+ test(S("abcde"), 2, 3, SV("abcde"), 2, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcde"), 2, 1, 2);
+ test(S("abcde"), 2, 3, SV("abcde"), 2, 2, 1);
+ test(S("abcde"), 2, 3, SV("abcde"), 2, 3, 0);
+ test(S("abcde"), 2, 3, SV("abcde"), 2, 4, 0);
+ test(S("abcde"), 2, 3, SV("abcde"), 4, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcde"), 4, 1, -2);
+ test(S("abcde"), 2, 3, SV("abcde"), 4, 2, -2);
+ test(S("abcde"), 2, 3, SV("abcde"), 5, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcde"), 5, 1, 3);
+ test(S("abcde"), 2, 3, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 0, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 0, 1, 2);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 0, 5, 2);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 0, 9, 2);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 0, 10, 2);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 0, 11, 2);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 1, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 1, 1, 1);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 1, 4, 1);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 1, 8, 1);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 1, 9, 1);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 1, 10, 1);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 5, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 5, 1, -3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 5, 2, -3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 5, 4, -3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 5, 5, -3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 5, 6, -3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 9, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 9, 1, -7);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 9, 2, -7);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 10, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 10, 1, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 0, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 0, 1, 2);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 0, 10, 2);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 0, 19, 2);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 0, 20, 2);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 0, 21, 2);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 1, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 1, 1, 1);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 1, 9, 1);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 1, 18, 1);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 1, 19, 1);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 1, 20, 1);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 10, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 10, 1, -8);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 10, 5, -8);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 10, 9, -8);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 10, 10, -8);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 10, 11, -8);
+}
+
+template <class S, class SV>
+void test14()
+{
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 19, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 19, 1, -17);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 19, 2, -17);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 20, 0, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 20, 1, 3);
+ test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 2, 4, SV(""), 0, 0, 3);
+ test(S("abcde"), 2, 4, SV(""), 0, 1, 3);
+ test(S("abcde"), 2, 4, SV(""), 1, 0, 0);
+ test(S("abcde"), 2, 4, SV("abcde"), 0, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcde"), 0, 1, 2);
+ test(S("abcde"), 2, 4, SV("abcde"), 0, 2, 2);
+ test(S("abcde"), 2, 4, SV("abcde"), 0, 4, 2);
+ test(S("abcde"), 2, 4, SV("abcde"), 0, 5, 2);
+ test(S("abcde"), 2, 4, SV("abcde"), 0, 6, 2);
+ test(S("abcde"), 2, 4, SV("abcde"), 1, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcde"), 1, 1, 1);
+ test(S("abcde"), 2, 4, SV("abcde"), 1, 2, 1);
+ test(S("abcde"), 2, 4, SV("abcde"), 1, 3, 1);
+ test(S("abcde"), 2, 4, SV("abcde"), 1, 4, 1);
+ test(S("abcde"), 2, 4, SV("abcde"), 1, 5, 1);
+ test(S("abcde"), 2, 4, SV("abcde"), 2, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcde"), 2, 1, 2);
+ test(S("abcde"), 2, 4, SV("abcde"), 2, 2, 1);
+ test(S("abcde"), 2, 4, SV("abcde"), 2, 3, 0);
+ test(S("abcde"), 2, 4, SV("abcde"), 2, 4, 0);
+ test(S("abcde"), 2, 4, SV("abcde"), 4, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcde"), 4, 1, -2);
+ test(S("abcde"), 2, 4, SV("abcde"), 4, 2, -2);
+ test(S("abcde"), 2, 4, SV("abcde"), 5, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcde"), 5, 1, 3);
+ test(S("abcde"), 2, 4, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 0, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 0, 1, 2);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 0, 5, 2);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 0, 9, 2);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 0, 10, 2);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 0, 11, 2);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 1, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 1, 1, 1);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 1, 4, 1);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 1, 8, 1);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 1, 9, 1);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 1, 10, 1);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 5, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 5, 1, -3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 5, 2, -3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 5, 4, -3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 5, 5, -3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 5, 6, -3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 9, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 9, 1, -7);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 9, 2, -7);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 10, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 10, 1, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 0, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 0, 1, 2);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 0, 10, 2);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 0, 19, 2);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 0, 20, 2);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 0, 21, 2);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 1, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 1, 1, 1);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 1, 9, 1);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 1, 18, 1);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 1, 19, 1);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 1, 20, 1);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 10, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 10, 1, -8);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 10, 5, -8);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 10, 9, -8);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 10, 10, -8);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 10, 11, -8);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 19, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 19, 1, -17);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 19, 2, -17);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 20, 0, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 20, 1, 3);
+ test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 4, 0, SV(""), 0, 0, 0);
+ test(S("abcde"), 4, 0, SV(""), 0, 1, 0);
+ test(S("abcde"), 4, 0, SV(""), 1, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcde"), 4, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcde"), 4, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcde"), 4, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcde"), 4, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcde"), 4, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcde"), 4, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcde"), 4, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcde"), 4, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 4, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcde"), 4, 0, SV("abcde"), 2, 4, -3);
+}
+
+template <class S, class SV>
+void test15()
+{
+ test(S("abcde"), 4, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcde"), 4, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcde"), 4, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 4, 1, SV(""), 0, 0, 1);
+ test(S("abcde"), 4, 1, SV(""), 0, 1, 1);
+ test(S("abcde"), 4, 1, SV(""), 1, 0, 0);
+ test(S("abcde"), 4, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcde"), 0, 1, 4);
+ test(S("abcde"), 4, 1, SV("abcde"), 0, 2, 4);
+ test(S("abcde"), 4, 1, SV("abcde"), 0, 4, 4);
+ test(S("abcde"), 4, 1, SV("abcde"), 0, 5, 4);
+ test(S("abcde"), 4, 1, SV("abcde"), 0, 6, 4);
+ test(S("abcde"), 4, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcde"), 1, 1, 3);
+ test(S("abcde"), 4, 1, SV("abcde"), 1, 2, 3);
+ test(S("abcde"), 4, 1, SV("abcde"), 1, 3, 3);
+ test(S("abcde"), 4, 1, SV("abcde"), 1, 4, 3);
+ test(S("abcde"), 4, 1, SV("abcde"), 1, 5, 3);
+ test(S("abcde"), 4, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcde"), 2, 1, 2);
+ test(S("abcde"), 4, 1, SV("abcde"), 2, 2, 2);
+ test(S("abcde"), 4, 1, SV("abcde"), 2, 3, 2);
+ test(S("abcde"), 4, 1, SV("abcde"), 2, 4, 2);
+ test(S("abcde"), 4, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcde"), 4, 1, 0);
+ test(S("abcde"), 4, 1, SV("abcde"), 4, 2, 0);
+ test(S("abcde"), 4, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcde"), 4, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 0, 1, 4);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 0, 5, 4);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 0, 9, 4);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 0, 10, 4);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 0, 11, 4);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 1, 1, 3);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 1, 4, 3);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 1, 8, 3);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 1, 9, 3);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 1, 10, 3);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 5, 2, -1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 5, 4, -1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 5, 5, -1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 5, 6, -1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 9, 1, -5);
+}
+
+template <class S, class SV>
+void test16()
+{
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 9, 2, -5);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 0, 1, 4);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 0, 10, 4);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 0, 19, 4);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 0, 20, 4);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 0, 21, 4);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 1, 1, 3);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 1, 9, 3);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 1, 18, 3);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 1, 19, 3);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 1, 20, 3);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 10, 1, -6);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 10, 5, -6);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 10, 9, -6);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 10, 10, -6);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 10, 11, -6);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 19, 1, -15);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 19, 2, -15);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 4, 2, SV(""), 0, 0, 1);
+ test(S("abcde"), 4, 2, SV(""), 0, 1, 1);
+ test(S("abcde"), 4, 2, SV(""), 1, 0, 0);
+ test(S("abcde"), 4, 2, SV("abcde"), 0, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcde"), 0, 1, 4);
+ test(S("abcde"), 4, 2, SV("abcde"), 0, 2, 4);
+ test(S("abcde"), 4, 2, SV("abcde"), 0, 4, 4);
+ test(S("abcde"), 4, 2, SV("abcde"), 0, 5, 4);
+ test(S("abcde"), 4, 2, SV("abcde"), 0, 6, 4);
+ test(S("abcde"), 4, 2, SV("abcde"), 1, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcde"), 1, 1, 3);
+ test(S("abcde"), 4, 2, SV("abcde"), 1, 2, 3);
+ test(S("abcde"), 4, 2, SV("abcde"), 1, 3, 3);
+ test(S("abcde"), 4, 2, SV("abcde"), 1, 4, 3);
+ test(S("abcde"), 4, 2, SV("abcde"), 1, 5, 3);
+ test(S("abcde"), 4, 2, SV("abcde"), 2, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcde"), 2, 1, 2);
+ test(S("abcde"), 4, 2, SV("abcde"), 2, 2, 2);
+ test(S("abcde"), 4, 2, SV("abcde"), 2, 3, 2);
+ test(S("abcde"), 4, 2, SV("abcde"), 2, 4, 2);
+ test(S("abcde"), 4, 2, SV("abcde"), 4, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcde"), 4, 1, 0);
+ test(S("abcde"), 4, 2, SV("abcde"), 4, 2, 0);
+ test(S("abcde"), 4, 2, SV("abcde"), 5, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcde"), 5, 1, 1);
+ test(S("abcde"), 4, 2, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 0, 1, 4);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 0, 5, 4);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 0, 9, 4);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 0, 10, 4);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 0, 11, 4);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 1, 1, 3);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 1, 4, 3);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 1, 8, 3);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 1, 9, 3);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 1, 10, 3);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 5, 2, -1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 5, 4, -1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 5, 5, -1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 5, 6, -1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 9, 1, -5);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 9, 2, -5);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 0, 1, 4);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 0, 10, 4);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 0, 19, 4);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 0, 20, 4);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 0, 21, 4);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 1, 1, 3);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 1, 9, 3);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 1, 18, 3);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 1, 19, 3);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 1, 20, 3);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 10, 1, -6);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 10, 5, -6);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 10, 9, -6);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 10, 10, -6);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 10, 11, -6);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 19, 1, -15);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 19, 2, -15);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+}
+
+template <class S, class SV>
+void test17()
+{
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 5, 0, SV(""), 0, 0, 0);
+ test(S("abcde"), 5, 0, SV(""), 0, 1, 0);
+ test(S("abcde"), 5, 0, SV(""), 1, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcde"), 5, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcde"), 5, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcde"), 5, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcde"), 5, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcde"), 5, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcde"), 5, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcde"), 5, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcde"), 5, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 5, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcde"), 5, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcde"), 5, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcde"), 5, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcde"), 5, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 5, 1, SV(""), 0, 0, 0);
+ test(S("abcde"), 5, 1, SV(""), 0, 1, 0);
+ test(S("abcde"), 5, 1, SV(""), 1, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcde"), 0, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcde"), 0, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcde"), 0, 2, -2);
+ test(S("abcde"), 5, 1, SV("abcde"), 0, 4, -4);
+ test(S("abcde"), 5, 1, SV("abcde"), 0, 5, -5);
+ test(S("abcde"), 5, 1, SV("abcde"), 0, 6, -5);
+ test(S("abcde"), 5, 1, SV("abcde"), 1, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcde"), 1, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcde"), 1, 2, -2);
+ test(S("abcde"), 5, 1, SV("abcde"), 1, 3, -3);
+ test(S("abcde"), 5, 1, SV("abcde"), 1, 4, -4);
+ test(S("abcde"), 5, 1, SV("abcde"), 1, 5, -4);
+ test(S("abcde"), 5, 1, SV("abcde"), 2, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcde"), 2, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcde"), 2, 2, -2);
+ test(S("abcde"), 5, 1, SV("abcde"), 2, 3, -3);
+ test(S("abcde"), 5, 1, SV("abcde"), 2, 4, -3);
+ test(S("abcde"), 5, 1, SV("abcde"), 4, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcde"), 4, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcde"), 4, 2, -1);
+ test(S("abcde"), 5, 1, SV("abcde"), 5, 0, 0);
+}
+
+template <class S, class SV>
+void test18()
+{
+ test(S("abcde"), 5, 1, SV("abcde"), 5, 1, 0);
+ test(S("abcde"), 5, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcde"), 6, 0, SV(""), 0, 0, 0);
+ test(S("abcde"), 6, 0, SV(""), 0, 1, 0);
+ test(S("abcde"), 6, 0, SV(""), 1, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 0, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 0, 2, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 0, 4, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 0, 5, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 0, 6, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 1, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 1, 2, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 1, 3, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 1, 4, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 1, 5, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 2, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 2, 2, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 2, 3, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 2, 4, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 4, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 4, 2, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 0, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 0, 5, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 0, 9, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 0, 10, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 0, 11, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 1, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 1, 4, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 1, 8, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 1, 9, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 1, 10, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 5, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 5, 2, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 5, 4, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 5, 5, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 5, 6, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 9, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 9, 2, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghij"), 11, 0, 0);
+}
+
+template <class S, class SV>
+void test19()
+{
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 0, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 0, 10, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 0, 19, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 0, 20, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 0, 21, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 1, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 1, 9, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 1, 18, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 1, 19, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 1, 20, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 10, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 10, 5, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 10, 9, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 10, 10, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 10, 11, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 19, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 19, 2, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghij"), 0, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 0, 1, SV(""), 0, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV(""), 0, 1, 1);
+}
+
+template <class S, class SV>
+void test20()
+{
+ test(S("abcdefghij"), 0, 1, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 0, 1, 0);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 0, 2, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 0, 4, -3);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 0, 5, -4);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 0, 6, -4);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 1, 3, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 1, 4, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 1, 5, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 2, 1, -2);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 2, 3, -2);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 2, 4, -2);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 4, 1, -4);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 4, 2, -4);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 0, 1, 0);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 0, 5, -4);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 0, 9, -8);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 0, 10, -9);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 0, 11, -9);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 1, 0);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 10, -9);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 19, -18);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 20, -19);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 21, -19);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 0, 5, SV(""), 0, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV(""), 0, 1, 5);
+ test(S("abcdefghij"), 0, 5, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 0, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 0, 1, 4);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 0, 2, 3);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 0, 5, 0);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 0, 6, 0);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 1, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 1, 3, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 1, 4, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 1, 5, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 2, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 2, 1, -2);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 2, 3, -2);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 2, 4, -2);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 4, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 4, 1, -4);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 4, 2, -4);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 5, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 5, 1, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 0, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 0, 1, 4);
+}
+
+template <class S, class SV>
+void test21()
+{
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 0, 5, 0);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 0, 9, -4);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 0, 10, -5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 0, 11, -5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 1, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 5, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 9, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 10, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 10, 1, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 1, 4);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 10, -5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 19, -14);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 20, -15);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 0, 21, -15);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 19, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 20, 0, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 20, 1, 5);
+ test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 0, 9, SV(""), 0, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV(""), 0, 1, 9);
+ test(S("abcdefghij"), 0, 9, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 0, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 0, 1, 8);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 0, 2, 7);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 0, 4, 5);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 0, 5, 4);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 0, 6, 4);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 1, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 1, 3, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 1, 4, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 1, 5, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 2, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 2, 1, -2);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 2, 3, -2);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 2, 4, -2);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 4, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 4, 1, -4);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 4, 2, -4);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 5, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 5, 1, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 0, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 0, 1, 8);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 0, 5, 4);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 0, 9, 0);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 0, 10, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 0, 11, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 1, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 5, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 9, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 10, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 10, 1, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 0, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 0, 1, 8);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 0, 10, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 0, 19, -10);
+}
+
+template <class S, class SV>
+void test22()
+{
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 0, 20, -11);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 0, 21, -11);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 1, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 10, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 19, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 20, 0, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 20, 1, 9);
+ test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 0, 10, SV(""), 0, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV(""), 0, 1, 10);
+ test(S("abcdefghij"), 0, 10, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 0, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 0, 1, 9);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 0, 2, 8);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 0, 4, 6);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 0, 5, 5);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 0, 6, 5);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 1, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 1, 3, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 1, 4, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 1, 5, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 2, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 2, 1, -2);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 2, 3, -2);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 2, 4, -2);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 4, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 4, 1, -4);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 4, 2, -4);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 5, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 5, 1, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 0, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 0, 1, 9);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 0, 5, 5);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 0, 10, 0);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 0, 11, 0);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 1, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 5, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 9, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 10, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 10, 1, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 1, 9);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 10, 0);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 19, -9);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 20, -10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 21, -10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 19, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 20, 0, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 20, 1, 10);
+ test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 0, 11, SV(""), 0, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV(""), 0, 1, 10);
+ test(S("abcdefghij"), 0, 11, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 0, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 0, 1, 9);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 0, 2, 8);
+}
+
+template <class S, class SV>
+void test23()
+{
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 0, 4, 6);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 0, 5, 5);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 0, 6, 5);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 1, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 1, 3, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 1, 4, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 1, 5, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 2, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 2, 1, -2);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 2, 3, -2);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 2, 4, -2);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 4, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 4, 1, -4);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 4, 2, -4);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 5, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 5, 1, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 0, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 0, 1, 9);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 0, 5, 5);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 0, 10, 0);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 0, 11, 0);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 1, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 5, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 9, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 10, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 10, 1, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 0, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 0, 1, 9);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 0, 10, 0);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 0, 19, -9);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 0, 20, -10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 0, 21, -10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 1, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 10, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 19, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 20, 0, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 20, 1, 10);
+ test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghij"), 1, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 0, 11, -10);
+}
+
+template <class S, class SV>
+void test24()
+{
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 1, 1, SV(""), 0, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV(""), 0, 1, 1);
+ test(S("abcdefghij"), 1, 1, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 0, 2, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 0, 5, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 0, 6, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 1, 1, 0);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 1, 3, -2);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 1, 4, -3);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 1, 5, -3);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 2, 2, -1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 2, 3, -1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 2, 4, -1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 4, 1, -3);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 4, 2, -3);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 1, 1, 0);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 1, 4, -3);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 1, 8, -7);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 1, 9, -8);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 1, 10, -8);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 1, 0);
+}
+
+template <class S, class SV>
+void test25()
+{
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 9, -8);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 18, -17);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 19, -18);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 20, -18);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 1, 4, SV(""), 0, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV(""), 0, 1, 4);
+ test(S("abcdefghij"), 1, 4, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 0, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 0, 2, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 0, 5, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 0, 6, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 1, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 1, 1, 3);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 1, 2, 2);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 1, 3, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 1, 4, 0);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 1, 5, 0);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 2, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 2, 2, -1);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 2, 3, -1);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 2, 4, -1);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 4, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 4, 1, -3);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 4, 2, -3);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 5, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 5, 1, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 0, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 1, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 1, 1, 3);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 1, 4, 0);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 1, 8, -4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 1, 9, -5);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 1, 10, -5);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 5, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 9, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 10, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 10, 1, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 1, 3);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 9, -5);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 18, -14);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 19, -15);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 1, 20, -15);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 19, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 20, 0, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 20, 1, 4);
+ test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 1, 8, SV(""), 0, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV(""), 0, 1, 8);
+ test(S("abcdefghij"), 1, 8, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 0, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 0, 2, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 0, 5, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 0, 6, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 1, 0, 8);
+}
+
+template <class S, class SV>
+void test26()
+{
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 1, 1, 7);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 1, 2, 6);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 1, 3, 5);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 1, 4, 4);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 1, 5, 4);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 2, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 2, 2, -1);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 2, 3, -1);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 2, 4, -1);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 4, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 4, 1, -3);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 4, 2, -3);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 5, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 5, 1, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 0, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 1, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 1, 1, 7);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 1, 4, 4);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 1, 8, 0);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 5, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 9, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 10, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 10, 1, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 0, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 1, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 1, 1, 7);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 1, 18, -10);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 1, 19, -11);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 1, 20, -11);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 10, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 19, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 20, 0, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 20, 1, 8);
+ test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 1, 9, SV(""), 0, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV(""), 0, 1, 9);
+ test(S("abcdefghij"), 1, 9, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 0, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 0, 2, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 0, 5, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 0, 6, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 1, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 1, 1, 8);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 1, 2, 7);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 1, 3, 6);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 1, 4, 5);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 1, 5, 5);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 2, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 2, 2, -1);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 2, 3, -1);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 2, 4, -1);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 4, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 4, 1, -3);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 4, 2, -3);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 5, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 5, 1, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 0, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 1, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 1, 1, 8);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 1, 4, 5);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 1, 8, 1);
+}
+
+template <class S, class SV>
+void test27()
+{
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 1, 9, 0);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 1, 10, 0);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 5, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 9, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 10, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 10, 1, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 1, 8);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 9, 0);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 18, -9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 19, -10);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 20, -10);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 19, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 20, 0, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 20, 1, 9);
+ test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 1, 10, SV(""), 0, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV(""), 0, 1, 9);
+ test(S("abcdefghij"), 1, 10, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 0, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 0, 2, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 0, 5, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 0, 6, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 1, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 1, 1, 8);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 1, 2, 7);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 1, 3, 6);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 1, 4, 5);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 1, 5, 5);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 2, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 2, 2, -1);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 2, 3, -1);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 2, 4, -1);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 4, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 4, 1, -3);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 4, 2, -3);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 5, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 5, 1, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 0, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 1, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 1, 1, 8);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 1, 4, 5);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 1, 8, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 1, 9, 0);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 1, 10, 0);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 5, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 9, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 10, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 10, 1, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 0, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 1, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 1, 1, 8);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 1, 9, 0);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 1, 18, -9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 1, 19, -10);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 1, 20, -10);
+}
+
+template <class S, class SV>
+void test28()
+{
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 10, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 19, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 20, 0, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 20, 1, 9);
+ test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghij"), 5, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 5, 1, SV(""), 0, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV(""), 0, 1, 1);
+ test(S("abcdefghij"), 5, 1, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 0, 2, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 0, 4, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 0, 5, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 0, 6, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 1, 2, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 1, 3, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 1, 4, 4);
+}
+
+template <class S, class SV>
+void test29()
+{
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 1, 5, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 2, 1, 3);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 2, 2, 3);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 2, 3, 3);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 2, 4, 3);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 4, 1, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 4, 2, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 0, 5, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 0, 9, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 0, 10, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 0, 11, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 1, 4, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 1, 8, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 1, 9, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 1, 10, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 5, 1, 0);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 5, 2, -1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 5, 4, -3);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 9, 1, -4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 9, 2, -4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 10, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 19, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 20, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 0, 21, 5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 9, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 18, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 19, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 1, 20, 4);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 1, -5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 9, -5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 10, -5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 10, 11, -5);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 19, 1, -14);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 19, 2, -14);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 5, 2, SV(""), 0, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV(""), 0, 1, 2);
+ test(S("abcdefghij"), 5, 2, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 0, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 0, 2, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 0, 4, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 0, 5, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 0, 6, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 1, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 1, 2, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 1, 3, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 1, 4, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 1, 5, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 2, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 2, 1, 3);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 2, 2, 3);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 2, 3, 3);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 2, 4, 3);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 4, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 4, 1, 1);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 4, 2, 1);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 5, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 5, 1, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 0, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 0, 5, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 0, 9, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 0, 10, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 0, 11, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 1, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 1, 4, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 1, 8, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 1, 9, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 1, 10, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 5, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 5, 1, 1);
+}
+
+template <class S, class SV>
+void test30()
+{
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 5, 2, 0);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 5, 4, -2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 5, 5, -3);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 5, 6, -3);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 9, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 9, 1, -4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 9, 2, -4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 10, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 10, 1, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 0, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 0, 10, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 0, 19, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 0, 20, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 0, 21, 5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 1, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 1, 9, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 1, 18, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 1, 19, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 1, 20, 4);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 10, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 10, 1, -5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 10, 9, -5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 10, 10, -5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 10, 11, -5);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 19, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 19, 1, -14);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 19, 2, -14);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 20, 0, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 20, 1, 2);
+ test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 5, 4, SV(""), 0, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV(""), 0, 1, 4);
+ test(S("abcdefghij"), 5, 4, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 0, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 0, 2, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 0, 4, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 0, 5, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 0, 6, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 1, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 1, 2, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 1, 3, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 1, 4, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 1, 5, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 2, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 2, 1, 3);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 2, 2, 3);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 2, 3, 3);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 2, 4, 3);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 4, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 4, 1, 1);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 4, 2, 1);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 5, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 5, 1, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 0, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 0, 5, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 0, 9, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 0, 10, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 0, 11, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 1, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 1, 4, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 1, 8, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 1, 9, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 1, 10, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 5, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 5, 1, 3);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 5, 2, 2);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 5, 4, 0);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 5, 5, -1);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 5, 6, -1);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 9, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 9, 1, -4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 9, 2, -4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 10, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 10, 1, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 0, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 0, 10, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 0, 19, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 0, 20, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 0, 21, 5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 1, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 1, 9, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 1, 18, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 1, 19, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 1, 20, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 10, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 10, 1, -5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 10, 9, -5);
+}
+
+template <class S, class SV>
+void test31()
+{
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 10, 10, -5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 10, 11, -5);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 19, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 19, 1, -14);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 19, 2, -14);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 20, 0, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 20, 1, 4);
+ test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 5, 5, SV(""), 0, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV(""), 0, 1, 5);
+ test(S("abcdefghij"), 5, 5, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 0, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 0, 2, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 0, 4, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 0, 5, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 0, 6, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 1, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 1, 2, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 1, 3, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 1, 4, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 1, 5, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 2, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 2, 1, 3);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 2, 2, 3);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 2, 3, 3);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 2, 4, 3);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 4, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 4, 1, 1);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 4, 2, 1);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 5, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 5, 1, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 0, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 0, 5, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 0, 9, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 0, 10, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 0, 11, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 1, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 1, 4, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 1, 8, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 1, 9, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 1, 10, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 5, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 5, 1, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 5, 2, 3);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 5, 4, 1);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 5, 5, 0);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 5, 6, 0);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 9, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 9, 1, -4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 9, 2, -4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 10, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 10, 1, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 0, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 0, 10, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 0, 19, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 0, 20, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 0, 21, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 1, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 1, 9, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 1, 18, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 1, 19, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 1, 20, 4);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 10, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 10, 1, -5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 10, 9, -5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 10, 10, -5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 10, 11, -5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 19, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 19, 1, -14);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 19, 2, -14);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 20, 0, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 20, 1, 5);
+ test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 5, 6, SV(""), 0, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV(""), 0, 1, 5);
+ test(S("abcdefghij"), 5, 6, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 0, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 0, 2, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 0, 4, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 0, 5, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 0, 6, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 1, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 1, 2, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 1, 3, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 1, 4, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 1, 5, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 2, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 2, 1, 3);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 2, 2, 3);
+}
+
+template <class S, class SV>
+void test32()
+{
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 2, 3, 3);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 2, 4, 3);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 4, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 4, 1, 1);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 4, 2, 1);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 5, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 5, 1, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 0, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 0, 5, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 0, 9, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 0, 10, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 0, 11, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 1, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 1, 4, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 1, 8, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 1, 9, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 1, 10, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 5, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 5, 1, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 5, 2, 3);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 5, 4, 1);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 5, 5, 0);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 5, 6, 0);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 9, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 9, 1, -4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 9, 2, -4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 10, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 10, 1, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 0, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 0, 1, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 0, 10, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 0, 19, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 0, 20, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 0, 21, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 1, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 1, 1, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 1, 9, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 1, 18, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 1, 19, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 1, 20, 4);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 10, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 10, 1, -5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 10, 9, -5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 10, 10, -5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 10, 11, -5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 19, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 19, 1, -14);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 19, 2, -14);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 20, 0, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 20, 1, 5);
+ test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghij"), 9, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 5, 6, -5);
+}
+
+template <class S, class SV>
+void test33()
+{
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 9, 1, SV(""), 0, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV(""), 0, 1, 1);
+ test(S("abcdefghij"), 9, 1, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 0, 1, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 0, 2, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 0, 4, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 0, 5, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 0, 6, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 1, 1, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 1, 2, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 1, 3, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 1, 4, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 1, 5, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 2, 1, 7);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 2, 2, 7);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 2, 3, 7);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 2, 4, 7);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 4, 1, 5);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 4, 2, 5);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 0, 1, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 0, 5, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 0, 9, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 0, 10, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 0, 11, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 1, 1, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 1, 4, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 1, 8, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 1, 9, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 1, 10, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 5, 1, 4);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 5, 2, 4);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 5, 4, 4);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 5, 5, 4);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 5, 6, 4);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 9, 1, 0);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 9, 2, 0);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 0, 1, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 0, 10, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 0, 19, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 0, 20, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 0, 21, 9);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 1, 1, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 1, 9, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 1, 18, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 1, 19, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 1, 20, 8);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 10, 5, -1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 10, 9, -1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 10, 10, -1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 10, 11, -1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 19, 1, -10);
+}
+
+template <class S, class SV>
+void test34()
+{
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 19, 2, -10);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 9, 2, SV(""), 0, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV(""), 0, 1, 1);
+ test(S("abcdefghij"), 9, 2, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 0, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 0, 1, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 0, 2, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 0, 4, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 0, 5, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 0, 6, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 1, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 1, 1, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 1, 2, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 1, 3, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 1, 4, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 1, 5, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 2, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 2, 1, 7);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 2, 2, 7);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 2, 3, 7);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 2, 4, 7);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 4, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 4, 1, 5);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 4, 2, 5);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 5, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 5, 1, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 0, 1, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 0, 5, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 0, 9, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 0, 10, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 0, 11, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 1, 1, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 1, 4, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 1, 8, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 1, 9, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 1, 10, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 5, 1, 4);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 5, 2, 4);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 5, 4, 4);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 5, 5, 4);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 5, 6, 4);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 9, 1, 0);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 9, 2, 0);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 0, 1, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 0, 10, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 0, 19, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 0, 20, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 0, 21, 9);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 1, 1, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 1, 9, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 1, 18, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 1, 19, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 1, 20, 8);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 10, 5, -1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 10, 9, -1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 10, 10, -1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 10, 11, -1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 19, 1, -10);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 19, 2, -10);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghij"), 10, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 4, 1, -1);
+}
+
+template <class S, class SV>
+void test35()
+{
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV(""), 0, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV(""), 0, 1, 0);
+ test(S("abcdefghij"), 10, 1, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 10, 0, 0);
+}
+
+template <class S, class SV>
+void test36()
+{
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 0, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 0, 2, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 0, 4, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 0, 5, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 0, 6, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 1, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 1, 2, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 1, 3, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 1, 4, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 1, 5, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 2, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 2, 2, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 2, 3, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 2, 4, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 4, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 4, 2, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 0, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 0, 5, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 0, 9, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 0, 10, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 0, 11, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 1, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 1, 4, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 1, 8, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 1, 9, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 1, 10, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 5, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 5, 2, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 5, 4, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 5, 5, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 5, 6, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 9, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 9, 2, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 0, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 0, 10, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 0, 19, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 0, 20, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 0, 21, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 1, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 1, 9, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 1, 18, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 1, 19, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 1, 20, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 10, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 10, 5, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 10, 9, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 10, 10, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 10, 11, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 19, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 19, 2, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+}
+
+template <class S, class SV>
+void test37()
+{
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV(""), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV(""), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 0, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 0, 4, -3);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 0, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 0, 6, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 1, 3, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 1, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 1, 5, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 2, 1, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 2, 3, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 2, 4, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 4, 1, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 4, 2, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), 6, 0, 0);
+}
+
+template <class S, class SV>
+void test38()
+{
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 0, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 0, 9, -8);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 0, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 0, 11, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 19, -18);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 20, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 0, 21, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV(""), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV(""), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 0, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 0, 2, 8);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 0, 4, 6);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 0, 5, 5);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 0, 6, 5);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 1, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 1, 3, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 1, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 1, 5, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 2, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 2, 1, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 2, 3, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 2, 4, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 4, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 4, 1, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 4, 2, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 5, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 5, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 0, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 0, 5, 5);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 0, 10, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 0, 11, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 1, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 5, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 9, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 10, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 10, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 1, 9);
+}
+
+template <class S, class SV>
+void test39()
+{
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 10, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 19, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 20, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 0, 21, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 19, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 20, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 20, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV(""), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV(""), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 0, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 0, 2, 17);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 0, 4, 15);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 0, 5, 14);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 0, 6, 14);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 1, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 1, 3, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 1, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 1, 5, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 2, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 2, 1, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 2, 3, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 2, 4, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 4, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 4, 1, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 4, 2, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 5, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 5, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 0, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 0, 5, 14);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 0, 9, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 0, 10, 9);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 0, 11, 9);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 1, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 5, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 9, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 10, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 10, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 0, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 0, 10, 9);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 0, 19, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 0, 20, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 0, 21, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 1, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 10, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 19, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 20, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 20, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV(""), 0, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV(""), 0, 1, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 0, 0, 20);
+}
+
+template <class S, class SV>
+void test40()
+{
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 0, 2, 18);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 0, 4, 16);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 0, 5, 15);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 0, 6, 15);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 1, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 1, 3, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 1, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 1, 5, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 2, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 2, 1, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 2, 3, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 2, 4, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 4, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 4, 1, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 4, 2, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 5, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 5, 1, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 0, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 0, 5, 15);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 0, 9, 11);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 0, 11, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 1, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 5, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 9, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 10, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 10, 1, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 0, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 0, 20, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 0, 21, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 1, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 10, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 19, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 20, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 20, 1, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV(""), 0, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV(""), 0, 1, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 0, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 0, 2, 18);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 0, 4, 16);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 0, 5, 15);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 0, 6, 15);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 1, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 1, 3, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 1, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 1, 5, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 2, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 2, 1, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 2, 3, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 2, 4, -2);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 4, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 4, 1, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 4, 2, -4);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 5, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 5, 1, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 0, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 0, 5, 15);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 0, 9, 11);
+}
+
+template <class S, class SV>
+void test41()
+{
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 0, 11, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 1, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 1, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 1, 8, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 1, 9, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 1, 10, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 5, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 5, 1, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 5, 2, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 5, 4, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 9, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 9, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 9, 2, -9);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 10, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 10, 1, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 0, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 0, 20, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 0, 21, 0);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 1, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 1, 9, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 1, 18, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 10, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 10, 1, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 10, 5, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 10, 9, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 19, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 19, 1, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 19, 2, -19);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 20, 0, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 20, 1, 20);
+ test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+}
+
+template <class S, class SV>
+void test42()
+{
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV(""), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV(""), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 0, 2, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 0, 5, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 0, 6, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 1, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 1, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 1, 3, -2);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 1, 4, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 1, 5, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 2, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 2, 3, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 2, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 4, 1, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 4, 2, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 1, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 1, 4, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 1, 8, -7);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 1, 9, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 1, 10, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 9, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 18, -17);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 19, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 1, 20, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV(""), 0, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV(""), 0, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 0, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 0, 2, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 0, 5, 1);
+}
+
+template <class S, class SV>
+void test43()
+{
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 0, 6, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 1, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 1, 1, 8);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 1, 2, 7);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 1, 3, 6);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 1, 4, 5);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 1, 5, 5);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 2, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 2, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 2, 3, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 2, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 4, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 4, 1, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 4, 2, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 5, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 5, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 0, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 1, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 1, 1, 8);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 1, 4, 5);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 1, 8, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 1, 9, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 1, 10, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 5, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 9, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 10, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 10, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 1, 8);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 9, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 18, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 19, -10);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 1, 20, -10);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 19, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 20, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 20, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV(""), 0, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV(""), 0, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 0, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 0, 2, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 0, 5, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 0, 6, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 1, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 1, 1, 17);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 1, 2, 16);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 1, 3, 15);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 1, 4, 14);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 1, 5, 14);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 2, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 2, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 2, 3, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 2, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 4, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 4, 1, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 4, 2, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 5, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 5, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 0, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 1, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 1, 1, 17);
+}
+
+template <class S, class SV>
+void test44()
+{
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 1, 4, 14);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 1, 8, 10);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 1, 10, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 5, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 9, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 10, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 10, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 0, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 1, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 1, 1, 17);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 1, 18, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 1, 19, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 1, 20, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 10, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 19, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 20, 0, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 20, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV(""), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV(""), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 0, 2, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 0, 5, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 0, 6, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 1, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 1, 2, 17);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 1, 3, 16);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 1, 4, 15);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 1, 5, 15);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 2, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 2, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 2, 3, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 2, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 4, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 4, 1, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 4, 2, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 5, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 5, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 1, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 1, 4, 15);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 1, 8, 11);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 1, 9, 10);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 1, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 5, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 9, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 10, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 10, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 1, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 1, 9, 10);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 1, 18, 1);
+}
+
+template <class S, class SV>
+void test45()
+{
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 1, 19, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 1, 20, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 10, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 19, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 20, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 20, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV(""), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV(""), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 0, 2, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 0, 4, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 0, 5, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 0, 6, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 1, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 1, 2, 17);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 1, 3, 16);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 1, 4, 15);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 1, 5, 15);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 2, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 2, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 2, 3, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 2, 4, -1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 4, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 4, 1, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 4, 2, -3);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 5, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 5, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 0, 5, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 0, 9, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 0, 10, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 0, 11, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 1, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 1, 4, 15);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 1, 8, 11);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 1, 9, 10);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 1, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 5, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 5, 1, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 5, 2, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 5, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 5, 6, -4);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 9, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 9, 1, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 9, 2, -8);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 10, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 10, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 0, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 0, 10, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 0, 19, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 0, 20, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 0, 21, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 1, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 1, 9, 10);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 1, 18, 1);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 1, 19, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 1, 20, 0);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 10, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 10, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 10, 5, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 19, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 19, 1, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 19, 2, -18);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 20, 0, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 20, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 1, 2, -2);
+}
+
+template <class S, class SV>
+void test46()
+{
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV(""), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV(""), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 0, 2, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 0, 4, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 0, 5, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 0, 6, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 1, 2, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 1, 3, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 1, 4, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 1, 5, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 2, 1, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 2, 2, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 2, 3, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 2, 4, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 4, 1, 6);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 4, 2, 6);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 0, 5, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 0, 9, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 0, 11, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 1, 4, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 1, 8, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 1, 10, 9);
+}
+
+template <class S, class SV>
+void test47()
+{
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 5, 1, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 5, 2, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 5, 4, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 5, 5, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 5, 6, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 9, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 9, 2, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 19, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 20, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 0, 21, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 18, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 19, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 1, 20, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 9, -8);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 10, 11, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 19, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 19, 2, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV(""), 0, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV(""), 0, 1, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 0, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 0, 2, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 0, 4, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 0, 5, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 0, 6, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 1, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 1, 2, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 1, 3, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 1, 4, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 1, 5, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 2, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 2, 1, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 2, 2, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 2, 3, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 2, 4, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 4, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 4, 1, 6);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 4, 2, 6);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 5, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 5, 1, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 0, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 0, 5, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 0, 9, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 0, 11, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 1, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 1, 4, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 1, 8, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 1, 10, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 5, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 5, 1, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 5, 2, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 5, 4, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 5, 5, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 5, 6, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 9, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 9, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 9, 2, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 10, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 10, 1, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 0, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 0, 19, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 0, 20, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 0, 21, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 1, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 1, 18, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 1, 19, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 1, 20, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 10, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 10, 1, 4);
+}
+
+template <class S, class SV>
+void test48()
+{
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 10, 5, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 10, 9, -4);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 10, 10, -5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 10, 11, -5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 19, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 19, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 19, 2, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 20, 0, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 20, 1, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV(""), 0, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV(""), 0, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 0, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 0, 2, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 0, 4, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 0, 5, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 0, 6, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 1, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 1, 2, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 1, 3, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 1, 4, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 1, 5, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 2, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 2, 1, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 2, 2, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 2, 3, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 2, 4, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 4, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 4, 1, 6);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 4, 2, 6);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 5, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 5, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 0, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 0, 5, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 0, 9, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 0, 11, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 1, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 1, 4, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 1, 8, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 1, 10, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 5, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 5, 1, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 5, 2, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 5, 4, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 5, 5, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 5, 6, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 9, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 9, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 9, 2, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 10, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 10, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 0, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 0, 19, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 0, 20, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 0, 21, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 1, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 1, 18, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 1, 19, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 1, 20, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 10, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 10, 1, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 10, 5, 4);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 10, 9, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 10, 10, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 10, 11, -1);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 19, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 19, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 19, 2, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 20, 0, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 20, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV(""), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV(""), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 0, 2, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 0, 4, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 0, 5, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 0, 6, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 1, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 1, 2, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 1, 3, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 1, 4, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 1, 5, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 2, 0, 10);
+}
+
+template <class S, class SV>
+void test49()
+{
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 2, 1, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 2, 2, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 2, 3, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 2, 4, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 4, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 4, 1, 6);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 4, 2, 6);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 5, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 5, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 0, 5, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 0, 9, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 0, 11, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 1, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 1, 4, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 1, 8, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 1, 10, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 5, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 5, 1, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 5, 2, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 5, 4, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 5, 5, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 5, 6, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 9, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 9, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 9, 2, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 10, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 10, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 0, 19, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 0, 20, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 0, 21, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 1, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 1, 18, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 1, 19, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 1, 20, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 10, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 10, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 10, 5, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 10, 9, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 10, 10, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 10, 11, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 19, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 19, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 19, 2, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 20, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 20, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV(""), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV(""), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 0, 2, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 0, 4, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 0, 5, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 0, 6, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 1, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 1, 2, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 1, 3, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 1, 4, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 1, 5, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 2, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 2, 1, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 2, 2, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 2, 3, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 2, 4, 8);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 4, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 4, 1, 6);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 4, 2, 6);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 5, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 5, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 0, 5, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 0, 9, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 0, 11, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 1, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 1, 4, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 1, 8, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 1, 10, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 5, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 5, 1, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 5, 2, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 5, 4, 5);
+}
+
+template <class S, class SV>
+void test50()
+{
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 5, 5, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 5, 6, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 9, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 9, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 9, 2, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 10, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 10, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 0, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 0, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 0, 10, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 0, 19, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 0, 20, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 0, 21, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 1, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 1, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 1, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 1, 18, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 1, 19, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 1, 20, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 10, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 10, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 10, 5, 5);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 10, 9, 1);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 10, 10, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 10, 11, 0);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 19, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 19, 1, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 19, 2, -9);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 20, 0, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 20, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+}
+
+template <class S, class SV>
+void test51()
+{
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV(""), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV(""), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 0, 2, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 0, 4, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 0, 5, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 0, 6, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 1, 2, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 1, 3, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 1, 4, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 1, 5, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 2, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 2, 1, 17);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 2, 2, 17);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 2, 3, 17);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 2, 4, 17);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 4, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 4, 1, 15);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 4, 2, 15);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 5, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 5, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 0, 5, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 0, 9, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 0, 10, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 0, 11, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 1, 4, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 1, 8, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 1, 9, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 1, 10, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 5, 1, 14);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 5, 2, 14);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 5, 4, 14);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 5, 5, 14);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 5, 6, 14);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 9, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 9, 2, 10);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 0, 10, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 0, 19, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 0, 20, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 0, 21, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 1, 9, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 1, 18, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 1, 19, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 1, 20, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 10, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 10, 5, 9);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 10, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 10, 10, 9);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 10, 11, 9);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 19, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 19, 2, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV(""), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV(""), 0, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 0, 2, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 0, 4, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 0, 5, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 0, 6, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 1, 2, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 1, 3, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 1, 4, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 1, 5, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 2, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 2, 1, 17);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 2, 2, 17);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 2, 3, 17);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 2, 4, 17);
+}
+
+template <class S, class SV>
+void test52()
+{
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 4, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 4, 1, 15);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 4, 2, 15);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 5, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 5, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 0, 5, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 0, 9, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 0, 10, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 0, 11, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 1, 4, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 1, 8, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 1, 9, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 1, 10, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 5, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 5, 1, 14);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 5, 2, 14);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 5, 4, 14);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 5, 5, 14);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 5, 6, 14);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 9, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 9, 1, 10);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 9, 2, 10);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 10, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 10, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 0, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 0, 1, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 0, 10, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 0, 19, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 0, 20, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 0, 21, 19);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 1, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 1, 1, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 1, 9, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 1, 18, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 1, 19, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 1, 20, 18);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 10, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 10, 1, 9);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 10, 5, 9);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 10, 9, 9);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 10, 10, 9);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 10, 11, 9);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 19, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 19, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 19, 2, 0);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 20, 0, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 20, 1, 1);
+ test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 9, 1, -1);
+}
+
+template <class S, class SV>
+void test53()
+{
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV(""), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV(""), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 0, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 0, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 0, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 1, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 1, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 1, 5, -4);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 2, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 2, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 2, 3, -3);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 2, 4, -3);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 4, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 4, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 0, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 0, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 0, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 1, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 1, 8, -8);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 1, 10, -9);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 5, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 5, 2, -2);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 5, 4, -4);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 5, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 5, 6, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 9, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 9, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 0, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 0, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 0, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 0, 20, -20);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 0, 21, -20);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 1, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 1, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 1, 18, -18);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 1, 19, -19);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 1, 20, -19);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 10, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 10, 5, -5);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 10, 9, -9);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 10, 10, -10);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 10, 11, -10);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 19, 1, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 19, 2, -1);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+}
+
+template <class S, class SV>
+void test54()
+{
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV(""), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV(""), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV(""), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 0, 2, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 0, 4, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 0, 5, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 0, 6, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 1, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 1, 2, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 1, 3, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 1, 4, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 1, 5, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 2, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 2, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 2, 2, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 2, 3, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 2, 4, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 4, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 4, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 4, 2, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 5, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 6, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 0, 5, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 0, 9, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 0, 10, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 0, 11, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 1, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 1, 4, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 1, 8, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 1, 9, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 1, 10, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 5, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 5, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 5, 2, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 5, 4, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 5, 5, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 5, 6, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 9, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 9, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 9, 2, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 10, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 11, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 0, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 0, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 0, 10, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 0, 19, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 0, 20, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 0, 21, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 1, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 1, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 1, 9, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 1, 18, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 1, 19, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 1, 20, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 10, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 10, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 10, 5, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 10, 9, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 10, 10, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 10, 11, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 19, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 19, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 19, 2, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 20, 0, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 20, 1, 0);
+ test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 21, 0, 0);
+}
+
+template <class S, class SV>
+void test55()
+{
+ test_npos(S(""), 0, 0, SV(""), 0, 0);
+ test_npos(S(""), 0, 0, SV("abcde"), 0, -5);
+ test_npos(S("abcde"), 0, 0, SV("abcdefghij"), 0, -10);
+ test_npos(S("abcde"), 0, 0, SV("abcdefghij"), 1, -9);
+ test_npos(S("abcde"), 0, 0, SV("abcdefghij"), 5, -5);
+}
+
+int main()
+{
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ test0<S, SV>();
+ test1<S, SV>();
+ test2<S, SV>();
+ test3<S, SV>();
+ test4<S, SV>();
+ test5<S, SV>();
+ test6<S, SV>();
+ test7<S, SV>();
+ test8<S, SV>();
+ test9<S, SV>();
+ test10<S, SV>();
+ test11<S, SV>();
+ test12<S, SV>();
+ test13<S, SV>();
+ test14<S, SV>();
+ test15<S, SV>();
+ test16<S, SV>();
+ test17<S, SV>();
+ test18<S, SV>();
+ test19<S, SV>();
+ test20<S, SV>();
+ test21<S, SV>();
+ test22<S, SV>();
+ test23<S, SV>();
+ test24<S, SV>();
+ test25<S, SV>();
+ test26<S, SV>();
+ test27<S, SV>();
+ test28<S, SV>();
+ test29<S, SV>();
+ test30<S, SV>();
+ test31<S, SV>();
+ test32<S, SV>();
+ test33<S, SV>();
+ test34<S, SV>();
+ test35<S, SV>();
+ test36<S, SV>();
+ test37<S, SV>();
+ test38<S, SV>();
+ test39<S, SV>();
+ test40<S, SV>();
+ test41<S, SV>();
+ test42<S, SV>();
+ test43<S, SV>();
+ test44<S, SV>();
+ test45<S, SV>();
+ test46<S, SV>();
+ test47<S, SV>();
+ test48<S, SV>();
+ test49<S, SV>();
+ test50<S, SV>();
+ test51<S, SV>();
+ test52<S, SV>();
+ test53<S, SV>();
+ test54<S, SV>();
+ test55<S, SV>();
+ }
+#if TEST_STD_VER >= 11
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ typedef std::basic_string_view<char, std::char_traits<char>> SV;
+ test0<S, SV>();
+ test1<S, SV>();
+ test2<S, SV>();
+ test3<S, SV>();
+ test4<S, SV>();
+ test5<S, SV>();
+ test6<S, SV>();
+ test7<S, SV>();
+ test8<S, SV>();
+ test9<S, SV>();
+ test10<S, SV>();
+ test11<S, SV>();
+ test12<S, SV>();
+ test13<S, SV>();
+ test14<S, SV>();
+ test15<S, SV>();
+ test16<S, SV>();
+ test17<S, SV>();
+ test18<S, SV>();
+ test19<S, SV>();
+ test20<S, SV>();
+ test21<S, SV>();
+ test22<S, SV>();
+ test23<S, SV>();
+ test24<S, SV>();
+ test25<S, SV>();
+ test26<S, SV>();
+ test27<S, SV>();
+ test28<S, SV>();
+ test29<S, SV>();
+ test30<S, SV>();
+ test31<S, SV>();
+ test32<S, SV>();
+ test33<S, SV>();
+ test34<S, SV>();
+ test35<S, SV>();
+ test36<S, SV>();
+ test37<S, SV>();
+ test38<S, SV>();
+ test39<S, SV>();
+ test40<S, SV>();
+ test41<S, SV>();
+ test42<S, SV>();
+ test43<S, SV>();
+ test44<S, SV>();
+ test45<S, SV>();
+ test46<S, SV>();
+ test47<S, SV>();
+ test48<S, SV>();
+ test49<S, SV>();
+ test50<S, SV>();
+ test51<S, SV>();
+ test52<S, SV>();
+ test53<S, SV>();
+ test54<S, SV>();
+ test55<S, SV>();
+ }
+#endif
+ {
+ typedef std::string S;
+ typedef std::string_view SV;
+ S s = "MNOP";
+ SV sv = "CDEF";
+ char arr[] = "MNOP";
+
+// calls compare(pos, n1, const char *, 0)
+ assert(s.compare(0, 4, "QRST", 0) > 0);
+
+// calls compare(pos, n1, string("QRST"), 0, npos)
+ assert(s.compare(0, 4, "QRST", 0, std::string::npos) < 0);
+
+// calls compare(pos, n1, T, 0, npos)
+ assert(s.compare(0, 4, sv, 0) > 0);
+
+// calls compare(pos, n1, T, 0, npos)
+ assert(s.compare(0, 4, sv, 0, std::string::npos) > 0);
+
+// calls compare(pos, n1, const char *, 0)
+ assert(s.compare(0, 4, arr, 0) > 0);
+
+// calls compare(size, size, string(arr), 0, npos)
+ assert(s.compare(0, 4, arr, 0, std::string::npos) == 0);
+ }
+}
diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp
index 094c227030b8..13f6c5a1cd7a 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos, size_type n1, const charT *s) const;
@@ -18,6 +17,8 @@
#include "min_allocator.h"
+#include "test_macros.h"
+
int sign(int x)
{
if (x == 0)
@@ -32,15 +33,22 @@ void
test(const S& s, typename S::size_type pos1, typename S::size_type n1,
const typename S::value_type* str, int x)
{
- try
- {
+ if (pos1 <= s.size())
assert(sign(s.compare(pos1, n1, str)) == sign(x));
- assert(pos1 <= s.size());
- }
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos1 > s.size());
+ try
+ {
+ s.compare(pos1, n1, str);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > s.size());
+ }
}
+#endif
}
template <class S>
diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp
index 22aae785c19a..fc811c84671b 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos, size_type n1, const charT *s, size_type n2) const;
@@ -18,6 +17,8 @@
#include "min_allocator.h"
+#include "test_macros.h"
+
int sign(int x)
{
if (x == 0)
@@ -32,15 +33,22 @@ void
test(const S& s, typename S::size_type pos, typename S::size_type n1,
const typename S::value_type* str, typename S::size_type n2, int x)
{
- try
- {
+ if (pos <= s.size())
assert(sign(s.compare(pos, n1, str, n2)) == sign(x));
- assert(pos <= s.size());
- }
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > s.size());
+ try
+ {
+ s.compare(pos, n1, str, n2);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > s.size());
+ }
}
+#endif
}
template <class S>
diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
index 90b4230f64da..b3d7da29fb1f 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos1, size_type n1, const basic_string& str) const;
@@ -18,6 +17,8 @@
#include "min_allocator.h"
+#include "test_macros.h"
+
int sign(int x)
{
if (x == 0)
@@ -32,15 +33,22 @@ void
test(const S& s, typename S::size_type pos1, typename S::size_type n1,
const S& str, int x)
{
- try
- {
+ if (pos1 <= s.size())
assert(sign(s.compare(pos1, n1, str)) == sign(x));
- assert(pos1 <= s.size());
- }
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos1 > s.size());
+ try
+ {
+ s.compare(pos1, n1, str);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos1 > s.size());
+ }
}
+#endif
}
template <class S>
diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp
index 3cbbea7b490b..42bba9d5eb2b 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// int compare(size_type pos1, size_type n1, const basic_string& str,
@@ -20,6 +19,8 @@
#include "min_allocator.h"
+#include "test_macros.h"
+
int sign(int x)
{
if (x == 0)
@@ -31,36 +32,48 @@ int sign(int x)
template <class S>
void
-test(const S& s, typename S::size_type pos1, typename S::size_type n1,
+test(const S& s, typename S::size_type pos1, typename S::size_type n1,
const S& str, typename S::size_type pos2, typename S::size_type n2, int x)
{
- try
- {
+ if (pos1 <= s.size() && pos2 <= str.size())
assert(sign(s.compare(pos1, n1, str, pos2, n2)) == sign(x));
- assert(pos1 <= s.size());
- assert(pos2 <= str.size());
- }
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos1 > s.size() || pos2 > str.size());
+ try
+ {
+ s.compare(pos1, n1, str, pos2, n2);
+ assert(false);
+ }
+ catch (const std::out_of_range&)
+ {
+ assert(pos1 > s.size() || pos2 > str.size());
+ }
}
+#endif
}
template <class S>
void
-test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1,
- const S& str, typename S::size_type pos2, int x)
+test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1,
+ const S& str, typename S::size_type pos2, int x)
{
- try
- {
+ if (pos1 <= s.size() && pos2 <= str.size())
assert(sign(s.compare(pos1, n1, str, pos2)) == sign(x));
- assert(pos1 <= s.size());
- assert(pos2 <= str.size());
- }
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos1 > s.size() || pos2 > str.size());
+ try
+ {
+ s.compare(pos1, n1, str, pos2);
+ assert(false);
+ }
+ catch (const std::out_of_range&)
+ {
+ assert(pos1 > s.size() || pos2 > str.size());
+ }
}
+#endif
}
template <class S>
diff --git a/test/std/strings/basic.string/string.ops/string_substr/substr.pass.cpp b/test/std/strings/basic.string/string.ops/string_substr/substr.pass.cpp
index 145e8dde58bf..f94739eb4413 100644
--- a/test/std/strings/basic.string/string.ops/string_substr/substr.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_substr/substr.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// basic_string substr(size_type pos = 0, size_type n = npos) const;
@@ -24,7 +23,7 @@ template <class S>
void
test(const S& s, typename S::size_type pos, typename S::size_type n)
{
- try
+ if (pos <= s.size())
{
S str = s.substr(pos, n);
LIBCPP_ASSERT(str.__invariants());
@@ -33,10 +32,20 @@ test(const S& s, typename S::size_type pos, typename S::size_type n)
assert(str.size() == rlen);
assert(S::traits_type::compare(s.data()+pos, str.data(), rlen) == 0);
}
- catch (std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ else
{
- assert(pos > s.size());
+ try
+ {
+ S str = s.substr(pos, n);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ assert(pos > s.size());
+ }
}
+#endif
}
int main()
diff --git a/test/std/strings/basic.string/string.require/contiguous.pass.cpp b/test/std/strings/basic.string/string.require/contiguous.pass.cpp
index 49773fe491a2..1cc8e96e8cd4 100644
--- a/test/std/strings/basic.string/string.require/contiguous.pass.cpp
+++ b/test/std/strings/basic.string/string.require/contiguous.pass.cpp
@@ -22,7 +22,7 @@ template <class C>
void test_contiguous ( const C &c )
{
for ( size_t i = 0; i < c.size(); ++i )
- assert ( *(c.begin() + i) == *(std::addressof(*c.begin()) + i));
+ assert ( *(c.begin() + static_cast<typename C::difference_type>(i)) == *(std::addressof(*c.begin()) + i));
}
int main()
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign3.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign3.pass.cpp
index a4a0e294c262..a9eb6c961a31 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign3.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/assign3.pass.cpp
@@ -18,7 +18,6 @@
int main()
{
- char s1[] = {1, 2, 3};
char s2[3] = {0};
assert(std::char_traits<char>::assign(s2, 3, char(5)) == s2);
assert(s2[0] == char(5));
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp
index f7f84e85924c..8a2f2964c765 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp
@@ -18,7 +18,6 @@
int main()
{
- char c = '\0';
assert(std::char_traits<char>::eq('a', 'a'));
assert(!std::char_traits<char>::eq('a', 'A'));
}
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign3.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign3.pass.cpp
index fc1ba6e8670a..4b702fa8b409 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign3.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/assign3.pass.cpp
@@ -19,7 +19,6 @@
int main()
{
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- char16_t s1[] = {1, 2, 3};
char16_t s2[3] = {0};
assert(std::char_traits<char16_t>::assign(s2, 3, char16_t(5)) == s2);
assert(s2[0] == char16_t(5));
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp
index 4e5a1834aeb5..3b6e0d609d09 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp
@@ -20,5 +20,6 @@ int main()
{
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
std::char_traits<char16_t>::int_type i = std::char_traits<char16_t>::eof();
+ ((void)i); // Prevent unused warning
#endif
}
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp
index 1ae4cb8fe8d9..c58db4c1492f 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp
@@ -22,7 +22,6 @@ int main()
{
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11
- char16_t c = u'\0';
assert(std::char_traits<char16_t>::eq(u'a', u'a'));
assert(!std::char_traits<char16_t>::eq(u'a', u'A'));
#endif
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp
index b27ee06f4a59..2327670690ac 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp
@@ -22,7 +22,6 @@ int main()
{
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11
- char16_t c = u'\0';
assert(!std::char_traits<char16_t>::lt(u'a', u'a'));
assert( std::char_traits<char16_t>::lt(u'A', u'a'));
#endif
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign3.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign3.pass.cpp
index 0c31ea7ae97e..8e0ee2f6ff9e 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign3.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/assign3.pass.cpp
@@ -19,7 +19,6 @@
int main()
{
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- char32_t s1[] = {1, 2, 3};
char32_t s2[3] = {0};
assert(std::char_traits<char32_t>::assign(s2, 3, char32_t(5)) == s2);
assert(s2[0] == char32_t(5));
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp
index 8f804aa22e7a..178486d701fa 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp
@@ -20,5 +20,6 @@ int main()
{
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
std::char_traits<char32_t>::int_type i = std::char_traits<char32_t>::eof();
+ ((void)i); // Prevent unused warning
#endif
}
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp
index 0284d9f7933b..92dd5b87b54a 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp
@@ -22,7 +22,6 @@ int main()
{
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11
- char32_t c = U'\0';
assert(std::char_traits<char32_t>::eq(U'a', U'a'));
assert(!std::char_traits<char32_t>::eq(U'a', U'A'));
#endif
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp
index 9816df738709..f091bd980182 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp
@@ -22,7 +22,6 @@ int main()
{
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11
- char32_t c = U'\0';
assert(!std::char_traits<char32_t>::lt(U'a', U'a'));
assert( std::char_traits<char32_t>::lt(U'A', U'a'));
#endif
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp
index 2a00fe06e5a2..acb505671728 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp
@@ -18,7 +18,6 @@
int main()
{
- wchar_t s1[] = {1, 2, 3};
wchar_t s2[3] = {0};
assert(std::char_traits<wchar_t>::assign(s2, 3, wchar_t(5)) == s2);
assert(s2[0] == wchar_t(5));
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp
index 98d0926e3071..bd00b07ad281 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp
@@ -18,7 +18,6 @@
int main()
{
- wchar_t c = L'\0';
assert(std::char_traits<wchar_t>::eq(L'a', L'a'));
assert(!std::char_traits<wchar_t>::eq(L'a', L'A'));
}
diff --git a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
index 147a57914e09..60cbc218b72a 100644
--- a/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
+++ b/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
@@ -18,7 +18,6 @@
int main()
{
- wchar_t c = L'\0';
assert(!std::char_traits<wchar_t>::lt(L'a', L'a'));
assert( std::char_traits<wchar_t>::lt(L'A', L'a'));
}
diff --git a/test/std/strings/string.conversions/stod.pass.cpp b/test/std/strings/string.conversions/stod.pass.cpp
index 27d5e5cbd19b..3d5db63e0983 100644
--- a/test/std/strings/string.conversions/stod.pass.cpp
+++ b/test/std/strings/string.conversions/stod.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// double stod(const string& str, size_t *idx = 0);
@@ -17,6 +16,8 @@
#include <cmath>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
assert(std::stod("0") == 0);
@@ -33,20 +34,25 @@ int main()
idx = 0;
assert(std::stod(L"10g", &idx) == 10);
assert(idx == 2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::stod("1.e60", &idx) == 1.e60);
assert(idx == 5);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
try
+#endif
{
assert(std::stod(L"1.e60", &idx) == 1.e60);
assert(idx == 5);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
@@ -71,40 +77,54 @@ int main()
assert(idx == 0);
}
try
+#endif
{
assert(std::stod("INF", &idx) == INFINITY);
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
+#endif
idx = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::stod(L"INF", &idx) == INFINITY);
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
+#endif
idx = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::isnan(std::stod("NAN", &idx)));
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
+#endif
idx = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::isnan(std::stod(L"NAN", &idx)));
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
@@ -164,4 +184,5 @@ int main()
{
assert(idx == 0);
}
+#endif
}
diff --git a/test/std/strings/string.conversions/stof.pass.cpp b/test/std/strings/string.conversions/stof.pass.cpp
index 38519a2feba0..1e17e1d3abdd 100644
--- a/test/std/strings/string.conversions/stof.pass.cpp
+++ b/test/std/strings/string.conversions/stof.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
@@ -20,6 +19,8 @@
#include <cmath>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
assert(std::stof("0") == 0);
@@ -36,6 +37,7 @@ int main()
idx = 0;
assert(std::stof(L"10g", &idx) == 10);
assert(idx == 2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
idx = 0;
try
{
@@ -75,40 +77,54 @@ int main()
assert(idx == 0);
}
try
+#endif
{
assert(std::stof("INF", &idx) == INFINITY);
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
+#endif
idx = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::stof(L"INF", &idx) == INFINITY);
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
+#endif
idx = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::isnan(std::stof("NAN", &idx)));
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
+#endif
idx = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::isnan(std::stof(L"NAN", &idx)));
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
@@ -168,4 +184,5 @@ int main()
{
assert(idx == 0);
}
+#endif
}
diff --git a/test/std/strings/string.conversions/stoi.pass.cpp b/test/std/strings/string.conversions/stoi.pass.cpp
index 238072740703..8852d47f0011 100644
--- a/test/std/strings/string.conversions/stoi.pass.cpp
+++ b/test/std/strings/string.conversions/stoi.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// int stoi(const string& str, size_t *idx = 0, int base = 10);
@@ -16,6 +15,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
assert(std::stoi("0") == 0);
@@ -32,6 +33,7 @@ int main()
idx = 0;
assert(std::stoi(L"10g", &idx, 16) == 16);
assert(idx == 2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
if (std::numeric_limits<long>::max() > std::numeric_limits<int>::max())
{
try
@@ -106,4 +108,5 @@ int main()
{
assert(idx == 0);
}
+#endif
}
diff --git a/test/std/strings/string.conversions/stol.pass.cpp b/test/std/strings/string.conversions/stol.pass.cpp
index 2ca2c01cfb8c..457cf0a76997 100644
--- a/test/std/strings/string.conversions/stol.pass.cpp
+++ b/test/std/strings/string.conversions/stol.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
@@ -19,6 +18,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
assert(std::stol("0") == 0);
@@ -35,6 +36,7 @@ int main()
idx = 0;
assert(std::stol(L"10g", &idx, 16) == 16);
assert(idx == 2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
idx = 0;
try
{
@@ -109,4 +111,5 @@ int main()
{
assert(idx == 0);
}
+#endif
}
diff --git a/test/std/strings/string.conversions/stold.pass.cpp b/test/std/strings/string.conversions/stold.pass.cpp
index f489df2f124d..9d9dc3832ba6 100644
--- a/test/std/strings/string.conversions/stold.pass.cpp
+++ b/test/std/strings/string.conversions/stold.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <string>
// long double stold(const string& str, size_t *idx = 0);
@@ -19,6 +18,8 @@
#include <cmath>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
assert(std::stold("0") == 0);
@@ -35,25 +36,32 @@ int main()
idx = 0;
assert(std::stold(L"10g", &idx) == 10);
assert(idx == 2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::stold("1.e60", &idx) == 1.e60L);
assert(idx == 5);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
try
+#endif
{
assert(std::stold(L"1.e60", &idx) == 1.e60L);
assert(idx == 5);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
+#endif
idx = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
assert(std::stold("1.e6000", &idx) == INFINITY);
@@ -73,40 +81,54 @@ int main()
assert(idx == 0);
}
try
+#endif
{
assert(std::stold("INF", &idx) == INFINITY);
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
+#endif
idx = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::stold(L"INF", &idx) == INFINITY);
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
+#endif
idx = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::isnan(std::stold("NAN", &idx)));
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
}
+#endif
idx = 0;
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
+#endif
{
assert(std::isnan(std::stold(L"NAN", &idx)));
assert(idx == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (const std::out_of_range&)
{
assert(false);
@@ -166,4 +188,5 @@ int main()
{
assert(idx == 0);
}
+#endif
}
diff --git a/test/std/strings/string.conversions/stoll.pass.cpp b/test/std/strings/string.conversions/stoll.pass.cpp
index d41db4284acd..ca8412aeb758 100644
--- a/test/std/strings/string.conversions/stoll.pass.cpp
+++ b/test/std/strings/string.conversions/stoll.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
@@ -19,6 +18,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
assert(std::stoll("0") == 0);
@@ -35,6 +36,7 @@ int main()
idx = 0;
assert(std::stoll(L"10g", &idx, 16) == 16);
assert(idx == 2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
idx = 0;
try
{
@@ -108,4 +110,5 @@ int main()
{
assert(idx == 0);
}
+#endif
}
diff --git a/test/std/strings/string.conversions/stoul.pass.cpp b/test/std/strings/string.conversions/stoul.pass.cpp
index 9dbd952434a9..1acdf116458f 100644
--- a/test/std/strings/string.conversions/stoul.pass.cpp
+++ b/test/std/strings/string.conversions/stoul.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
@@ -19,6 +18,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
assert(std::stoul("0") == 0);
@@ -33,6 +34,7 @@ int main()
idx = 0;
assert(std::stoul(L"10g", &idx, 16) == 16);
assert(idx == 2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
idx = 0;
try
{
@@ -107,4 +109,5 @@ int main()
{
assert(idx == 0);
}
+#endif
}
diff --git a/test/std/strings/string.conversions/stoull.pass.cpp b/test/std/strings/string.conversions/stoull.pass.cpp
index 837ca3120100..e63679eed2f4 100644
--- a/test/std/strings/string.conversions/stoull.pass.cpp
+++ b/test/std/strings/string.conversions/stoull.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
@@ -19,6 +18,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
assert(std::stoull("0") == 0);
@@ -33,6 +34,7 @@ int main()
idx = 0;
assert(std::stoull(L"10g", &idx, 16) == 16);
assert(idx == 2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
idx = 0;
try
{
@@ -108,4 +110,5 @@ int main()
{
assert(idx == 0);
}
+#endif
}
diff --git a/test/std/strings/string.view/nothing_to_do.pass.cpp b/test/std/strings/string.view/nothing_to_do.pass.cpp
new file mode 100644
index 000000000000..353dd98f415e
--- /dev/null
+++ b/test/std/strings/string.view/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+#include <string_view>
+
+int main () {}
diff --git a/test/std/strings/string.view/string.view.access/at.pass.cpp b/test/std/strings/string.view/string.view.access/at.pass.cpp
new file mode 100644
index 000000000000..0f1636d3f94f
--- /dev/null
+++ b/test/std/strings/string.view/string.view.access/at.pass.cpp
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// NOTE: Older versions of clang have a bug where they fail to evalute
+// string_view::at as a constant expression.
+// XFAIL: clang-3.4, clang-3.3
+
+
+// <string_view>
+
+// constexpr const _CharT& at(size_type _pos) const;
+
+#include <string_view>
+#include <stdexcept>
+#include <cassert>
+
+#include "test_macros.h"
+
+template <typename CharT>
+void test ( const CharT *s, size_t len ) {
+ std::basic_string_view<CharT> sv ( s, len );
+ assert ( sv.length() == len );
+ for ( size_t i = 0; i < len; ++i ) {
+ assert ( sv.at(i) == s[i] );
+ assert ( &sv.at(i) == s + i );
+ }
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try { sv.at(len); } catch ( const std::out_of_range & ) { return ; }
+ assert ( false );
+#endif
+}
+
+int main () {
+ test ( "ABCDE", 5 );
+ test ( "a", 1 );
+
+ test ( L"ABCDE", 5 );
+ test ( L"a", 1 );
+
+#if TEST_STD_VER >= 11
+ test ( u"ABCDE", 5 );
+ test ( u"a", 1 );
+
+ test ( U"ABCDE", 5 );
+ test ( U"a", 1 );
+#endif
+
+#if TEST_STD_VER >= 11
+ {
+ constexpr std::basic_string_view<char> sv ( "ABC", 2 );
+ static_assert ( sv.length() == 2, "" );
+ static_assert ( sv.at(0) == 'A', "" );
+ static_assert ( sv.at(1) == 'B', "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.access/back.pass.cpp b/test/std/strings/string.view/string.view.access/back.pass.cpp
new file mode 100644
index 000000000000..73f7737265d5
--- /dev/null
+++ b/test/std/strings/string.view/string.view.access/back.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// constexpr const _CharT& front();
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template <typename CharT>
+bool test ( const CharT *s, size_t len ) {
+ std::basic_string_view<CharT> sv ( s, len );
+ assert ( sv.length() == len );
+ assert ( sv.back() == s[len-1] );
+ return &sv.back() == s + len - 1;
+ }
+
+int main () {
+ assert ( test ( "ABCDE", 5 ));
+ assert ( test ( "a", 1 ));
+
+ assert ( test ( L"ABCDE", 5 ));
+ assert ( test ( L"a", 1 ));
+
+#if TEST_STD_VER >= 11
+ assert ( test ( u"ABCDE", 5 ));
+ assert ( test ( u"a", 1 ));
+
+ assert ( test ( U"ABCDE", 5 ));
+ assert ( test ( U"a", 1 ));
+#endif
+
+#if TEST_STD_VER >= 11
+ {
+ constexpr std::basic_string_view<char> sv ( "ABC", 2 );
+ static_assert ( sv.length() == 2, "" );
+ static_assert ( sv.back() == 'B', "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.access/data.pass.cpp b/test/std/strings/string.view/string.view.access/data.pass.cpp
new file mode 100644
index 000000000000..7b2350923bb6
--- /dev/null
+++ b/test/std/strings/string.view/string.view.access/data.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// constexpr const _CharT* data() const noexcept;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template <typename CharT>
+void test ( const CharT *s, size_t len ) {
+ std::basic_string_view<CharT> sv ( s, len );
+ assert ( sv.length() == len );
+ assert ( sv.data() == s );
+ }
+
+int main () {
+ test ( "ABCDE", 5 );
+ test ( "a", 1 );
+
+ test ( L"ABCDE", 5 );
+ test ( L"a", 1 );
+
+#if TEST_STD_VER >= 11
+ test ( u"ABCDE", 5 );
+ test ( u"a", 1 );
+
+ test ( U"ABCDE", 5 );
+ test ( U"a", 1 );
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ constexpr const char *s = "ABC";
+ constexpr std::basic_string_view<char> sv( s, 2 );
+ static_assert( sv.length() == 2, "" );
+ static_assert( sv.data() == s, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.access/front.pass.cpp b/test/std/strings/string.view/string.view.access/front.pass.cpp
new file mode 100644
index 000000000000..c627e02c410f
--- /dev/null
+++ b/test/std/strings/string.view/string.view.access/front.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// constexpr const _CharT& back();
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template <typename CharT>
+bool test ( const CharT *s, size_t len ) {
+ std::basic_string_view<CharT> sv ( s, len );
+ assert ( sv.length() == len );
+ assert ( sv.front() == s[0] );
+ return &sv.front() == s;
+ }
+
+int main () {
+ assert ( test ( "ABCDE", 5 ));
+ assert ( test ( "a", 1 ));
+
+ assert ( test ( L"ABCDE", 5 ));
+ assert ( test ( L"a", 1 ));
+
+#if TEST_STD_VER >= 11
+ assert ( test ( u"ABCDE", 5 ));
+ assert ( test ( u"a", 1 ));
+
+ assert ( test ( U"ABCDE", 5 ));
+ assert ( test ( U"a", 1 ));
+#endif
+
+#if TEST_STD_VER >= 11
+ {
+ constexpr std::basic_string_view<char> sv ( "ABC", 2 );
+ static_assert ( sv.length() == 2, "" );
+ static_assert ( sv.front() == 'A', "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.access/index.pass.cpp b/test/std/strings/string.view/string.view.access/index.pass.cpp
new file mode 100644
index 000000000000..65eb6b4f65e9
--- /dev/null
+++ b/test/std/strings/string.view/string.view.access/index.pass.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// constexpr const _CharT& operator[](size_type _pos) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template <typename CharT>
+void test ( const CharT *s, size_t len ) {
+ std::basic_string_view<CharT> sv ( s, len );
+ assert ( sv.length() == len );
+ for ( size_t i = 0; i < len; ++i ) {
+ assert ( sv[i] == s[i] );
+ assert ( &sv[i] == s + i );
+ }
+ }
+
+int main () {
+ test ( "ABCDE", 5 );
+ test ( "a", 1 );
+
+ test ( L"ABCDE", 5 );
+ test ( L"a", 1 );
+
+#if TEST_STD_VER >= 11
+ test ( u"ABCDE", 5 );
+ test ( u"a", 1 );
+
+ test ( U"ABCDE", 5 );
+ test ( U"a", 1 );
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ constexpr std::basic_string_view<char> sv ( "ABC", 2 );
+ static_assert ( sv.length() == 2, "" );
+ static_assert ( sv[0] == 'A', "" );
+ static_assert ( sv[1] == 'B', "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp b/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
new file mode 100644
index 000000000000..d36c27886295
--- /dev/null
+++ b/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
@@ -0,0 +1,89 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// [string.view.capacity], capacity
+// constexpr size_type size() const noexcept;
+// constexpr size_type length() const noexcept;
+// constexpr size_type max_size() const noexcept;
+// constexpr bool empty() const noexcept;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template<typename SV>
+void test1 () {
+#if TEST_STD_VER > 11
+ {
+ constexpr SV sv1;
+ static_assert ( sv1.size() == 0, "" );
+ static_assert ( sv1.empty(), "");
+ static_assert ( sv1.size() == sv1.length(), "" );
+ static_assert ( sv1.max_size() > sv1.size(), "");
+ }
+#endif
+
+ {
+ SV sv1;
+ assert ( sv1.size() == 0 );
+ assert ( sv1.empty());
+ assert ( sv1.size() == sv1.length());
+ assert ( sv1.max_size() > sv1.size());
+ }
+}
+
+template<typename CharT>
+void test2 ( const CharT *s, size_t len ) {
+ {
+ std::basic_string_view<CharT> sv1 ( s );
+ assert ( sv1.size() == len );
+ assert ( sv1.data() == s );
+ assert ( sv1.empty() == (len == 0));
+ assert ( sv1.size() == sv1.length());
+ assert ( sv1.max_size() > sv1.size());
+ }
+}
+
+int main () {
+ typedef std::string_view string_view;
+ typedef std::u16string_view u16string_view;
+ typedef std::u32string_view u32string_view;
+ typedef std::wstring_view wstring_view;
+
+ test1<string_view> ();
+ test1<u16string_view> ();
+ test1<u32string_view> ();
+ test1<wstring_view> ();
+
+ test2 ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );
+ test2 ( "ABCDE", 5 );
+ test2 ( "a", 1 );
+ test2 ( "", 0 );
+
+ test2 ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );
+ test2 ( L"ABCDE", 5 );
+ test2 ( L"a", 1 );
+ test2 ( L"", 0 );
+
+#if TEST_STD_VER >= 11
+ test2 ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );
+ test2 ( u"ABCDE", 5 );
+ test2 ( u"a", 1 );
+ test2 ( u"", 0 );
+
+ test2 ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );
+ test2 ( U"ABCDE", 5 );
+ test2 ( U"a", 1 );
+ test2 ( U"", 0 );
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp b/test/std/strings/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp
new file mode 100644
index 000000000000..079c89191e49
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits>
+// constexpr bool operator==(basic_string_view<charT,traits> lhs, const charT* rhs);
+// template<class charT, class traits>
+// constexpr bool operator==(const charT* lhs, basic_string_view<charT,traits> rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(S lhs, const typename S::value_type* rhs, bool x)
+{
+ assert((lhs == rhs) == x);
+ assert((rhs == lhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), "", true);
+ test(S(""), "abcde", false);
+ test(S(""), "abcdefghij", false);
+ test(S(""), "abcdefghijklmnopqrst", false);
+ test(S("abcde"), "", false);
+ test(S("abcde"), "abcde", true);
+ test(S("abcde"), "abcdefghij", false);
+ test(S("abcde"), "abcdefghijklmnopqrst", false);
+ test(S("abcdefghij"), "", false);
+ test(S("abcdefghij"), "abcde", false);
+ test(S("abcdefghij"), "abcdefghij", true);
+ test(S("abcdefghij"), "abcdefghijklmnopqrst", false);
+ test(S("abcdefghijklmnopqrst"), "", false);
+ test(S("abcdefghijklmnopqrst"), "abcde", false);
+ test(S("abcdefghijklmnopqrst"), "abcdefghij", false);
+ test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+ static_assert ( sv1 == "", "" );
+ static_assert ( "" == sv1, "" );
+ static_assert (!(sv1 == "abcde"), "" );
+ static_assert (!("abcde" == sv1), "" );
+
+ static_assert ( sv2 == "abcde", "" );
+ static_assert ( "abcde" == sv2, "" );
+ static_assert (!(sv2 == "abcde0"), "" );
+ static_assert (!("abcde0" == sv2), "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opeq.string_view.string.pass.cpp b/test/std/strings/string.view/string.view.comparison/opeq.string_view.string.pass.cpp
new file mode 100644
index 000000000000..4b107b01e2c6
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opeq.string_view.string.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits, class Allocator>
+// bool operator==(const charT* lhs, const basic_string<charT,traits> rhs);
+// template<class charT, class traits, class Allocator>
+// bool operator==(const basic_string_view<charT,traits> lhs, const CharT* rhs);
+
+#include <string_view>
+#include <string>
+#include <cassert>
+
+template <class S>
+void
+test(const std::string &lhs, S rhs, bool x)
+{
+ assert((lhs == rhs) == x);
+ assert((rhs == lhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test("", S(""), true);
+ test("", S("abcde"), false);
+ test("", S("abcdefghij"), false);
+ test("", S("abcdefghijklmnopqrst"), false);
+ test("abcde", S(""), false);
+ test("abcde", S("abcde"), true);
+ test("abcde", S("abcdefghij"), false);
+ test("abcde", S("abcdefghijklmnopqrst"), false);
+ test("abcdefghij", S(""), false);
+ test("abcdefghij", S("abcde"), false);
+ test("abcdefghij", S("abcdefghij"), true);
+ test("abcdefghij", S("abcdefghijklmnopqrst"), false);
+ test("abcdefghijklmnopqrst", S(""), false);
+ test("abcdefghijklmnopqrst", S("abcde"), false);
+ test("abcdefghijklmnopqrst", S("abcdefghij"), false);
+ test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true);
+ }
+}
+
diff --git a/test/std/strings/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp b/test/std/strings/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp
new file mode 100644
index 000000000000..59cd7215b7e6
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// template<class charT, class traits, class Allocator>
+// constexpr bool operator==(const basic_string_view<charT,traits> lhs,
+// const basic_string_view<charT,traits> rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(S lhs, S rhs, bool x)
+{
+ assert((lhs == rhs) == x);
+ assert((rhs == lhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), S(""), true);
+ test(S(""), S("abcde"), false);
+ test(S(""), S("abcdefghij"), false);
+ test(S(""), S("abcdefghijklmnopqrst"), false);
+ test(S("abcde"), S(""), false);
+ test(S("abcde"), S("abcde"), true);
+ test(S("abcde"), S("abcdefghij"), false);
+ test(S("abcde"), S("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghij"), S(""), false);
+ test(S("abcdefghij"), S("abcde"), false);
+ test(S("abcdefghij"), S("abcdefghij"), true);
+ test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false);
+ test(S("abcdefghijklmnopqrst"), S(""), false);
+ test(S("abcdefghijklmnopqrst"), S("abcde"), false);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2;
+ constexpr SV sv3 { "abcde", 5 };
+ static_assert ( sv1 == sv2, "" );
+ static_assert (!(sv1 == sv3), "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp b/test/std/strings/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp
new file mode 100644
index 000000000000..a75cb318505c
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits, class Allocator>
+// constexpr bool operator>=(const charT* lhs, basic_string_wiew<charT,traits> rhs);
+// template<class charT, class traits, class Allocator>
+// constexpr bool operator>=(basic_string_wiew<charT,traits> lhs, const charT* rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const typename S::value_type* lhs, const S& rhs, bool x, bool y)
+{
+ assert((lhs >= rhs) == x);
+ assert((rhs >= lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test("", S(""), true, true);
+ test("", S("abcde"), false, true);
+ test("", S("abcdefghij"), false, true);
+ test("", S("abcdefghijklmnopqrst"), false, true);
+ test("abcde", S(""), true, false);
+ test("abcde", S("abcde"), true, true);
+ test("abcde", S("abcdefghij"), false, true);
+ test("abcde", S("abcdefghijklmnopqrst"), false, true);
+ test("abcdefghij", S(""), true, false);
+ test("abcdefghij", S("abcde"), true, false);
+ test("abcdefghij", S("abcdefghij"), true, true);
+ test("abcdefghij", S("abcdefghijklmnopqrst"), false, true);
+ test("abcdefghijklmnopqrst", S(""), true, false);
+ test("abcdefghijklmnopqrst", S("abcde"), true, false);
+ test("abcdefghijklmnopqrst", S("abcdefghij"), true, false);
+ test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert ( sv1 >= "", "" );
+ static_assert ( "" >= sv1, "" );
+ static_assert (!(sv1 >= "abcde"), "" );
+ static_assert ( "abcde" >= sv1, "" );
+
+ static_assert ( sv2 >= "", "" );
+ static_assert (!("" >= sv2), "" );
+ static_assert ( sv2 >= "abcde", "" );
+ static_assert ( "abcde" >= sv2, "" );
+ static_assert (!(sv2 >= "abcde0"), "" );
+ static_assert ( "abcde0" >= sv2, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opge.string_view.string.pass.cpp b/test/std/strings/string.view/string.view.comparison/opge.string_view.string.pass.cpp
new file mode 100644
index 000000000000..3881372ffc34
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opge.string_view.string.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits, class Allocator>
+// bool operator>=(const basic_string<charT,traits,Allocator>& lhs,
+// basic_string_view<charT,traits> rhs);
+// bool operator>=(basic_string_view<charT,traits> lhs,
+// const basic_string<charT,traits,Allocator>& rhs);
+
+#include <string_view>
+#include <cassert>
+
+template <class S>
+void
+test(const S& lhs, const typename S::value_type* rhs, bool x, bool y)
+{
+ assert((lhs >= rhs) == x);
+ assert((rhs >= lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), "", true, true);
+ test(S(""), "abcde", false, true);
+ test(S(""), "abcdefghij", false, true);
+ test(S(""), "abcdefghijklmnopqrst", false, true);
+ test(S("abcde"), "", true, false);
+ test(S("abcde"), "abcde", true, true);
+ test(S("abcde"), "abcdefghij", false, true);
+ test(S("abcde"), "abcdefghijklmnopqrst", false, true);
+ test(S("abcdefghij"), "", true, false);
+ test(S("abcdefghij"), "abcde", true, false);
+ test(S("abcdefghij"), "abcdefghij", true, true);
+ test(S("abcdefghij"), "abcdefghijklmnopqrst", false, true);
+ test(S("abcdefghijklmnopqrst"), "", true, false);
+ test(S("abcdefghijklmnopqrst"), "abcde", true, false);
+ test(S("abcdefghijklmnopqrst"), "abcdefghij", true, false);
+ test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true, true);
+ }
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp b/test/std/strings/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp
new file mode 100644
index 000000000000..85455e18d071
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits>
+// constexpr bool operator>=(basic_string_view<charT,traits> lhs,
+// basic_string_view<charT,traits> rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& lhs, const S& rhs, bool x, bool y)
+{
+ assert((lhs >= rhs) == x);
+ assert((rhs >= lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), S(""), true, true);
+ test(S(""), S("abcde"), false, true);
+ test(S(""), S("abcdefghij"), false, true);
+ test(S(""), S("abcdefghijklmnopqrst"), false, true);
+ test(S("abcde"), S(""), true, false);
+ test(S("abcde"), S("abcde"), true, true);
+ test(S("abcde"), S("abcdefghij"), false, true);
+ test(S("abcde"), S("abcdefghijklmnopqrst"), false, true);
+ test(S("abcdefghij"), S(""), true, false);
+ test(S("abcdefghij"), S("abcde"), true, false);
+ test(S("abcdefghij"), S("abcdefghij"), true, true);
+ test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false, true);
+ test(S("abcdefghijklmnopqrst"), S(""), true, false);
+ test(S("abcdefghijklmnopqrst"), S("abcde"), true, false);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true, false);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert ( sv1 >= sv1, "" );
+ static_assert ( sv2 >= sv2, "" );
+
+ static_assert (!(sv1 >= sv2), "" );
+ static_assert ( sv2 >= sv1, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp b/test/std/strings/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp
new file mode 100644
index 000000000000..d4dc39e891fc
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// constexpr template<class charT, class traits, class Allocator>
+// bool operator>(const charT* lhs, basic_string_wiew<charT,traits> rhs);
+// constexpr template<class charT, class traits, class Allocator>
+// bool operator>(basic_string_wiew<charT,traits> lhs, const charT* rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const typename S::value_type* lhs, const S& rhs, bool x, bool y)
+{
+ assert((lhs > rhs) == x);
+ assert((rhs > lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test("", S(""), false, false);
+ test("", S("abcde"), false, true);
+ test("", S("abcdefghij"), false, true);
+ test("", S("abcdefghijklmnopqrst"), false, true);
+ test("abcde", S(""), true, false);
+ test("abcde", S("abcde"), false, false);
+ test("abcde", S("abcdefghij"), false, true);
+ test("abcde", S("abcdefghijklmnopqrst"), false, true);
+ test("abcdefghij", S(""), true, false);
+ test("abcdefghij", S("abcde"), true, false);
+ test("abcdefghij", S("abcdefghij"), false, false);
+ test("abcdefghij", S("abcdefghijklmnopqrst"), false, true);
+ test("abcdefghijklmnopqrst", S(""), true, false);
+ test("abcdefghijklmnopqrst", S("abcde"), true, false);
+ test("abcdefghijklmnopqrst", S("abcdefghij"), true, false);
+ test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (!(sv1 > ""), "" );
+ static_assert (!("" > sv1), "" );
+ static_assert (!(sv1 > "abcde"), "" );
+ static_assert ( "abcde" > sv1, "" );
+
+ static_assert ( sv2 > "", "" );
+ static_assert (!("" > sv2), "" );
+ static_assert (!(sv2 > "abcde"), "" );
+ static_assert (!("abcde" > sv2), "" );
+ static_assert (!(sv2 > "abcde0"), "" );
+ static_assert ( "abcde0" > sv2, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opgt.string_view.string.pass.cpp b/test/std/strings/string.view/string.view.comparison/opgt.string_view.string.pass.cpp
new file mode 100644
index 000000000000..f0058c809e4d
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opgt.string_view.string.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits, class Allocator>
+// bool operator>(const basic_string<charT,traits,Allocator>& lhs,
+// basic_string_view<charT,traits> rhs);
+// bool operator>(basic_string_view<charT,traits> lhs,
+// const basic_string<charT,traits,Allocator>& rhs);
+
+#include <string_view>
+#include <cassert>
+
+template <class S>
+void
+test(const S& lhs, const typename S::value_type* rhs, bool x, bool y)
+{
+ assert((lhs > rhs) == x);
+ assert((rhs > lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), "", false, false);
+ test(S(""), "abcde", false, true);
+ test(S(""), "abcdefghij", false, true);
+ test(S(""), "abcdefghijklmnopqrst", false, true);
+ test(S("abcde"), "", true, false);
+ test(S("abcde"), "abcde", false, false);
+ test(S("abcde"), "abcdefghij", false, true);
+ test(S("abcde"), "abcdefghijklmnopqrst", false, true);
+ test(S("abcdefghij"), "", true, false);
+ test(S("abcdefghij"), "abcde", true, false);
+ test(S("abcdefghij"), "abcdefghij", false, false);
+ test(S("abcdefghij"), "abcdefghijklmnopqrst", false, true);
+ test(S("abcdefghijklmnopqrst"), "", true, false);
+ test(S("abcdefghijklmnopqrst"), "abcde", true, false);
+ test(S("abcdefghijklmnopqrst"), "abcdefghij", true, false);
+ test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false, false);
+ }
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp b/test/std/strings/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp
new file mode 100644
index 000000000000..09f5360cd817
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits>
+// constexpr bool operator>(basic_string_view<charT,traits> lhs,
+// basic_string_view<charT,traits> rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& lhs, const S& rhs, bool x, bool y)
+{
+ assert((lhs > rhs) == x);
+ assert((rhs > lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), S(""), false, false);
+ test(S(""), S("abcde"), false, true);
+ test(S(""), S("abcdefghij"), false, true);
+ test(S(""), S("abcdefghijklmnopqrst"), false, true);
+ test(S("abcde"), S(""), true, false);
+ test(S("abcde"), S("abcde"), false, false);
+ test(S("abcde"), S("abcdefghij"), false, true);
+ test(S("abcde"), S("abcdefghijklmnopqrst"), false, true);
+ test(S("abcdefghij"), S(""), true, false);
+ test(S("abcdefghij"), S("abcde"), true, false);
+ test(S("abcdefghij"), S("abcdefghij"), false, false);
+ test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false, true);
+ test(S("abcdefghijklmnopqrst"), S(""), true, false);
+ test(S("abcdefghijklmnopqrst"), S("abcde"), true, false);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true, false);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (!(sv1 > sv1), "" );
+ static_assert (!(sv2 > sv2), "" );
+
+ static_assert (!(sv1 > sv2), "" );
+ static_assert ( sv2 > sv1, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp b/test/std/strings/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp
new file mode 100644
index 000000000000..da6e2d90a975
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits, class Allocator>
+// constexpr bool operator<=(const charT* lhs, basic_string_wiew<charT,traits> rhs);
+// template<class charT, class traits, class Allocator>
+// constexpr bool operator<=(basic_string_wiew<charT,traits> lhs, const charT* rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const typename S::value_type* lhs, const S& rhs, bool x, bool y)
+{
+ assert((lhs <= rhs) == x);
+ assert((rhs <= lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test("", S(""), true, true);
+ test("", S("abcde"), true, false);
+ test("", S("abcdefghij"), true, false);
+ test("", S("abcdefghijklmnopqrst"), true, false);
+ test("abcde", S(""), false, true);
+ test("abcde", S("abcde"), true, true);
+ test("abcde", S("abcdefghij"), true, false);
+ test("abcde", S("abcdefghijklmnopqrst"), true, false);
+ test("abcdefghij", S(""), false, true);
+ test("abcdefghij", S("abcde"), false, true);
+ test("abcdefghij", S("abcdefghij"), true, true);
+ test("abcdefghij", S("abcdefghijklmnopqrst"), true, false);
+ test("abcdefghijklmnopqrst", S(""), false, true);
+ test("abcdefghijklmnopqrst", S("abcde"), false, true);
+ test("abcdefghijklmnopqrst", S("abcdefghij"), false, true);
+ test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert ( sv1 <= "", "" );
+ static_assert ( "" <= sv1, "" );
+ static_assert ( sv1 <= "abcde", "" );
+ static_assert (!("abcde" <= sv1), "" );
+
+ static_assert (!(sv2 <= ""), "" );
+ static_assert ( "" <= sv2, "" );
+ static_assert ( sv2 <= "abcde", "" );
+ static_assert ( "abcde" <= sv2, "" );
+ static_assert ( sv2 <= "abcde0", "" );
+ static_assert (!("abcde0" <= sv2), "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/ople.string_view.string.pass.cpp b/test/std/strings/string.view/string.view.comparison/ople.string_view.string.pass.cpp
new file mode 100644
index 000000000000..092bc23b1c1d
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/ople.string_view.string.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits, class Allocator>
+// bool operator<=(const basic_string<charT,traits,Allocator>& lhs,
+// basic_string_view<charT,traits> rhs);
+// bool operator<=(basic_string_view<charT,traits> lhs,
+// const basic_string<charT,traits,Allocator>& rhs);
+
+#include <string_view>
+#include <cassert>
+
+template <class S>
+void
+test(const S& lhs, const typename S::value_type* rhs, bool x, bool y)
+{
+ assert((lhs <= rhs) == x);
+ assert((rhs <= lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), "", true, true);
+ test(S(""), "abcde", true, false);
+ test(S(""), "abcdefghij", true, false);
+ test(S(""), "abcdefghijklmnopqrst", true, false);
+ test(S("abcde"), "", false, true);
+ test(S("abcde"), "abcde", true, true);
+ test(S("abcde"), "abcdefghij", true, false);
+ test(S("abcde"), "abcdefghijklmnopqrst", true, false);
+ test(S("abcdefghij"), "", false, true);
+ test(S("abcdefghij"), "abcde", false, true);
+ test(S("abcdefghij"), "abcdefghij", true, true);
+ test(S("abcdefghij"), "abcdefghijklmnopqrst", true, false);
+ test(S("abcdefghijklmnopqrst"), "", false, true);
+ test(S("abcdefghijklmnopqrst"), "abcde", false, true);
+ test(S("abcdefghijklmnopqrst"), "abcdefghij", false, true);
+ test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true, true);
+ }
+}
diff --git a/test/std/strings/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp b/test/std/strings/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp
new file mode 100644
index 000000000000..17c0b6bfd1cb
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits>
+// constexpr bool operator<=(basic_string_view<charT,traits> lhs,
+// basic_string_view<charT,traits> rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& lhs, const S& rhs, bool x, bool y)
+{
+ assert((lhs <= rhs) == x);
+ assert((rhs <= lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), S(""), true, true);
+ test(S(""), S("abcde"), true, false);
+ test(S(""), S("abcdefghij"), true, false);
+ test(S(""), S("abcdefghijklmnopqrst"), true, false);
+ test(S("abcde"), S(""), false, true);
+ test(S("abcde"), S("abcde"), true, true);
+ test(S("abcde"), S("abcdefghij"), true, false);
+ test(S("abcde"), S("abcdefghijklmnopqrst"), true, false);
+ test(S("abcdefghij"), S(""), false, true);
+ test(S("abcdefghij"), S("abcde"), false, true);
+ test(S("abcdefghij"), S("abcdefghij"), true, true);
+ test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true, false);
+ test(S("abcdefghijklmnopqrst"), S(""), false, true);
+ test(S("abcdefghijklmnopqrst"), S("abcde"), false, true);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false, true);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert ( sv1 <= sv1, "" );
+ static_assert ( sv2 <= sv2, "" );
+
+ static_assert ( sv1 <= sv2, "" );
+ static_assert (!(sv2 <= sv1), "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp b/test/std/strings/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp
new file mode 100644
index 000000000000..554663f1b828
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits, class Allocator>
+// constexpr bool operator<(const charT* lhs, basic_string_wiew<charT,traits> rhs);
+// template<class charT, class traits, class Allocator>
+// constexpr bool operator<(basic_string_wiew<charT,traits> lhs, const charT* rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const typename S::value_type* lhs, const S& rhs, bool x, bool y)
+{
+ assert((lhs < rhs) == x);
+ assert((rhs < lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test("", S(""), false, false);
+ test("", S("abcde"), true, false);
+ test("", S("abcdefghij"), true, false);
+ test("", S("abcdefghijklmnopqrst"), true, false);
+ test("abcde", S(""), false, true);
+ test("abcde", S("abcde"), false, false);
+ test("abcde", S("abcdefghij"), true, false);
+ test("abcde", S("abcdefghijklmnopqrst"), true, false);
+ test("abcdefghij", S(""), false, true);
+ test("abcdefghij", S("abcde"), false, true);
+ test("abcdefghij", S("abcdefghij"), false, false);
+ test("abcdefghij", S("abcdefghijklmnopqrst"), true, false);
+ test("abcdefghijklmnopqrst", S(""), false, true);
+ test("abcdefghijklmnopqrst", S("abcde"), false, true);
+ test("abcdefghijklmnopqrst", S("abcdefghij"), false, true);
+ test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (!(sv1 < ""), "" );
+ static_assert (!("" < sv1), "" );
+ static_assert ( sv1 < "abcde", "" );
+ static_assert (!("abcde" < sv1), "" );
+
+ static_assert (!(sv2 < ""), "" );
+ static_assert ( "" < sv2, "" );
+ static_assert (!(sv2 < "abcde"), "" );
+ static_assert (!("abcde" < sv2), "" );
+ static_assert ( sv2 < "abcde0", "" );
+ static_assert (!("abcde0" < sv2), "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/oplt.string_view.string.pass.cpp b/test/std/strings/string.view/string.view.comparison/oplt.string_view.string.pass.cpp
new file mode 100644
index 000000000000..609edd764cfe
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/oplt.string_view.string.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits, class Allocator>
+// bool operator<(const basic_string<charT,traits,Allocator>& lhs,
+// basic_string_view<charT,traits> rhs);
+// bool operator<(basic_string_view<charT,traits> lhs,
+// const basic_string<charT,traits,Allocator>& rhs);
+
+#include <string_view>
+#include <cassert>
+
+template <class S>
+void
+test(const S& lhs, const typename S::value_type* rhs, bool x, bool y)
+{
+ assert((lhs < rhs) == x);
+ assert((rhs < lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), "", false, false);
+ test(S(""), "abcde", true, false);
+ test(S(""), "abcdefghij", true, false);
+ test(S(""), "abcdefghijklmnopqrst", true, false);
+ test(S("abcde"), "", false, true);
+ test(S("abcde"), "abcde", false, false);
+ test(S("abcde"), "abcdefghij", true, false);
+ test(S("abcde"), "abcdefghijklmnopqrst", true, false);
+ test(S("abcdefghij"), "", false, true);
+ test(S("abcdefghij"), "abcde", false, true);
+ test(S("abcdefghij"), "abcdefghij", false, false);
+ test(S("abcdefghij"), "abcdefghijklmnopqrst", true, false);
+ test(S("abcdefghijklmnopqrst"), "", false, true);
+ test(S("abcdefghijklmnopqrst"), "abcde", false, true);
+ test(S("abcdefghijklmnopqrst"), "abcdefghij", false, true);
+ test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false, false);
+ }
+}
diff --git a/test/std/strings/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp b/test/std/strings/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp
new file mode 100644
index 000000000000..9ae1927b44e1
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits>
+// constexpr bool operator<(basic_string_view<charT,traits> lhs,
+// basic_string_view<charT,traits> rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& lhs, const S& rhs, bool x, bool y)
+{
+ assert((lhs < rhs) == x);
+ assert((rhs < lhs) == y);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), S(""), false, false);
+ test(S(""), S("abcde"), true, false);
+ test(S(""), S("abcdefghij"), true, false);
+ test(S(""), S("abcdefghijklmnopqrst"), true, false);
+ test(S("abcde"), S(""), false, true);
+ test(S("abcde"), S("abcde"), false, false);
+ test(S("abcde"), S("abcdefghij"), true, false);
+ test(S("abcde"), S("abcdefghijklmnopqrst"), true, false);
+ test(S("abcdefghij"), S(""), false, true);
+ test(S("abcdefghij"), S("abcde"), false, true);
+ test(S("abcdefghij"), S("abcdefghij"), false, false);
+ test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true, false);
+ test(S("abcdefghijklmnopqrst"), S(""), false, true);
+ test(S("abcdefghijklmnopqrst"), S("abcde"), false, true);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false, true);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (!(sv1 < sv1), "" );
+ static_assert (!(sv2 < sv2), "" );
+
+ static_assert ( sv1 < sv2, "" );
+ static_assert (!(sv2 < sv1), "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp b/test/std/strings/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp
new file mode 100644
index 000000000000..8a9c4dbfe782
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits>
+// constexpr bool operator!=(basic_string_view<charT,traits> lhs, const charT* rhs);
+// template<class charT, class traits>
+// constexpr bool operator!=(const charT* lhs, basic_string_view<charT,traits> rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(S lhs, const typename S::value_type* rhs, bool x)
+{
+ assert((lhs != rhs) == x);
+ assert((rhs != lhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), "", false);
+ test(S(""), "abcde", true);
+ test(S(""), "abcdefghij", true);
+ test(S(""), "abcdefghijklmnopqrst", true);
+ test(S("abcde"), "", true);
+ test(S("abcde"), "abcde", false);
+ test(S("abcde"), "abcdefghij", true);
+ test(S("abcde"), "abcdefghijklmnopqrst", true);
+ test(S("abcdefghij"), "", true);
+ test(S("abcdefghij"), "abcde", true);
+ test(S("abcdefghij"), "abcdefghij", false);
+ test(S("abcdefghij"), "abcdefghijklmnopqrst", true);
+ test(S("abcdefghijklmnopqrst"), "", true);
+ test(S("abcdefghijklmnopqrst"), "abcde", true);
+ test(S("abcdefghijklmnopqrst"), "abcdefghij", true);
+ test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (!(sv1 != ""), "" );
+ static_assert (!("" != sv1), "" );
+ static_assert ( sv1 != "abcde", "" );
+ static_assert ( "abcde" != sv1, "" );
+
+ static_assert (!(sv2 != "abcde"), "" );
+ static_assert (!("abcde" != sv2), "" );
+ static_assert ( sv2 != "abcde0", "" );
+ static_assert ( "abcde0" != sv2, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opne.string_view.string.pass.cpp b/test/std/strings/string.view/string.view.comparison/opne.string_view.string.pass.cpp
new file mode 100644
index 000000000000..0c981e21d2aa
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opne.string_view.string.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits, class Allocator>
+// bool operator!=(const basic_string<charT, traits, Allocator> &lhs, basic_string_view<charT,traits> rhs);
+// template<class charT, class traits, class Allocator>
+// bool operator!=(basic_string_view<charT,traits> lhs, const basic_string<charT, traits, Allocator> &rhs);
+
+#include <string_view>
+#include <string>
+#include <cassert>
+
+template <class S>
+void
+test(const std::string &lhs, S rhs, bool x)
+{
+ assert((lhs != rhs) == x);
+ assert((rhs != lhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test("", S(""), false);
+ test("", S("abcde"), true);
+ test("", S("abcdefghij"), true);
+ test("", S("abcdefghijklmnopqrst"), true);
+ test("abcde", S(""), true);
+ test("abcde", S("abcde"), false);
+ test("abcde", S("abcdefghij"), true);
+ test("abcde", S("abcdefghijklmnopqrst"), true);
+ test("abcdefghij", S(""), true);
+ test("abcdefghij", S("abcde"), true);
+ test("abcdefghij", S("abcdefghij"), false);
+ test("abcdefghij", S("abcdefghijklmnopqrst"), true);
+ test("abcdefghijklmnopqrst", S(""), true);
+ test("abcdefghijklmnopqrst", S("abcde"), true);
+ test("abcdefghijklmnopqrst", S("abcdefghij"), true);
+ test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false);
+ }
+}
diff --git a/test/std/strings/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp b/test/std/strings/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp
new file mode 100644
index 000000000000..63a3000f9360
--- /dev/null
+++ b/test/std/strings/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// template<class charT, class traits, class Allocator>
+// constexpr bool operator!=(const basic_string_view<charT,traits> lhs,
+// const basic_string_view<charT,traits> rhs);
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(S lhs, S rhs, bool x)
+{
+ assert((lhs != rhs) == x);
+ assert((rhs != lhs) == x);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), S(""), false);
+ test(S(""), S("abcde"), true);
+ test(S(""), S("abcdefghij"), true);
+ test(S(""), S("abcdefghijklmnopqrst"), true);
+ test(S("abcde"), S(""), true);
+ test(S("abcde"), S("abcde"), false);
+ test(S("abcde"), S("abcdefghij"), true);
+ test(S("abcde"), S("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghij"), S(""), true);
+ test(S("abcdefghij"), S("abcde"), true);
+ test(S("abcdefghij"), S("abcdefghij"), false);
+ test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true);
+ test(S("abcdefghijklmnopqrst"), S(""), true);
+ test(S("abcdefghijklmnopqrst"), S("abcde"), true);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true);
+ test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2;
+ constexpr SV sv3 { "abcde", 5 };
+ static_assert (!( sv1 != sv2), "" );
+ static_assert ( sv1 != sv3, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.cons/default.pass.cpp b/test/std/strings/string.view/string.view.cons/default.pass.cpp
new file mode 100644
index 000000000000..ca332801ead9
--- /dev/null
+++ b/test/std/strings/string.view/string.view.cons/default.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// constexpr basic_string_view () noexcept;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template<typename T>
+void test () {
+#if TEST_STD_VER > 11
+ {
+ constexpr T sv1;
+ static_assert ( sv1.size() == 0, "" );
+ static_assert ( sv1.empty(), "");
+ }
+#endif
+
+ {
+ T sv1;
+ assert ( sv1.size() == 0 );
+ assert ( sv1.empty());
+ }
+}
+
+int main () {
+ typedef std::string_view string_view;
+ typedef std::u16string_view u16string_view;
+ typedef std::u32string_view u32string_view;
+ typedef std::wstring_view wstring_view;
+
+ test<string_view> ();
+ test<u16string_view> ();
+ test<u32string_view> ();
+ test<wstring_view> ();
+
+}
diff --git a/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp b/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp
new file mode 100644
index 000000000000..6c9939340ce2
--- /dev/null
+++ b/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// constexpr basic_string_view(const _CharT* _s)
+// : __data (_s), __size(_Traits::length(_s)) {}
+
+
+#include <string_view>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template<typename CharT>
+size_t StrLen ( const CharT *s ) {
+ size_t retVal = 0;
+ while ( *s != 0 ) { ++retVal; ++s; }
+ return retVal;
+ }
+
+template<typename CharT>
+void test ( const CharT *s ) {
+ std::basic_string_view<CharT> sv1 ( s );
+ assert ( sv1.size() == StrLen( s ));
+ assert ( sv1.data() == s );
+ }
+
+
+int main () {
+
+ test ( "QBCDE" );
+ test ( "A" );
+ test ( "" );
+
+ test ( L"QBCDE" );
+ test ( L"A" );
+ test ( L"" );
+
+#if TEST_STD_VER >= 11
+ test ( u"QBCDE" );
+ test ( u"A" );
+ test ( u"" );
+
+ test ( U"QBCDE" );
+ test ( U"A" );
+ test ( U"" );
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ constexpr std::basic_string_view<char, constexpr_char_traits<char>> sv1 ( "ABCDE" );
+ static_assert ( sv1.size() == 5, "");
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp b/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp
new file mode 100644
index 000000000000..da4d264ae371
--- /dev/null
+++ b/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// constexpr basic_string_view(const _CharT* _s, size_type _len)
+// : __data (_s), __size(_len) {}
+
+
+#include <string_view>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+template<typename CharT>
+void test ( const CharT *s, size_t sz ) {
+ {
+ std::basic_string_view<CharT> sv1 ( s, sz );
+ assert ( sv1.size() == sz );
+ assert ( sv1.data() == s );
+ }
+}
+
+int main () {
+
+ test ( "QBCDE", 5 );
+ test ( "QBCDE", 2 );
+ test ( "", 0 );
+#if TEST_STD_VER > 11
+ {
+ constexpr const char *s = "QBCDE";
+ constexpr std::basic_string_view<char> sv1 ( s, 2 );
+ static_assert ( sv1.size() == 2, "" );
+ static_assert ( sv1.data() == s, "" );
+ }
+#endif
+
+ test ( L"QBCDE", 5 );
+ test ( L"QBCDE", 2 );
+ test ( L"", 0 );
+#if TEST_STD_VER > 11
+ {
+ constexpr const wchar_t *s = L"QBCDE";
+ constexpr std::basic_string_view<wchar_t> sv1 ( s, 2 );
+ static_assert ( sv1.size() == 2, "" );
+ static_assert ( sv1.data() == s, "" );
+ }
+#endif
+
+#if TEST_STD_VER >= 11
+ test ( u"QBCDE", 5 );
+ test ( u"QBCDE", 2 );
+ test ( u"", 0 );
+#if TEST_STD_VER > 11
+ {
+ constexpr const char16_t *s = u"QBCDE";
+ constexpr std::basic_string_view<char16_t> sv1 ( s, 2 );
+ static_assert ( sv1.size() == 2, "" );
+ static_assert ( sv1.data() == s, "" );
+ }
+#endif
+
+ test ( U"QBCDE", 5 );
+ test ( U"QBCDE", 2 );
+ test ( U"", 0 );
+#if TEST_STD_VER > 11
+ {
+ constexpr const char32_t *s = U"QBCDE";
+ constexpr std::basic_string_view<char32_t> sv1 ( s, 2 );
+ static_assert ( sv1.size() == 2, "" );
+ static_assert ( sv1.data() == s, "" );
+ }
+#endif
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.cons/from_string.pass.cpp b/test/std/strings/string.view/string.view.cons/from_string.pass.cpp
new file mode 100644
index 000000000000..3ca6ea16f5b8
--- /dev/null
+++ b/test/std/strings/string.view/string.view.cons/from_string.pass.cpp
@@ -0,0 +1,56 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// template<class Allocator>
+// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept
+
+
+#include <string_view>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct dummy_char_traits : public std::char_traits<char> {};
+
+template<typename CharT, typename Traits>
+void test ( const std::basic_string<CharT, Traits> &str ) {
+ std::basic_string_view<CharT, Traits> sv1 ( str );
+ assert ( sv1.size() == str.size());
+ assert ( sv1.data() == str.data());
+}
+
+int main () {
+
+ test ( std::string("QBCDE") );
+ test ( std::string("") );
+ test ( std::string() );
+
+ test ( std::wstring(L"QBCDE") );
+ test ( std::wstring(L"") );
+ test ( std::wstring() );
+
+#if TEST_STD_VER >= 11
+ test ( std::u16string{u"QBCDE"} );
+ test ( std::u16string{u""} );
+ test ( std::u16string{} );
+
+ test ( std::u32string{U"QBCDE"} );
+ test ( std::u32string{U""} );
+ test ( std::u32string{} );
+#endif
+
+ test ( std::basic_string<char, dummy_char_traits>("QBCDE") );
+ test ( std::basic_string<char, dummy_char_traits>("") );
+ test ( std::basic_string<char, dummy_char_traits>() );
+
+}
diff --git a/test/std/strings/string.view/string.view.cons/from_string1.fail.cpp b/test/std/strings/string.view/string.view.cons/from_string1.fail.cpp
new file mode 100644
index 000000000000..0f33dd87bca0
--- /dev/null
+++ b/test/std/strings/string.view/string.view.cons/from_string1.fail.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// template<class Allocator>
+// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept
+
+#include <string_view>
+#include <string>
+#include <cassert>
+
+struct dummy_char_traits : public std::char_traits<char> {};
+
+int main () {
+ using string_view = std::basic_string_view<char>;
+ using string = std:: basic_string <char, dummy_char_traits>;
+
+ {
+ string s{"QBCDE"};
+ string_view sv1 ( s );
+ assert ( sv1.size() == s.size());
+ assert ( sv1.data() == s.data());
+ }
+} \ No newline at end of file
diff --git a/test/std/strings/string.view/string.view.cons/from_string2.fail.cpp b/test/std/strings/string.view/string.view.cons/from_string2.fail.cpp
new file mode 100644
index 000000000000..6c9ac6436ef3
--- /dev/null
+++ b/test/std/strings/string.view/string.view.cons/from_string2.fail.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// template<class Allocator>
+// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept
+
+#include <string_view>
+#include <string>
+#include <cassert>
+
+struct dummy_char_traits : public std::char_traits<char> {};
+
+int main () {
+ using string_view = std::basic_string_view<char, dummy_char_traits>;
+ using string = std:: basic_string <char>;
+
+ {
+ string s{"QBCDE"};
+ string_view sv1 ( s );
+ assert ( sv1.size() == s.size());
+ assert ( sv1.data() == s.data());
+ }
+}
diff --git a/test/std/strings/string.view/string.view.find/find_char_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_char_size.pass.cpp
new file mode 100644
index 000000000000..67a9133088ff
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_char_size.pass.cpp
@@ -0,0 +1,85 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type find(charT c, size_type pos = 0) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.find(c, pos) == x);
+ if (x != S::npos)
+ assert(pos <= x && x + 1 <= s.size());
+}
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type x)
+{
+ assert(s.find(c) == x);
+ if (x != S::npos)
+ assert(0 <= x && x + 1 <= s.size());
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), 'c', 0, S::npos);
+ test(S(""), 'c', 1, S::npos);
+ test(S("abcde"), 'c', 0, 2);
+ test(S("abcde"), 'c', 1, 2);
+ test(S("abcde"), 'c', 2, 2);
+ test(S("abcde"), 'c', 4, S::npos);
+ test(S("abcde"), 'c', 5, S::npos);
+ test(S("abcde"), 'c', 6, S::npos);
+ test(S("abcdeabcde"), 'c', 0, 2);
+ test(S("abcdeabcde"), 'c', 1, 2);
+ test(S("abcdeabcde"), 'c', 5, 7);
+ test(S("abcdeabcde"), 'c', 9, S::npos);
+ test(S("abcdeabcde"), 'c', 10, S::npos);
+ test(S("abcdeabcde"), 'c', 11, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), 'c', 0, 2);
+ test(S("abcdeabcdeabcdeabcde"), 'c', 1, 2);
+ test(S("abcdeabcdeabcdeabcde"), 'c', 10, 12);
+ test(S("abcdeabcdeabcdeabcde"), 'c', 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), 'c', 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), 'c', 21, S::npos);
+
+ test(S(""), 'c', S::npos);
+ test(S("abcde"), 'c', 2);
+ test(S("abcdeabcde"), 'c', 2);
+ test(S("abcdeabcdeabcdeabcde"), 'c', 2);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find( 'c', 0 ) == SV::npos, "" );
+ static_assert (sv1.find( 'c', 1 ) == SV::npos, "" );
+ static_assert (sv2.find( 'c', 0 ) == 2, "" );
+ static_assert (sv2.find( 'c', 1 ) == 2, "" );
+ static_assert (sv2.find( 'c', 2 ) == 2, "" );
+ static_assert (sv2.find( 'c', 3 ) == SV::npos, "" );
+ static_assert (sv2.find( 'c', 4 ) == SV::npos, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_first_not_of_char_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
new file mode 100644
index 000000000000..77e1343cb00e
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
@@ -0,0 +1,85 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type find_first_not_of(charT c, size_type pos = 0) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.find_first_not_of(c, pos) == x);
+ if (x != S::npos)
+ assert(pos <= x && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type x)
+{
+ assert(s.find_first_not_of(c) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), 'q', 0, S::npos);
+ test(S(""), 'q', 1, S::npos);
+ test(S("kitcj"), 'q', 0, 0);
+ test(S("qkamf"), 'q', 1, 1);
+ test(S("nhmko"), 'q', 2, 2);
+ test(S("tpsaf"), 'q', 4, 4);
+ test(S("lahfb"), 'q', 5, S::npos);
+ test(S("irkhs"), 'q', 6, S::npos);
+ test(S("gmfhdaipsr"), 'q', 0, 0);
+ test(S("kantesmpgj"), 'q', 1, 1);
+ test(S("odaftiegpm"), 'q', 5, 5);
+ test(S("oknlrstdpi"), 'q', 9, 9);
+ test(S("eolhfgpjqk"), 'q', 10, S::npos);
+ test(S("pcdrofikas"), 'q', 11, S::npos);
+ test(S("nbatdlmekrgcfqsophij"), 'q', 0, 0);
+ test(S("bnrpehidofmqtcksjgla"), 'q', 1, 1);
+ test(S("jdmciepkaqgotsrfnhlb"), 'q', 10, 10);
+ test(S("jtdaefblsokrmhpgcnqi"), 'q', 19, 19);
+ test(S("hkbgspofltajcnedqmri"), 'q', 20, S::npos);
+ test(S("oselktgbcapndfjihrmq"), 'q', 21, S::npos);
+
+ test(S(""), 'q', S::npos);
+ test(S("q"), 'q', S::npos);
+ test(S("qqq"), 'q', S::npos);
+ test(S("csope"), 'q', 0);
+ test(S("gfsmthlkon"), 'q', 0);
+ test(S("laenfsbridchgotmkqpj"), 'q', 0);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_first_not_of( 'q', 0 ) == SV::npos, "" );
+ static_assert (sv1.find_first_not_of( 'q', 1 ) == SV::npos, "" );
+ static_assert (sv2.find_first_not_of( 'q', 0 ) == 0, "" );
+ static_assert (sv2.find_first_not_of( 'q', 1 ) == 1, "" );
+ static_assert (sv2.find_first_not_of( 'q', 5 ) == SV::npos, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
new file mode 100644
index 000000000000..a15ac1ef2ba9
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
@@ -0,0 +1,166 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.find_first_not_of(str, pos) == x);
+ if (x != S::npos)
+ assert(pos <= x && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type x)
+{
+ assert(s.find_first_not_of(str) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, S::npos);
+ test(S(""), "laenf", 0, S::npos);
+ test(S(""), "pqlnkmbdjo", 0, S::npos);
+ test(S(""), "qkamfogpnljdcshbreti", 0, S::npos);
+ test(S(""), "", 1, S::npos);
+ test(S(""), "bjaht", 1, S::npos);
+ test(S(""), "hjlcmgpket", 1, S::npos);
+ test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos);
+ test(S("fodgq"), "", 0, 0);
+ test(S("qanej"), "dfkap", 0, 0);
+ test(S("clbao"), "ihqrfebgad", 0, 0);
+ test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, S::npos);
+ test(S("srdfq"), "", 1, 1);
+ test(S("oemth"), "ikcrq", 1, 1);
+ test(S("cdaih"), "dmajblfhsg", 1, 3);
+ test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, S::npos);
+ test(S("cshmd"), "", 2, 2);
+ test(S("lhcdo"), "oebqi", 2, 2);
+ test(S("qnsoh"), "kojhpmbsfe", 2, S::npos);
+ test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, S::npos);
+ test(S("fmtsp"), "", 4, 4);
+ test(S("khbpm"), "aobjd", 4, 4);
+ test(S("pbsji"), "pcbahntsje", 4, 4);
+ test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, S::npos);
+ test(S("eqmpa"), "", 5, S::npos);
+ test(S("omigs"), "kocgb", 5, S::npos);
+ test(S("onmje"), "fbslrjiqkm", 5, S::npos);
+ test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, S::npos);
+ test(S("schfa"), "", 6, S::npos);
+ test(S("igdsc"), "qngpd", 6, S::npos);
+ test(S("brqgo"), "rodhqklgmb", 6, S::npos);
+ test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, S::npos);
+ test(S("hcjitbfapl"), "", 0, 0);
+ test(S("daiprenocl"), "ashjd", 0, 2);
+ test(S("litpcfdghe"), "mgojkldsqh", 0, 1);
+ test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, S::npos);
+ test(S("qpghtfbaji"), "", 1, 1);
+ test(S("gfshlcmdjr"), "nadkh", 1, 1);
+ test(S("nkodajteqp"), "ofdrqmkebl", 1, 4);
+ test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, S::npos);
+ test(S("crnklpmegd"), "", 5, 5);
+ test(S("jsbtafedoc"), "prqgn", 5, 5);
+ test(S("qnmodrtkeb"), "pejafmnokr", 5, 6);
+ test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, S::npos);
+ test(S("lmofqdhpki"), "", 9, 9);
+ test(S("hnefkqimca"), "rtjpa", 9, S::npos);
+ test(S("drtasbgmfp"), "ktsrmnqagd", 9, 9);
+ test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, S::npos);
+ test(S("elgofjmbrq"), "", 10, S::npos);
+ test(S("mjqdgalkpc"), "dplqa", 10, S::npos);
+ test(S("kthqnfcerm"), "dkacjoptns", 10, S::npos);
+ test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, S::npos);
+ test(S("eqsgalomhb"), "", 11, S::npos);
+ test(S("akiteljmoh"), "lofbc", 11, S::npos);
+ test(S("hlbdfreqjo"), "astoegbfpn", 11, S::npos);
+ test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, S::npos);
+ test(S("snafbdlghrjkpqtoceim"), "", 0, 0);
+ test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, 0);
+ test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, 1);
+ test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, S::npos);
+ test(S("jlnkraeodhcspfgbqitm"), "", 1, 1);
+ test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, 1);
+ test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 3);
+ test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, S::npos);
+ test(S("hdpkobnsalmcfijregtq"), "", 10, 10);
+ test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 11);
+ test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 13);
+ test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, S::npos);
+ test(S("niptglfbosehkamrdqcj"), "", 19, 19);
+ test(S("copqdhstbingamjfkler"), "djkqc", 19, 19);
+ test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, S::npos);
+ test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, S::npos);
+ test(S("eaintpchlqsbdgrkjofm"), "", 20, S::npos);
+ test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, S::npos);
+ test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, S::npos);
+ test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, S::npos);
+ test(S("liatsqdoegkmfcnbhrpj"), "", 21, S::npos);
+ test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, S::npos);
+ test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, S::npos);
+ test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), "", S::npos);
+ test(S(""), "laenf", S::npos);
+ test(S(""), "pqlnkmbdjo", S::npos);
+ test(S(""), "qkamfogpnljdcshbreti", S::npos);
+ test(S("nhmko"), "", 0);
+ test(S("lahfb"), "irkhs", 0);
+ test(S("gmfhd"), "kantesmpgj", 2);
+ test(S("odaft"), "oknlrstdpiqmjbaghcfe", S::npos);
+ test(S("eolhfgpjqk"), "", 0);
+ test(S("nbatdlmekr"), "bnrpe", 2);
+ test(S("jdmciepkaq"), "jtdaefblso", 2);
+ test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", S::npos);
+ test(S("gprdcokbnjhlsfmtieqa"), "", 0);
+ test(S("qjghlnftcaismkropdeb"), "bjaht", 0);
+ test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 1);
+ test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", S::npos);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_first_not_of( "", 0) == SV::npos, "" );
+ static_assert (sv1.find_first_not_of( "irkhs", 0) == SV::npos, "" );
+ static_assert (sv2.find_first_not_of( "", 0) == 0, "" );
+ static_assert (sv2.find_first_not_of( "gfsrt", 0) == 0, "" );
+ static_assert (sv2.find_first_not_of( "lecar", 0) == 1, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
new file mode 100644
index 000000000000..5587a0334783
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
@@ -0,0 +1,393 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type n, typename S::size_type x)
+{
+ assert(s.find_first_not_of(str, pos, n) == x);
+ if (x != S::npos)
+ assert(pos <= x && x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, 0, S::npos);
+ test(S(""), "irkhs", 0, 0, S::npos);
+ test(S(""), "kante", 0, 1, S::npos);
+ test(S(""), "oknlr", 0, 2, S::npos);
+ test(S(""), "pcdro", 0, 4, S::npos);
+ test(S(""), "bnrpe", 0, 5, S::npos);
+ test(S(""), "jtdaefblso", 0, 0, S::npos);
+ test(S(""), "oselktgbca", 0, 1, S::npos);
+ test(S(""), "eqgaplhckj", 0, 5, S::npos);
+ test(S(""), "bjahtcmnlp", 0, 9, S::npos);
+ test(S(""), "hjlcmgpket", 0, 10, S::npos);
+ test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos);
+ test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos);
+ test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos);
+ test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos);
+ test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos);
+ test(S(""), "", 1, 0, S::npos);
+ test(S(""), "lbtqd", 1, 0, S::npos);
+ test(S(""), "tboim", 1, 1, S::npos);
+ test(S(""), "slcer", 1, 2, S::npos);
+ test(S(""), "cbjfs", 1, 4, S::npos);
+ test(S(""), "aqibs", 1, 5, S::npos);
+ test(S(""), "gtfblmqinc", 1, 0, S::npos);
+ test(S(""), "mkqpbtdalg", 1, 1, S::npos);
+ test(S(""), "kphatlimcd", 1, 5, S::npos);
+ test(S(""), "pblasqogic", 1, 9, S::npos);
+ test(S(""), "arosdhcfme", 1, 10, S::npos);
+ test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos);
+ test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos);
+ test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos);
+ test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos);
+ test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos);
+ test(S("eaint"), "", 0, 0, 0);
+ test(S("binja"), "gfsrt", 0, 0, 0);
+ test(S("latkm"), "pfsoc", 0, 1, 0);
+ test(S("lecfr"), "tpflm", 0, 2, 0);
+ test(S("eqkst"), "sgkec", 0, 4, 1);
+ test(S("cdafr"), "romds", 0, 5, 0);
+ test(S("prbhe"), "qhjistlgmr", 0, 0, 0);
+ test(S("lbisk"), "pedfirsglo", 0, 1, 0);
+ test(S("hrlpd"), "aqcoslgrmk", 0, 5, 0);
+ test(S("ehmja"), "dabckmepqj", 0, 9, 1);
+ test(S("mhqgd"), "pqscrjthli", 0, 10, 0);
+ test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, 0);
+ test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, 0);
+ test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, 0);
+ test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, S::npos);
+ test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, S::npos);
+ test(S("clrgb"), "", 1, 0, 1);
+ test(S("tjmek"), "osmia", 1, 0, 1);
+ test(S("bgstp"), "ckonl", 1, 1, 1);
+ test(S("hstrk"), "ilcaj", 1, 2, 1);
+ test(S("kmspj"), "lasiq", 1, 4, 1);
+ test(S("tjboh"), "kfqmr", 1, 5, 1);
+ test(S("ilbcj"), "klnitfaobg", 1, 0, 1);
+ test(S("jkngf"), "gjhmdlqikp", 1, 1, 1);
+ test(S("gfcql"), "skbgtahqej", 1, 5, 1);
+ test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 1);
+ test(S("bthpg"), "bjgfmnlkio", 1, 10, 1);
+ test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, 1);
+ test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, 1);
+ test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, 3);
+ test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, S::npos);
+ test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, S::npos);
+ test(S("ndrhl"), "", 2, 0, 2);
+ test(S("mrecp"), "otkgb", 2, 0, 2);
+ test(S("qlasf"), "cqsjl", 2, 1, 2);
+ test(S("smaqd"), "dpifl", 2, 2, 2);
+ test(S("hjeni"), "oapht", 2, 4, 2);
+ test(S("ocmfj"), "cifts", 2, 5, 2);
+ test(S("hmftq"), "nmsckbgalo", 2, 0, 2);
+ test(S("fklad"), "tpksqhamle", 2, 1, 2);
+ test(S("dirnm"), "tpdrchmkji", 2, 5, 3);
+ test(S("hrgdc"), "ijagfkblst", 2, 9, 3);
+ test(S("ifakg"), "kpocsignjb", 2, 10, 2);
+ test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, 2);
+ test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, 2);
+ test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 2);
+ test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, S::npos);
+ test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, S::npos);
+ test(S("cjgao"), "", 4, 0, 4);
+ test(S("kjplq"), "mabns", 4, 0, 4);
+ test(S("herni"), "bdnrp", 4, 1, 4);
+ test(S("tadrb"), "scidp", 4, 2, 4);
+ test(S("pkfeo"), "agbjl", 4, 4, 4);
+ test(S("hoser"), "jfmpr", 4, 5, S::npos);
+ test(S("kgrsp"), "rbpefghsmj", 4, 0, 4);
+ test(S("pgejb"), "apsfntdoqc", 4, 1, 4);
+ test(S("thlnq"), "ndkjeisgcl", 4, 5, 4);
+ test(S("nbmit"), "rnfpqatdeo", 4, 9, S::npos);
+ test(S("jgmib"), "bntjlqrfik", 4, 10, S::npos);
+ test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, 4);
+ test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, 4);
+ test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, S::npos);
+ test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, S::npos);
+ test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, S::npos);
+ test(S("klopi"), "", 5, 0, S::npos);
+ test(S("dajhn"), "psthd", 5, 0, S::npos);
+ test(S("jbgno"), "rpmjd", 5, 1, S::npos);
+ test(S("hkjae"), "dfsmk", 5, 2, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S("gbhqo"), "skqne", 5, 4, S::npos);
+ test(S("ktdor"), "kipnf", 5, 5, S::npos);
+ test(S("ldprn"), "hmrnqdgifl", 5, 0, S::npos);
+ test(S("egmjk"), "fsmjcdairn", 5, 1, S::npos);
+ test(S("armql"), "pcdgltbrfj", 5, 5, S::npos);
+ test(S("cdhjo"), "aekfctpirg", 5, 9, S::npos);
+ test(S("jcons"), "ledihrsgpf", 5, 10, S::npos);
+ test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, S::npos);
+ test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, S::npos);
+ test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, S::npos);
+ test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, S::npos);
+ test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, S::npos);
+ test(S("gajqn"), "", 6, 0, S::npos);
+ test(S("stedk"), "hrnat", 6, 0, S::npos);
+ test(S("tjkaf"), "gsqdt", 6, 1, S::npos);
+ test(S("dthpe"), "bspkd", 6, 2, S::npos);
+ test(S("klhde"), "ohcmb", 6, 4, S::npos);
+ test(S("bhlki"), "heatr", 6, 5, S::npos);
+ test(S("lqmoh"), "pmblckedfn", 6, 0, S::npos);
+ test(S("mtqin"), "aceqmsrbik", 6, 1, S::npos);
+ test(S("dpqbr"), "lmbtdehjrn", 6, 5, S::npos);
+ test(S("kdhmo"), "teqmcrlgib", 6, 9, S::npos);
+ test(S("jblqp"), "njolbmspac", 6, 10, S::npos);
+ test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, S::npos);
+ test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, S::npos);
+ test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, S::npos);
+ test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, S::npos);
+ test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, S::npos);
+ test(S("jnkrfhotgl"), "", 0, 0, 0);
+ test(S("dltjfngbko"), "rqegt", 0, 0, 0);
+ test(S("bmjlpkiqde"), "dashm", 0, 1, 0);
+ test(S("skrflobnqm"), "jqirk", 0, 2, 0);
+ test(S("jkpldtshrm"), "rckeg", 0, 4, 0);
+ test(S("ghasdbnjqo"), "jscie", 0, 5, 0);
+ test(S("igrkhpbqjt"), "efsphndliq", 0, 0, 0);
+ test(S("ikthdgcamf"), "gdicosleja", 0, 1, 0);
+ test(S("pcofgeniam"), "qcpjibosfl", 0, 5, 2);
+ test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, 4);
+ test(S("itphbqsker"), "dtablcrseo", 0, 10, 0);
+ test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, 0);
+ test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, 0);
+ test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, 0);
+ test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, 1);
+ test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, S::npos);
+ test(S("shbcqnmoar"), "", 1, 0, 1);
+ test(S("bdoshlmfin"), "ontrs", 1, 0, 1);
+ test(S("khfrebnsgq"), "pfkna", 1, 1, 1);
+ test(S("getcrsaoji"), "ekosa", 1, 2, 2);
+ test(S("fjiknedcpq"), "anqhk", 1, 4, 1);
+ test(S("tkejgnafrm"), "jekca", 1, 5, 4);
+ test(S("jnakolqrde"), "ikemsjgacf", 1, 0, 1);
+ test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, 1);
+ test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 3);
+ test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 1);
+ test(S("cigfqkated"), "sqcflrgtim", 1, 10, 5);
+ test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, 1);
+ test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, 1);
+ test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, 5);
+ test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, 5);
+ test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, S::npos);
+ test(S("ectnhskflp"), "", 5, 0, 5);
+ test(S("fgtianblpq"), "pijag", 5, 0, 5);
+ test(S("mfeqklirnh"), "jrckd", 5, 1, 5);
+ test(S("astedncjhk"), "qcloh", 5, 2, 5);
+ test(S("fhlqgcajbr"), "thlmp", 5, 4, 5);
+ test(S("epfhocmdng"), "qidmo", 5, 5, 5);
+ test(S("apcnsibger"), "lnegpsjqrd", 5, 0, 5);
+ test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 6);
+ test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, 5);
+ test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 6);
+ test(S("jbhcfposld"), "trfqgmckbe", 5, 10, 5);
+ test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, 5);
+ test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, 5);
+ test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 6);
+ test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, 8);
+ test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, S::npos);
+ test(S("shoiedtcjb"), "", 9, 0, 9);
+ test(S("ebcinjgads"), "tqbnh", 9, 0, 9);
+ test(S("dqmregkcfl"), "akmle", 9, 1, 9);
+ test(S("ngcrieqajf"), "iqfkm", 9, 2, 9);
+ test(S("qosmilgnjb"), "tqjsr", 9, 4, 9);
+ test(S("ikabsjtdfl"), "jplqg", 9, 5, S::npos);
+ test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, 9);
+ test(S("fdnplotmgh"), "morkglpesn", 9, 1, 9);
+ test(S("fdbicojerm"), "dmicerngat", 9, 5, S::npos);
+ test(S("mbtafndjcq"), "radgeskbtc", 9, 9, 9);
+ test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, 9);
+ test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, 9);
+ test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, 9);
+ test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, 9);
+ test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, S::npos);
+ test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, S::npos);
+ test(S("ncjpmaekbs"), "", 10, 0, S::npos);
+ test(S("hlbosgmrak"), "hpmsd", 10, 0, S::npos);
+ test(S("pqfhsgilen"), "qnpor", 10, 1, S::npos);
+ test(S("gqtjsbdckh"), "otdma", 10, 2, S::npos);
+ test(S("cfkqpjlegi"), "efhjg", 10, 4, S::npos);
+ test(S("beanrfodgj"), "odpte", 10, 5, S::npos);
+ test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, S::npos);
+ test(S("iomkfthagj"), "oaklidrbqg", 10, 1, S::npos);
+}
+
+template <class S>
+void test2()
+{
+ test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, S::npos);
+ test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, S::npos);
+ test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, S::npos);
+ test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, S::npos);
+ test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, S::npos);
+ test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, S::npos);
+ test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, S::npos);
+ test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, S::npos);
+ test(S("cqjohampgd"), "", 11, 0, S::npos);
+ test(S("hobitmpsan"), "aocjb", 11, 0, S::npos);
+ test(S("tjehkpsalm"), "jbrnk", 11, 1, S::npos);
+ test(S("ngfbojitcl"), "tqedg", 11, 2, S::npos);
+ test(S("rcfkdbhgjo"), "nqskp", 11, 4, S::npos);
+ test(S("qghptonrea"), "eaqkl", 11, 5, S::npos);
+ test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, S::npos);
+ test(S("hlmgabenti"), "lsftgajqpm", 11, 1, S::npos);
+ test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, S::npos);
+ test(S("jqedtkornm"), "shkncmiaqj", 11, 9, S::npos);
+ test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, S::npos);
+ test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, S::npos);
+ test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, S::npos);
+ test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, S::npos);
+ test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, S::npos);
+ test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, S::npos);
+ test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, 0);
+ test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, 0);
+ test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, 0);
+ test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, 0);
+ test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, 0);
+ test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, 0);
+ test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, 0);
+ test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, 0);
+ test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, 0);
+ test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, 0);
+ test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, 0);
+ test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, 0);
+ test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, 0);
+ test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, 0);
+ test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, 11);
+ test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, S::npos);
+ test(S("febhmqtjanokscdirpgl"), "", 1, 0, 1);
+ test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, 1);
+ test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, 1);
+ test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 2);
+ test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 2);
+ test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, 1);
+ test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, 1);
+ test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, 1);
+ test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, 1);
+ test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 3);
+ test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 2);
+ test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, 1);
+ test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, 1);
+ test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 2);
+ test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, 13);
+ test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, S::npos);
+ test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, 10);
+ test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, 10);
+ test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, 10);
+ test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, 10);
+ test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 11);
+ test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 10);
+ test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, 10);
+ test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, 10);
+ test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 10);
+ test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 11);
+ test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 10);
+ test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, 10);
+ test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, 10);
+ test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 11);
+ test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, 11);
+ test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, S::npos);
+ test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, 19);
+ test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, 19);
+ test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, 19);
+ test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, 19);
+ test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, 19);
+ test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, S::npos);
+ test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, 19);
+ test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, 19);
+ test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, 19);
+ test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, 19);
+ test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, 19);
+ test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, 19);
+ test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, 19);
+ test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, S::npos);
+ test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, S::npos);
+ test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, S::npos);
+ test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, S::npos);
+ test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, S::npos);
+ test(S("grkpahljcftesdmonqib"), "odife", 20, 1, S::npos);
+ test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, S::npos);
+ test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, S::npos);
+ test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, S::npos);
+ test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, S::npos);
+ test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, S::npos);
+ test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, S::npos);
+ test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, S::npos);
+ test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, S::npos);
+ test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, S::npos);
+}
+
+template <class S>
+void test3()
+{
+ test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, S::npos);
+ test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, S::npos);
+ test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, S::npos);
+ test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, S::npos);
+ test(S("ecgdanriptblhjfqskom"), "", 21, 0, S::npos);
+ test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, S::npos);
+ test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, S::npos);
+ test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, S::npos);
+ test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, S::npos);
+ test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, S::npos);
+ test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, S::npos);
+ test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, S::npos);
+ test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, S::npos);
+ test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, S::npos);
+ test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, S::npos);
+ test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, S::npos);
+ test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, S::npos);
+ test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, S::npos);
+ test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, S::npos);
+ test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, S::npos);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ test2<S>();
+ test3<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_first_not_of( "", 0, 0) == SV::npos, "" );
+ static_assert (sv1.find_first_not_of( "irkhs", 0, 5) == SV::npos, "" );
+ static_assert (sv2.find_first_not_of( "", 0, 0) == 0, "" );
+ static_assert (sv2.find_first_not_of( "gfsrt", 0, 5) == 0, "" );
+ static_assert (sv2.find_first_not_of( "lecar", 0, 5) == 1, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp
new file mode 100644
index 000000000000..a52c577660de
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp
@@ -0,0 +1,148 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// size_type find_first_not_of(const basic_string& str, size_type pos = 0) const;
+
+#include <string_view>
+#include <cassert>
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
+{
+ assert(s.find_first_not_of(str, pos) == x);
+ if (x != S::npos)
+ assert(pos <= x && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type x)
+{
+ assert(s.find_first_not_of(str) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), S(""), 0, S::npos);
+ test(S(""), S("laenf"), 0, S::npos);
+ test(S(""), S("pqlnkmbdjo"), 0, S::npos);
+ test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos);
+ test(S(""), S(""), 1, S::npos);
+ test(S(""), S("bjaht"), 1, S::npos);
+ test(S(""), S("hjlcmgpket"), 1, S::npos);
+ test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos);
+ test(S("fodgq"), S(""), 0, 0);
+ test(S("qanej"), S("dfkap"), 0, 0);
+ test(S("clbao"), S("ihqrfebgad"), 0, 0);
+ test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, S::npos);
+ test(S("srdfq"), S(""), 1, 1);
+ test(S("oemth"), S("ikcrq"), 1, 1);
+ test(S("cdaih"), S("dmajblfhsg"), 1, 3);
+ test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, S::npos);
+ test(S("cshmd"), S(""), 2, 2);
+ test(S("lhcdo"), S("oebqi"), 2, 2);
+ test(S("qnsoh"), S("kojhpmbsfe"), 2, S::npos);
+ test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, S::npos);
+ test(S("fmtsp"), S(""), 4, 4);
+ test(S("khbpm"), S("aobjd"), 4, 4);
+ test(S("pbsji"), S("pcbahntsje"), 4, 4);
+ test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, S::npos);
+ test(S("eqmpa"), S(""), 5, S::npos);
+ test(S("omigs"), S("kocgb"), 5, S::npos);
+ test(S("onmje"), S("fbslrjiqkm"), 5, S::npos);
+ test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, S::npos);
+ test(S("schfa"), S(""), 6, S::npos);
+ test(S("igdsc"), S("qngpd"), 6, S::npos);
+ test(S("brqgo"), S("rodhqklgmb"), 6, S::npos);
+ test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, S::npos);
+ test(S("hcjitbfapl"), S(""), 0, 0);
+ test(S("daiprenocl"), S("ashjd"), 0, 2);
+ test(S("litpcfdghe"), S("mgojkldsqh"), 0, 1);
+ test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, S::npos);
+ test(S("qpghtfbaji"), S(""), 1, 1);
+ test(S("gfshlcmdjr"), S("nadkh"), 1, 1);
+ test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 4);
+ test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, S::npos);
+ test(S("crnklpmegd"), S(""), 5, 5);
+ test(S("jsbtafedoc"), S("prqgn"), 5, 5);
+ test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 6);
+ test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, S::npos);
+ test(S("lmofqdhpki"), S(""), 9, 9);
+ test(S("hnefkqimca"), S("rtjpa"), 9, S::npos);
+ test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, 9);
+ test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, S::npos);
+ test(S("elgofjmbrq"), S(""), 10, S::npos);
+ test(S("mjqdgalkpc"), S("dplqa"), 10, S::npos);
+ test(S("kthqnfcerm"), S("dkacjoptns"), 10, S::npos);
+ test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, S::npos);
+ test(S("eqsgalomhb"), S(""), 11, S::npos);
+ test(S("akiteljmoh"), S("lofbc"), 11, S::npos);
+ test(S("hlbdfreqjo"), S("astoegbfpn"), 11, S::npos);
+ test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, S::npos);
+ test(S("snafbdlghrjkpqtoceim"), S(""), 0, 0);
+ test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, 0);
+ test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, 1);
+ test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, S::npos);
+ test(S("jlnkraeodhcspfgbqitm"), S(""), 1, 1);
+ test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, 1);
+ test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 3);
+ test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, S::npos);
+ test(S("hdpkobnsalmcfijregtq"), S(""), 10, 10);
+ test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 11);
+ test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 13);
+ test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, S::npos);
+ test(S("niptglfbosehkamrdqcj"), S(""), 19, 19);
+ test(S("copqdhstbingamjfkler"), S("djkqc"), 19, 19);
+ test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, S::npos);
+ test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, S::npos);
+ test(S("eaintpchlqsbdgrkjofm"), S(""), 20, S::npos);
+ test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, S::npos);
+ test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, S::npos);
+ test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, S::npos);
+ test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, S::npos);
+ test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, S::npos);
+ test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, S::npos);
+ test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), S(""), S::npos);
+ test(S(""), S("laenf"), S::npos);
+ test(S(""), S("pqlnkmbdjo"), S::npos);
+ test(S(""), S("qkamfogpnljdcshbreti"), S::npos);
+ test(S("nhmko"), S(""), 0);
+ test(S("lahfb"), S("irkhs"), 0);
+ test(S("gmfhd"), S("kantesmpgj"), 2);
+ test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), S::npos);
+ test(S("eolhfgpjqk"), S(""), 0);
+ test(S("nbatdlmekr"), S("bnrpe"), 2);
+ test(S("jdmciepkaq"), S("jtdaefblso"), 2);
+ test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), S::npos);
+ test(S("gprdcokbnjhlsfmtieqa"), S(""), 0);
+ test(S("qjghlnftcaismkropdeb"), S("bjaht"), 0);
+ test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 1);
+ test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), S::npos);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+}
diff --git a/test/std/strings/string.view/string.view.find/find_first_of_char_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_first_of_char_size.pass.cpp
new file mode 100644
index 000000000000..21722ecc75d7
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_first_of_char_size.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// constexpr size_type find_first_of(charT c, size_type pos = 0) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.find_first_of(c, pos) == x);
+ if (x != S::npos)
+ assert(pos <= x && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type x)
+{
+ assert(s.find_first_of(c) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), 'e', 0, S::npos);
+ test(S(""), 'e', 1, S::npos);
+ test(S("kitcj"), 'e', 0, S::npos);
+ test(S("qkamf"), 'e', 1, S::npos);
+ test(S("nhmko"), 'e', 2, S::npos);
+ test(S("tpsaf"), 'e', 4, S::npos);
+ test(S("lahfb"), 'e', 5, S::npos);
+ test(S("irkhs"), 'e', 6, S::npos);
+ test(S("gmfhdaipsr"), 'e', 0, S::npos);
+ test(S("kantesmpgj"), 'e', 1, 4);
+ test(S("odaftiegpm"), 'e', 5, 6);
+ test(S("oknlrstdpi"), 'e', 9, S::npos);
+ test(S("eolhfgpjqk"), 'e', 10, S::npos);
+ test(S("pcdrofikas"), 'e', 11, S::npos);
+ test(S("nbatdlmekrgcfqsophij"), 'e', 0, 7);
+ test(S("bnrpehidofmqtcksjgla"), 'e', 1, 4);
+ test(S("jdmciepkaqgotsrfnhlb"), 'e', 10, S::npos);
+ test(S("jtdaefblsokrmhpgcnqi"), 'e', 19, S::npos);
+ test(S("hkbgspofltajcnedqmri"), 'e', 20, S::npos);
+ test(S("oselktgbcapndfjihrmq"), 'e', 21, S::npos);
+
+ test(S(""), 'e', S::npos);
+ test(S("csope"), 'e', 4);
+ test(S("gfsmthlkon"), 'e', S::npos);
+ test(S("laenfsbridchgotmkqpj"), 'e', 2);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_first_of( 'e', 0 ) == SV::npos, "" );
+ static_assert (sv1.find_first_of( 'e', 1 ) == SV::npos, "" );
+ static_assert (sv2.find_first_of( 'q', 0 ) == SV::npos, "" );
+ static_assert (sv2.find_first_of( 'e', 1 ) == 4, "" );
+ static_assert (sv2.find_first_of( 'e', 5 ) == SV::npos, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_first_of_pointer_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
new file mode 100644
index 000000000000..55e71c4f5832
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
@@ -0,0 +1,166 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// constexpr size_type find_first_of(const charT* s, size_type pos = 0) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.find_first_of(str, pos) == x);
+ if (x != S::npos)
+ assert(pos <= x && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type x)
+{
+ assert(s.find_first_of(str) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, S::npos);
+ test(S(""), "laenf", 0, S::npos);
+ test(S(""), "pqlnkmbdjo", 0, S::npos);
+ test(S(""), "qkamfogpnljdcshbreti", 0, S::npos);
+ test(S(""), "", 1, S::npos);
+ test(S(""), "bjaht", 1, S::npos);
+ test(S(""), "hjlcmgpket", 1, S::npos);
+ test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos);
+ test(S("fodgq"), "", 0, S::npos);
+ test(S("qanej"), "dfkap", 0, 1);
+ test(S("clbao"), "ihqrfebgad", 0, 2);
+ test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, 0);
+ test(S("srdfq"), "", 1, S::npos);
+ test(S("oemth"), "ikcrq", 1, S::npos);
+ test(S("cdaih"), "dmajblfhsg", 1, 1);
+ test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, 1);
+ test(S("cshmd"), "", 2, S::npos);
+ test(S("lhcdo"), "oebqi", 2, 4);
+ test(S("qnsoh"), "kojhpmbsfe", 2, 2);
+ test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, 2);
+ test(S("fmtsp"), "", 4, S::npos);
+ test(S("khbpm"), "aobjd", 4, S::npos);
+ test(S("pbsji"), "pcbahntsje", 4, S::npos);
+ test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, 4);
+ test(S("eqmpa"), "", 5, S::npos);
+ test(S("omigs"), "kocgb", 5, S::npos);
+ test(S("onmje"), "fbslrjiqkm", 5, S::npos);
+ test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, S::npos);
+ test(S("schfa"), "", 6, S::npos);
+ test(S("igdsc"), "qngpd", 6, S::npos);
+ test(S("brqgo"), "rodhqklgmb", 6, S::npos);
+ test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, S::npos);
+ test(S("hcjitbfapl"), "", 0, S::npos);
+ test(S("daiprenocl"), "ashjd", 0, 0);
+ test(S("litpcfdghe"), "mgojkldsqh", 0, 0);
+ test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, 0);
+ test(S("qpghtfbaji"), "", 1, S::npos);
+ test(S("gfshlcmdjr"), "nadkh", 1, 3);
+ test(S("nkodajteqp"), "ofdrqmkebl", 1, 1);
+ test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, 1);
+ test(S("crnklpmegd"), "", 5, S::npos);
+ test(S("jsbtafedoc"), "prqgn", 5, S::npos);
+ test(S("qnmodrtkeb"), "pejafmnokr", 5, 5);
+ test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, 5);
+ test(S("lmofqdhpki"), "", 9, S::npos);
+ test(S("hnefkqimca"), "rtjpa", 9, 9);
+ test(S("drtasbgmfp"), "ktsrmnqagd", 9, S::npos);
+ test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, 9);
+ test(S("elgofjmbrq"), "", 10, S::npos);
+ test(S("mjqdgalkpc"), "dplqa", 10, S::npos);
+ test(S("kthqnfcerm"), "dkacjoptns", 10, S::npos);
+ test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, S::npos);
+ test(S("eqsgalomhb"), "", 11, S::npos);
+ test(S("akiteljmoh"), "lofbc", 11, S::npos);
+ test(S("hlbdfreqjo"), "astoegbfpn", 11, S::npos);
+ test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, S::npos);
+ test(S("snafbdlghrjkpqtoceim"), "", 0, S::npos);
+ test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, 3);
+ test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, 0);
+ test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, 0);
+ test(S("jlnkraeodhcspfgbqitm"), "", 1, S::npos);
+ test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, 3);
+ test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 1);
+ test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, 1);
+ test(S("hdpkobnsalmcfijregtq"), "", 10, S::npos);
+ test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 10);
+ test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 10);
+ test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, 10);
+ test(S("niptglfbosehkamrdqcj"), "", 19, S::npos);
+ test(S("copqdhstbingamjfkler"), "djkqc", 19, S::npos);
+ test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, 19);
+ test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, 19);
+ test(S("eaintpchlqsbdgrkjofm"), "", 20, S::npos);
+ test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, S::npos);
+ test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, S::npos);
+ test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, S::npos);
+ test(S("liatsqdoegkmfcnbhrpj"), "", 21, S::npos);
+ test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, S::npos);
+ test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, S::npos);
+ test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), "", S::npos);
+ test(S(""), "laenf", S::npos);
+ test(S(""), "pqlnkmbdjo", S::npos);
+ test(S(""), "qkamfogpnljdcshbreti", S::npos);
+ test(S("nhmko"), "", S::npos);
+ test(S("lahfb"), "irkhs", 2);
+ test(S("gmfhd"), "kantesmpgj", 0);
+ test(S("odaft"), "oknlrstdpiqmjbaghcfe", 0);
+ test(S("eolhfgpjqk"), "", S::npos);
+ test(S("nbatdlmekr"), "bnrpe", 0);
+ test(S("jdmciepkaq"), "jtdaefblso", 0);
+ test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", 0);
+ test(S("gprdcokbnjhlsfmtieqa"), "", S::npos);
+ test(S("qjghlnftcaismkropdeb"), "bjaht", 1);
+ test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 0);
+ test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", 0);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_first_of( "", 0) == SV::npos, "" );
+ static_assert (sv1.find_first_of( "irkhs", 0) == SV::npos, "" );
+ static_assert (sv2.find_first_of( "", 0) == SV::npos, "" );
+ static_assert (sv2.find_first_of( "gfsrt", 0) == SV::npos, "" );
+ static_assert (sv2.find_first_of( "lecar", 0) == 0, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
new file mode 100644
index 000000000000..fa9917c6e33a
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
@@ -0,0 +1,393 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type n, typename S::size_type x)
+{
+ assert(s.find_first_of(str, pos, n) == x);
+ if (x != S::npos)
+ assert(pos <= x && x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, 0, S::npos);
+ test(S(""), "irkhs", 0, 0, S::npos);
+ test(S(""), "kante", 0, 1, S::npos);
+ test(S(""), "oknlr", 0, 2, S::npos);
+ test(S(""), "pcdro", 0, 4, S::npos);
+ test(S(""), "bnrpe", 0, 5, S::npos);
+ test(S(""), "jtdaefblso", 0, 0, S::npos);
+ test(S(""), "oselktgbca", 0, 1, S::npos);
+ test(S(""), "eqgaplhckj", 0, 5, S::npos);
+ test(S(""), "bjahtcmnlp", 0, 9, S::npos);
+ test(S(""), "hjlcmgpket", 0, 10, S::npos);
+ test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos);
+ test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos);
+ test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos);
+ test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos);
+ test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos);
+ test(S(""), "", 1, 0, S::npos);
+ test(S(""), "lbtqd", 1, 0, S::npos);
+ test(S(""), "tboim", 1, 1, S::npos);
+ test(S(""), "slcer", 1, 2, S::npos);
+ test(S(""), "cbjfs", 1, 4, S::npos);
+ test(S(""), "aqibs", 1, 5, S::npos);
+ test(S(""), "gtfblmqinc", 1, 0, S::npos);
+ test(S(""), "mkqpbtdalg", 1, 1, S::npos);
+ test(S(""), "kphatlimcd", 1, 5, S::npos);
+ test(S(""), "pblasqogic", 1, 9, S::npos);
+ test(S(""), "arosdhcfme", 1, 10, S::npos);
+ test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos);
+ test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos);
+ test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos);
+ test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos);
+ test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos);
+ test(S("eaint"), "", 0, 0, S::npos);
+ test(S("binja"), "gfsrt", 0, 0, S::npos);
+ test(S("latkm"), "pfsoc", 0, 1, S::npos);
+ test(S("lecfr"), "tpflm", 0, 2, S::npos);
+ test(S("eqkst"), "sgkec", 0, 4, 0);
+ test(S("cdafr"), "romds", 0, 5, 1);
+ test(S("prbhe"), "qhjistlgmr", 0, 0, S::npos);
+ test(S("lbisk"), "pedfirsglo", 0, 1, S::npos);
+ test(S("hrlpd"), "aqcoslgrmk", 0, 5, S::npos);
+ test(S("ehmja"), "dabckmepqj", 0, 9, 0);
+ test(S("mhqgd"), "pqscrjthli", 0, 10, 1);
+ test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, S::npos);
+ test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, S::npos);
+ test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, S::npos);
+ test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, 0);
+ test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, 0);
+ test(S("clrgb"), "", 1, 0, S::npos);
+ test(S("tjmek"), "osmia", 1, 0, S::npos);
+ test(S("bgstp"), "ckonl", 1, 1, S::npos);
+ test(S("hstrk"), "ilcaj", 1, 2, S::npos);
+ test(S("kmspj"), "lasiq", 1, 4, 2);
+ test(S("tjboh"), "kfqmr", 1, 5, S::npos);
+ test(S("ilbcj"), "klnitfaobg", 1, 0, S::npos);
+ test(S("jkngf"), "gjhmdlqikp", 1, 1, 3);
+ test(S("gfcql"), "skbgtahqej", 1, 5, S::npos);
+ test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 2);
+ test(S("bthpg"), "bjgfmnlkio", 1, 10, 4);
+ test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, S::npos);
+ test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, S::npos);
+ test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, 1);
+ test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, 1);
+ test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, 1);
+ test(S("ndrhl"), "", 2, 0, S::npos);
+ test(S("mrecp"), "otkgb", 2, 0, S::npos);
+ test(S("qlasf"), "cqsjl", 2, 1, S::npos);
+ test(S("smaqd"), "dpifl", 2, 2, 4);
+ test(S("hjeni"), "oapht", 2, 4, S::npos);
+ test(S("ocmfj"), "cifts", 2, 5, 3);
+ test(S("hmftq"), "nmsckbgalo", 2, 0, S::npos);
+ test(S("fklad"), "tpksqhamle", 2, 1, S::npos);
+ test(S("dirnm"), "tpdrchmkji", 2, 5, 2);
+ test(S("hrgdc"), "ijagfkblst", 2, 9, 2);
+ test(S("ifakg"), "kpocsignjb", 2, 10, 3);
+ test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, S::npos);
+ test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, S::npos);
+ test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 3);
+ test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, 2);
+ test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, 2);
+ test(S("cjgao"), "", 4, 0, S::npos);
+ test(S("kjplq"), "mabns", 4, 0, S::npos);
+ test(S("herni"), "bdnrp", 4, 1, S::npos);
+ test(S("tadrb"), "scidp", 4, 2, S::npos);
+ test(S("pkfeo"), "agbjl", 4, 4, S::npos);
+ test(S("hoser"), "jfmpr", 4, 5, 4);
+ test(S("kgrsp"), "rbpefghsmj", 4, 0, S::npos);
+ test(S("pgejb"), "apsfntdoqc", 4, 1, S::npos);
+ test(S("thlnq"), "ndkjeisgcl", 4, 5, S::npos);
+ test(S("nbmit"), "rnfpqatdeo", 4, 9, 4);
+ test(S("jgmib"), "bntjlqrfik", 4, 10, 4);
+ test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, S::npos);
+ test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, S::npos);
+ test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, 4);
+ test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, 4);
+ test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, 4);
+ test(S("klopi"), "", 5, 0, S::npos);
+ test(S("dajhn"), "psthd", 5, 0, S::npos);
+ test(S("jbgno"), "rpmjd", 5, 1, S::npos);
+ test(S("hkjae"), "dfsmk", 5, 2, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S("gbhqo"), "skqne", 5, 4, S::npos);
+ test(S("ktdor"), "kipnf", 5, 5, S::npos);
+ test(S("ldprn"), "hmrnqdgifl", 5, 0, S::npos);
+ test(S("egmjk"), "fsmjcdairn", 5, 1, S::npos);
+ test(S("armql"), "pcdgltbrfj", 5, 5, S::npos);
+ test(S("cdhjo"), "aekfctpirg", 5, 9, S::npos);
+ test(S("jcons"), "ledihrsgpf", 5, 10, S::npos);
+ test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, S::npos);
+ test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, S::npos);
+ test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, S::npos);
+ test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, S::npos);
+ test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, S::npos);
+ test(S("gajqn"), "", 6, 0, S::npos);
+ test(S("stedk"), "hrnat", 6, 0, S::npos);
+ test(S("tjkaf"), "gsqdt", 6, 1, S::npos);
+ test(S("dthpe"), "bspkd", 6, 2, S::npos);
+ test(S("klhde"), "ohcmb", 6, 4, S::npos);
+ test(S("bhlki"), "heatr", 6, 5, S::npos);
+ test(S("lqmoh"), "pmblckedfn", 6, 0, S::npos);
+ test(S("mtqin"), "aceqmsrbik", 6, 1, S::npos);
+ test(S("dpqbr"), "lmbtdehjrn", 6, 5, S::npos);
+ test(S("kdhmo"), "teqmcrlgib", 6, 9, S::npos);
+ test(S("jblqp"), "njolbmspac", 6, 10, S::npos);
+ test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, S::npos);
+ test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, S::npos);
+ test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, S::npos);
+ test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, S::npos);
+ test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, S::npos);
+ test(S("jnkrfhotgl"), "", 0, 0, S::npos);
+ test(S("dltjfngbko"), "rqegt", 0, 0, S::npos);
+ test(S("bmjlpkiqde"), "dashm", 0, 1, 8);
+ test(S("skrflobnqm"), "jqirk", 0, 2, 8);
+ test(S("jkpldtshrm"), "rckeg", 0, 4, 1);
+ test(S("ghasdbnjqo"), "jscie", 0, 5, 3);
+ test(S("igrkhpbqjt"), "efsphndliq", 0, 0, S::npos);
+ test(S("ikthdgcamf"), "gdicosleja", 0, 1, 5);
+ test(S("pcofgeniam"), "qcpjibosfl", 0, 5, 0);
+ test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, 0);
+ test(S("itphbqsker"), "dtablcrseo", 0, 10, 1);
+ test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, S::npos);
+ test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, S::npos);
+ test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, 4);
+ test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, 0);
+ test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, 0);
+ test(S("shbcqnmoar"), "", 1, 0, S::npos);
+ test(S("bdoshlmfin"), "ontrs", 1, 0, S::npos);
+ test(S("khfrebnsgq"), "pfkna", 1, 1, S::npos);
+ test(S("getcrsaoji"), "ekosa", 1, 2, 1);
+ test(S("fjiknedcpq"), "anqhk", 1, 4, 4);
+ test(S("tkejgnafrm"), "jekca", 1, 5, 1);
+ test(S("jnakolqrde"), "ikemsjgacf", 1, 0, S::npos);
+ test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, S::npos);
+ test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 1);
+ test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 4);
+ test(S("cigfqkated"), "sqcflrgtim", 1, 10, 1);
+ test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, S::npos);
+ test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, S::npos);
+ test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, 1);
+ test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, 1);
+ test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, 1);
+ test(S("ectnhskflp"), "", 5, 0, S::npos);
+ test(S("fgtianblpq"), "pijag", 5, 0, S::npos);
+ test(S("mfeqklirnh"), "jrckd", 5, 1, S::npos);
+ test(S("astedncjhk"), "qcloh", 5, 2, 6);
+ test(S("fhlqgcajbr"), "thlmp", 5, 4, S::npos);
+ test(S("epfhocmdng"), "qidmo", 5, 5, 6);
+ test(S("apcnsibger"), "lnegpsjqrd", 5, 0, S::npos);
+ test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 5);
+ test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, 7);
+ test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 5);
+ test(S("jbhcfposld"), "trfqgmckbe", 5, 10, S::npos);
+ test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, S::npos);
+ test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, S::npos);
+ test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 5);
+ test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, 5);
+ test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, 5);
+ test(S("shoiedtcjb"), "", 9, 0, S::npos);
+ test(S("ebcinjgads"), "tqbnh", 9, 0, S::npos);
+ test(S("dqmregkcfl"), "akmle", 9, 1, S::npos);
+ test(S("ngcrieqajf"), "iqfkm", 9, 2, S::npos);
+ test(S("qosmilgnjb"), "tqjsr", 9, 4, S::npos);
+ test(S("ikabsjtdfl"), "jplqg", 9, 5, 9);
+ test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, S::npos);
+ test(S("fdnplotmgh"), "morkglpesn", 9, 1, S::npos);
+ test(S("fdbicojerm"), "dmicerngat", 9, 5, 9);
+ test(S("mbtafndjcq"), "radgeskbtc", 9, 9, S::npos);
+ test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, S::npos);
+ test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, S::npos);
+ test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, S::npos);
+ test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, S::npos);
+ test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, 9);
+ test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, 9);
+ test(S("ncjpmaekbs"), "", 10, 0, S::npos);
+ test(S("hlbosgmrak"), "hpmsd", 10, 0, S::npos);
+ test(S("pqfhsgilen"), "qnpor", 10, 1, S::npos);
+ test(S("gqtjsbdckh"), "otdma", 10, 2, S::npos);
+ test(S("cfkqpjlegi"), "efhjg", 10, 4, S::npos);
+ test(S("beanrfodgj"), "odpte", 10, 5, S::npos);
+ test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, S::npos);
+ test(S("iomkfthagj"), "oaklidrbqg", 10, 1, S::npos);
+}
+
+template <class S>
+void test2()
+{
+ test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, S::npos);
+ test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, S::npos);
+ test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, S::npos);
+ test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, S::npos);
+ test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, S::npos);
+ test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, S::npos);
+ test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, S::npos);
+ test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, S::npos);
+ test(S("cqjohampgd"), "", 11, 0, S::npos);
+ test(S("hobitmpsan"), "aocjb", 11, 0, S::npos);
+ test(S("tjehkpsalm"), "jbrnk", 11, 1, S::npos);
+ test(S("ngfbojitcl"), "tqedg", 11, 2, S::npos);
+ test(S("rcfkdbhgjo"), "nqskp", 11, 4, S::npos);
+ test(S("qghptonrea"), "eaqkl", 11, 5, S::npos);
+ test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, S::npos);
+ test(S("hlmgabenti"), "lsftgajqpm", 11, 1, S::npos);
+ test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, S::npos);
+ test(S("jqedtkornm"), "shkncmiaqj", 11, 9, S::npos);
+ test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, S::npos);
+ test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, S::npos);
+ test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, S::npos);
+ test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, S::npos);
+ test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, S::npos);
+ test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, S::npos);
+ test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, S::npos);
+ test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, S::npos);
+ test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, 4);
+ test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, 3);
+ test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, 3);
+ test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, 3);
+ test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, S::npos);
+ test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, 19);
+ test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, 2);
+ test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, 2);
+ test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, 2);
+ test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, S::npos);
+ test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, 16);
+ test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, 1);
+ test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, 0);
+ test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, 0);
+ test(S("febhmqtjanokscdirpgl"), "", 1, 0, S::npos);
+ test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, S::npos);
+ test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, 6);
+ test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 1);
+ test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 1);
+ test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, 6);
+ test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, S::npos);
+ test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, 19);
+ test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, 4);
+ test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 1);
+ test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 1);
+ test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, S::npos);
+ test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, 7);
+ test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 1);
+ test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, 1);
+ test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, 1);
+ test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, S::npos);
+ test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, S::npos);
+ test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, 12);
+ test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, S::npos);
+ test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 10);
+ test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 15);
+ test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, S::npos);
+ test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, S::npos);
+ test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 11);
+ test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 10);
+ test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 11);
+ test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, S::npos);
+ test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, 18);
+ test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 10);
+ test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, 10);
+ test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, 10);
+ test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, S::npos);
+ test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, S::npos);
+ test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, S::npos);
+ test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, S::npos);
+ test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, S::npos);
+ test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, 19);
+ test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, S::npos);
+ test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, S::npos);
+ test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, S::npos);
+ test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, S::npos);
+ test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, S::npos);
+ test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, S::npos);
+ test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, S::npos);
+ test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, 19);
+ test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, 19);
+ test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, 19);
+ test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, S::npos);
+ test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, S::npos);
+ test(S("grkpahljcftesdmonqib"), "odife", 20, 1, S::npos);
+ test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, S::npos);
+ test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, S::npos);
+ test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, S::npos);
+ test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, S::npos);
+ test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, S::npos);
+ test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, S::npos);
+ test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, S::npos);
+ test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, S::npos);
+ test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, S::npos);
+}
+
+template <class S>
+void test3()
+{
+ test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, S::npos);
+ test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, S::npos);
+ test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, S::npos);
+ test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, S::npos);
+ test(S("ecgdanriptblhjfqskom"), "", 21, 0, S::npos);
+ test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, S::npos);
+ test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, S::npos);
+ test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, S::npos);
+ test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, S::npos);
+ test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, S::npos);
+ test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, S::npos);
+ test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, S::npos);
+ test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, S::npos);
+ test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, S::npos);
+ test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, S::npos);
+ test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, S::npos);
+ test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, S::npos);
+ test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, S::npos);
+ test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, S::npos);
+ test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, S::npos);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ test2<S>();
+ test3<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_first_of( "", 0, 0) == SV::npos, "" );
+ static_assert (sv1.find_first_of( "irkhs", 0, 5) == SV::npos, "" );
+ static_assert (sv2.find_first_of( "", 0, 0) == SV::npos, "" );
+ static_assert (sv2.find_first_of( "gfsrt", 0, 5) == SV::npos, "" );
+ static_assert (sv2.find_first_of( "lecar", 0, 5) == 0, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_first_of_string_view_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_first_of_string_view_size.pass.cpp
new file mode 100644
index 000000000000..b8bbd86a4592
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_first_of_string_view_size.pass.cpp
@@ -0,0 +1,148 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// size_type find_first_of(const basic_string_view& str, size_type pos = 0) const;
+
+#include <string_view>
+#include <cassert>
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
+{
+ assert(s.find_first_of(str, pos) == x);
+ if (x != S::npos)
+ assert(pos <= x && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type x)
+{
+ assert(s.find_first_of(str) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), S(""), 0, S::npos);
+ test(S(""), S("laenf"), 0, S::npos);
+ test(S(""), S("pqlnkmbdjo"), 0, S::npos);
+ test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos);
+ test(S(""), S(""), 1, S::npos);
+ test(S(""), S("bjaht"), 1, S::npos);
+ test(S(""), S("hjlcmgpket"), 1, S::npos);
+ test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos);
+ test(S("fodgq"), S(""), 0, S::npos);
+ test(S("qanej"), S("dfkap"), 0, 1);
+ test(S("clbao"), S("ihqrfebgad"), 0, 2);
+ test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, 0);
+ test(S("srdfq"), S(""), 1, S::npos);
+ test(S("oemth"), S("ikcrq"), 1, S::npos);
+ test(S("cdaih"), S("dmajblfhsg"), 1, 1);
+ test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, 1);
+ test(S("cshmd"), S(""), 2, S::npos);
+ test(S("lhcdo"), S("oebqi"), 2, 4);
+ test(S("qnsoh"), S("kojhpmbsfe"), 2, 2);
+ test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, 2);
+ test(S("fmtsp"), S(""), 4, S::npos);
+ test(S("khbpm"), S("aobjd"), 4, S::npos);
+ test(S("pbsji"), S("pcbahntsje"), 4, S::npos);
+ test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, 4);
+ test(S("eqmpa"), S(""), 5, S::npos);
+ test(S("omigs"), S("kocgb"), 5, S::npos);
+ test(S("onmje"), S("fbslrjiqkm"), 5, S::npos);
+ test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, S::npos);
+ test(S("schfa"), S(""), 6, S::npos);
+ test(S("igdsc"), S("qngpd"), 6, S::npos);
+ test(S("brqgo"), S("rodhqklgmb"), 6, S::npos);
+ test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, S::npos);
+ test(S("hcjitbfapl"), S(""), 0, S::npos);
+ test(S("daiprenocl"), S("ashjd"), 0, 0);
+ test(S("litpcfdghe"), S("mgojkldsqh"), 0, 0);
+ test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, 0);
+ test(S("qpghtfbaji"), S(""), 1, S::npos);
+ test(S("gfshlcmdjr"), S("nadkh"), 1, 3);
+ test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 1);
+ test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, 1);
+ test(S("crnklpmegd"), S(""), 5, S::npos);
+ test(S("jsbtafedoc"), S("prqgn"), 5, S::npos);
+ test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 5);
+ test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, 5);
+ test(S("lmofqdhpki"), S(""), 9, S::npos);
+ test(S("hnefkqimca"), S("rtjpa"), 9, 9);
+ test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, S::npos);
+ test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, 9);
+ test(S("elgofjmbrq"), S(""), 10, S::npos);
+ test(S("mjqdgalkpc"), S("dplqa"), 10, S::npos);
+ test(S("kthqnfcerm"), S("dkacjoptns"), 10, S::npos);
+ test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, S::npos);
+ test(S("eqsgalomhb"), S(""), 11, S::npos);
+ test(S("akiteljmoh"), S("lofbc"), 11, S::npos);
+ test(S("hlbdfreqjo"), S("astoegbfpn"), 11, S::npos);
+ test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, S::npos);
+ test(S("snafbdlghrjkpqtoceim"), S(""), 0, S::npos);
+ test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, 3);
+ test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, 0);
+ test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, 0);
+ test(S("jlnkraeodhcspfgbqitm"), S(""), 1, S::npos);
+ test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, 3);
+ test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 1);
+ test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, 1);
+ test(S("hdpkobnsalmcfijregtq"), S(""), 10, S::npos);
+ test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 10);
+ test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 10);
+ test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, 10);
+ test(S("niptglfbosehkamrdqcj"), S(""), 19, S::npos);
+ test(S("copqdhstbingamjfkler"), S("djkqc"), 19, S::npos);
+ test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, 19);
+ test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, 19);
+ test(S("eaintpchlqsbdgrkjofm"), S(""), 20, S::npos);
+ test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, S::npos);
+ test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, S::npos);
+ test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, S::npos);
+ test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, S::npos);
+ test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, S::npos);
+ test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, S::npos);
+ test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), S(""), S::npos);
+ test(S(""), S("laenf"), S::npos);
+ test(S(""), S("pqlnkmbdjo"), S::npos);
+ test(S(""), S("qkamfogpnljdcshbreti"), S::npos);
+ test(S("nhmko"), S(""), S::npos);
+ test(S("lahfb"), S("irkhs"), 2);
+ test(S("gmfhd"), S("kantesmpgj"), 0);
+ test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), 0);
+ test(S("eolhfgpjqk"), S(""), S::npos);
+ test(S("nbatdlmekr"), S("bnrpe"), 0);
+ test(S("jdmciepkaq"), S("jtdaefblso"), 0);
+ test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), 0);
+ test(S("gprdcokbnjhlsfmtieqa"), S(""), S::npos);
+ test(S("qjghlnftcaismkropdeb"), S("bjaht"), 1);
+ test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 0);
+ test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), 0);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+}
diff --git a/test/std/strings/string.view/string.view.find/find_last_not_of_char_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
new file mode 100644
index 000000000000..5a792974f8c5
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// const size_type find_last_not_of(charT c, size_type pos = npos) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.find_last_not_of(c, pos) == x);
+ if (x != S::npos)
+ assert(x <= pos && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type x)
+{
+ assert(s.find_last_not_of(c) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), 'i', 0, S::npos);
+ test(S(""), 'i', 1, S::npos);
+ test(S("kitcj"), 'i', 0, 0);
+ test(S("qkamf"), 'i', 1, 1);
+ test(S("nhmko"), 'i', 2, 2);
+ test(S("tpsaf"), 'i', 4, 4);
+ test(S("lahfb"), 'i', 5, 4);
+ test(S("irkhs"), 'i', 6, 4);
+ test(S("gmfhdaipsr"), 'i', 0, 0);
+ test(S("kantesmpgj"), 'i', 1, 1);
+ test(S("odaftiegpm"), 'i', 5, 4);
+ test(S("oknlrstdpi"), 'i', 9, 8);
+ test(S("eolhfgpjqk"), 'i', 10, 9);
+ test(S("pcdrofikas"), 'i', 11, 9);
+ test(S("nbatdlmekrgcfqsophij"), 'i', 0, 0);
+ test(S("bnrpehidofmqtcksjgla"), 'i', 1, 1);
+ test(S("jdmciepkaqgotsrfnhlb"), 'i', 10, 10);
+ test(S("jtdaefblsokrmhpgcnqi"), 'i', 19, 18);
+ test(S("hkbgspofltajcnedqmri"), 'i', 20, 18);
+ test(S("oselktgbcapndfjihrmq"), 'i', 21, 19);
+
+ test(S(""), 'i', S::npos);
+ test(S("csope"), 'i', 4);
+ test(S("gfsmthlkon"), 'i', 9);
+ test(S("laenfsbridchgotmkqpj"), 'i', 19);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_last_not_of( 'i', 0 ) == SV::npos, "" );
+ static_assert (sv1.find_last_not_of( 'i', 1 ) == SV::npos, "" );
+ static_assert (sv2.find_last_not_of( 'a', 0 ) == SV::npos, "" );
+ static_assert (sv2.find_last_not_of( 'a', 1 ) == 1, "" );
+ static_assert (sv2.find_last_not_of( 'e', 5 ) == 3, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
new file mode 100644
index 000000000000..81881deadf30
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
@@ -0,0 +1,166 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.find_last_not_of(str, pos) == x);
+ if (x != S::npos)
+ assert(x <= pos && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type x)
+{
+ assert(s.find_last_not_of(str) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, S::npos);
+ test(S(""), "laenf", 0, S::npos);
+ test(S(""), "pqlnkmbdjo", 0, S::npos);
+ test(S(""), "qkamfogpnljdcshbreti", 0, S::npos);
+ test(S(""), "", 1, S::npos);
+ test(S(""), "bjaht", 1, S::npos);
+ test(S(""), "hjlcmgpket", 1, S::npos);
+ test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos);
+ test(S("fodgq"), "", 0, 0);
+ test(S("qanej"), "dfkap", 0, 0);
+ test(S("clbao"), "ihqrfebgad", 0, 0);
+ test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, S::npos);
+ test(S("srdfq"), "", 1, 1);
+ test(S("oemth"), "ikcrq", 1, 1);
+ test(S("cdaih"), "dmajblfhsg", 1, 0);
+ test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, S::npos);
+ test(S("cshmd"), "", 2, 2);
+ test(S("lhcdo"), "oebqi", 2, 2);
+ test(S("qnsoh"), "kojhpmbsfe", 2, 1);
+ test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, S::npos);
+ test(S("fmtsp"), "", 4, 4);
+ test(S("khbpm"), "aobjd", 4, 4);
+ test(S("pbsji"), "pcbahntsje", 4, 4);
+ test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, S::npos);
+ test(S("eqmpa"), "", 5, 4);
+ test(S("omigs"), "kocgb", 5, 4);
+ test(S("onmje"), "fbslrjiqkm", 5, 4);
+ test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, S::npos);
+ test(S("schfa"), "", 6, 4);
+ test(S("igdsc"), "qngpd", 6, 4);
+ test(S("brqgo"), "rodhqklgmb", 6, S::npos);
+ test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, S::npos);
+ test(S("hcjitbfapl"), "", 0, 0);
+ test(S("daiprenocl"), "ashjd", 0, S::npos);
+ test(S("litpcfdghe"), "mgojkldsqh", 0, S::npos);
+ test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, S::npos);
+ test(S("qpghtfbaji"), "", 1, 1);
+ test(S("gfshlcmdjr"), "nadkh", 1, 1);
+ test(S("nkodajteqp"), "ofdrqmkebl", 1, 0);
+ test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, S::npos);
+ test(S("crnklpmegd"), "", 5, 5);
+ test(S("jsbtafedoc"), "prqgn", 5, 5);
+ test(S("qnmodrtkeb"), "pejafmnokr", 5, 4);
+ test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, S::npos);
+ test(S("lmofqdhpki"), "", 9, 9);
+ test(S("hnefkqimca"), "rtjpa", 9, 8);
+ test(S("drtasbgmfp"), "ktsrmnqagd", 9, 9);
+ test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, S::npos);
+ test(S("elgofjmbrq"), "", 10, 9);
+ test(S("mjqdgalkpc"), "dplqa", 10, 9);
+ test(S("kthqnfcerm"), "dkacjoptns", 10, 9);
+ test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, S::npos);
+ test(S("eqsgalomhb"), "", 11, 9);
+ test(S("akiteljmoh"), "lofbc", 11, 9);
+ test(S("hlbdfreqjo"), "astoegbfpn", 11, 8);
+ test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, S::npos);
+ test(S("snafbdlghrjkpqtoceim"), "", 0, 0);
+ test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, 0);
+ test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, S::npos);
+ test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, S::npos);
+ test(S("jlnkraeodhcspfgbqitm"), "", 1, 1);
+ test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, 1);
+ test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 0);
+ test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, S::npos);
+ test(S("hdpkobnsalmcfijregtq"), "", 10, 10);
+ test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 9);
+ test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 9);
+ test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, S::npos);
+ test(S("niptglfbosehkamrdqcj"), "", 19, 19);
+ test(S("copqdhstbingamjfkler"), "djkqc", 19, 19);
+ test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, 16);
+ test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, S::npos);
+ test(S("eaintpchlqsbdgrkjofm"), "", 20, 19);
+ test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, 18);
+ test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, 19);
+ test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, S::npos);
+ test(S("liatsqdoegkmfcnbhrpj"), "", 21, 19);
+ test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, 19);
+ test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, 19);
+ test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), "", S::npos);
+ test(S(""), "laenf", S::npos);
+ test(S(""), "pqlnkmbdjo", S::npos);
+ test(S(""), "qkamfogpnljdcshbreti", S::npos);
+ test(S("nhmko"), "", 4);
+ test(S("lahfb"), "irkhs", 4);
+ test(S("gmfhd"), "kantesmpgj", 4);
+ test(S("odaft"), "oknlrstdpiqmjbaghcfe", S::npos);
+ test(S("eolhfgpjqk"), "", 9);
+ test(S("nbatdlmekr"), "bnrpe", 8);
+ test(S("jdmciepkaq"), "jtdaefblso", 9);
+ test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", S::npos);
+ test(S("gprdcokbnjhlsfmtieqa"), "", 19);
+ test(S("qjghlnftcaismkropdeb"), "bjaht", 18);
+ test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 17);
+ test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", S::npos);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_last_not_of( "", 0) == SV::npos, "" );
+ static_assert (sv1.find_last_not_of( "irkhs", 5) == SV::npos, "" );
+ static_assert (sv2.find_last_not_of( "", 0) == 0, "" );
+ static_assert (sv2.find_last_not_of( "gfsrt", 5) == 4, "" );
+ static_assert (sv2.find_last_not_of( "lecar", 5) == 3, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
new file mode 100644
index 000000000000..314f338e775e
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
@@ -0,0 +1,393 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type n, typename S::size_type x)
+{
+ assert(s.find_last_not_of(str, pos, n) == x);
+ if (x != S::npos)
+ assert(x <= pos && x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, 0, S::npos);
+ test(S(""), "irkhs", 0, 0, S::npos);
+ test(S(""), "kante", 0, 1, S::npos);
+ test(S(""), "oknlr", 0, 2, S::npos);
+ test(S(""), "pcdro", 0, 4, S::npos);
+ test(S(""), "bnrpe", 0, 5, S::npos);
+ test(S(""), "jtdaefblso", 0, 0, S::npos);
+ test(S(""), "oselktgbca", 0, 1, S::npos);
+ test(S(""), "eqgaplhckj", 0, 5, S::npos);
+ test(S(""), "bjahtcmnlp", 0, 9, S::npos);
+ test(S(""), "hjlcmgpket", 0, 10, S::npos);
+ test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos);
+ test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos);
+ test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos);
+ test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos);
+ test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos);
+ test(S(""), "", 1, 0, S::npos);
+ test(S(""), "lbtqd", 1, 0, S::npos);
+ test(S(""), "tboim", 1, 1, S::npos);
+ test(S(""), "slcer", 1, 2, S::npos);
+ test(S(""), "cbjfs", 1, 4, S::npos);
+ test(S(""), "aqibs", 1, 5, S::npos);
+ test(S(""), "gtfblmqinc", 1, 0, S::npos);
+ test(S(""), "mkqpbtdalg", 1, 1, S::npos);
+ test(S(""), "kphatlimcd", 1, 5, S::npos);
+ test(S(""), "pblasqogic", 1, 9, S::npos);
+ test(S(""), "arosdhcfme", 1, 10, S::npos);
+ test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos);
+ test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos);
+ test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos);
+ test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos);
+ test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos);
+ test(S("eaint"), "", 0, 0, 0);
+ test(S("binja"), "gfsrt", 0, 0, 0);
+ test(S("latkm"), "pfsoc", 0, 1, 0);
+ test(S("lecfr"), "tpflm", 0, 2, 0);
+ test(S("eqkst"), "sgkec", 0, 4, S::npos);
+ test(S("cdafr"), "romds", 0, 5, 0);
+ test(S("prbhe"), "qhjistlgmr", 0, 0, 0);
+ test(S("lbisk"), "pedfirsglo", 0, 1, 0);
+ test(S("hrlpd"), "aqcoslgrmk", 0, 5, 0);
+ test(S("ehmja"), "dabckmepqj", 0, 9, S::npos);
+ test(S("mhqgd"), "pqscrjthli", 0, 10, 0);
+ test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, 0);
+ test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, 0);
+ test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, 0);
+ test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, S::npos);
+ test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, S::npos);
+ test(S("clrgb"), "", 1, 0, 1);
+ test(S("tjmek"), "osmia", 1, 0, 1);
+ test(S("bgstp"), "ckonl", 1, 1, 1);
+ test(S("hstrk"), "ilcaj", 1, 2, 1);
+ test(S("kmspj"), "lasiq", 1, 4, 1);
+ test(S("tjboh"), "kfqmr", 1, 5, 1);
+ test(S("ilbcj"), "klnitfaobg", 1, 0, 1);
+ test(S("jkngf"), "gjhmdlqikp", 1, 1, 1);
+ test(S("gfcql"), "skbgtahqej", 1, 5, 1);
+ test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 1);
+ test(S("bthpg"), "bjgfmnlkio", 1, 10, 1);
+ test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, 1);
+ test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, 1);
+ test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, S::npos);
+ test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, S::npos);
+ test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, S::npos);
+ test(S("ndrhl"), "", 2, 0, 2);
+ test(S("mrecp"), "otkgb", 2, 0, 2);
+ test(S("qlasf"), "cqsjl", 2, 1, 2);
+ test(S("smaqd"), "dpifl", 2, 2, 2);
+ test(S("hjeni"), "oapht", 2, 4, 2);
+ test(S("ocmfj"), "cifts", 2, 5, 2);
+ test(S("hmftq"), "nmsckbgalo", 2, 0, 2);
+ test(S("fklad"), "tpksqhamle", 2, 1, 2);
+ test(S("dirnm"), "tpdrchmkji", 2, 5, 1);
+ test(S("hrgdc"), "ijagfkblst", 2, 9, 1);
+ test(S("ifakg"), "kpocsignjb", 2, 10, 2);
+ test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, 2);
+ test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, 2);
+ test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 2);
+ test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, S::npos);
+ test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, S::npos);
+ test(S("cjgao"), "", 4, 0, 4);
+ test(S("kjplq"), "mabns", 4, 0, 4);
+ test(S("herni"), "bdnrp", 4, 1, 4);
+ test(S("tadrb"), "scidp", 4, 2, 4);
+ test(S("pkfeo"), "agbjl", 4, 4, 4);
+ test(S("hoser"), "jfmpr", 4, 5, 3);
+ test(S("kgrsp"), "rbpefghsmj", 4, 0, 4);
+ test(S("pgejb"), "apsfntdoqc", 4, 1, 4);
+ test(S("thlnq"), "ndkjeisgcl", 4, 5, 4);
+ test(S("nbmit"), "rnfpqatdeo", 4, 9, 3);
+ test(S("jgmib"), "bntjlqrfik", 4, 10, 2);
+ test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, 4);
+ test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, 4);
+ test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, 3);
+ test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, 2);
+ test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, S::npos);
+ test(S("klopi"), "", 5, 0, 4);
+ test(S("dajhn"), "psthd", 5, 0, 4);
+ test(S("jbgno"), "rpmjd", 5, 1, 4);
+ test(S("hkjae"), "dfsmk", 5, 2, 4);
+}
+
+template <class S>
+void test1()
+{
+ test(S("gbhqo"), "skqne", 5, 4, 4);
+ test(S("ktdor"), "kipnf", 5, 5, 4);
+ test(S("ldprn"), "hmrnqdgifl", 5, 0, 4);
+ test(S("egmjk"), "fsmjcdairn", 5, 1, 4);
+ test(S("armql"), "pcdgltbrfj", 5, 5, 3);
+ test(S("cdhjo"), "aekfctpirg", 5, 9, 4);
+ test(S("jcons"), "ledihrsgpf", 5, 10, 3);
+ test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, 4);
+ test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, 4);
+ test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, 1);
+ test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, 2);
+ test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, S::npos);
+ test(S("gajqn"), "", 6, 0, 4);
+ test(S("stedk"), "hrnat", 6, 0, 4);
+ test(S("tjkaf"), "gsqdt", 6, 1, 4);
+ test(S("dthpe"), "bspkd", 6, 2, 4);
+ test(S("klhde"), "ohcmb", 6, 4, 4);
+ test(S("bhlki"), "heatr", 6, 5, 4);
+ test(S("lqmoh"), "pmblckedfn", 6, 0, 4);
+ test(S("mtqin"), "aceqmsrbik", 6, 1, 4);
+ test(S("dpqbr"), "lmbtdehjrn", 6, 5, 4);
+ test(S("kdhmo"), "teqmcrlgib", 6, 9, 4);
+ test(S("jblqp"), "njolbmspac", 6, 10, 3);
+ test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, 4);
+ test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, 4);
+ test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, 1);
+ test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, S::npos);
+ test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, S::npos);
+ test(S("jnkrfhotgl"), "", 0, 0, 0);
+ test(S("dltjfngbko"), "rqegt", 0, 0, 0);
+ test(S("bmjlpkiqde"), "dashm", 0, 1, 0);
+ test(S("skrflobnqm"), "jqirk", 0, 2, 0);
+ test(S("jkpldtshrm"), "rckeg", 0, 4, 0);
+ test(S("ghasdbnjqo"), "jscie", 0, 5, 0);
+ test(S("igrkhpbqjt"), "efsphndliq", 0, 0, 0);
+ test(S("ikthdgcamf"), "gdicosleja", 0, 1, 0);
+ test(S("pcofgeniam"), "qcpjibosfl", 0, 5, S::npos);
+ test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, S::npos);
+ test(S("itphbqsker"), "dtablcrseo", 0, 10, 0);
+ test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, 0);
+ test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, 0);
+ test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, 0);
+ test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, S::npos);
+ test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, S::npos);
+ test(S("shbcqnmoar"), "", 1, 0, 1);
+ test(S("bdoshlmfin"), "ontrs", 1, 0, 1);
+ test(S("khfrebnsgq"), "pfkna", 1, 1, 1);
+ test(S("getcrsaoji"), "ekosa", 1, 2, 0);
+ test(S("fjiknedcpq"), "anqhk", 1, 4, 1);
+ test(S("tkejgnafrm"), "jekca", 1, 5, 0);
+ test(S("jnakolqrde"), "ikemsjgacf", 1, 0, 1);
+ test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, 1);
+ test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 0);
+ test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 1);
+ test(S("cigfqkated"), "sqcflrgtim", 1, 10, S::npos);
+ test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, 1);
+ test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, 1);
+ test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, S::npos);
+ test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, S::npos);
+ test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, S::npos);
+ test(S("ectnhskflp"), "", 5, 0, 5);
+ test(S("fgtianblpq"), "pijag", 5, 0, 5);
+ test(S("mfeqklirnh"), "jrckd", 5, 1, 5);
+ test(S("astedncjhk"), "qcloh", 5, 2, 5);
+ test(S("fhlqgcajbr"), "thlmp", 5, 4, 5);
+ test(S("epfhocmdng"), "qidmo", 5, 5, 5);
+ test(S("apcnsibger"), "lnegpsjqrd", 5, 0, 5);
+ test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 4);
+ test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, 5);
+ test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 3);
+ test(S("jbhcfposld"), "trfqgmckbe", 5, 10, 5);
+ test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, 5);
+ test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, 5);
+ test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 1);
+ test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, S::npos);
+ test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, S::npos);
+ test(S("shoiedtcjb"), "", 9, 0, 9);
+ test(S("ebcinjgads"), "tqbnh", 9, 0, 9);
+ test(S("dqmregkcfl"), "akmle", 9, 1, 9);
+ test(S("ngcrieqajf"), "iqfkm", 9, 2, 9);
+ test(S("qosmilgnjb"), "tqjsr", 9, 4, 9);
+ test(S("ikabsjtdfl"), "jplqg", 9, 5, 8);
+ test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, 9);
+ test(S("fdnplotmgh"), "morkglpesn", 9, 1, 9);
+ test(S("fdbicojerm"), "dmicerngat", 9, 5, 8);
+ test(S("mbtafndjcq"), "radgeskbtc", 9, 9, 9);
+ test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, 9);
+ test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, 9);
+ test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, 9);
+ test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, 9);
+ test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, 3);
+ test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, S::npos);
+ test(S("ncjpmaekbs"), "", 10, 0, 9);
+ test(S("hlbosgmrak"), "hpmsd", 10, 0, 9);
+ test(S("pqfhsgilen"), "qnpor", 10, 1, 9);
+ test(S("gqtjsbdckh"), "otdma", 10, 2, 9);
+ test(S("cfkqpjlegi"), "efhjg", 10, 4, 9);
+ test(S("beanrfodgj"), "odpte", 10, 5, 9);
+ test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, 9);
+ test(S("iomkfthagj"), "oaklidrbqg", 10, 1, 9);
+}
+
+template <class S>
+void test2()
+{
+ test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, 8);
+ test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, 9);
+ test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, 8);
+ test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, 9);
+ test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, 9);
+ test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, 7);
+ test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, 5);
+ test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, S::npos);
+ test(S("cqjohampgd"), "", 11, 0, 9);
+ test(S("hobitmpsan"), "aocjb", 11, 0, 9);
+ test(S("tjehkpsalm"), "jbrnk", 11, 1, 9);
+ test(S("ngfbojitcl"), "tqedg", 11, 2, 9);
+ test(S("rcfkdbhgjo"), "nqskp", 11, 4, 9);
+ test(S("qghptonrea"), "eaqkl", 11, 5, 7);
+ test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, 9);
+ test(S("hlmgabenti"), "lsftgajqpm", 11, 1, 9);
+ test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, 9);
+ test(S("jqedtkornm"), "shkncmiaqj", 11, 9, 7);
+ test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, 8);
+ test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, 9);
+ test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, 9);
+ test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, 8);
+ test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, S::npos);
+ test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, S::npos);
+ test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, 0);
+ test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, 0);
+ test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, 0);
+ test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, 0);
+ test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, 0);
+ test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, 0);
+ test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, 0);
+ test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, 0);
+ test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, 0);
+ test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, 0);
+ test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, 0);
+ test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, 0);
+ test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, 0);
+ test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, 0);
+ test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, S::npos);
+ test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, S::npos);
+ test(S("febhmqtjanokscdirpgl"), "", 1, 0, 1);
+ test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, 1);
+ test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, 1);
+ test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 0);
+ test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 0);
+ test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, 1);
+ test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, 1);
+ test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, 1);
+ test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, 1);
+ test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 0);
+ test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 0);
+ test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, 1);
+ test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, 1);
+ test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 0);
+ test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, S::npos);
+ test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, S::npos);
+ test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, 10);
+ test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, 10);
+ test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, 10);
+ test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, 10);
+ test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 9);
+ test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 10);
+ test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, 10);
+ test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, 10);
+ test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 10);
+ test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 8);
+ test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 10);
+ test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, 10);
+ test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, 10);
+ test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 8);
+ test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, S::npos);
+ test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, S::npos);
+ test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, 19);
+ test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, 19);
+ test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, 19);
+ test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, 19);
+ test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, 19);
+ test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, 17);
+ test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, 19);
+ test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, 19);
+ test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, 19);
+ test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, 19);
+ test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, 19);
+ test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, 19);
+ test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, 19);
+ test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, 18);
+ test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, 7);
+ test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, S::npos);
+ test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, 19);
+ test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, 19);
+ test(S("grkpahljcftesdmonqib"), "odife", 20, 1, 19);
+ test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, 19);
+ test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, 18);
+ test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, 18);
+ test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, 19);
+ test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, 19);
+ test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, 18);
+ test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, 18);
+ test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, 17);
+ test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, 19);
+}
+
+template <class S>
+void test3()
+{
+ test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, 19);
+ test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, 19);
+ test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, 1);
+ test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, S::npos);
+ test(S("ecgdanriptblhjfqskom"), "", 21, 0, 19);
+ test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, 19);
+ test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, 19);
+ test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, 19);
+ test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, 19);
+ test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, 19);
+ test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, 19);
+ test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, 19);
+ test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, 18);
+ test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, 19);
+ test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, 19);
+ test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, 19);
+ test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, 19);
+ test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, 19);
+ test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, 7);
+ test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, S::npos);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ test2<S>();
+ test3<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_last_not_of( "", 0, 0) == SV::npos, "" );
+ static_assert (sv1.find_last_not_of( "irkhs", 0, 5) == SV::npos, "" );
+ static_assert (sv2.find_last_not_of( "", 0, 0) == 0, "" );
+ static_assert (sv2.find_last_not_of( "gfsrt", 5, 0) == 4, "" );
+ static_assert (sv2.find_last_not_of( "lecar", 5, 0) == 4, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp
new file mode 100644
index 000000000000..89a8f9f3859e
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp
@@ -0,0 +1,148 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// size_type find_last_not_of(const basic_string& str, size_type pos = npos) const;
+
+#include <string_view>
+#include <cassert>
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
+{
+ assert(s.find_last_not_of(str, pos) == x);
+ if (x != S::npos)
+ assert(x <= pos && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type x)
+{
+ assert(s.find_last_not_of(str) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), S(""), 0, S::npos);
+ test(S(""), S("laenf"), 0, S::npos);
+ test(S(""), S("pqlnkmbdjo"), 0, S::npos);
+ test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos);
+ test(S(""), S(""), 1, S::npos);
+ test(S(""), S("bjaht"), 1, S::npos);
+ test(S(""), S("hjlcmgpket"), 1, S::npos);
+ test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos);
+ test(S("fodgq"), S(""), 0, 0);
+ test(S("qanej"), S("dfkap"), 0, 0);
+ test(S("clbao"), S("ihqrfebgad"), 0, 0);
+ test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, S::npos);
+ test(S("srdfq"), S(""), 1, 1);
+ test(S("oemth"), S("ikcrq"), 1, 1);
+ test(S("cdaih"), S("dmajblfhsg"), 1, 0);
+ test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, S::npos);
+ test(S("cshmd"), S(""), 2, 2);
+ test(S("lhcdo"), S("oebqi"), 2, 2);
+ test(S("qnsoh"), S("kojhpmbsfe"), 2, 1);
+ test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, S::npos);
+ test(S("fmtsp"), S(""), 4, 4);
+ test(S("khbpm"), S("aobjd"), 4, 4);
+ test(S("pbsji"), S("pcbahntsje"), 4, 4);
+ test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, S::npos);
+ test(S("eqmpa"), S(""), 5, 4);
+ test(S("omigs"), S("kocgb"), 5, 4);
+ test(S("onmje"), S("fbslrjiqkm"), 5, 4);
+ test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, S::npos);
+ test(S("schfa"), S(""), 6, 4);
+ test(S("igdsc"), S("qngpd"), 6, 4);
+ test(S("brqgo"), S("rodhqklgmb"), 6, S::npos);
+ test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, S::npos);
+ test(S("hcjitbfapl"), S(""), 0, 0);
+ test(S("daiprenocl"), S("ashjd"), 0, S::npos);
+ test(S("litpcfdghe"), S("mgojkldsqh"), 0, S::npos);
+ test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, S::npos);
+ test(S("qpghtfbaji"), S(""), 1, 1);
+ test(S("gfshlcmdjr"), S("nadkh"), 1, 1);
+ test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 0);
+ test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, S::npos);
+ test(S("crnklpmegd"), S(""), 5, 5);
+ test(S("jsbtafedoc"), S("prqgn"), 5, 5);
+ test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 4);
+ test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, S::npos);
+ test(S("lmofqdhpki"), S(""), 9, 9);
+ test(S("hnefkqimca"), S("rtjpa"), 9, 8);
+ test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, 9);
+ test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, S::npos);
+ test(S("elgofjmbrq"), S(""), 10, 9);
+ test(S("mjqdgalkpc"), S("dplqa"), 10, 9);
+ test(S("kthqnfcerm"), S("dkacjoptns"), 10, 9);
+ test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, S::npos);
+ test(S("eqsgalomhb"), S(""), 11, 9);
+ test(S("akiteljmoh"), S("lofbc"), 11, 9);
+ test(S("hlbdfreqjo"), S("astoegbfpn"), 11, 8);
+ test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, S::npos);
+ test(S("snafbdlghrjkpqtoceim"), S(""), 0, 0);
+ test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, 0);
+ test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, S::npos);
+ test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, S::npos);
+ test(S("jlnkraeodhcspfgbqitm"), S(""), 1, 1);
+ test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, 1);
+ test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 0);
+ test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, S::npos);
+ test(S("hdpkobnsalmcfijregtq"), S(""), 10, 10);
+ test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 9);
+ test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 9);
+ test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, S::npos);
+ test(S("niptglfbosehkamrdqcj"), S(""), 19, 19);
+ test(S("copqdhstbingamjfkler"), S("djkqc"), 19, 19);
+ test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, 16);
+ test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, S::npos);
+ test(S("eaintpchlqsbdgrkjofm"), S(""), 20, 19);
+ test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, 18);
+ test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, 19);
+ test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, S::npos);
+ test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, 19);
+ test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, 19);
+ test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, 19);
+ test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), S(""), S::npos);
+ test(S(""), S("laenf"), S::npos);
+ test(S(""), S("pqlnkmbdjo"), S::npos);
+ test(S(""), S("qkamfogpnljdcshbreti"), S::npos);
+ test(S("nhmko"), S(""), 4);
+ test(S("lahfb"), S("irkhs"), 4);
+ test(S("gmfhd"), S("kantesmpgj"), 4);
+ test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), S::npos);
+ test(S("eolhfgpjqk"), S(""), 9);
+ test(S("nbatdlmekr"), S("bnrpe"), 8);
+ test(S("jdmciepkaq"), S("jtdaefblso"), 9);
+ test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), S::npos);
+ test(S("gprdcokbnjhlsfmtieqa"), S(""), 19);
+ test(S("qjghlnftcaismkropdeb"), S("bjaht"), 18);
+ test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 17);
+ test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), S::npos);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+}
diff --git a/test/std/strings/string.view/string.view.find/find_last_of_char_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_last_of_char_size.pass.cpp
new file mode 100644
index 000000000000..b4e0196a515b
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_last_of_char_size.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type find_last_of(charT c, size_type pos = npos) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.find_last_of(c, pos) == x);
+ if (x != S::npos)
+ assert(x <= pos && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type x)
+{
+ assert(s.find_last_of(c) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), 'm', 0, S::npos);
+ test(S(""), 'm', 1, S::npos);
+ test(S("kitcj"), 'm', 0, S::npos);
+ test(S("qkamf"), 'm', 1, S::npos);
+ test(S("nhmko"), 'm', 2, 2);
+ test(S("tpsaf"), 'm', 4, S::npos);
+ test(S("lahfb"), 'm', 5, S::npos);
+ test(S("irkhs"), 'm', 6, S::npos);
+ test(S("gmfhdaipsr"), 'm', 0, S::npos);
+ test(S("kantesmpgj"), 'm', 1, S::npos);
+ test(S("odaftiegpm"), 'm', 5, S::npos);
+ test(S("oknlrstdpi"), 'm', 9, S::npos);
+ test(S("eolhfgpjqk"), 'm', 10, S::npos);
+ test(S("pcdrofikas"), 'm', 11, S::npos);
+ test(S("nbatdlmekrgcfqsophij"), 'm', 0, S::npos);
+ test(S("bnrpehidofmqtcksjgla"), 'm', 1, S::npos);
+ test(S("jdmciepkaqgotsrfnhlb"), 'm', 10, 2);
+ test(S("jtdaefblsokrmhpgcnqi"), 'm', 19, 12);
+ test(S("hkbgspofltajcnedqmri"), 'm', 20, 17);
+ test(S("oselktgbcapndfjihrmq"), 'm', 21, 18);
+
+ test(S(""), 'm', S::npos);
+ test(S("csope"), 'm', S::npos);
+ test(S("gfsmthlkon"), 'm', 3);
+ test(S("laenfsbridchgotmkqpj"), 'm', 15);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_last_of( 'i', 0 ) == SV::npos, "" );
+ static_assert (sv1.find_last_of( 'i', 1 ) == SV::npos, "" );
+ static_assert (sv2.find_last_of( 'a', 0 ) == 0, "" );
+ static_assert (sv2.find_last_of( 'a', 1 ) == 0, "" );
+ static_assert (sv2.find_last_of( 'e', 5 ) == 4, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_last_of_pointer_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
new file mode 100644
index 000000000000..d19010e07a62
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
@@ -0,0 +1,166 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type find_last_of(const charT* s, size_type pos = npos) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.find_last_of(str, pos) == x);
+ if (x != S::npos)
+ assert(x <= pos && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type x)
+{
+ assert(s.find_last_of(str) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, S::npos);
+ test(S(""), "laenf", 0, S::npos);
+ test(S(""), "pqlnkmbdjo", 0, S::npos);
+ test(S(""), "qkamfogpnljdcshbreti", 0, S::npos);
+ test(S(""), "", 1, S::npos);
+ test(S(""), "bjaht", 1, S::npos);
+ test(S(""), "hjlcmgpket", 1, S::npos);
+ test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos);
+ test(S("fodgq"), "", 0, S::npos);
+ test(S("qanej"), "dfkap", 0, S::npos);
+ test(S("clbao"), "ihqrfebgad", 0, S::npos);
+ test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, 0);
+ test(S("srdfq"), "", 1, S::npos);
+ test(S("oemth"), "ikcrq", 1, S::npos);
+ test(S("cdaih"), "dmajblfhsg", 1, 1);
+ test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, 1);
+ test(S("cshmd"), "", 2, S::npos);
+ test(S("lhcdo"), "oebqi", 2, S::npos);
+ test(S("qnsoh"), "kojhpmbsfe", 2, 2);
+ test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, 2);
+ test(S("fmtsp"), "", 4, S::npos);
+ test(S("khbpm"), "aobjd", 4, 2);
+ test(S("pbsji"), "pcbahntsje", 4, 3);
+ test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, 4);
+ test(S("eqmpa"), "", 5, S::npos);
+ test(S("omigs"), "kocgb", 5, 3);
+ test(S("onmje"), "fbslrjiqkm", 5, 3);
+ test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, 4);
+ test(S("schfa"), "", 6, S::npos);
+ test(S("igdsc"), "qngpd", 6, 2);
+ test(S("brqgo"), "rodhqklgmb", 6, 4);
+ test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, 4);
+ test(S("hcjitbfapl"), "", 0, S::npos);
+ test(S("daiprenocl"), "ashjd", 0, 0);
+ test(S("litpcfdghe"), "mgojkldsqh", 0, 0);
+ test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, 0);
+ test(S("qpghtfbaji"), "", 1, S::npos);
+ test(S("gfshlcmdjr"), "nadkh", 1, S::npos);
+ test(S("nkodajteqp"), "ofdrqmkebl", 1, 1);
+ test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, 1);
+ test(S("crnklpmegd"), "", 5, S::npos);
+ test(S("jsbtafedoc"), "prqgn", 5, S::npos);
+ test(S("qnmodrtkeb"), "pejafmnokr", 5, 5);
+ test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, 5);
+ test(S("lmofqdhpki"), "", 9, S::npos);
+ test(S("hnefkqimca"), "rtjpa", 9, 9);
+ test(S("drtasbgmfp"), "ktsrmnqagd", 9, 7);
+ test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, 9);
+ test(S("elgofjmbrq"), "", 10, S::npos);
+ test(S("mjqdgalkpc"), "dplqa", 10, 8);
+ test(S("kthqnfcerm"), "dkacjoptns", 10, 6);
+ test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, 9);
+ test(S("eqsgalomhb"), "", 11, S::npos);
+ test(S("akiteljmoh"), "lofbc", 11, 8);
+ test(S("hlbdfreqjo"), "astoegbfpn", 11, 9);
+ test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, 9);
+ test(S("snafbdlghrjkpqtoceim"), "", 0, S::npos);
+ test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, S::npos);
+ test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, 0);
+ test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, 0);
+ test(S("jlnkraeodhcspfgbqitm"), "", 1, S::npos);
+ test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, S::npos);
+ test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 1);
+ test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, 1);
+ test(S("hdpkobnsalmcfijregtq"), "", 10, S::npos);
+ test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 10);
+ test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 10);
+ test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, 10);
+ test(S("niptglfbosehkamrdqcj"), "", 19, S::npos);
+ test(S("copqdhstbingamjfkler"), "djkqc", 19, 16);
+ test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, 19);
+ test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, 19);
+ test(S("eaintpchlqsbdgrkjofm"), "", 20, S::npos);
+ test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, 19);
+ test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, 18);
+ test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, 19);
+ test(S("liatsqdoegkmfcnbhrpj"), "", 21, S::npos);
+ test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, 12);
+ test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, 17);
+ test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, 19);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), "", S::npos);
+ test(S(""), "laenf", S::npos);
+ test(S(""), "pqlnkmbdjo", S::npos);
+ test(S(""), "qkamfogpnljdcshbreti", S::npos);
+ test(S("nhmko"), "", S::npos);
+ test(S("lahfb"), "irkhs", 2);
+ test(S("gmfhd"), "kantesmpgj", 1);
+ test(S("odaft"), "oknlrstdpiqmjbaghcfe", 4);
+ test(S("eolhfgpjqk"), "", S::npos);
+ test(S("nbatdlmekr"), "bnrpe", 9);
+ test(S("jdmciepkaq"), "jtdaefblso", 8);
+ test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", 9);
+ test(S("gprdcokbnjhlsfmtieqa"), "", S::npos);
+ test(S("qjghlnftcaismkropdeb"), "bjaht", 19);
+ test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 19);
+ test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", 19);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_last_of( "", 0) == SV::npos, "" );
+ static_assert (sv1.find_last_of( "irkhs", 5) == SV::npos, "" );
+ static_assert (sv2.find_last_of( "", 0) == SV::npos, "" );
+ static_assert (sv2.find_last_of( "gfsrt", 5) == SV::npos, "" );
+ static_assert (sv2.find_last_of( "lecar", 5) == 4, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
new file mode 100644
index 000000000000..7d2804bf64b1
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
@@ -0,0 +1,393 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type n, typename S::size_type x)
+{
+ assert(s.find_last_of(str, pos, n) == x);
+ if (x != S::npos)
+ assert(x <= pos && x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, 0, S::npos);
+ test(S(""), "irkhs", 0, 0, S::npos);
+ test(S(""), "kante", 0, 1, S::npos);
+ test(S(""), "oknlr", 0, 2, S::npos);
+ test(S(""), "pcdro", 0, 4, S::npos);
+ test(S(""), "bnrpe", 0, 5, S::npos);
+ test(S(""), "jtdaefblso", 0, 0, S::npos);
+ test(S(""), "oselktgbca", 0, 1, S::npos);
+ test(S(""), "eqgaplhckj", 0, 5, S::npos);
+ test(S(""), "bjahtcmnlp", 0, 9, S::npos);
+ test(S(""), "hjlcmgpket", 0, 10, S::npos);
+ test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos);
+ test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos);
+ test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos);
+ test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos);
+ test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos);
+ test(S(""), "", 1, 0, S::npos);
+ test(S(""), "lbtqd", 1, 0, S::npos);
+ test(S(""), "tboim", 1, 1, S::npos);
+ test(S(""), "slcer", 1, 2, S::npos);
+ test(S(""), "cbjfs", 1, 4, S::npos);
+ test(S(""), "aqibs", 1, 5, S::npos);
+ test(S(""), "gtfblmqinc", 1, 0, S::npos);
+ test(S(""), "mkqpbtdalg", 1, 1, S::npos);
+ test(S(""), "kphatlimcd", 1, 5, S::npos);
+ test(S(""), "pblasqogic", 1, 9, S::npos);
+ test(S(""), "arosdhcfme", 1, 10, S::npos);
+ test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos);
+ test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos);
+ test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos);
+ test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos);
+ test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos);
+ test(S("eaint"), "", 0, 0, S::npos);
+ test(S("binja"), "gfsrt", 0, 0, S::npos);
+ test(S("latkm"), "pfsoc", 0, 1, S::npos);
+ test(S("lecfr"), "tpflm", 0, 2, S::npos);
+ test(S("eqkst"), "sgkec", 0, 4, 0);
+ test(S("cdafr"), "romds", 0, 5, S::npos);
+ test(S("prbhe"), "qhjistlgmr", 0, 0, S::npos);
+ test(S("lbisk"), "pedfirsglo", 0, 1, S::npos);
+ test(S("hrlpd"), "aqcoslgrmk", 0, 5, S::npos);
+ test(S("ehmja"), "dabckmepqj", 0, 9, 0);
+ test(S("mhqgd"), "pqscrjthli", 0, 10, S::npos);
+ test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, S::npos);
+ test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, S::npos);
+ test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, S::npos);
+ test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, 0);
+ test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, 0);
+ test(S("clrgb"), "", 1, 0, S::npos);
+ test(S("tjmek"), "osmia", 1, 0, S::npos);
+ test(S("bgstp"), "ckonl", 1, 1, S::npos);
+ test(S("hstrk"), "ilcaj", 1, 2, S::npos);
+ test(S("kmspj"), "lasiq", 1, 4, S::npos);
+ test(S("tjboh"), "kfqmr", 1, 5, S::npos);
+ test(S("ilbcj"), "klnitfaobg", 1, 0, S::npos);
+ test(S("jkngf"), "gjhmdlqikp", 1, 1, S::npos);
+ test(S("gfcql"), "skbgtahqej", 1, 5, 0);
+ test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 0);
+ test(S("bthpg"), "bjgfmnlkio", 1, 10, 0);
+ test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, S::npos);
+ test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, S::npos);
+ test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, 1);
+ test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, 1);
+ test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, 1);
+ test(S("ndrhl"), "", 2, 0, S::npos);
+ test(S("mrecp"), "otkgb", 2, 0, S::npos);
+ test(S("qlasf"), "cqsjl", 2, 1, S::npos);
+ test(S("smaqd"), "dpifl", 2, 2, S::npos);
+ test(S("hjeni"), "oapht", 2, 4, 0);
+ test(S("ocmfj"), "cifts", 2, 5, 1);
+ test(S("hmftq"), "nmsckbgalo", 2, 0, S::npos);
+ test(S("fklad"), "tpksqhamle", 2, 1, S::npos);
+ test(S("dirnm"), "tpdrchmkji", 2, 5, 2);
+ test(S("hrgdc"), "ijagfkblst", 2, 9, 2);
+ test(S("ifakg"), "kpocsignjb", 2, 10, 0);
+ test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, S::npos);
+ test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, S::npos);
+ test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 1);
+ test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, 2);
+ test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, 2);
+ test(S("cjgao"), "", 4, 0, S::npos);
+ test(S("kjplq"), "mabns", 4, 0, S::npos);
+ test(S("herni"), "bdnrp", 4, 1, S::npos);
+ test(S("tadrb"), "scidp", 4, 2, S::npos);
+ test(S("pkfeo"), "agbjl", 4, 4, S::npos);
+ test(S("hoser"), "jfmpr", 4, 5, 4);
+ test(S("kgrsp"), "rbpefghsmj", 4, 0, S::npos);
+ test(S("pgejb"), "apsfntdoqc", 4, 1, S::npos);
+ test(S("thlnq"), "ndkjeisgcl", 4, 5, 3);
+ test(S("nbmit"), "rnfpqatdeo", 4, 9, 4);
+ test(S("jgmib"), "bntjlqrfik", 4, 10, 4);
+ test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, S::npos);
+ test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, S::npos);
+ test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, 4);
+ test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, 4);
+ test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, 4);
+ test(S("klopi"), "", 5, 0, S::npos);
+ test(S("dajhn"), "psthd", 5, 0, S::npos);
+ test(S("jbgno"), "rpmjd", 5, 1, S::npos);
+ test(S("hkjae"), "dfsmk", 5, 2, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S("gbhqo"), "skqne", 5, 4, 3);
+ test(S("ktdor"), "kipnf", 5, 5, 0);
+ test(S("ldprn"), "hmrnqdgifl", 5, 0, S::npos);
+ test(S("egmjk"), "fsmjcdairn", 5, 1, S::npos);
+ test(S("armql"), "pcdgltbrfj", 5, 5, 4);
+ test(S("cdhjo"), "aekfctpirg", 5, 9, 0);
+ test(S("jcons"), "ledihrsgpf", 5, 10, 4);
+ test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, S::npos);
+ test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, S::npos);
+ test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, 4);
+ test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, 4);
+ test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, 4);
+ test(S("gajqn"), "", 6, 0, S::npos);
+ test(S("stedk"), "hrnat", 6, 0, S::npos);
+ test(S("tjkaf"), "gsqdt", 6, 1, S::npos);
+ test(S("dthpe"), "bspkd", 6, 2, S::npos);
+ test(S("klhde"), "ohcmb", 6, 4, 2);
+ test(S("bhlki"), "heatr", 6, 5, 1);
+ test(S("lqmoh"), "pmblckedfn", 6, 0, S::npos);
+ test(S("mtqin"), "aceqmsrbik", 6, 1, S::npos);
+ test(S("dpqbr"), "lmbtdehjrn", 6, 5, 3);
+ test(S("kdhmo"), "teqmcrlgib", 6, 9, 3);
+ test(S("jblqp"), "njolbmspac", 6, 10, 4);
+ test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, S::npos);
+ test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, S::npos);
+ test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, 4);
+ test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, 4);
+ test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, 4);
+ test(S("jnkrfhotgl"), "", 0, 0, S::npos);
+ test(S("dltjfngbko"), "rqegt", 0, 0, S::npos);
+ test(S("bmjlpkiqde"), "dashm", 0, 1, S::npos);
+ test(S("skrflobnqm"), "jqirk", 0, 2, S::npos);
+ test(S("jkpldtshrm"), "rckeg", 0, 4, S::npos);
+ test(S("ghasdbnjqo"), "jscie", 0, 5, S::npos);
+ test(S("igrkhpbqjt"), "efsphndliq", 0, 0, S::npos);
+ test(S("ikthdgcamf"), "gdicosleja", 0, 1, S::npos);
+ test(S("pcofgeniam"), "qcpjibosfl", 0, 5, 0);
+ test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, 0);
+ test(S("itphbqsker"), "dtablcrseo", 0, 10, S::npos);
+ test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, S::npos);
+ test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, S::npos);
+ test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, S::npos);
+ test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, 0);
+ test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, 0);
+ test(S("shbcqnmoar"), "", 1, 0, S::npos);
+ test(S("bdoshlmfin"), "ontrs", 1, 0, S::npos);
+ test(S("khfrebnsgq"), "pfkna", 1, 1, S::npos);
+ test(S("getcrsaoji"), "ekosa", 1, 2, 1);
+ test(S("fjiknedcpq"), "anqhk", 1, 4, S::npos);
+ test(S("tkejgnafrm"), "jekca", 1, 5, 1);
+ test(S("jnakolqrde"), "ikemsjgacf", 1, 0, S::npos);
+ test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, S::npos);
+ test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 1);
+ test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 0);
+ test(S("cigfqkated"), "sqcflrgtim", 1, 10, 1);
+ test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, S::npos);
+ test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, S::npos);
+ test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, 1);
+ test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, 1);
+ test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, 1);
+ test(S("ectnhskflp"), "", 5, 0, S::npos);
+ test(S("fgtianblpq"), "pijag", 5, 0, S::npos);
+ test(S("mfeqklirnh"), "jrckd", 5, 1, S::npos);
+ test(S("astedncjhk"), "qcloh", 5, 2, S::npos);
+ test(S("fhlqgcajbr"), "thlmp", 5, 4, 2);
+ test(S("epfhocmdng"), "qidmo", 5, 5, 4);
+ test(S("apcnsibger"), "lnegpsjqrd", 5, 0, S::npos);
+ test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 5);
+ test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, S::npos);
+ test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 5);
+ test(S("jbhcfposld"), "trfqgmckbe", 5, 10, 4);
+ test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, S::npos);
+ test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, S::npos);
+ test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 5);
+ test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, 5);
+ test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, 5);
+ test(S("shoiedtcjb"), "", 9, 0, S::npos);
+ test(S("ebcinjgads"), "tqbnh", 9, 0, S::npos);
+ test(S("dqmregkcfl"), "akmle", 9, 1, S::npos);
+ test(S("ngcrieqajf"), "iqfkm", 9, 2, 6);
+ test(S("qosmilgnjb"), "tqjsr", 9, 4, 8);
+ test(S("ikabsjtdfl"), "jplqg", 9, 5, 9);
+ test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, S::npos);
+ test(S("fdnplotmgh"), "morkglpesn", 9, 1, 7);
+ test(S("fdbicojerm"), "dmicerngat", 9, 5, 9);
+ test(S("mbtafndjcq"), "radgeskbtc", 9, 9, 6);
+ test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, 5);
+ test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, S::npos);
+ test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, 6);
+ test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, 7);
+ test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, 9);
+ test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, 9);
+ test(S("ncjpmaekbs"), "", 10, 0, S::npos);
+ test(S("hlbosgmrak"), "hpmsd", 10, 0, S::npos);
+ test(S("pqfhsgilen"), "qnpor", 10, 1, 1);
+ test(S("gqtjsbdckh"), "otdma", 10, 2, 2);
+ test(S("cfkqpjlegi"), "efhjg", 10, 4, 7);
+ test(S("beanrfodgj"), "odpte", 10, 5, 7);
+ test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, S::npos);
+ test(S("iomkfthagj"), "oaklidrbqg", 10, 1, 1);
+}
+
+template <class S>
+void test2()
+{
+ test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, 9);
+ test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, 8);
+ test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, 9);
+ test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, S::npos);
+ test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, 8);
+ test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, 9);
+ test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, 9);
+ test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, 9);
+ test(S("cqjohampgd"), "", 11, 0, S::npos);
+ test(S("hobitmpsan"), "aocjb", 11, 0, S::npos);
+ test(S("tjehkpsalm"), "jbrnk", 11, 1, 1);
+ test(S("ngfbojitcl"), "tqedg", 11, 2, 7);
+ test(S("rcfkdbhgjo"), "nqskp", 11, 4, 3);
+ test(S("qghptonrea"), "eaqkl", 11, 5, 9);
+ test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, S::npos);
+ test(S("hlmgabenti"), "lsftgajqpm", 11, 1, 1);
+ test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, 7);
+ test(S("jqedtkornm"), "shkncmiaqj", 11, 9, 9);
+ test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, 9);
+ test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, S::npos);
+ test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, S::npos);
+ test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, 9);
+ test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, 9);
+ test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, 9);
+ test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, S::npos);
+ test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, S::npos);
+ test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, S::npos);
+ test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, S::npos);
+ test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, S::npos);
+ test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, S::npos);
+ test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, S::npos);
+ test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, S::npos);
+ test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, S::npos);
+ test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, S::npos);
+ test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, S::npos);
+ test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, S::npos);
+ test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, S::npos);
+ test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, S::npos);
+ test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, 0);
+ test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, 0);
+ test(S("febhmqtjanokscdirpgl"), "", 1, 0, S::npos);
+ test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, S::npos);
+ test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, S::npos);
+ test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 1);
+ test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 1);
+ test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, S::npos);
+ test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, S::npos);
+ test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, S::npos);
+ test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, S::npos);
+ test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 1);
+ test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 1);
+ test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, S::npos);
+ test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, S::npos);
+ test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 1);
+ test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, 1);
+ test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, 1);
+ test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, S::npos);
+ test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, S::npos);
+ test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, S::npos);
+ test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, 7);
+ test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 10);
+ test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 6);
+ test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, S::npos);
+ test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, 9);
+ test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 5);
+ test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 10);
+ test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 9);
+ test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, S::npos);
+ test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, S::npos);
+ test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 10);
+ test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, 10);
+ test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, 10);
+ test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, S::npos);
+ test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, S::npos);
+ test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, 16);
+ test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, 7);
+ test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, 16);
+ test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, 19);
+ test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, S::npos);
+ test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, 15);
+ test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, 17);
+ test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, 16);
+ test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, 16);
+ test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, S::npos);
+ test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, 10);
+ test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, 19);
+ test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, 19);
+ test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, 19);
+ test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, S::npos);
+ test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, S::npos);
+ test(S("grkpahljcftesdmonqib"), "odife", 20, 1, 15);
+ test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, 12);
+ test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, 19);
+ test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, 19);
+ test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, S::npos);
+ test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, 3);
+ test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, 19);
+ test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, 19);
+ test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, 19);
+ test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, S::npos);
+}
+
+template <class S>
+void test3()
+{
+ test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, 4);
+ test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, 17);
+ test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, 19);
+ test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, 19);
+ test(S("ecgdanriptblhjfqskom"), "", 21, 0, S::npos);
+ test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, S::npos);
+ test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, 6);
+ test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, 13);
+ test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, 10);
+ test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, 17);
+ test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, S::npos);
+ test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, 14);
+ test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, 19);
+ test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, 14);
+ test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, 16);
+ test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, S::npos);
+ test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, 17);
+ test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, 17);
+ test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, 19);
+ test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, 19);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ test2<S>();
+ test3<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find_last_of( "", 0, 0) == SV::npos, "" );
+ static_assert (sv1.find_last_of( "irkhs", 0, 5) == SV::npos, "" );
+ static_assert (sv2.find_last_of( "", 0, 0) == SV::npos, "" );
+ static_assert (sv2.find_last_of( "gfsrt", 5, 5) == SV::npos, "" );
+ static_assert (sv2.find_last_of( "lecar", 5, 5) == 4, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_last_of_string_view_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_last_of_string_view_size.pass.cpp
new file mode 100644
index 000000000000..ed530870e187
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_last_of_string_view_size.pass.cpp
@@ -0,0 +1,148 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// size_type find_last_of(const basic_string& str, size_type pos = npos) const;
+
+#include <string_view>
+#include <cassert>
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
+{
+ assert(s.find_last_of(str, pos) == x);
+ if (x != S::npos)
+ assert(x <= pos && x < s.size());
+}
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type x)
+{
+ assert(s.find_last_of(str) == x);
+ if (x != S::npos)
+ assert(x < s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), S(""), 0, S::npos);
+ test(S(""), S("laenf"), 0, S::npos);
+ test(S(""), S("pqlnkmbdjo"), 0, S::npos);
+ test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos);
+ test(S(""), S(""), 1, S::npos);
+ test(S(""), S("bjaht"), 1, S::npos);
+ test(S(""), S("hjlcmgpket"), 1, S::npos);
+ test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos);
+ test(S("fodgq"), S(""), 0, S::npos);
+ test(S("qanej"), S("dfkap"), 0, S::npos);
+ test(S("clbao"), S("ihqrfebgad"), 0, S::npos);
+ test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, 0);
+ test(S("srdfq"), S(""), 1, S::npos);
+ test(S("oemth"), S("ikcrq"), 1, S::npos);
+ test(S("cdaih"), S("dmajblfhsg"), 1, 1);
+ test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, 1);
+ test(S("cshmd"), S(""), 2, S::npos);
+ test(S("lhcdo"), S("oebqi"), 2, S::npos);
+ test(S("qnsoh"), S("kojhpmbsfe"), 2, 2);
+ test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, 2);
+ test(S("fmtsp"), S(""), 4, S::npos);
+ test(S("khbpm"), S("aobjd"), 4, 2);
+ test(S("pbsji"), S("pcbahntsje"), 4, 3);
+ test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, 4);
+ test(S("eqmpa"), S(""), 5, S::npos);
+ test(S("omigs"), S("kocgb"), 5, 3);
+ test(S("onmje"), S("fbslrjiqkm"), 5, 3);
+ test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, 4);
+ test(S("schfa"), S(""), 6, S::npos);
+ test(S("igdsc"), S("qngpd"), 6, 2);
+ test(S("brqgo"), S("rodhqklgmb"), 6, 4);
+ test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, 4);
+ test(S("hcjitbfapl"), S(""), 0, S::npos);
+ test(S("daiprenocl"), S("ashjd"), 0, 0);
+ test(S("litpcfdghe"), S("mgojkldsqh"), 0, 0);
+ test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, 0);
+ test(S("qpghtfbaji"), S(""), 1, S::npos);
+ test(S("gfshlcmdjr"), S("nadkh"), 1, S::npos);
+ test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 1);
+ test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, 1);
+ test(S("crnklpmegd"), S(""), 5, S::npos);
+ test(S("jsbtafedoc"), S("prqgn"), 5, S::npos);
+ test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 5);
+ test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, 5);
+ test(S("lmofqdhpki"), S(""), 9, S::npos);
+ test(S("hnefkqimca"), S("rtjpa"), 9, 9);
+ test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, 7);
+ test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, 9);
+ test(S("elgofjmbrq"), S(""), 10, S::npos);
+ test(S("mjqdgalkpc"), S("dplqa"), 10, 8);
+ test(S("kthqnfcerm"), S("dkacjoptns"), 10, 6);
+ test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, 9);
+ test(S("eqsgalomhb"), S(""), 11, S::npos);
+ test(S("akiteljmoh"), S("lofbc"), 11, 8);
+ test(S("hlbdfreqjo"), S("astoegbfpn"), 11, 9);
+ test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, 9);
+ test(S("snafbdlghrjkpqtoceim"), S(""), 0, S::npos);
+ test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, S::npos);
+ test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, 0);
+ test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, 0);
+ test(S("jlnkraeodhcspfgbqitm"), S(""), 1, S::npos);
+ test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, S::npos);
+ test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 1);
+ test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, 1);
+ test(S("hdpkobnsalmcfijregtq"), S(""), 10, S::npos);
+ test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 10);
+ test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 10);
+ test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, 10);
+ test(S("niptglfbosehkamrdqcj"), S(""), 19, S::npos);
+ test(S("copqdhstbingamjfkler"), S("djkqc"), 19, 16);
+ test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, 19);
+ test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, 19);
+ test(S("eaintpchlqsbdgrkjofm"), S(""), 20, S::npos);
+ test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, 19);
+ test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, 18);
+ test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, 19);
+ test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, S::npos);
+ test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, 12);
+ test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, 17);
+ test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, 19);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), S(""), S::npos);
+ test(S(""), S("laenf"), S::npos);
+ test(S(""), S("pqlnkmbdjo"), S::npos);
+ test(S(""), S("qkamfogpnljdcshbreti"), S::npos);
+ test(S("nhmko"), S(""), S::npos);
+ test(S("lahfb"), S("irkhs"), 2);
+ test(S("gmfhd"), S("kantesmpgj"), 1);
+ test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), 4);
+ test(S("eolhfgpjqk"), S(""), S::npos);
+ test(S("nbatdlmekr"), S("bnrpe"), 9);
+ test(S("jdmciepkaq"), S("jtdaefblso"), 8);
+ test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), 9);
+ test(S("gprdcokbnjhlsfmtieqa"), S(""), S::npos);
+ test(S("qjghlnftcaismkropdeb"), S("bjaht"), 19);
+ test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 19);
+ test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), 19);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+}
diff --git a/test/std/strings/string.view/string.view.find/find_pointer_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_pointer_size.pass.cpp
new file mode 100644
index 000000000000..9380f6cd82a0
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_pointer_size.pass.cpp
@@ -0,0 +1,172 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// constexpr size_type find(const charT* s, size_type pos = 0) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.find(str, pos) == x);
+ if (x != S::npos)
+ {
+ typename S::size_type n = S::traits_type::length(str);
+ assert(pos <= x && x + n <= s.size());
+ }
+}
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type x)
+{
+ assert(s.find(str) == x);
+ if (x != S::npos)
+ {
+ typename S::size_type n = S::traits_type::length(str);
+ assert(0 <= x && x + n <= s.size());
+ }
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, 0);
+ test(S(""), "abcde", 0, S::npos);
+ test(S(""), "abcdeabcde", 0, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, S::npos);
+ test(S(""), "", 1, S::npos);
+ test(S(""), "abcde", 1, S::npos);
+ test(S(""), "abcdeabcde", 1, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, S::npos);
+ test(S("abcde"), "", 0, 0);
+ test(S("abcde"), "abcde", 0, 0);
+ test(S("abcde"), "abcdeabcde", 0, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, S::npos);
+ test(S("abcde"), "", 1, 1);
+ test(S("abcde"), "abcde", 1, S::npos);
+ test(S("abcde"), "abcdeabcde", 1, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, S::npos);
+ test(S("abcde"), "", 2, 2);
+ test(S("abcde"), "abcde", 2, S::npos);
+ test(S("abcde"), "abcdeabcde", 2, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, S::npos);
+ test(S("abcde"), "", 4, 4);
+ test(S("abcde"), "abcde", 4, S::npos);
+ test(S("abcde"), "abcdeabcde", 4, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, S::npos);
+ test(S("abcde"), "", 5, 5);
+ test(S("abcde"), "abcde", 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 5, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, S::npos);
+ test(S("abcde"), "", 6, S::npos);
+ test(S("abcde"), "abcde", 6, S::npos);
+ test(S("abcde"), "abcdeabcde", 6, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, S::npos);
+ test(S("abcdeabcde"), "", 0, 0);
+ test(S("abcdeabcde"), "abcde", 0, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, S::npos);
+ test(S("abcdeabcde"), "", 1, 1);
+ test(S("abcdeabcde"), "abcde", 1, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 1, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, S::npos);
+ test(S("abcdeabcde"), "", 5, 5);
+ test(S("abcdeabcde"), "abcde", 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 5, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, S::npos);
+ test(S("abcdeabcde"), "", 9, 9);
+ test(S("abcdeabcde"), "abcde", 9, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 9, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, S::npos);
+ test(S("abcdeabcde"), "", 10, 10);
+ test(S("abcdeabcde"), "abcde", 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, S::npos);
+ test(S("abcdeabcde"), "", 11, S::npos);
+ test(S("abcdeabcde"), "abcde", 11, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 11, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 1, 1);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 19, 19);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 20, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 21, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), "", 0);
+ test(S(""), "abcde", S::npos);
+ test(S(""), "abcdeabcde", S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", S::npos);
+ test(S("abcde"), "", 0);
+ test(S("abcde"), "abcde", 0);
+ test(S("abcde"), "abcdeabcde", S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", S::npos);
+ test(S("abcdeabcde"), "", 0);
+ test(S("abcdeabcde"), "abcde", 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find( "") == 0, "" );
+ static_assert (sv1.find( "abcde") == SV::npos, "" );
+ static_assert (sv2.find( "") == 0, "" );
+ static_assert (sv2.find( "abcde") == 0, "" );
+ static_assert (sv2.find( "abcde", 1) == SV::npos, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_pointer_size_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_pointer_size_size.pass.cpp
new file mode 100644
index 000000000000..da01b75e7070
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_pointer_size_size.pass.cpp
@@ -0,0 +1,394 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type find(const charT* s, size_type pos, size_type n) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type n, typename S::size_type x)
+{
+ assert(s.find(str, pos, n) == x);
+ if (x != S::npos)
+ assert(pos <= x && x + n <= s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, 0, 0);
+ test(S(""), "abcde", 0, 0, 0);
+ test(S(""), "abcde", 0, 1, S::npos);
+ test(S(""), "abcde", 0, 2, S::npos);
+ test(S(""), "abcde", 0, 4, S::npos);
+ test(S(""), "abcde", 0, 5, S::npos);
+ test(S(""), "abcdeabcde", 0, 0, 0);
+ test(S(""), "abcdeabcde", 0, 1, S::npos);
+ test(S(""), "abcdeabcde", 0, 5, S::npos);
+ test(S(""), "abcdeabcde", 0, 9, S::npos);
+ test(S(""), "abcdeabcde", 0, 10, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, 0, 0);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, 1, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, 10, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
+ test(S(""), "", 1, 0, S::npos);
+ test(S(""), "abcde", 1, 0, S::npos);
+ test(S(""), "abcde", 1, 1, S::npos);
+ test(S(""), "abcde", 1, 2, S::npos);
+ test(S(""), "abcde", 1, 4, S::npos);
+ test(S(""), "abcde", 1, 5, S::npos);
+ test(S(""), "abcdeabcde", 1, 0, S::npos);
+ test(S(""), "abcdeabcde", 1, 1, S::npos);
+ test(S(""), "abcdeabcde", 1, 5, S::npos);
+ test(S(""), "abcdeabcde", 1, 9, S::npos);
+ test(S(""), "abcdeabcde", 1, 10, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, 0, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, 1, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, 10, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
+ test(S("abcde"), "", 0, 0, 0);
+ test(S("abcde"), "abcde", 0, 0, 0);
+ test(S("abcde"), "abcde", 0, 1, 0);
+ test(S("abcde"), "abcde", 0, 2, 0);
+ test(S("abcde"), "abcde", 0, 4, 0);
+ test(S("abcde"), "abcde", 0, 5, 0);
+ test(S("abcde"), "abcdeabcde", 0, 0, 0);
+ test(S("abcde"), "abcdeabcde", 0, 1, 0);
+ test(S("abcde"), "abcdeabcde", 0, 5, 0);
+ test(S("abcde"), "abcdeabcde", 0, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 0, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
+ test(S("abcde"), "", 1, 0, 1);
+ test(S("abcde"), "abcde", 1, 0, 1);
+ test(S("abcde"), "abcde", 1, 1, S::npos);
+ test(S("abcde"), "abcde", 1, 2, S::npos);
+ test(S("abcde"), "abcde", 1, 4, S::npos);
+ test(S("abcde"), "abcde", 1, 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 1, 0, 1);
+ test(S("abcde"), "abcdeabcde", 1, 1, S::npos);
+ test(S("abcde"), "abcdeabcde", 1, 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 1, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 1, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 1, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
+ test(S("abcde"), "", 2, 0, 2);
+ test(S("abcde"), "abcde", 2, 0, 2);
+ test(S("abcde"), "abcde", 2, 1, S::npos);
+ test(S("abcde"), "abcde", 2, 2, S::npos);
+ test(S("abcde"), "abcde", 2, 4, S::npos);
+ test(S("abcde"), "abcde", 2, 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 2, 0, 2);
+ test(S("abcde"), "abcdeabcde", 2, 1, S::npos);
+ test(S("abcde"), "abcdeabcde", 2, 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 2, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 2, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 0, 2);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 1, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 20, S::npos);
+ test(S("abcde"), "", 4, 0, 4);
+ test(S("abcde"), "abcde", 4, 0, 4);
+ test(S("abcde"), "abcde", 4, 1, S::npos);
+ test(S("abcde"), "abcde", 4, 2, S::npos);
+ test(S("abcde"), "abcde", 4, 4, S::npos);
+ test(S("abcde"), "abcde", 4, 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 4, 0, 4);
+ test(S("abcde"), "abcdeabcde", 4, 1, S::npos);
+ test(S("abcde"), "abcdeabcde", 4, 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 4, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 4, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 0, 4);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 1, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 20, S::npos);
+ test(S("abcde"), "", 5, 0, 5);
+ test(S("abcde"), "abcde", 5, 0, 5);
+ test(S("abcde"), "abcde", 5, 1, S::npos);
+ test(S("abcde"), "abcde", 5, 2, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S("abcde"), "abcde", 5, 4, S::npos);
+ test(S("abcde"), "abcde", 5, 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 5, 0, 5);
+ test(S("abcde"), "abcdeabcde", 5, 1, S::npos);
+ test(S("abcde"), "abcdeabcde", 5, 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 5, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 5, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 0, 5);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 1, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos);
+ test(S("abcde"), "", 6, 0, S::npos);
+ test(S("abcde"), "abcde", 6, 0, S::npos);
+ test(S("abcde"), "abcde", 6, 1, S::npos);
+ test(S("abcde"), "abcde", 6, 2, S::npos);
+ test(S("abcde"), "abcde", 6, 4, S::npos);
+ test(S("abcde"), "abcde", 6, 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 6, 0, S::npos);
+ test(S("abcde"), "abcdeabcde", 6, 1, S::npos);
+ test(S("abcde"), "abcdeabcde", 6, 5, S::npos);
+ test(S("abcde"), "abcdeabcde", 6, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 6, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 0, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 1, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 20, S::npos);
+ test(S("abcdeabcde"), "", 0, 0, 0);
+ test(S("abcdeabcde"), "abcde", 0, 0, 0);
+ test(S("abcdeabcde"), "abcde", 0, 1, 0);
+ test(S("abcdeabcde"), "abcde", 0, 2, 0);
+ test(S("abcdeabcde"), "abcde", 0, 4, 0);
+ test(S("abcdeabcde"), "abcde", 0, 5, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 0, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 1, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 5, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 9, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
+ test(S("abcdeabcde"), "", 1, 0, 1);
+ test(S("abcdeabcde"), "abcde", 1, 0, 1);
+ test(S("abcdeabcde"), "abcde", 1, 1, 5);
+ test(S("abcdeabcde"), "abcde", 1, 2, 5);
+ test(S("abcdeabcde"), "abcde", 1, 4, 5);
+ test(S("abcdeabcde"), "abcde", 1, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 0, 1);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 9, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
+ test(S("abcdeabcde"), "", 5, 0, 5);
+ test(S("abcdeabcde"), "abcde", 5, 0, 5);
+ test(S("abcdeabcde"), "abcde", 5, 1, 5);
+ test(S("abcdeabcde"), "abcde", 5, 2, 5);
+ test(S("abcdeabcde"), "abcde", 5, 4, 5);
+ test(S("abcdeabcde"), "abcde", 5, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 0, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 9, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 0, 5);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos);
+ test(S("abcdeabcde"), "", 9, 0, 9);
+ test(S("abcdeabcde"), "abcde", 9, 0, 9);
+ test(S("abcdeabcde"), "abcde", 9, 1, S::npos);
+ test(S("abcdeabcde"), "abcde", 9, 2, S::npos);
+ test(S("abcdeabcde"), "abcde", 9, 4, S::npos);
+ test(S("abcdeabcde"), "abcde", 9, 5, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 0, 9);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 1, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 5, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 9, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 0, 9);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 1, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 20, S::npos);
+ test(S("abcdeabcde"), "", 10, 0, 10);
+ test(S("abcdeabcde"), "abcde", 10, 0, 10);
+ test(S("abcdeabcde"), "abcde", 10, 1, S::npos);
+ test(S("abcdeabcde"), "abcde", 10, 2, S::npos);
+ test(S("abcdeabcde"), "abcde", 10, 4, S::npos);
+ test(S("abcdeabcde"), "abcde", 10, 5, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 10, 0, 10);
+ test(S("abcdeabcde"), "abcdeabcde", 10, 1, S::npos);
+}
+
+template <class S>
+void test2()
+{
+ test(S("abcdeabcde"), "abcdeabcde", 10, 5, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 10, 9, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 10, 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, S::npos);
+ test(S("abcdeabcde"), "", 11, 0, S::npos);
+ test(S("abcdeabcde"), "abcde", 11, 0, S::npos);
+ test(S("abcdeabcde"), "abcde", 11, 1, S::npos);
+ test(S("abcdeabcde"), "abcde", 11, 2, S::npos);
+ test(S("abcdeabcde"), "abcde", 11, 4, S::npos);
+ test(S("abcdeabcde"), "abcde", 11, 5, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 0, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 1, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 5, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 9, S::npos);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 0, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 1, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 10, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 0, 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 2, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 4, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 5, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 5, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 9, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 10, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 1, 0, 1);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 0, 1);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 1, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 2, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 4, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 5, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 0, 1);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 1, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 5, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 9, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 10, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, 5);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 10, 0, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 0, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 1, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 2, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 4, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 5, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 0, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 1, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 5, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 9, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 19, 0, 19);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 0, 19);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 2, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 4, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 5, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 0, 19);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 5, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 9, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 10, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 0, 19);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 10, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 20, 0, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 0, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 2, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 4, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 5, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 0, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 5, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 9, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 10, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 0, 20);
+}
+
+template <class S>
+void test3()
+{
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 10, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 21, 0, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 0, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 2, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 4, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 5, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 0, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 5, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 9, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 10, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 0, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 10, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 20, S::npos);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ test2<S>();
+ test3<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find( "", 0, 0 ) == 0, "" );
+ static_assert (sv1.find( "abcde", 0, 0 ) == 0, "" );
+ static_assert (sv1.find( "abcde", 0, 1 ) == SV::npos, "" );
+ static_assert (sv2.find( "", 0, 0 ) == 0, "" );
+ static_assert (sv2.find( "abcde", 0, 0 ) == 0, "" );
+ static_assert (sv2.find( "abcde", 0, 1 ) == 0, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/find_string_view_size.pass.cpp b/test/std/strings/string.view/string.view.find/find_string_view_size.pass.cpp
new file mode 100644
index 000000000000..387e834f4998
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/find_string_view_size.pass.cpp
@@ -0,0 +1,165 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type find(const basic_string_view& str, size_type pos = 0) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
+{
+ assert(s.find(str, pos) == x);
+ if (x != S::npos)
+ assert(pos <= x && x + str.size() <= s.size());
+}
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type x)
+{
+ assert(s.find(str) == x);
+ if (x != S::npos)
+ assert(0 <= x && x + str.size() <= s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), S(""), 0, 0);
+ test(S(""), S("abcde"), 0, S::npos);
+ test(S(""), S("abcdeabcde"), 0, S::npos);
+ test(S(""), S("abcdeabcdeabcdeabcde"), 0, S::npos);
+ test(S(""), S(""), 1, S::npos);
+ test(S(""), S("abcde"), 1, S::npos);
+ test(S(""), S("abcdeabcde"), 1, S::npos);
+ test(S(""), S("abcdeabcdeabcdeabcde"), 1, S::npos);
+ test(S("abcde"), S(""), 0, 0);
+ test(S("abcde"), S("abcde"), 0, 0);
+ test(S("abcde"), S("abcdeabcde"), 0, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos);
+ test(S("abcde"), S(""), 1, 1);
+ test(S("abcde"), S("abcde"), 1, S::npos);
+ test(S("abcde"), S("abcdeabcde"), 1, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos);
+ test(S("abcde"), S(""), 2, 2);
+ test(S("abcde"), S("abcde"), 2, S::npos);
+ test(S("abcde"), S("abcdeabcde"), 2, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 2, S::npos);
+ test(S("abcde"), S(""), 4, 4);
+ test(S("abcde"), S("abcde"), 4, S::npos);
+ test(S("abcde"), S("abcdeabcde"), 4, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 4, S::npos);
+ test(S("abcde"), S(""), 5, 5);
+ test(S("abcde"), S("abcde"), 5, S::npos);
+ test(S("abcde"), S("abcdeabcde"), 5, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos);
+ test(S("abcde"), S(""), 6, S::npos);
+ test(S("abcde"), S("abcde"), 6, S::npos);
+ test(S("abcde"), S("abcdeabcde"), 6, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 6, S::npos);
+ test(S("abcdeabcde"), S(""), 0, 0);
+ test(S("abcdeabcde"), S("abcde"), 0, 0);
+ test(S("abcdeabcde"), S("abcdeabcde"), 0, 0);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos);
+ test(S("abcdeabcde"), S(""), 1, 1);
+ test(S("abcdeabcde"), S("abcde"), 1, 5);
+ test(S("abcdeabcde"), S("abcdeabcde"), 1, S::npos);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos);
+ test(S("abcdeabcde"), S(""), 5, 5);
+ test(S("abcdeabcde"), S("abcde"), 5, 5);
+ test(S("abcdeabcde"), S("abcdeabcde"), 5, S::npos);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos);
+ test(S("abcdeabcde"), S(""), 9, 9);
+ test(S("abcdeabcde"), S("abcde"), 9, S::npos);
+ test(S("abcdeabcde"), S("abcdeabcde"), 9, S::npos);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 9, S::npos);
+ test(S("abcdeabcde"), S(""), 10, 10);
+ test(S("abcdeabcde"), S("abcde"), 10, S::npos);
+ test(S("abcdeabcde"), S("abcdeabcde"), 10, S::npos);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, S::npos);
+ test(S("abcdeabcde"), S(""), 11, S::npos);
+ test(S("abcdeabcde"), S("abcde"), 11, S::npos);
+ test(S("abcdeabcde"), S("abcdeabcde"), 11, S::npos);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 11, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 1, 1);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 1, 5);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 1, 5);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 19, 19);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 19, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 20, 20);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 21, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 21, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 21, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 21, S::npos);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), S(""), 0);
+ test(S(""), S("abcde"), S::npos);
+ test(S(""), S("abcdeabcde"), S::npos);
+ test(S(""), S("abcdeabcdeabcdeabcde"), S::npos);
+ test(S("abcde"), S(""), 0);
+ test(S("abcde"), S("abcde"), 0);
+ test(S("abcde"), S("abcdeabcde"), S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), S::npos);
+ test(S("abcdeabcde"), S(""), 0);
+ test(S("abcdeabcde"), S("abcde"), 0);
+ test(S("abcdeabcde"), S("abcdeabcde"), 0);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.find(sv1) == 0, "" );
+ static_assert (sv1.find(sv2) == SV::npos, "" );
+ static_assert (sv2.find(sv1) == 0, "" );
+ static_assert (sv2.find(sv2) == 0, "" );
+ static_assert (sv2.find(sv2, 1 ) == SV::npos, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/rfind_char_size.pass.cpp b/test/std/strings/string.view/string.view.find/rfind_char_size.pass.cpp
new file mode 100644
index 000000000000..6fc87b8e935b
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/rfind_char_size.pass.cpp
@@ -0,0 +1,84 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+// constexpr size_type rfind(charT c, size_type pos = npos) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.rfind(c, pos) == x);
+ if (x != S::npos)
+ assert(x <= pos && x + 1 <= s.size());
+}
+
+template <class S>
+void
+test(const S& s, typename S::value_type c, typename S::size_type x)
+{
+ assert(s.rfind(c) == x);
+ if (x != S::npos)
+ assert(x + 1 <= s.size());
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test(S(""), 'b', 0, S::npos);
+ test(S(""), 'b', 1, S::npos);
+ test(S("abcde"), 'b', 0, S::npos);
+ test(S("abcde"), 'b', 1, 1);
+ test(S("abcde"), 'b', 2, 1);
+ test(S("abcde"), 'b', 4, 1);
+ test(S("abcde"), 'b', 5, 1);
+ test(S("abcde"), 'b', 6, 1);
+ test(S("abcdeabcde"), 'b', 0, S::npos);
+ test(S("abcdeabcde"), 'b', 1, 1);
+ test(S("abcdeabcde"), 'b', 5, 1);
+ test(S("abcdeabcde"), 'b', 9, 6);
+ test(S("abcdeabcde"), 'b', 10, 6);
+ test(S("abcdeabcde"), 'b', 11, 6);
+ test(S("abcdeabcdeabcdeabcde"), 'b', 0, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), 'b', 1, 1);
+ test(S("abcdeabcdeabcdeabcde"), 'b', 10, 6);
+ test(S("abcdeabcdeabcdeabcde"), 'b', 19, 16);
+ test(S("abcdeabcdeabcdeabcde"), 'b', 20, 16);
+ test(S("abcdeabcdeabcdeabcde"), 'b', 21, 16);
+
+ test(S(""), 'b', S::npos);
+ test(S("abcde"), 'b', 1);
+ test(S("abcdeabcde"), 'b', 6);
+ test(S("abcdeabcdeabcdeabcde"), 'b', 16);
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.rfind( 'b', 0 ) == SV::npos, "" );
+ static_assert (sv1.rfind( 'b', 1 ) == SV::npos, "" );
+ static_assert (sv2.rfind( 'b', 0 ) == SV::npos, "" );
+ static_assert (sv2.rfind( 'b', 1 ) == 1, "" );
+ static_assert (sv2.rfind( 'b', 2 ) == 1, "" );
+ static_assert (sv2.rfind( 'b', 3 ) == 1, "" );
+ static_assert (sv2.rfind( 'b', 4 ) == 1, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/rfind_pointer_size.pass.cpp b/test/std/strings/string.view/string.view.find/rfind_pointer_size.pass.cpp
new file mode 100644
index 000000000000..4d7688206528
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/rfind_pointer_size.pass.cpp
@@ -0,0 +1,172 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+// constexpr size_type rfind(const charT* s, size_type pos = npos) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type x)
+{
+ assert(s.rfind(str, pos) == x);
+ if (x != S::npos)
+ {
+ typename S::size_type n = S::traits_type::length(str);
+ assert(x <= pos && x + n <= s.size());
+ }
+}
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type x)
+{
+ assert(s.rfind(str) == x);
+ if (x != S::npos)
+ {
+ typename S::size_type pos = s.size();
+ typename S::size_type n = S::traits_type::length(str);
+ assert(x <= pos && x + n <= s.size());
+ }
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, 0);
+ test(S(""), "abcde", 0, S::npos);
+ test(S(""), "abcdeabcde", 0, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, S::npos);
+ test(S(""), "", 1, 0);
+ test(S(""), "abcde", 1, S::npos);
+ test(S(""), "abcdeabcde", 1, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, S::npos);
+ test(S("abcde"), "", 0, 0);
+ test(S("abcde"), "abcde", 0, 0);
+ test(S("abcde"), "abcdeabcde", 0, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, S::npos);
+ test(S("abcde"), "", 1, 1);
+ test(S("abcde"), "abcde", 1, 0);
+ test(S("abcde"), "abcdeabcde", 1, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, S::npos);
+ test(S("abcde"), "", 2, 2);
+ test(S("abcde"), "abcde", 2, 0);
+ test(S("abcde"), "abcdeabcde", 2, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, S::npos);
+ test(S("abcde"), "", 4, 4);
+ test(S("abcde"), "abcde", 4, 0);
+ test(S("abcde"), "abcdeabcde", 4, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, S::npos);
+ test(S("abcde"), "", 5, 5);
+ test(S("abcde"), "abcde", 5, 0);
+ test(S("abcde"), "abcdeabcde", 5, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, S::npos);
+ test(S("abcde"), "", 6, 5);
+ test(S("abcde"), "abcde", 6, 0);
+ test(S("abcde"), "abcdeabcde", 6, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, S::npos);
+ test(S("abcdeabcde"), "", 0, 0);
+ test(S("abcdeabcde"), "abcde", 0, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, S::npos);
+ test(S("abcdeabcde"), "", 1, 1);
+ test(S("abcdeabcde"), "abcde", 1, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, S::npos);
+ test(S("abcdeabcde"), "", 5, 5);
+ test(S("abcdeabcde"), "abcde", 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, S::npos);
+ test(S("abcdeabcde"), "", 9, 9);
+ test(S("abcdeabcde"), "abcde", 9, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, S::npos);
+ test(S("abcdeabcde"), "", 10, 10);
+ test(S("abcdeabcde"), "abcde", 10, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, S::npos);
+ test(S("abcdeabcde"), "", 11, 10);
+ test(S("abcdeabcde"), "abcde", 11, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 1, 1);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 19, 19);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 20, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 21, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 0);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), "", 0);
+ test(S(""), "abcde", S::npos);
+ test(S(""), "abcdeabcde", S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", S::npos);
+ test(S("abcde"), "", 5);
+ test(S("abcde"), "abcde", 0);
+ test(S("abcde"), "abcdeabcde", S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", S::npos);
+ test(S("abcdeabcde"), "", 10);
+ test(S("abcdeabcde"), "abcde", 5);
+ test(S("abcdeabcde"), "abcdeabcde", 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.rfind( "") == 0, "" );
+ static_assert (sv1.rfind( "abcde") == SV::npos, "" );
+ static_assert (sv2.rfind( "") == 5, "" );
+ static_assert (sv2.rfind( "abcde") == 0, "" );
+ static_assert (sv2.rfind( "abcde", 1) == 0, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/rfind_pointer_size_size.pass.cpp b/test/std/strings/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
new file mode 100644
index 000000000000..ce16d418e194
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
@@ -0,0 +1,393 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+// constexpr size_type rfind(const charT* s, size_type pos, size_type n) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const typename S::value_type* str, typename S::size_type pos,
+ typename S::size_type n, typename S::size_type x)
+{
+ assert(s.rfind(str, pos, n) == x);
+ if (x != S::npos)
+ assert(x <= pos && x + n <= s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), "", 0, 0, 0);
+ test(S(""), "abcde", 0, 0, 0);
+ test(S(""), "abcde", 0, 1, S::npos);
+ test(S(""), "abcde", 0, 2, S::npos);
+ test(S(""), "abcde", 0, 4, S::npos);
+ test(S(""), "abcde", 0, 5, S::npos);
+ test(S(""), "abcdeabcde", 0, 0, 0);
+ test(S(""), "abcdeabcde", 0, 1, S::npos);
+ test(S(""), "abcdeabcde", 0, 5, S::npos);
+ test(S(""), "abcdeabcde", 0, 9, S::npos);
+ test(S(""), "abcdeabcde", 0, 10, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, 0, 0);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, 1, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, 10, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
+ test(S(""), "", 1, 0, 0);
+ test(S(""), "abcde", 1, 0, 0);
+ test(S(""), "abcde", 1, 1, S::npos);
+ test(S(""), "abcde", 1, 2, S::npos);
+ test(S(""), "abcde", 1, 4, S::npos);
+ test(S(""), "abcde", 1, 5, S::npos);
+ test(S(""), "abcdeabcde", 1, 0, 0);
+ test(S(""), "abcdeabcde", 1, 1, S::npos);
+ test(S(""), "abcdeabcde", 1, 5, S::npos);
+ test(S(""), "abcdeabcde", 1, 9, S::npos);
+ test(S(""), "abcdeabcde", 1, 10, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, 0, 0);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, 1, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, 10, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
+ test(S(""), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
+ test(S("abcde"), "", 0, 0, 0);
+ test(S("abcde"), "abcde", 0, 0, 0);
+ test(S("abcde"), "abcde", 0, 1, 0);
+ test(S("abcde"), "abcde", 0, 2, 0);
+ test(S("abcde"), "abcde", 0, 4, 0);
+ test(S("abcde"), "abcde", 0, 5, 0);
+ test(S("abcde"), "abcdeabcde", 0, 0, 0);
+ test(S("abcde"), "abcdeabcde", 0, 1, 0);
+ test(S("abcde"), "abcdeabcde", 0, 5, 0);
+ test(S("abcde"), "abcdeabcde", 0, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 0, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
+ test(S("abcde"), "", 1, 0, 1);
+ test(S("abcde"), "abcde", 1, 0, 1);
+ test(S("abcde"), "abcde", 1, 1, 0);
+ test(S("abcde"), "abcde", 1, 2, 0);
+ test(S("abcde"), "abcde", 1, 4, 0);
+ test(S("abcde"), "abcde", 1, 5, 0);
+ test(S("abcde"), "abcdeabcde", 1, 0, 1);
+ test(S("abcde"), "abcdeabcde", 1, 1, 0);
+ test(S("abcde"), "abcdeabcde", 1, 5, 0);
+ test(S("abcde"), "abcdeabcde", 1, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 1, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 1, 0);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
+ test(S("abcde"), "", 2, 0, 2);
+ test(S("abcde"), "abcde", 2, 0, 2);
+ test(S("abcde"), "abcde", 2, 1, 0);
+ test(S("abcde"), "abcde", 2, 2, 0);
+ test(S("abcde"), "abcde", 2, 4, 0);
+ test(S("abcde"), "abcde", 2, 5, 0);
+ test(S("abcde"), "abcdeabcde", 2, 0, 2);
+ test(S("abcde"), "abcdeabcde", 2, 1, 0);
+ test(S("abcde"), "abcdeabcde", 2, 5, 0);
+ test(S("abcde"), "abcdeabcde", 2, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 2, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 0, 2);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 1, 0);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 20, S::npos);
+ test(S("abcde"), "", 4, 0, 4);
+ test(S("abcde"), "abcde", 4, 0, 4);
+ test(S("abcde"), "abcde", 4, 1, 0);
+ test(S("abcde"), "abcde", 4, 2, 0);
+ test(S("abcde"), "abcde", 4, 4, 0);
+ test(S("abcde"), "abcde", 4, 5, 0);
+ test(S("abcde"), "abcdeabcde", 4, 0, 4);
+ test(S("abcde"), "abcdeabcde", 4, 1, 0);
+ test(S("abcde"), "abcdeabcde", 4, 5, 0);
+ test(S("abcde"), "abcdeabcde", 4, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 4, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 0, 4);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 1, 0);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 20, S::npos);
+ test(S("abcde"), "", 5, 0, 5);
+ test(S("abcde"), "abcde", 5, 0, 5);
+ test(S("abcde"), "abcde", 5, 1, 0);
+ test(S("abcde"), "abcde", 5, 2, 0);
+}
+
+template <class S>
+void test1()
+{
+ test(S("abcde"), "abcde", 5, 4, 0);
+ test(S("abcde"), "abcde", 5, 5, 0);
+ test(S("abcde"), "abcdeabcde", 5, 0, 5);
+ test(S("abcde"), "abcdeabcde", 5, 1, 0);
+ test(S("abcde"), "abcdeabcde", 5, 5, 0);
+ test(S("abcde"), "abcdeabcde", 5, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 5, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 0, 5);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 1, 0);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos);
+ test(S("abcde"), "", 6, 0, 5);
+ test(S("abcde"), "abcde", 6, 0, 5);
+ test(S("abcde"), "abcde", 6, 1, 0);
+ test(S("abcde"), "abcde", 6, 2, 0);
+ test(S("abcde"), "abcde", 6, 4, 0);
+ test(S("abcde"), "abcde", 6, 5, 0);
+ test(S("abcde"), "abcdeabcde", 6, 0, 5);
+ test(S("abcde"), "abcdeabcde", 6, 1, 0);
+ test(S("abcde"), "abcdeabcde", 6, 5, 0);
+ test(S("abcde"), "abcdeabcde", 6, 9, S::npos);
+ test(S("abcde"), "abcdeabcde", 6, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 0, 5);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 1, 0);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 10, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 19, S::npos);
+ test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 20, S::npos);
+ test(S("abcdeabcde"), "", 0, 0, 0);
+ test(S("abcdeabcde"), "abcde", 0, 0, 0);
+ test(S("abcdeabcde"), "abcde", 0, 1, 0);
+ test(S("abcdeabcde"), "abcde", 0, 2, 0);
+ test(S("abcdeabcde"), "abcde", 0, 4, 0);
+ test(S("abcdeabcde"), "abcde", 0, 5, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 0, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 1, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 5, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 9, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 0, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos);
+ test(S("abcdeabcde"), "", 1, 0, 1);
+ test(S("abcdeabcde"), "abcde", 1, 0, 1);
+ test(S("abcdeabcde"), "abcde", 1, 1, 0);
+ test(S("abcdeabcde"), "abcde", 1, 2, 0);
+ test(S("abcdeabcde"), "abcde", 1, 4, 0);
+ test(S("abcdeabcde"), "abcde", 1, 5, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 0, 1);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 1, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 5, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 9, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 1, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos);
+ test(S("abcdeabcde"), "", 5, 0, 5);
+ test(S("abcdeabcde"), "abcde", 5, 0, 5);
+ test(S("abcdeabcde"), "abcde", 5, 1, 5);
+ test(S("abcdeabcde"), "abcde", 5, 2, 5);
+ test(S("abcdeabcde"), "abcde", 5, 4, 5);
+ test(S("abcdeabcde"), "abcde", 5, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 0, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 9, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 5, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 0, 5);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos);
+ test(S("abcdeabcde"), "", 9, 0, 9);
+ test(S("abcdeabcde"), "abcde", 9, 0, 9);
+ test(S("abcdeabcde"), "abcde", 9, 1, 5);
+ test(S("abcdeabcde"), "abcde", 9, 2, 5);
+ test(S("abcdeabcde"), "abcde", 9, 4, 5);
+ test(S("abcdeabcde"), "abcde", 9, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 0, 9);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 9, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 9, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 0, 9);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 20, S::npos);
+ test(S("abcdeabcde"), "", 10, 0, 10);
+ test(S("abcdeabcde"), "abcde", 10, 0, 10);
+ test(S("abcdeabcde"), "abcde", 10, 1, 5);
+ test(S("abcdeabcde"), "abcde", 10, 2, 5);
+ test(S("abcdeabcde"), "abcde", 10, 4, 5);
+ test(S("abcdeabcde"), "abcde", 10, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 10, 0, 10);
+ test(S("abcdeabcde"), "abcdeabcde", 10, 1, 5);
+}
+
+template <class S>
+void test2()
+{
+ test(S("abcdeabcde"), "abcdeabcde", 10, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 10, 9, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 10, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, S::npos);
+ test(S("abcdeabcde"), "", 11, 0, 10);
+ test(S("abcdeabcde"), "abcde", 11, 0, 10);
+ test(S("abcdeabcde"), "abcde", 11, 1, 5);
+ test(S("abcdeabcde"), "abcde", 11, 2, 5);
+ test(S("abcdeabcde"), "abcde", 11, 4, 5);
+ test(S("abcdeabcde"), "abcde", 11, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 0, 10);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 5, 5);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 9, 0);
+ test(S("abcdeabcde"), "abcdeabcde", 11, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 0, 10);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 1, 5);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 10, 0);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 19, S::npos);
+ test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 20, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), "", 0, 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 2, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 4, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 5, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 5, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 9, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 10, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 1, 0, 1);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 0, 1);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 2, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 4, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 5, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 0, 1);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 5, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 9, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 10, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 10, 0, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 0, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 1, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 2, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 4, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 5, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 0, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 1, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 5, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 9, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 19, 0, 19);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 0, 19);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 1, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 2, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 4, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 5, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 0, 19);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 1, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 5, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 9, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 0, 19);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 1, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 19, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 20, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 20, 0, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 0, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 1, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 2, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 4, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 5, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 0, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 1, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 5, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 9, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 0, 20);
+}
+
+template <class S>
+void test3()
+{
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 1, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 19, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 20, 0);
+ test(S("abcdeabcdeabcdeabcde"), "", 21, 0, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 0, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 1, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 2, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 4, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 5, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 0, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 1, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 5, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 9, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 0, 20);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 1, 15);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 19, 0);
+ test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 20, 0);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ test2<S>();
+ test3<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.rfind( "", 0, 0 ) == 0, "" );
+ static_assert (sv1.rfind( "abcde", 0, 0 ) == 0, "" );
+ static_assert (sv1.rfind( "abcde", 0, 1 ) == SV::npos, "" );
+ static_assert (sv2.rfind( "", 0, 0 ) == 0, "" );
+ static_assert (sv2.rfind( "abcde", 0, 0 ) == 0, "" );
+ static_assert (sv2.rfind( "abcde", 0, 1 ) == 0, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.find/rfind_string_view_size.pass.cpp b/test/std/strings/string.view/string.view.find/rfind_string_view_size.pass.cpp
new file mode 100644
index 000000000000..eded51af2447
--- /dev/null
+++ b/test/std/strings/string.view/string.view.find/rfind_string_view_size.pass.cpp
@@ -0,0 +1,165 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr size_type rfind(const basic_string& str, size_type pos = npos) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x)
+{
+ assert(s.rfind(str, pos) == x);
+ if (x != S::npos)
+ assert(x <= pos && x + str.size() <= s.size());
+}
+
+template <class S>
+void
+test(const S& s, const S& str, typename S::size_type x)
+{
+ assert(s.rfind(str) == x);
+ if (x != S::npos)
+ assert(0 <= x && x + str.size() <= s.size());
+}
+
+template <class S>
+void test0()
+{
+ test(S(""), S(""), 0, 0);
+ test(S(""), S("abcde"), 0, S::npos);
+ test(S(""), S("abcdeabcde"), 0, S::npos);
+ test(S(""), S("abcdeabcdeabcdeabcde"), 0, S::npos);
+ test(S(""), S(""), 1, 0);
+ test(S(""), S("abcde"), 1, S::npos);
+ test(S(""), S("abcdeabcde"), 1, S::npos);
+ test(S(""), S("abcdeabcdeabcdeabcde"), 1, S::npos);
+ test(S("abcde"), S(""), 0, 0);
+ test(S("abcde"), S("abcde"), 0, 0);
+ test(S("abcde"), S("abcdeabcde"), 0, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos);
+ test(S("abcde"), S(""), 1, 1);
+ test(S("abcde"), S("abcde"), 1, 0);
+ test(S("abcde"), S("abcdeabcde"), 1, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos);
+ test(S("abcde"), S(""), 2, 2);
+ test(S("abcde"), S("abcde"), 2, 0);
+ test(S("abcde"), S("abcdeabcde"), 2, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 2, S::npos);
+ test(S("abcde"), S(""), 4, 4);
+ test(S("abcde"), S("abcde"), 4, 0);
+ test(S("abcde"), S("abcdeabcde"), 4, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 4, S::npos);
+ test(S("abcde"), S(""), 5, 5);
+ test(S("abcde"), S("abcde"), 5, 0);
+ test(S("abcde"), S("abcdeabcde"), 5, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos);
+ test(S("abcde"), S(""), 6, 5);
+ test(S("abcde"), S("abcde"), 6, 0);
+ test(S("abcde"), S("abcdeabcde"), 6, S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), 6, S::npos);
+ test(S("abcdeabcde"), S(""), 0, 0);
+ test(S("abcdeabcde"), S("abcde"), 0, 0);
+ test(S("abcdeabcde"), S("abcdeabcde"), 0, 0);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos);
+ test(S("abcdeabcde"), S(""), 1, 1);
+ test(S("abcdeabcde"), S("abcde"), 1, 0);
+ test(S("abcdeabcde"), S("abcdeabcde"), 1, 0);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos);
+ test(S("abcdeabcde"), S(""), 5, 5);
+ test(S("abcdeabcde"), S("abcde"), 5, 5);
+ test(S("abcdeabcde"), S("abcdeabcde"), 5, 0);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos);
+ test(S("abcdeabcde"), S(""), 9, 9);
+ test(S("abcdeabcde"), S("abcde"), 9, 5);
+ test(S("abcdeabcde"), S("abcdeabcde"), 9, 0);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 9, S::npos);
+ test(S("abcdeabcde"), S(""), 10, 10);
+ test(S("abcdeabcde"), S("abcde"), 10, 5);
+ test(S("abcdeabcde"), S("abcdeabcde"), 10, 0);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, S::npos);
+ test(S("abcdeabcde"), S(""), 11, 10);
+ test(S("abcdeabcde"), S("abcde"), 11, 5);
+ test(S("abcdeabcde"), S("abcdeabcde"), 11, 0);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 11, S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, 0);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 1, 1);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, 0);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 10, 10);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, 0);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 19, 19);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 19, 15);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 19, 10);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 19, 0);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 20, 20);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 20, 15);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 20, 10);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 20, 0);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 21, 20);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 21, 15);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 21, 10);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 21, 0);
+}
+
+template <class S>
+void test1()
+{
+ test(S(""), S(""), 0);
+ test(S(""), S("abcde"), S::npos);
+ test(S(""), S("abcdeabcde"), S::npos);
+ test(S(""), S("abcdeabcdeabcdeabcde"), S::npos);
+ test(S("abcde"), S(""), 5);
+ test(S("abcde"), S("abcde"), 0);
+ test(S("abcde"), S("abcdeabcde"), S::npos);
+ test(S("abcde"), S("abcdeabcdeabcdeabcde"), S::npos);
+ test(S("abcdeabcde"), S(""), 10);
+ test(S("abcdeabcde"), S("abcde"), 5);
+ test(S("abcdeabcde"), S("abcdeabcde"), 0);
+ test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), S::npos);
+ test(S("abcdeabcdeabcdeabcde"), S(""), 20);
+ test(S("abcdeabcdeabcdeabcde"), S("abcde"), 15);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 10);
+ test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0);
+}
+
+int main()
+{
+ {
+ typedef std::string_view S;
+ test0<S>();
+ test1<S>();
+ }
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+
+ static_assert (sv1.rfind(sv1) == 0, "" );
+ static_assert (sv1.rfind(sv2) == SV::npos, "" );
+ static_assert (sv2.rfind(sv1) == 5, "" );
+ static_assert (sv2.rfind(sv2) == 0, "" );
+ static_assert (sv2.rfind(sv2, 1) == 0, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.hash/string_view.pass.cpp b/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
new file mode 100644
index 000000000000..63099e2c8864
--- /dev/null
+++ b/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <class T>
+// struct hash
+// : public unary_function<T, size_t>
+// {
+// size_t operator()(T val) const;
+// };
+
+// Not very portable
+
+#include <string_view>
+#include <cassert>
+#include <type_traits>
+
+using std::string_view;
+
+template <class T>
+void
+test()
+{
+ typedef std::hash<T> H;
+ static_assert((std::is_same<typename H::argument_type, T>::value), "" );
+ static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
+ H h;
+// std::string g1 = "1234567890";
+// std::string g2 = "1234567891";
+ typedef typename T::value_type char_type;
+ char_type g1 [ 10 ];
+ char_type g2 [ 10 ];
+ for ( int i = 0; i < 10; ++i )
+ g1[i] = g2[9-i] = static_cast<char_type>('0' + i);
+ T s1(g1, 10);
+ T s2(g2, 10);
+ assert(h(s1) != h(s2));
+}
+
+int main()
+{
+ test<std::string_view>();
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+ test<std::u16string_view>();
+ test<std::u32string_view>();
+#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ test<std::wstring_view>();
+}
diff --git a/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp b/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp
new file mode 100644
index 000000000000..343c297d2a24
--- /dev/null
+++ b/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// template<class charT, class traits, class Allocator>
+// basic_ostream<charT, traits>&
+// operator<<(basic_ostream<charT, traits>& os,
+// const basic_string_view<charT,traits> str);
+
+#include <string_view>
+#include <sstream>
+#include <cassert>
+
+using std::string_view;
+using std::wstring_view;
+
+int main()
+{
+ {
+ std::ostringstream out;
+ string_view sv("some text");
+ out << sv;
+ assert(out.good());
+ assert(sv == out.str());
+ }
+ {
+ std::ostringstream out;
+ std::string s("some text");
+ string_view sv(s);
+ out.width(12);
+ out << sv;
+ assert(out.good());
+ assert(" " + s == out.str());
+ }
+ {
+ std::wostringstream out;
+ wstring_view sv(L"some text");
+ out << sv;
+ assert(out.good());
+ assert(sv == out.str());
+ }
+ {
+ std::wostringstream out;
+ std::wstring s(L"some text");
+ wstring_view sv(s);
+ out.width(12);
+ out << sv;
+ assert(out.good());
+ assert(L" " + s == out.str());
+ }
+}
diff --git a/test/std/strings/string.view/string.view.iterators/begin.pass.cpp b/test/std/strings/string.view/string.view.iterators/begin.pass.cpp
new file mode 100644
index 000000000000..b766c51682fa
--- /dev/null
+++ b/test/std/strings/string.view/string.view.iterators/begin.pass.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr const_iterator begin() const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template <class S>
+void
+test(S s)
+{
+ const S& cs = s;
+ typename S::iterator b = s.begin();
+ typename S::const_iterator cb1 = cs.begin();
+ typename S::const_iterator cb2 = s.cbegin();
+ if (!s.empty())
+ {
+ assert( *b == s[0]);
+ assert( &*b == &s[0]);
+ assert( *cb1 == s[0]);
+ assert(&*cb1 == &s[0]);
+ assert( *cb2 == s[0]);
+ assert(&*cb2 == &s[0]);
+
+ }
+ assert( b == cb1);
+ assert( b == cb2);
+ assert(cb1 == cb2);
+}
+
+
+int main()
+{
+ typedef std::string_view string_view;
+ typedef std::u16string_view u16string_view;
+ typedef std::u32string_view u32string_view;
+ typedef std::wstring_view wstring_view;
+
+ test(string_view ());
+ test(u16string_view());
+ test(u32string_view());
+ test(wstring_view ());
+ test(string_view ( "123"));
+ test(wstring_view (L"123"));
+#if TEST_STD_VER >= 11
+ test(u16string_view{u"123"});
+ test(u32string_view{U"123"});
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ constexpr string_view sv { "123", 3 };
+ constexpr u16string_view u16sv {u"123", 3 };
+ constexpr u32string_view u32sv {U"123", 3 };
+ constexpr wstring_view wsv {L"123", 3 };
+
+ static_assert ( *sv.begin() == sv[0], "" );
+ static_assert ( *u16sv.begin() == u16sv[0], "" );
+ static_assert ( *u32sv.begin() == u32sv[0], "" );
+ static_assert ( *wsv.begin() == wsv[0], "" );
+
+ static_assert ( *sv.cbegin() == sv[0], "" );
+ static_assert ( *u16sv.cbegin() == u16sv[0], "" );
+ static_assert ( *u32sv.cbegin() == u32sv[0], "" );
+ static_assert ( *wsv.cbegin() == wsv[0], "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.iterators/end.pass.cpp b/test/std/strings/string.view/string.view.iterators/end.pass.cpp
new file mode 100644
index 000000000000..b5759d701612
--- /dev/null
+++ b/test/std/strings/string.view/string.view.iterators/end.pass.cpp
@@ -0,0 +1,88 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr const_iterator end() const;
+
+#include <string_view>
+#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
+
+template <class S>
+void
+test(S s)
+{
+ const S& cs = s;
+ typename S::iterator e = s.end();
+ typename S::const_iterator ce1 = cs.end();
+ typename S::const_iterator ce2 = s.cend();
+
+ if (s.empty())
+ {
+ assert( e == s.begin());
+ assert(ce1 == cs.begin());
+ assert(ce2 == s.begin());
+ }
+ else
+ {
+ assert( e != s.begin());
+ assert(ce1 != cs.begin());
+ assert(ce2 != s.begin());
+ }
+
+ assert(static_cast<std::size_t>( e - s.begin()) == s.size());
+ assert(static_cast<std::size_t>(ce1 - cs.begin()) == cs.size());
+ assert(static_cast<std::size_t>(ce2 - s.cbegin()) == s.size());
+
+ assert( e == ce1);
+ assert( e == ce2);
+ assert(ce1 == ce2);
+}
+
+
+int main()
+{
+ typedef std::string_view string_view;
+ typedef std::u16string_view u16string_view;
+ typedef std::u32string_view u32string_view;
+ typedef std::wstring_view wstring_view;
+
+ test(string_view ());
+ test(u16string_view());
+ test(u32string_view());
+ test(wstring_view ());
+ test(string_view ( "123"));
+ test(wstring_view (L"123"));
+#if TEST_STD_VER >= 11
+ test(u16string_view{u"123"});
+ test(u32string_view{U"123"});
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ constexpr string_view sv { "123", 3 };
+ constexpr u16string_view u16sv {u"123", 3 };
+ constexpr u32string_view u32sv {U"123", 3 };
+ constexpr wstring_view wsv {L"123", 3 };
+
+ static_assert ( sv.begin() != sv.end(), "" );
+ static_assert ( u16sv.begin() != u16sv.end(), "" );
+ static_assert ( u32sv.begin() != u32sv.end(), "" );
+ static_assert ( wsv.begin() != wsv.end(), "" );
+
+ static_assert ( sv.begin() != sv.cend(), "" );
+ static_assert ( u16sv.begin() != u16sv.cend(), "" );
+ static_assert ( u32sv.begin() != u32sv.cend(), "" );
+ static_assert ( wsv.begin() != wsv.cend(), "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp b/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
new file mode 100644
index 000000000000..381f792e5ce0
--- /dev/null
+++ b/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// const_iterator rbegin() const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template <class S>
+void
+test(S s)
+{
+ const S& cs = s;
+ typename S::reverse_iterator b = s.rbegin();
+ typename S::const_reverse_iterator cb1 = cs.rbegin();
+ typename S::const_reverse_iterator cb2 = s.crbegin();
+ if (!s.empty())
+ {
+ const size_t last = s.size() - 1;
+ assert( *b == s[last]);
+ assert( &*b == &s[last]);
+ assert( *cb1 == s[last]);
+ assert(&*cb1 == &s[last]);
+ assert( *cb2 == s[last]);
+ assert(&*cb2 == &s[last]);
+
+ }
+ assert( b == cb1);
+ assert( b == cb2);
+ assert(cb1 == cb2);
+}
+
+
+int main()
+{
+ typedef std::string_view string_view;
+ typedef std::u16string_view u16string_view;
+ typedef std::u32string_view u32string_view;
+ typedef std::wstring_view wstring_view;
+
+ test(string_view ());
+ test(u16string_view());
+ test(u32string_view());
+ test(wstring_view ());
+ test(string_view ( "123"));
+ test(wstring_view (L"123"));
+#if TEST_STD_VER >= 11
+ test(u16string_view{u"123"});
+ test(u32string_view{U"123"});
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.iterators/rend.pass.cpp b/test/std/strings/string.view/string.view.iterators/rend.pass.cpp
new file mode 100644
index 000000000000..ca529fb708dc
--- /dev/null
+++ b/test/std/strings/string.view/string.view.iterators/rend.pass.cpp
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr const_iterator rend() const;
+
+#include <string_view>
+#include <cassert>
+#include <cstddef>
+
+#include "test_macros.h"
+
+template <class S>
+void
+test(S s)
+{
+ const S& cs = s;
+ typename S::reverse_iterator e = s.rend();
+ typename S::const_reverse_iterator ce1 = cs.rend();
+ typename S::const_reverse_iterator ce2 = s.crend();
+
+ if (s.empty())
+ {
+ assert( e == s.rbegin());
+ assert(ce1 == cs.rbegin());
+ assert(ce2 == s.rbegin());
+ }
+ else
+ {
+ assert( e != s.rbegin());
+ assert(ce1 != cs.rbegin());
+ assert(ce2 != s.rbegin());
+ }
+
+ assert(static_cast<std::size_t>( e - s.rbegin()) == s.size());
+ assert(static_cast<std::size_t>(ce1 - cs.rbegin()) == cs.size());
+ assert(static_cast<std::size_t>(ce2 - s.crbegin()) == s.size());
+
+ assert( e == ce1);
+ assert( e == ce2);
+ assert(ce1 == ce2);
+}
+
+
+int main()
+{
+ typedef std::string_view string_view;
+ typedef std::u16string_view u16string_view;
+ typedef std::u32string_view u32string_view;
+ typedef std::wstring_view wstring_view;
+
+ test(string_view ());
+ test(u16string_view());
+ test(u32string_view());
+ test(wstring_view ());
+ test(string_view ( "123"));
+ test(wstring_view (L"123"));
+#if TEST_STD_VER >= 11
+ test(u16string_view{u"123"});
+ test(u32string_view{U"123"});
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.modifiers/clear.pass.cpp b/test/std/strings/string.view/string.view.modifiers/clear.pass.cpp
new file mode 100644
index 000000000000..c1137e80acaf
--- /dev/null
+++ b/test/std/strings/string.view/string.view.modifiers/clear.pass.cpp
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// void clear() noexcept
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template<typename CharT>
+void test ( const CharT *s, size_t len ) {
+ typedef std::basic_string_view<CharT> SV;
+ {
+ SV sv1 ( s );
+ assert ( sv1.size() == len );
+ assert ( sv1.data() == s );
+
+ sv1.clear ();
+ assert ( sv1.data() == nullptr );
+ assert ( sv1.size() == 0 );
+ assert ( sv1 == SV());
+ }
+}
+
+#if TEST_STD_VER > 11
+constexpr size_t test_ce ( size_t n ) {
+ typedef std::basic_string_view<char> SV;
+ SV sv1{ "ABCDEFGHIJKL", n };
+ sv1.clear();
+ return sv1.size();
+}
+#endif
+
+int main () {
+ test ( "ABCDE", 5 );
+ test ( "a", 1 );
+ test ( "", 0 );
+
+ test ( L"ABCDE", 5 );
+ test ( L"a", 1 );
+ test ( L"", 0 );
+
+#if TEST_STD_VER >= 11
+ test ( u"ABCDE", 5 );
+ test ( u"a", 1 );
+ test ( u"", 0 );
+
+ test ( U"ABCDE", 5 );
+ test ( U"a", 1 );
+ test ( U"", 0 );
+#endif
+
+#if TEST_STD_VER > 11
+ static_assert ( test_ce (5) == 0, "" );
+#endif
+
+}
diff --git a/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp b/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
new file mode 100644
index 000000000000..f2f6313aed93
--- /dev/null
+++ b/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// void remove_prefix(size_type _n)
+
+#include <string_view>
+#include <cassert>
+#include <iostream>
+
+#include "test_macros.h"
+
+template<typename CharT>
+void test ( const CharT *s, size_t len ) {
+ typedef std::basic_string_view<CharT> SV;
+ {
+ SV sv1 ( s );
+ assert ( sv1.size() == len );
+ assert ( sv1.data() == s );
+
+ if ( len > 0 ) {
+ sv1.remove_prefix ( 1 );
+ assert ( sv1.size() == (len - 1));
+ assert ( sv1.data() == (s + 1));
+ sv1.remove_prefix ( len - 1 );
+ }
+
+ assert ( sv1.size() == 0 );
+ sv1.remove_prefix ( 0 );
+ assert ( sv1.size() == 0 );
+ }
+}
+
+#if TEST_STD_VER > 11
+constexpr size_t test_ce ( size_t n, size_t k ) {
+ typedef std::basic_string_view<char> SV;
+ SV sv1{ "ABCDEFGHIJKL", n };
+ sv1.remove_prefix ( k );
+ return sv1.size();
+}
+#endif
+
+int main () {
+ test ( "ABCDE", 5 );
+ test ( "a", 1 );
+ test ( "", 0 );
+
+ test ( L"ABCDE", 5 );
+ test ( L"a", 1 );
+ test ( L"", 0 );
+
+#if TEST_STD_VER >= 11
+ test ( u"ABCDE", 5 );
+ test ( u"a", 1 );
+ test ( u"", 0 );
+
+ test ( U"ABCDE", 5 );
+ test ( U"a", 1 );
+ test ( U"", 0 );
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ static_assert ( test_ce ( 5, 0 ) == 5, "" );
+ static_assert ( test_ce ( 5, 1 ) == 4, "" );
+ static_assert ( test_ce ( 5, 5 ) == 0, "" );
+ static_assert ( test_ce ( 9, 3 ) == 6, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp b/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
new file mode 100644
index 000000000000..41f8362d3104
--- /dev/null
+++ b/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// void remove_suffix(size_type _n)
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template<typename CharT>
+void test ( const CharT *s, size_t len ) {
+ typedef std::basic_string_view<CharT> SV;
+ {
+ SV sv1 ( s );
+ assert ( sv1.size() == len );
+ assert ( sv1.data() == s );
+
+ if ( len > 0 ) {
+ sv1.remove_suffix ( 1 );
+ assert ( sv1.size() == (len - 1));
+ assert ( sv1.data() == s);
+ sv1.remove_suffix ( len - 1 );
+ }
+
+ assert ( sv1.size() == 0 );
+ sv1.remove_suffix ( 0 );
+ assert ( sv1.size() == 0 );
+ }
+
+}
+
+#if TEST_STD_VER > 11
+constexpr size_t test_ce ( size_t n, size_t k ) {
+ typedef std::basic_string_view<char> SV;
+ SV sv1{ "ABCDEFGHIJKL", n };
+ sv1.remove_suffix ( k );
+ return sv1.size();
+}
+#endif
+
+int main () {
+ test ( "ABCDE", 5 );
+ test ( "a", 1 );
+ test ( "", 0 );
+
+ test ( L"ABCDE", 5 );
+ test ( L"a", 1 );
+ test ( L"", 0 );
+
+#if TEST_STD_VER >= 11
+ test ( u"ABCDE", 5 );
+ test ( u"a", 1 );
+ test ( u"", 0 );
+
+ test ( U"ABCDE", 5 );
+ test ( U"a", 1 );
+ test ( U"", 0 );
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ static_assert ( test_ce ( 5, 0 ) == 5, "" );
+ static_assert ( test_ce ( 5, 1 ) == 4, "" );
+ static_assert ( test_ce ( 5, 5 ) == 0, "" );
+ static_assert ( test_ce ( 9, 3 ) == 6, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp b/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
new file mode 100644
index 000000000000..780fbad5f42b
--- /dev/null
+++ b/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// void swap(basic_string_view& _other) noexcept
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template<typename CharT>
+void test ( const CharT *s, size_t len ) {
+ typedef std::basic_string_view<CharT> SV;
+ {
+ SV sv1(s);
+ SV sv2;
+
+ assert ( sv1.size() == len );
+ assert ( sv1.data() == s );
+ assert ( sv2.size() == 0 );
+
+ sv1.swap ( sv2 );
+ assert ( sv1.size() == 0 );
+ assert ( sv2.size() == len );
+ assert ( sv2.data() == s );
+ }
+
+}
+
+#if TEST_STD_VER > 11
+constexpr size_t test_ce ( size_t n, size_t k ) {
+ typedef std::basic_string_view<char> SV;
+ SV sv1{ "ABCDEFGHIJKL", n };
+ SV sv2 { sv1.data(), k };
+ sv1.swap ( sv2 );
+ return sv1.size();
+}
+#endif
+
+
+int main () {
+ test ( "ABCDE", 5 );
+ test ( "a", 1 );
+ test ( "", 0 );
+
+ test ( L"ABCDE", 5 );
+ test ( L"a", 1 );
+ test ( L"", 0 );
+
+#if TEST_STD_VER >= 11
+ test ( u"ABCDE", 5 );
+ test ( u"a", 1 );
+ test ( u"", 0 );
+
+ test ( U"ABCDE", 5 );
+ test ( U"a", 1 );
+ test ( U"", 0 );
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ static_assert ( test_ce (2, 3) == 3, "" );
+ static_assert ( test_ce (5, 3) == 3, "" );
+ static_assert ( test_ce (0, 1) == 1, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp b/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp
new file mode 100644
index 000000000000..c11e144a0968
--- /dev/null
+++ b/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp
@@ -0,0 +1,214 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <iomanip>
+
+// quoted
+
+#include <iomanip>
+#include <sstream>
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+#if TEST_STD_VER > 11
+// quoted is C++14 only
+
+bool is_skipws ( const std::istream *is ) {
+ return ( is->flags() & std::ios_base::skipws ) != 0;
+ }
+
+
+bool is_skipws ( const std::wistream *is ) {
+ return ( is->flags() & std::ios_base::skipws ) != 0;
+ }
+
+void round_trip ( const char *p ) {
+ std::stringstream ss;
+ bool skippingws = is_skipws ( &ss );
+ std::string_view sv {p};
+
+ ss << std::quoted(sv);
+ std::string s;
+ ss >> std::quoted(s);
+ assert ( s == sv );
+ assert ( skippingws == is_skipws ( &ss ));
+ }
+
+void round_trip_ws ( const char *p ) {
+ std::stringstream ss;
+ std::noskipws ( ss );
+ bool skippingws = is_skipws ( &ss );
+ std::string_view sv {p};
+
+ ss << std::quoted(sv);
+ std::string s;
+ ss >> std::quoted(s);
+ assert ( s == sv );
+ assert ( skippingws == is_skipws ( &ss ));
+ }
+
+void round_trip_d ( const char *p, char delim ) {
+ std::stringstream ss;
+ std::string_view sv {p};
+
+ ss << std::quoted(sv, delim);
+ std::string s;
+ ss >> std::quoted(s, delim);
+ assert ( s == sv );
+ }
+
+void round_trip_e ( const char *p, char escape ) {
+ std::stringstream ss;
+ std::string_view sv {p};
+
+ ss << std::quoted(sv, '"', escape );
+ std::string s;
+ ss >> std::quoted(s, '"', escape );
+ assert ( s == sv );
+ }
+
+
+
+std::string quote ( const char *p, char delim='"', char escape='\\' ) {
+ std::stringstream ss;
+ ss << std::quoted(p, delim, escape);
+ std::string s;
+ ss >> s; // no quote
+ return s;
+}
+
+std::string unquote ( const char *p, char delim='"', char escape='\\' ) {
+ std::stringstream ss;
+ ss << p;
+ std::string s;
+ ss >> std::quoted(s, delim, escape);
+ return s;
+}
+
+
+void round_trip ( const wchar_t *p ) {
+ std::wstringstream ss;
+ bool skippingws = is_skipws ( &ss );
+ std::wstring_view sv {p};
+
+ ss << std::quoted(sv);
+ std::wstring s;
+ ss >> std::quoted(s);
+ assert ( s == sv );
+ assert ( skippingws == is_skipws ( &ss ));
+ }
+
+
+void round_trip_ws ( const wchar_t *p ) {
+ std::wstringstream ss;
+ std::noskipws ( ss );
+ bool skippingws = is_skipws ( &ss );
+ std::wstring_view sv {p};
+
+ ss << std::quoted(sv);
+ std::wstring s;
+ ss >> std::quoted(s);
+ assert ( s == sv );
+ assert ( skippingws == is_skipws ( &ss ));
+ }
+
+void round_trip_d ( const wchar_t *p, wchar_t delim ) {
+ std::wstringstream ss;
+ std::wstring_view sv {p};
+
+ ss << std::quoted(sv, delim);
+ std::wstring s;
+ ss >> std::quoted(s, delim);
+ assert ( s == sv );
+ }
+
+void round_trip_e ( const wchar_t *p, wchar_t escape ) {
+ std::wstringstream ss;
+ std::wstring_view sv {p};
+
+ ss << std::quoted(sv, wchar_t('"'), escape );
+ std::wstring s;
+ ss >> std::quoted(s, wchar_t('"'), escape );
+ assert ( s == sv );
+ }
+
+
+std::wstring quote ( const wchar_t *p, wchar_t delim='"', wchar_t escape='\\' ) {
+ std::wstringstream ss;
+ std::wstring_view sv {p};
+
+ ss << std::quoted(sv, delim, escape);
+ std::wstring s;
+ ss >> s; // no quote
+ return s;
+}
+
+std::wstring unquote ( const wchar_t *p, wchar_t delim='"', wchar_t escape='\\' ) {
+ std::wstringstream ss;
+ std::wstring_view sv {p};
+
+ ss << sv;
+ std::wstring s;
+ ss >> std::quoted(s, delim, escape);
+ return s;
+}
+
+int main()
+{
+ round_trip ( "" );
+ round_trip_ws ( "" );
+ round_trip_d ( "", 'q' );
+ round_trip_e ( "", 'q' );
+
+ round_trip ( L"" );
+ round_trip_ws ( L"" );
+ round_trip_d ( L"", 'q' );
+ round_trip_e ( L"", 'q' );
+
+ round_trip ( "Hi" );
+ round_trip_ws ( "Hi" );
+ round_trip_d ( "Hi", '!' );
+ round_trip_e ( "Hi", '!' );
+ assert ( quote ( "Hi", '!' ) == "!Hi!" );
+ assert ( quote ( "Hi!", '!' ) == R"(!Hi\!!)" );
+
+ round_trip ( L"Hi" );
+ round_trip_ws ( L"Hi" );
+ round_trip_d ( L"Hi", '!' );
+ round_trip_e ( L"Hi", '!' );
+ assert ( quote ( L"Hi", '!' ) == L"!Hi!" );
+ assert ( quote ( L"Hi!", '!' ) == LR"(!Hi\!!)" );
+
+ round_trip ( "Hi Mom" );
+ round_trip_ws ( "Hi Mom" );
+ round_trip ( L"Hi Mom" );
+ round_trip_ws ( L"Hi Mom" );
+
+ assert ( quote ( "" ) == "\"\"" );
+ assert ( quote ( L"" ) == L"\"\"" );
+ assert ( quote ( "a" ) == "\"a\"" );
+ assert ( quote ( L"a" ) == L"\"a\"" );
+
+// missing end quote - must not hang
+ assert ( unquote ( "\"abc" ) == "abc" );
+ assert ( unquote ( L"\"abc" ) == L"abc" );
+
+ assert ( unquote ( "abc" ) == "abc" ); // no delimiter
+ assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter
+ assert ( unquote ( "abc def" ) == "abc" ); // no delimiter
+ assert ( unquote ( L"abc def" ) == L"abc" ); // no delimiter
+
+ assert ( unquote ( "" ) == "" ); // nothing there
+ assert ( unquote ( L"" ) == L"" ); // nothing there
+ }
+#else
+int main() {}
+#endif
diff --git a/test/std/strings/string.view/string.view.ops/compare.pointer.pass.cpp b/test/std/strings/string.view/string.view.ops/compare.pointer.pass.cpp
new file mode 100644
index 000000000000..eb6eb1e97ef5
--- /dev/null
+++ b/test/std/strings/string.view/string.view.ops/compare.pointer.pass.cpp
@@ -0,0 +1,127 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr int compare(const charT* s) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
+
+template<typename CharT>
+void test1 ( std::basic_string_view<CharT> sv1, const CharT *s, int expected ) {
+ assert ( sign( sv1.compare(s)) == sign(expected));
+}
+
+template<typename CharT>
+void
+test( const CharT *s1, const CharT *s2, int expected)
+{
+ typedef std::basic_string_view<CharT> string_view_t;
+ string_view_t sv1 ( s1 );
+ test1 ( sv1, s2, expected );
+}
+
+int main()
+{
+ {
+ test("", "", 0);
+ test("", "abcde", -5);
+ test("", "abcdefghij", -10);
+ test("", "abcdefghijklmnopqrst", -20);
+ test("abcde", "", 5);
+ test("abcde", "abcde", 0);
+ test("abcde", "abcdefghij", -5);
+ test("abcde", "abcdefghijklmnopqrst", -15);
+ test("abcdefghij", "", 10);
+ test("abcdefghij", "abcde", 5);
+ test("abcdefghij", "abcdefghij", 0);
+ test("abcdefghij", "abcdefghijklmnopqrst", -10);
+ test("abcdefghijklmnopqrst", "", 20);
+ test("abcdefghijklmnopqrst", "abcde", 15);
+ test("abcdefghijklmnopqrst", "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", "abcdefghijklmnopqrst", 0);
+ }
+
+ {
+ test(L"", L"", 0);
+ test(L"", L"abcde", -5);
+ test(L"", L"abcdefghij", -10);
+ test(L"", L"abcdefghijklmnopqrst", -20);
+ test(L"abcde", L"", 5);
+ test(L"abcde", L"abcde", 0);
+ test(L"abcde", L"abcdefghij", -5);
+ test(L"abcde", L"abcdefghijklmnopqrst", -15);
+ test(L"abcdefghij", L"", 10);
+ test(L"abcdefghij", L"abcde", 5);
+ test(L"abcdefghij", L"abcdefghij", 0);
+ test(L"abcdefghij", L"abcdefghijklmnopqrst", -10);
+ test(L"abcdefghijklmnopqrst", L"", 20);
+ test(L"abcdefghijklmnopqrst", L"abcde", 15);
+ test(L"abcdefghijklmnopqrst", L"abcdefghij", 10);
+ test(L"abcdefghijklmnopqrst", L"abcdefghijklmnopqrst", 0);
+ }
+
+#if TEST_STD_VER >= 11
+ {
+ test(U"", U"", 0);
+ test(U"", U"abcde", -5);
+ test(U"", U"abcdefghij", -10);
+ test(U"", U"abcdefghijklmnopqrst", -20);
+ test(U"abcde", U"", 5);
+ test(U"abcde", U"abcde", 0);
+ test(U"abcde", U"abcdefghij", -5);
+ test(U"abcde", U"abcdefghijklmnopqrst", -15);
+ test(U"abcdefghij", U"", 10);
+ test(U"abcdefghij", U"abcde", 5);
+ test(U"abcdefghij", U"abcdefghij", 0);
+ test(U"abcdefghij", U"abcdefghijklmnopqrst", -10);
+ test(U"abcdefghijklmnopqrst", U"", 20);
+ test(U"abcdefghijklmnopqrst", U"abcde", 15);
+ test(U"abcdefghijklmnopqrst", U"abcdefghij", 10);
+ test(U"abcdefghijklmnopqrst", U"abcdefghijklmnopqrst", 0);
+ }
+
+ {
+ test(u"", u"", 0);
+ test(u"", u"abcde", -5);
+ test(u"", u"abcdefghij", -10);
+ test(u"", u"abcdefghijklmnopqrst", -20);
+ test(u"abcde", u"", 5);
+ test(u"abcde", u"abcde", 0);
+ test(u"abcde", u"abcdefghij", -5);
+ test(u"abcde", u"abcdefghijklmnopqrst", -15);
+ test(u"abcdefghij", u"", 10);
+ test(u"abcdefghij", u"abcde", 5);
+ test(u"abcdefghij", u"abcdefghij", 0);
+ test(u"abcdefghij", u"abcdefghijklmnopqrst", -10);
+ test(u"abcdefghijklmnopqrst", u"", 20);
+ test(u"abcdefghijklmnopqrst", u"abcde", 15);
+ test(u"abcdefghijklmnopqrst", u"abcdefghij", 10);
+ test(u"abcdefghijklmnopqrst", u"abcdefghijklmnopqrst", 0);
+ }
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+ static_assert ( sv1.compare("") == 0, "" );
+ static_assert ( sv1.compare("abcde") == -1, "" );
+ static_assert ( sv2.compare("") == 1, "" );
+ static_assert ( sv2.compare("abcde") == 0, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp b/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
new file mode 100644
index 000000000000..84f9ce080443
--- /dev/null
+++ b/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
@@ -0,0 +1,452 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr int compare(size_type pos1, size_type n1, const charT* s) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
+
+template<typename CharT>
+void test1 ( std::basic_string_view<CharT> sv1,
+ size_t pos1, size_t n1, const CharT *s, int expected ) {
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (pos1 <= sv1.size())
+ assert(sign(sv1.compare(pos1, n1, s)) == sign(expected));
+#else
+ try {
+ assert(sign(sv1.compare(pos1, n1, s)) == sign(expected));
+ assert(pos1 <= sv1.size());
+ }
+ catch (const std::out_of_range&) {
+ assert(pos1 > sv1.size());
+ }
+#endif
+}
+
+template<typename CharT>
+void
+test( const CharT *s1, size_t pos1, size_t n1, const CharT *s2, int expected)
+{
+ typedef std::basic_string_view<CharT> string_view_t;
+ string_view_t sv1 ( s1 );
+ test1 ( sv1, pos1, n1, s2, expected );
+}
+
+void test0()
+{
+ test("", 0, 0, "", 0);
+ test("", 0, 0, "abcde", -5);
+ test("", 0, 0, "abcdefghij", -10);
+ test("", 0, 0, "abcdefghijklmnopqrst", -20);
+ test("", 0, 1, "", 0);
+ test("", 0, 1, "abcde", -5);
+ test("", 0, 1, "abcdefghij", -10);
+ test("", 0, 1, "abcdefghijklmnopqrst", -20);
+ test("", 1, 0, "", 0);
+ test("", 1, 0, "abcde", 0);
+ test("", 1, 0, "abcdefghij", 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 0);
+ test("abcde", 0, 0, "", 0);
+ test("abcde", 0, 0, "abcde", -5);
+ test("abcde", 0, 0, "abcdefghij", -10);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 0, 1, "", 1);
+ test("abcde", 0, 1, "abcde", -4);
+ test("abcde", 0, 1, "abcdefghij", -9);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", -19);
+ test("abcde", 0, 2, "", 2);
+ test("abcde", 0, 2, "abcde", -3);
+ test("abcde", 0, 2, "abcdefghij", -8);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", -18);
+ test("abcde", 0, 4, "", 4);
+ test("abcde", 0, 4, "abcde", -1);
+ test("abcde", 0, 4, "abcdefghij", -6);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", -16);
+ test("abcde", 0, 5, "", 5);
+ test("abcde", 0, 5, "abcde", 0);
+ test("abcde", 0, 5, "abcdefghij", -5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", -15);
+ test("abcde", 0, 6, "", 5);
+ test("abcde", 0, 6, "abcde", 0);
+ test("abcde", 0, 6, "abcdefghij", -5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", -15);
+ test("abcde", 1, 0, "", 0);
+ test("abcde", 1, 0, "abcde", -5);
+ test("abcde", 1, 0, "abcdefghij", -10);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 1, 1, "", 1);
+ test("abcde", 1, 1, "abcde", 1);
+ test("abcde", 1, 1, "abcdefghij", 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 1);
+ test("abcde", 1, 2, "", 2);
+ test("abcde", 1, 2, "abcde", 1);
+ test("abcde", 1, 2, "abcdefghij", 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 1);
+ test("abcde", 1, 3, "", 3);
+ test("abcde", 1, 3, "abcde", 1);
+ test("abcde", 1, 3, "abcdefghij", 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 1);
+ test("abcde", 1, 4, "", 4);
+ test("abcde", 1, 4, "abcde", 1);
+ test("abcde", 1, 4, "abcdefghij", 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 1);
+ test("abcde", 1, 5, "", 4);
+ test("abcde", 1, 5, "abcde", 1);
+ test("abcde", 1, 5, "abcdefghij", 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 1);
+ test("abcde", 2, 0, "", 0);
+ test("abcde", 2, 0, "abcde", -5);
+ test("abcde", 2, 0, "abcdefghij", -10);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 2, 1, "", 1);
+ test("abcde", 2, 1, "abcde", 2);
+ test("abcde", 2, 1, "abcdefghij", 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 2);
+ test("abcde", 2, 2, "", 2);
+ test("abcde", 2, 2, "abcde", 2);
+ test("abcde", 2, 2, "abcdefghij", 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 2);
+ test("abcde", 2, 3, "", 3);
+ test("abcde", 2, 3, "abcde", 2);
+ test("abcde", 2, 3, "abcdefghij", 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 2);
+ test("abcde", 2, 4, "", 3);
+ test("abcde", 2, 4, "abcde", 2);
+ test("abcde", 2, 4, "abcdefghij", 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 2);
+ test("abcde", 4, 0, "", 0);
+ test("abcde", 4, 0, "abcde", -5);
+ test("abcde", 4, 0, "abcdefghij", -10);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 4, 1, "", 1);
+ test("abcde", 4, 1, "abcde", 4);
+ test("abcde", 4, 1, "abcdefghij", 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 4);
+ test("abcde", 4, 2, "", 1);
+ test("abcde", 4, 2, "abcde", 4);
+ test("abcde", 4, 2, "abcdefghij", 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 4);
+ test("abcde", 5, 0, "", 0);
+ test("abcde", 5, 0, "abcde", -5);
+ test("abcde", 5, 0, "abcdefghij", -10);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 5, 1, "", 0);
+ test("abcde", 5, 1, "abcde", -5);
+ test("abcde", 5, 1, "abcdefghij", -10);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", -20);
+}
+
+void test1()
+{
+ test("abcde", 6, 0, "", 0);
+ test("abcde", 6, 0, "abcde", 0);
+ test("abcde", 6, 0, "abcdefghij", 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 0);
+ test("abcdefghij", 0, 0, "", 0);
+ test("abcdefghij", 0, 0, "abcde", -5);
+ test("abcdefghij", 0, 0, "abcdefghij", -10);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 0, 1, "", 1);
+ test("abcdefghij", 0, 1, "abcde", -4);
+ test("abcdefghij", 0, 1, "abcdefghij", -9);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", -19);
+ test("abcdefghij", 0, 5, "", 5);
+ test("abcdefghij", 0, 5, "abcde", 0);
+ test("abcdefghij", 0, 5, "abcdefghij", -5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", -15);
+ test("abcdefghij", 0, 9, "", 9);
+ test("abcdefghij", 0, 9, "abcde", 4);
+ test("abcdefghij", 0, 9, "abcdefghij", -1);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", -11);
+ test("abcdefghij", 0, 10, "", 10);
+ test("abcdefghij", 0, 10, "abcde", 5);
+ test("abcdefghij", 0, 10, "abcdefghij", 0);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", -10);
+ test("abcdefghij", 0, 11, "", 10);
+ test("abcdefghij", 0, 11, "abcde", 5);
+ test("abcdefghij", 0, 11, "abcdefghij", 0);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", -10);
+ test("abcdefghij", 1, 0, "", 0);
+ test("abcdefghij", 1, 0, "abcde", -5);
+ test("abcdefghij", 1, 0, "abcdefghij", -10);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 1, 1, "", 1);
+ test("abcdefghij", 1, 1, "abcde", 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1);
+ test("abcdefghij", 1, 4, "", 4);
+ test("abcdefghij", 1, 4, "abcde", 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1);
+ test("abcdefghij", 1, 8, "", 8);
+ test("abcdefghij", 1, 8, "abcde", 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1);
+ test("abcdefghij", 1, 9, "", 9);
+ test("abcdefghij", 1, 9, "abcde", 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1);
+ test("abcdefghij", 1, 10, "", 9);
+ test("abcdefghij", 1, 10, "abcde", 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1);
+ test("abcdefghij", 5, 0, "", 0);
+ test("abcdefghij", 5, 0, "abcde", -5);
+ test("abcdefghij", 5, 0, "abcdefghij", -10);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 5, 1, "", 1);
+ test("abcdefghij", 5, 1, "abcde", 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 5);
+ test("abcdefghij", 5, 2, "", 2);
+ test("abcdefghij", 5, 2, "abcde", 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 5);
+ test("abcdefghij", 5, 4, "", 4);
+ test("abcdefghij", 5, 4, "abcde", 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 5);
+ test("abcdefghij", 5, 5, "", 5);
+ test("abcdefghij", 5, 5, "abcde", 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 5);
+ test("abcdefghij", 5, 6, "", 5);
+ test("abcdefghij", 5, 6, "abcde", 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 5);
+ test("abcdefghij", 9, 0, "", 0);
+ test("abcdefghij", 9, 0, "abcde", -5);
+ test("abcdefghij", 9, 0, "abcdefghij", -10);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 9, 1, "", 1);
+ test("abcdefghij", 9, 1, "abcde", 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 9);
+ test("abcdefghij", 9, 2, "", 1);
+ test("abcdefghij", 9, 2, "abcde", 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 9);
+ test("abcdefghij", 10, 0, "", 0);
+ test("abcdefghij", 10, 0, "abcde", -5);
+ test("abcdefghij", 10, 0, "abcdefghij", -10);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 10, 1, "", 0);
+ test("abcdefghij", 10, 1, "abcde", -5);
+ test("abcdefghij", 10, 1, "abcdefghij", -10);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 11, 0, "", 0);
+ test("abcdefghij", 11, 0, "abcde", 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0);
+}
+
+void test2()
+{
+ test("abcdefghijklmnopqrst", 0, 0, "", 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", -5);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 0, 1, "", 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", -4);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", -9);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", -19);
+ test("abcdefghijklmnopqrst", 0, 10, "", 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", -10);
+ test("abcdefghijklmnopqrst", 0, 19, "", 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 14);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", -1);
+ test("abcdefghijklmnopqrst", 0, 20, "", 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 15);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0);
+ test("abcdefghijklmnopqrst", 0, 21, "", 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 15);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0);
+ test("abcdefghijklmnopqrst", 1, 0, "", 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", -5);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 1, 1, "", 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1);
+ test("abcdefghijklmnopqrst", 1, 9, "", 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1);
+ test("abcdefghijklmnopqrst", 1, 18, "", 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1);
+ test("abcdefghijklmnopqrst", 1, 19, "", 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1);
+ test("abcdefghijklmnopqrst", 1, 20, "", 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1);
+ test("abcdefghijklmnopqrst", 10, 0, "", 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", -5);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 10, 1, "", 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10);
+ test("abcdefghijklmnopqrst", 10, 5, "", 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10);
+ test("abcdefghijklmnopqrst", 10, 9, "", 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10);
+ test("abcdefghijklmnopqrst", 10, 10, "", 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10);
+ test("abcdefghijklmnopqrst", 10, 11, "", 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10);
+ test("abcdefghijklmnopqrst", 19, 0, "", 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", -5);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 19, 1, "", 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19);
+ test("abcdefghijklmnopqrst", 19, 2, "", 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19);
+ test("abcdefghijklmnopqrst", 20, 0, "", 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", -5);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 20, 1, "", 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", -5);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 21, 0, "", 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0);
+}
+
+
+int main()
+{
+ test0();
+ test1();
+ test2();
+
+ {
+ test("", 0, 0, "", 0);
+ test("", 0, 0, "abcde", -5);
+ test("", 0, 0, "abcdefghij", -10);
+ test("", 0, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 0, 2, "", 5);
+ test("abcde", 0, 6,"abcde", 0);
+ test("abcde", 0, 6, "abcdefghij", -5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", -15);
+ test("abcdefghij", 3, 3, "", 10);
+ test("abcdefghij", 3, 3,"abcde", 5);
+ test("abcdefghij", 3, 3, "def", 0);
+ test("abcdefghij", 0, 4, "abcdefghijklmnopqrst", -10);
+ test("abcdefghijklmnopqrst", 5, 5, "", 20);
+ test("abcdefghijklmnopqrst", 0, 8, "abcde", 15);
+ test("abcdefghijklmnopqrst", 0, 12, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), "abcdefghijklmnopqrst", 0);
+ }
+
+ {
+ test(L"", 0, 0, L"", 0);
+ test(L"", 0, 0, L"abcde", -5);
+ test(L"", 0, 0, L"abcdefghij", -10);
+ test(L"", 0, 0, L"abcdefghijklmnopqrst", -20);
+ test(L"abcde", 0, 2, L"", 5);
+ test(L"abcde", 0, 6, L"abcde", 0);
+ test(L"abcde", 0, 6, L"abcdefghij", -5);
+ test(L"abcde", 0, 6, L"abcdefghijklmnopqrst", -15);
+ test(L"abcdefghij", 3, 3, L"", 10);
+ test(L"abcdefghij", 3, 3, L"abcde", 5);
+ test(L"abcdefghij", 3, 3, L"def", 0);
+ test(L"abcdefghij", 0, 4, L"abcdefghijklmnopqrst", -10);
+ test(L"abcdefghijklmnopqrst", 5, 5, L"", 20);
+ test(L"abcdefghijklmnopqrst", 0, 8, L"abcde", 15);
+ test(L"abcdefghijklmnopqrst", 0, 12, L"abcdefghij", 10);
+ test(L"abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), L"abcdefghijklmnopqrst", 0);
+ }
+
+#if TEST_STD_VER >= 11
+ {
+ test(U"", 0, 0, U"", 0);
+ test(U"", 0, 0, U"abcde", -5);
+ test(U"", 0, 0, U"abcdefghij", -10);
+ test(U"", 0, 0, U"abcdefghijklmnopqrst", -20);
+ test(U"abcde", 0, 2, U"", 5);
+ test(U"abcde", 0, 6, U"abcde", 0);
+ test(U"abcde", 0, 6, U"abcdefghij", -5);
+ test(U"abcde", 0, 6, U"abcdefghijklmnopqrst", -15);
+ test(U"abcdefghij", 3, 3, U"", 10);
+ test(U"abcdefghij", 3, 3, U"abcde", 5);
+ test(U"abcdefghij", 3, 3, U"def", 0);
+ test(U"abcdefghij", 0, 4, U"abcdefghijklmnopqrst", -10);
+ test(U"abcdefghijklmnopqrst", 5, 5, U"", 20);
+ test(U"abcdefghijklmnopqrst", 0, 8, U"abcde", 15);
+ test(U"abcdefghijklmnopqrst", 0, 12, U"abcdefghij", 10);
+ test(U"abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), U"abcdefghijklmnopqrst", 0);
+ }
+
+ {
+ test(u"", 0, 0, u"", 0);
+ test(u"", 0, 0, u"abcde", -5);
+ test(u"", 0, 0, u"abcdefghij", -10);
+ test(u"", 0, 0, u"abcdefghijklmnopqrst", -20);
+ test(u"abcde", 0, 2, u"", 5);
+ test(u"abcde", 0, 6, u"abcde", 0);
+ test(u"abcde", 0, 6, u"abcdefghij", -5);
+ test(u"abcde", 0, 6, u"abcdefghijklmnopqrst", -15);
+ test(u"abcdefghij", 3, 3, u"", 10);
+ test(u"abcdefghij", 3, 3, u"abcde", 5);
+ test(u"abcdefghij", 3, 3, u"def", 0);
+ test(u"abcdefghij", 0, 4, u"abcdefghijklmnopqrst", -10);
+ test(u"abcdefghijklmnopqrst", 5, 5, u"", 20);
+ test(u"abcdefghijklmnopqrst", 0, 8, u"abcde", 15);
+ test(u"abcdefghijklmnopqrst", 0, 12, u"abcdefghij", 10);
+ test(u"abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), u"abcdefghijklmnopqrst", 0);
+ }
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcde", 5 };
+ static_assert ( sv1.compare(0, 0, "") == 0, "" );
+ static_assert ( sv1.compare(0, 0, "abcde") == -1, "" );
+ static_assert ( sv2.compare(0, 2, "") == 1, "" );
+ static_assert ( sv2.compare(0, 6, "abcde") == 0, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp b/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp
new file mode 100644
index 000000000000..2bef7fdbac1a
--- /dev/null
+++ b/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp
@@ -0,0 +1,401 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr int compare(size_type pos1, size_type n1, basic_string_view str) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
+
+template<typename CharT>
+void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
+ std::basic_string_view<CharT> sv2, int expected ) {
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (pos1 <= sv1.size())
+ assert(sign( sv1.compare(pos1, n1, sv2)) == sign(expected));
+#else
+ try {
+ assert(sign( sv1.compare(pos1, n1, sv2)) == sign(expected));
+ assert(pos1 <= sv1.size());
+ }
+ catch (const std::out_of_range&) {
+ assert(pos1 > sv1.size());
+ }
+#endif
+}
+
+
+template<typename CharT>
+void test ( const CharT *s1, size_t pos1, size_t n1, const CharT *s2, int expected ) {
+ typedef std::basic_string_view<CharT> string_view_t;
+ string_view_t sv1 ( s1 );
+ string_view_t sv2 ( s2 );
+ test1(sv1, pos1, n1, sv2, expected);
+}
+
+void test0()
+{
+ test("", 0, 0, "", 0);
+ test("", 0, 0, "abcde", -5);
+ test("", 0, 0, "abcdefghij", -10);
+ test("", 0, 0, "abcdefghijklmnopqrst", -20);
+ test("", 0, 1, "", 0);
+ test("", 0, 1, "abcde", -5);
+ test("", 0, 1, "abcdefghij", -10);
+ test("", 0, 1, "abcdefghijklmnopqrst", -20);
+ test("", 1, 0, "", 0);
+ test("", 1, 0, "abcde", 0);
+ test("", 1, 0, "abcdefghij", 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 0);
+ test("abcde", 0, 0, "", 0);
+ test("abcde", 0, 0, "abcde", -5);
+ test("abcde", 0, 0, "abcdefghij", -10);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 0, 1, "", 1);
+ test("abcde", 0, 1, "abcde", -4);
+ test("abcde", 0, 1, "abcdefghij", -9);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", -19);
+ test("abcde", 0, 2, "", 2);
+ test("abcde", 0, 2, "abcde", -3);
+ test("abcde", 0, 2, "abcdefghij", -8);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", -18);
+ test("abcde", 0, 4, "", 4);
+ test("abcde", 0, 4, "abcde", -1);
+ test("abcde", 0, 4, "abcdefghij", -6);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", -16);
+ test("abcde", 0, 5, "", 5);
+ test("abcde", 0, 5, "abcde", 0);
+ test("abcde", 0, 5, "abcdefghij", -5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", -15);
+ test("abcde", 0, 6, "", 5);
+ test("abcde", 0, 6, "abcde", 0);
+ test("abcde", 0, 6, "abcdefghij", -5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", -15);
+ test("abcde", 1, 0, "", 0);
+ test("abcde", 1, 0, "abcde", -5);
+ test("abcde", 1, 0, "abcdefghij", -10);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 1, 1, "", 1);
+ test("abcde", 1, 1, "abcde", 1);
+ test("abcde", 1, 1, "abcdefghij", 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 1);
+ test("abcde", 1, 2, "", 2);
+ test("abcde", 1, 2, "abcde", 1);
+ test("abcde", 1, 2, "abcdefghij", 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 1);
+ test("abcde", 1, 3, "", 3);
+ test("abcde", 1, 3, "abcde", 1);
+ test("abcde", 1, 3, "abcdefghij", 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 1);
+ test("abcde", 1, 4, "", 4);
+ test("abcde", 1, 4, "abcde", 1);
+ test("abcde", 1, 4, "abcdefghij", 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 1);
+ test("abcde", 1, 5, "", 4);
+ test("abcde", 1, 5, "abcde", 1);
+ test("abcde", 1, 5, "abcdefghij", 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 1);
+ test("abcde", 2, 0, "", 0);
+ test("abcde", 2, 0, "abcde", -5);
+ test("abcde", 2, 0, "abcdefghij", -10);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 2, 1, "", 1);
+ test("abcde", 2, 1, "abcde", 2);
+ test("abcde", 2, 1, "abcdefghij", 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 2);
+ test("abcde", 2, 2, "", 2);
+ test("abcde", 2, 2, "abcde", 2);
+ test("abcde", 2, 2, "abcdefghij", 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 2);
+ test("abcde", 2, 3, "", 3);
+ test("abcde", 2, 3, "abcde", 2);
+ test("abcde", 2, 3, "abcdefghij", 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 2);
+ test("abcde", 2, 4, "", 3);
+ test("abcde", 2, 4, "abcde", 2);
+ test("abcde", 2, 4, "abcdefghij", 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 2);
+ test("abcde", 4, 0, "", 0);
+ test("abcde", 4, 0, "abcde", -5);
+ test("abcde", 4, 0, "abcdefghij", -10);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 4, 1, "", 1);
+ test("abcde", 4, 1, "abcde", 4);
+ test("abcde", 4, 1, "abcdefghij", 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 4);
+ test("abcde", 4, 2, "", 1);
+ test("abcde", 4, 2, "abcde", 4);
+ test("abcde", 4, 2, "abcdefghij", 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 4);
+ test("abcde", 5, 0, "", 0);
+ test("abcde", 5, 0, "abcde", -5);
+ test("abcde", 5, 0, "abcdefghij", -10);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", -20);
+ test("abcde", 5, 1, "", 0);
+ test("abcde", 5, 1, "abcde", -5);
+ test("abcde", 5, 1, "abcdefghij", -10);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", -20);
+}
+
+void test1()
+{
+ test("abcde", 6, 0, "", 0);
+ test("abcde", 6, 0, "abcde", 0);
+ test("abcde", 6, 0, "abcdefghij", 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 0);
+ test("abcdefghij", 0, 0, "", 0);
+ test("abcdefghij", 0, 0, "abcde", -5);
+ test("abcdefghij", 0, 0, "abcdefghij", -10);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 0, 1, "", 1);
+ test("abcdefghij", 0, 1, "abcde", -4);
+ test("abcdefghij", 0, 1, "abcdefghij", -9);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", -19);
+ test("abcdefghij", 0, 5, "", 5);
+ test("abcdefghij", 0, 5, "abcde", 0);
+ test("abcdefghij", 0, 5, "abcdefghij", -5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", -15);
+ test("abcdefghij", 0, 9, "", 9);
+ test("abcdefghij", 0, 9, "abcde", 4);
+ test("abcdefghij", 0, 9, "abcdefghij", -1);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", -11);
+ test("abcdefghij", 0, 10, "", 10);
+ test("abcdefghij", 0, 10, "abcde", 5);
+ test("abcdefghij", 0, 10, "abcdefghij", 0);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", -10);
+ test("abcdefghij", 0, 11, "", 10);
+ test("abcdefghij", 0, 11, "abcde", 5);
+ test("abcdefghij", 0, 11, "abcdefghij", 0);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", -10);
+ test("abcdefghij", 1, 0, "", 0);
+ test("abcdefghij", 1, 0, "abcde", -5);
+ test("abcdefghij", 1, 0, "abcdefghij", -10);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 1, 1, "", 1);
+ test("abcdefghij", 1, 1, "abcde", 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1);
+ test("abcdefghij", 1, 4, "", 4);
+ test("abcdefghij", 1, 4, "abcde", 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1);
+ test("abcdefghij", 1, 8, "", 8);
+ test("abcdefghij", 1, 8, "abcde", 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1);
+ test("abcdefghij", 1, 9, "", 9);
+ test("abcdefghij", 1, 9, "abcde", 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1);
+ test("abcdefghij", 1, 10, "", 9);
+ test("abcdefghij", 1, 10, "abcde", 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1);
+ test("abcdefghij", 5, 0, "", 0);
+ test("abcdefghij", 5, 0, "abcde", -5);
+ test("abcdefghij", 5, 0, "abcdefghij", -10);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 5, 1, "", 1);
+ test("abcdefghij", 5, 1, "abcde", 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 5);
+ test("abcdefghij", 5, 2, "", 2);
+ test("abcdefghij", 5, 2, "abcde", 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 5);
+ test("abcdefghij", 5, 4, "", 4);
+ test("abcdefghij", 5, 4, "abcde", 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 5);
+ test("abcdefghij", 5, 5, "", 5);
+ test("abcdefghij", 5, 5, "abcde", 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 5);
+ test("abcdefghij", 5, 6, "", 5);
+ test("abcdefghij", 5, 6, "abcde", 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 5);
+ test("abcdefghij", 9, 0, "", 0);
+ test("abcdefghij", 9, 0, "abcde", -5);
+ test("abcdefghij", 9, 0, "abcdefghij", -10);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 9, 1, "", 1);
+ test("abcdefghij", 9, 1, "abcde", 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 9);
+ test("abcdefghij", 9, 2, "", 1);
+ test("abcdefghij", 9, 2, "abcde", 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 9);
+ test("abcdefghij", 10, 0, "", 0);
+ test("abcdefghij", 10, 0, "abcde", -5);
+ test("abcdefghij", 10, 0, "abcdefghij", -10);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 10, 1, "", 0);
+ test("abcdefghij", 10, 1, "abcde", -5);
+ test("abcdefghij", 10, 1, "abcdefghij", -10);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", -20);
+ test("abcdefghij", 11, 0, "", 0);
+ test("abcdefghij", 11, 0, "abcde", 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0);
+}
+
+void test2()
+{
+ test("abcdefghijklmnopqrst", 0, 0, "", 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", -5);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 0, 1, "", 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", -4);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", -9);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", -19);
+ test("abcdefghijklmnopqrst", 0, 10, "", 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", -10);
+ test("abcdefghijklmnopqrst", 0, 19, "", 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 14);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", -1);
+ test("abcdefghijklmnopqrst", 0, 20, "", 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 15);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0);
+ test("abcdefghijklmnopqrst", 0, 21, "", 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 15);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0);
+ test("abcdefghijklmnopqrst", 1, 0, "", 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", -5);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 1, 1, "", 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1);
+ test("abcdefghijklmnopqrst", 1, 9, "", 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1);
+ test("abcdefghijklmnopqrst", 1, 18, "", 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1);
+ test("abcdefghijklmnopqrst", 1, 19, "", 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1);
+ test("abcdefghijklmnopqrst", 1, 20, "", 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1);
+ test("abcdefghijklmnopqrst", 10, 0, "", 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", -5);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 10, 1, "", 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10);
+ test("abcdefghijklmnopqrst", 10, 5, "", 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10);
+ test("abcdefghijklmnopqrst", 10, 9, "", 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10);
+ test("abcdefghijklmnopqrst", 10, 10, "", 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10);
+ test("abcdefghijklmnopqrst", 10, 11, "", 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10);
+ test("abcdefghijklmnopqrst", 19, 0, "", 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", -5);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 19, 1, "", 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19);
+ test("abcdefghijklmnopqrst", 19, 2, "", 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19);
+ test("abcdefghijklmnopqrst", 20, 0, "", 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", -5);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 20, 1, "", 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", -5);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", -10);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", -20);
+ test("abcdefghijklmnopqrst", 21, 0, "", 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0);
+}
+
+
+int main () {
+ test0();
+ test1();
+ test2();
+
+ {
+ test("abcde", 5, 1, "", 0);
+ test("abcde", 2, 4, "", 3);
+ test("abcde", 2, 4, "abcde", 2);
+ test("ABCde", 2, 4, "abcde", -1);
+ }
+
+ {
+ test(L"abcde", 5, 1, L"", 0);
+ test(L"abcde", 2, 4, L"", 3);
+ test(L"abcde", 2, 4, L"abcde", 2);
+ test(L"ABCde", 2, 4, L"abcde", -1);
+ }
+
+#if TEST_STD_VER >= 11
+ {
+ test(u"abcde", 5, 1, u"", 0);
+ test(u"abcde", 2, 4, u"", 3);
+ test(u"abcde", 2, 4, u"abcde", 2);
+ test(u"ABCde", 2, 4, u"abcde", -1);
+ }
+
+ {
+ test(U"abcde", 5, 1, U"", 0);
+ test(U"abcde", 2, 4, U"", 3);
+ test(U"abcde", 2, 4, U"abcde", 2);
+ test(U"ABCde", 2, 4, U"abcde", -1);
+ }
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1 { "abcde", 5 };
+ constexpr SV sv2 { "abcde", 0 };
+ static_assert ( sv1.compare(5, 1, sv2) == 0, "" );
+ static_assert ( sv1.compare(2, 4, sv2) == 1, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp b/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
new file mode 100644
index 000000000000..8256c997b118
--- /dev/null
+++ b/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp
@@ -0,0 +1,1352 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr int compare(size_type pos1, size_type n1,
+// const charT* s, size_type n2) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
+
+template<typename CharT>
+void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
+ const CharT *s2, size_t n2, int expected ) {
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (pos1 <= sv1.size())
+ assert(sign(sv1.compare(pos1, n1, s2, n2)) == sign(expected));
+#else
+ try {
+ assert(sign(sv1.compare(pos1, n1, s2, n2)) == sign(expected));
+ assert(pos1 <= sv1.size());
+ }
+ catch (const std::out_of_range&) {
+ assert(pos1 > sv1.size());
+ }
+#endif
+}
+
+
+template<typename CharT>
+void test ( const CharT *s1, size_t pos1, size_t n1,
+ const CharT *s2, size_t n2,
+ int expected ) {
+ typedef std::basic_string_view<CharT> string_view_t;
+ string_view_t sv1 ( s1 );
+ test1 (sv1, pos1, n1, s2, n2, expected);
+}
+
+
+void test0()
+{
+ test("", 0, 0, "", 0, 0);
+ test("", 0, 0, "abcde", 0, 0);
+ test("", 0, 0, "abcde", 1, -1);
+ test("", 0, 0, "abcde", 2, -2);
+ test("", 0, 0, "abcde", 4, -4);
+ test("", 0, 0, "abcde", 5, -5);
+ test("", 0, 0, "abcdefghij", 0, 0);
+ test("", 0, 0, "abcdefghij", 1, -1);
+ test("", 0, 0, "abcdefghij", 5, -5);
+ test("", 0, 0, "abcdefghij", 9, -9);
+ test("", 0, 0, "abcdefghij", 10, -10);
+ test("", 0, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("", 0, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("", 0, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("", 0, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("", 0, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("", 0, 1, "", 0, 0);
+ test("", 0, 1, "abcde", 0, 0);
+ test("", 0, 1, "abcde", 1, -1);
+ test("", 0, 1, "abcde", 2, -2);
+ test("", 0, 1, "abcde", 4, -4);
+ test("", 0, 1, "abcde", 5, -5);
+ test("", 0, 1, "abcdefghij", 0, 0);
+ test("", 0, 1, "abcdefghij", 1, -1);
+ test("", 0, 1, "abcdefghij", 5, -5);
+ test("", 0, 1, "abcdefghij", 9, -9);
+ test("", 0, 1, "abcdefghij", 10, -10);
+ test("", 0, 1, "abcdefghijklmnopqrst", 0, 0);
+ test("", 0, 1, "abcdefghijklmnopqrst", 1, -1);
+ test("", 0, 1, "abcdefghijklmnopqrst", 10, -10);
+ test("", 0, 1, "abcdefghijklmnopqrst", 19, -19);
+ test("", 0, 1, "abcdefghijklmnopqrst", 20, -20);
+ test("", 1, 0, "", 0, 0);
+ test("", 1, 0, "abcde", 0, 0);
+ test("", 1, 0, "abcde", 1, 0);
+ test("", 1, 0, "abcde", 2, 0);
+ test("", 1, 0, "abcde", 4, 0);
+ test("", 1, 0, "abcde", 5, 0);
+ test("", 1, 0, "abcdefghij", 0, 0);
+ test("", 1, 0, "abcdefghij", 1, 0);
+ test("", 1, 0, "abcdefghij", 5, 0);
+ test("", 1, 0, "abcdefghij", 9, 0);
+ test("", 1, 0, "abcdefghij", 10, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 1, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 10, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 19, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 20, 0);
+ test("abcde", 0, 0, "", 0, 0);
+ test("abcde", 0, 0, "abcde", 0, 0);
+ test("abcde", 0, 0, "abcde", 1, -1);
+ test("abcde", 0, 0, "abcde", 2, -2);
+ test("abcde", 0, 0, "abcde", 4, -4);
+ test("abcde", 0, 0, "abcde", 5, -5);
+ test("abcde", 0, 0, "abcdefghij", 0, 0);
+ test("abcde", 0, 0, "abcdefghij", 1, -1);
+ test("abcde", 0, 0, "abcdefghij", 5, -5);
+ test("abcde", 0, 0, "abcdefghij", 9, -9);
+ test("abcde", 0, 0, "abcdefghij", 10, -10);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcde", 0, 1, "", 0, 1);
+ test("abcde", 0, 1, "abcde", 0, 1);
+ test("abcde", 0, 1, "abcde", 1, 0);
+ test("abcde", 0, 1, "abcde", 2, -1);
+ test("abcde", 0, 1, "abcde", 4, -3);
+ test("abcde", 0, 1, "abcde", 5, -4);
+ test("abcde", 0, 1, "abcdefghij", 0, 1);
+ test("abcde", 0, 1, "abcdefghij", 1, 0);
+ test("abcde", 0, 1, "abcdefghij", 5, -4);
+ test("abcde", 0, 1, "abcdefghij", 9, -8);
+ test("abcde", 0, 1, "abcdefghij", 10, -9);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 0);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, -9);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, -18);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 20, -19);
+ test("abcde", 0, 2, "", 0, 2);
+ test("abcde", 0, 2, "abcde", 0, 2);
+ test("abcde", 0, 2, "abcde", 1, 1);
+ test("abcde", 0, 2, "abcde", 2, 0);
+ test("abcde", 0, 2, "abcde", 4, -2);
+ test("abcde", 0, 2, "abcde", 5, -3);
+ test("abcde", 0, 2, "abcdefghij", 0, 2);
+ test("abcde", 0, 2, "abcdefghij", 1, 1);
+ test("abcde", 0, 2, "abcdefghij", 5, -3);
+ test("abcde", 0, 2, "abcdefghij", 9, -7);
+ test("abcde", 0, 2, "abcdefghij", 10, -8);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 2);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 1);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, -8);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, -17);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 20, -18);
+ test("abcde", 0, 4, "", 0, 4);
+ test("abcde", 0, 4, "abcde", 0, 4);
+ test("abcde", 0, 4, "abcde", 1, 3);
+ test("abcde", 0, 4, "abcde", 2, 2);
+}
+
+
+void test1()
+{
+ test("abcde", 0, 4, "abcde", 4, 0);
+ test("abcde", 0, 4, "abcde", 5, -1);
+ test("abcde", 0, 4, "abcdefghij", 0, 4);
+ test("abcde", 0, 4, "abcdefghij", 1, 3);
+ test("abcde", 0, 4, "abcdefghij", 5, -1);
+ test("abcde", 0, 4, "abcdefghij", 9, -5);
+ test("abcde", 0, 4, "abcdefghij", 10, -6);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 4);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 3);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, -6);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, -15);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 20, -16);
+ test("abcde", 0, 5, "", 0, 5);
+ test("abcde", 0, 5, "abcde", 0, 5);
+ test("abcde", 0, 5, "abcde", 1, 4);
+ test("abcde", 0, 5, "abcde", 2, 3);
+ test("abcde", 0, 5, "abcde", 4, 1);
+ test("abcde", 0, 5, "abcde", 5, 0);
+ test("abcde", 0, 5, "abcdefghij", 0, 5);
+ test("abcde", 0, 5, "abcdefghij", 1, 4);
+ test("abcde", 0, 5, "abcdefghij", 5, 0);
+ test("abcde", 0, 5, "abcdefghij", 9, -4);
+ test("abcde", 0, 5, "abcdefghij", 10, -5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 4);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, -5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, -14);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 20, -15);
+ test("abcde", 0, 6, "", 0, 5);
+ test("abcde", 0, 6, "abcde", 0, 5);
+ test("abcde", 0, 6, "abcde", 1, 4);
+ test("abcde", 0, 6, "abcde", 2, 3);
+ test("abcde", 0, 6, "abcde", 4, 1);
+ test("abcde", 0, 6, "abcde", 5, 0);
+ test("abcde", 0, 6, "abcdefghij", 0, 5);
+ test("abcde", 0, 6, "abcdefghij", 1, 4);
+ test("abcde", 0, 6, "abcdefghij", 5, 0);
+ test("abcde", 0, 6, "abcdefghij", 9, -4);
+ test("abcde", 0, 6, "abcdefghij", 10, -5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 4);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, -5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, -14);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 20, -15);
+ test("abcde", 1, 0, "", 0, 0);
+ test("abcde", 1, 0, "abcde", 0, 0);
+ test("abcde", 1, 0, "abcde", 1, -1);
+ test("abcde", 1, 0, "abcde", 2, -2);
+ test("abcde", 1, 0, "abcde", 4, -4);
+ test("abcde", 1, 0, "abcde", 5, -5);
+ test("abcde", 1, 0, "abcdefghij", 0, 0);
+ test("abcde", 1, 0, "abcdefghij", 1, -1);
+ test("abcde", 1, 0, "abcdefghij", 5, -5);
+ test("abcde", 1, 0, "abcdefghij", 9, -9);
+ test("abcde", 1, 0, "abcdefghij", 10, -10);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcde", 1, 1, "", 0, 1);
+ test("abcde", 1, 1, "abcde", 0, 1);
+ test("abcde", 1, 1, "abcde", 1, 1);
+ test("abcde", 1, 1, "abcde", 2, 1);
+ test("abcde", 1, 1, "abcde", 4, 1);
+ test("abcde", 1, 1, "abcde", 5, 1);
+ test("abcde", 1, 1, "abcdefghij", 0, 1);
+ test("abcde", 1, 1, "abcdefghij", 1, 1);
+ test("abcde", 1, 1, "abcdefghij", 5, 1);
+ test("abcde", 1, 1, "abcdefghij", 9, 1);
+ test("abcde", 1, 1, "abcdefghij", 10, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 20, 1);
+ test("abcde", 1, 2, "", 0, 2);
+ test("abcde", 1, 2, "abcde", 0, 2);
+ test("abcde", 1, 2, "abcde", 1, 1);
+ test("abcde", 1, 2, "abcde", 2, 1);
+ test("abcde", 1, 2, "abcde", 4, 1);
+ test("abcde", 1, 2, "abcde", 5, 1);
+ test("abcde", 1, 2, "abcdefghij", 0, 2);
+ test("abcde", 1, 2, "abcdefghij", 1, 1);
+ test("abcde", 1, 2, "abcdefghij", 5, 1);
+ test("abcde", 1, 2, "abcdefghij", 9, 1);
+ test("abcde", 1, 2, "abcdefghij", 10, 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 2);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 20, 1);
+ test("abcde", 1, 3, "", 0, 3);
+ test("abcde", 1, 3, "abcde", 0, 3);
+ test("abcde", 1, 3, "abcde", 1, 1);
+ test("abcde", 1, 3, "abcde", 2, 1);
+ test("abcde", 1, 3, "abcde", 4, 1);
+ test("abcde", 1, 3, "abcde", 5, 1);
+ test("abcde", 1, 3, "abcdefghij", 0, 3);
+ test("abcde", 1, 3, "abcdefghij", 1, 1);
+}
+
+
+void test2()
+{
+ test("abcde", 1, 3, "abcdefghij", 5, 1);
+ test("abcde", 1, 3, "abcdefghij", 9, 1);
+ test("abcde", 1, 3, "abcdefghij", 10, 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 3);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 20, 1);
+ test("abcde", 1, 4, "", 0, 4);
+ test("abcde", 1, 4, "abcde", 0, 4);
+ test("abcde", 1, 4, "abcde", 1, 1);
+ test("abcde", 1, 4, "abcde", 2, 1);
+ test("abcde", 1, 4, "abcde", 4, 1);
+ test("abcde", 1, 4, "abcde", 5, 1);
+ test("abcde", 1, 4, "abcdefghij", 0, 4);
+ test("abcde", 1, 4, "abcdefghij", 1, 1);
+ test("abcde", 1, 4, "abcdefghij", 5, 1);
+ test("abcde", 1, 4, "abcdefghij", 9, 1);
+ test("abcde", 1, 4, "abcdefghij", 10, 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 4);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 20, 1);
+ test("abcde", 1, 5, "", 0, 4);
+ test("abcde", 1, 5, "abcde", 0, 4);
+ test("abcde", 1, 5, "abcde", 1, 1);
+ test("abcde", 1, 5, "abcde", 2, 1);
+ test("abcde", 1, 5, "abcde", 4, 1);
+ test("abcde", 1, 5, "abcde", 5, 1);
+ test("abcde", 1, 5, "abcdefghij", 0, 4);
+ test("abcde", 1, 5, "abcdefghij", 1, 1);
+ test("abcde", 1, 5, "abcdefghij", 5, 1);
+ test("abcde", 1, 5, "abcdefghij", 9, 1);
+ test("abcde", 1, 5, "abcdefghij", 10, 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 4);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 20, 1);
+ test("abcde", 2, 0, "", 0, 0);
+ test("abcde", 2, 0, "abcde", 0, 0);
+ test("abcde", 2, 0, "abcde", 1, -1);
+ test("abcde", 2, 0, "abcde", 2, -2);
+ test("abcde", 2, 0, "abcde", 4, -4);
+ test("abcde", 2, 0, "abcde", 5, -5);
+ test("abcde", 2, 0, "abcdefghij", 0, 0);
+ test("abcde", 2, 0, "abcdefghij", 1, -1);
+ test("abcde", 2, 0, "abcdefghij", 5, -5);
+ test("abcde", 2, 0, "abcdefghij", 9, -9);
+ test("abcde", 2, 0, "abcdefghij", 10, -10);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcde", 2, 1, "", 0, 1);
+ test("abcde", 2, 1, "abcde", 0, 1);
+ test("abcde", 2, 1, "abcde", 1, 2);
+ test("abcde", 2, 1, "abcde", 2, 2);
+ test("abcde", 2, 1, "abcde", 4, 2);
+ test("abcde", 2, 1, "abcde", 5, 2);
+ test("abcde", 2, 1, "abcdefghij", 0, 1);
+ test("abcde", 2, 1, "abcdefghij", 1, 2);
+ test("abcde", 2, 1, "abcdefghij", 5, 2);
+ test("abcde", 2, 1, "abcdefghij", 9, 2);
+ test("abcde", 2, 1, "abcdefghij", 10, 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 20, 2);
+ test("abcde", 2, 2, "", 0, 2);
+ test("abcde", 2, 2, "abcde", 0, 2);
+ test("abcde", 2, 2, "abcde", 1, 2);
+ test("abcde", 2, 2, "abcde", 2, 2);
+ test("abcde", 2, 2, "abcde", 4, 2);
+ test("abcde", 2, 2, "abcde", 5, 2);
+ test("abcde", 2, 2, "abcdefghij", 0, 2);
+ test("abcde", 2, 2, "abcdefghij", 1, 2);
+ test("abcde", 2, 2, "abcdefghij", 5, 2);
+ test("abcde", 2, 2, "abcdefghij", 9, 2);
+ test("abcde", 2, 2, "abcdefghij", 10, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 20, 2);
+ test("abcde", 2, 3, "", 0, 3);
+ test("abcde", 2, 3, "abcde", 0, 3);
+ test("abcde", 2, 3, "abcde", 1, 2);
+ test("abcde", 2, 3, "abcde", 2, 2);
+ test("abcde", 2, 3, "abcde", 4, 2);
+ test("abcde", 2, 3, "abcde", 5, 2);
+ test("abcde", 2, 3, "abcdefghij", 0, 3);
+ test("abcde", 2, 3, "abcdefghij", 1, 2);
+ test("abcde", 2, 3, "abcdefghij", 5, 2);
+ test("abcde", 2, 3, "abcdefghij", 9, 2);
+ test("abcde", 2, 3, "abcdefghij", 10, 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 3);
+}
+
+
+void test3()
+{
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 20, 2);
+ test("abcde", 2, 4, "", 0, 3);
+ test("abcde", 2, 4, "abcde", 0, 3);
+ test("abcde", 2, 4, "abcde", 1, 2);
+ test("abcde", 2, 4, "abcde", 2, 2);
+ test("abcde", 2, 4, "abcde", 4, 2);
+ test("abcde", 2, 4, "abcde", 5, 2);
+ test("abcde", 2, 4, "abcdefghij", 0, 3);
+ test("abcde", 2, 4, "abcdefghij", 1, 2);
+ test("abcde", 2, 4, "abcdefghij", 5, 2);
+ test("abcde", 2, 4, "abcdefghij", 9, 2);
+ test("abcde", 2, 4, "abcdefghij", 10, 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 3);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 20, 2);
+ test("abcde", 4, 0, "", 0, 0);
+ test("abcde", 4, 0, "abcde", 0, 0);
+ test("abcde", 4, 0, "abcde", 1, -1);
+ test("abcde", 4, 0, "abcde", 2, -2);
+ test("abcde", 4, 0, "abcde", 4, -4);
+ test("abcde", 4, 0, "abcde", 5, -5);
+ test("abcde", 4, 0, "abcdefghij", 0, 0);
+ test("abcde", 4, 0, "abcdefghij", 1, -1);
+ test("abcde", 4, 0, "abcdefghij", 5, -5);
+ test("abcde", 4, 0, "abcdefghij", 9, -9);
+ test("abcde", 4, 0, "abcdefghij", 10, -10);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcde", 4, 1, "", 0, 1);
+ test("abcde", 4, 1, "abcde", 0, 1);
+ test("abcde", 4, 1, "abcde", 1, 4);
+ test("abcde", 4, 1, "abcde", 2, 4);
+ test("abcde", 4, 1, "abcde", 4, 4);
+ test("abcde", 4, 1, "abcde", 5, 4);
+ test("abcde", 4, 1, "abcdefghij", 0, 1);
+ test("abcde", 4, 1, "abcdefghij", 1, 4);
+ test("abcde", 4, 1, "abcdefghij", 5, 4);
+ test("abcde", 4, 1, "abcdefghij", 9, 4);
+ test("abcde", 4, 1, "abcdefghij", 10, 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 20, 4);
+ test("abcde", 4, 2, "", 0, 1);
+ test("abcde", 4, 2, "abcde", 0, 1);
+ test("abcde", 4, 2, "abcde", 1, 4);
+ test("abcde", 4, 2, "abcde", 2, 4);
+ test("abcde", 4, 2, "abcde", 4, 4);
+ test("abcde", 4, 2, "abcde", 5, 4);
+ test("abcde", 4, 2, "abcdefghij", 0, 1);
+ test("abcde", 4, 2, "abcdefghij", 1, 4);
+ test("abcde", 4, 2, "abcdefghij", 5, 4);
+ test("abcde", 4, 2, "abcdefghij", 9, 4);
+ test("abcde", 4, 2, "abcdefghij", 10, 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 1);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 20, 4);
+ test("abcde", 5, 0, "", 0, 0);
+ test("abcde", 5, 0, "abcde", 0, 0);
+ test("abcde", 5, 0, "abcde", 1, -1);
+ test("abcde", 5, 0, "abcde", 2, -2);
+ test("abcde", 5, 0, "abcde", 4, -4);
+ test("abcde", 5, 0, "abcde", 5, -5);
+ test("abcde", 5, 0, "abcdefghij", 0, 0);
+ test("abcde", 5, 0, "abcdefghij", 1, -1);
+ test("abcde", 5, 0, "abcdefghij", 5, -5);
+ test("abcde", 5, 0, "abcdefghij", 9, -9);
+ test("abcde", 5, 0, "abcdefghij", 10, -10);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcde", 5, 1, "", 0, 0);
+ test("abcde", 5, 1, "abcde", 0, 0);
+ test("abcde", 5, 1, "abcde", 1, -1);
+ test("abcde", 5, 1, "abcde", 2, -2);
+ test("abcde", 5, 1, "abcde", 4, -4);
+ test("abcde", 5, 1, "abcde", 5, -5);
+ test("abcde", 5, 1, "abcdefghij", 0, 0);
+ test("abcde", 5, 1, "abcdefghij", 1, -1);
+ test("abcde", 5, 1, "abcdefghij", 5, -5);
+ test("abcde", 5, 1, "abcdefghij", 9, -9);
+ test("abcde", 5, 1, "abcdefghij", 10, -10);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 0);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, -1);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, -10);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, -19);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 20, -20);
+}
+
+
+void test4()
+{
+ test("abcde", 6, 0, "", 0, 0);
+ test("abcde", 6, 0, "abcde", 0, 0);
+ test("abcde", 6, 0, "abcde", 1, 0);
+ test("abcde", 6, 0, "abcde", 2, 0);
+ test("abcde", 6, 0, "abcde", 4, 0);
+ test("abcde", 6, 0, "abcde", 5, 0);
+ test("abcde", 6, 0, "abcdefghij", 0, 0);
+ test("abcde", 6, 0, "abcdefghij", 1, 0);
+ test("abcde", 6, 0, "abcdefghij", 5, 0);
+ test("abcde", 6, 0, "abcdefghij", 9, 0);
+ test("abcde", 6, 0, "abcdefghij", 10, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 20, 0);
+ test("abcdefghij", 0, 0, "", 0, 0);
+ test("abcdefghij", 0, 0, "abcde", 0, 0);
+ test("abcdefghij", 0, 0, "abcde", 1, -1);
+ test("abcdefghij", 0, 0, "abcde", 2, -2);
+ test("abcdefghij", 0, 0, "abcde", 4, -4);
+ test("abcdefghij", 0, 0, "abcde", 5, -5);
+ test("abcdefghij", 0, 0, "abcdefghij", 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghij", 1, -1);
+ test("abcdefghij", 0, 0, "abcdefghij", 5, -5);
+ test("abcdefghij", 0, 0, "abcdefghij", 9, -9);
+ test("abcdefghij", 0, 0, "abcdefghij", 10, -10);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghij", 0, 1, "", 0, 1);
+ test("abcdefghij", 0, 1, "abcde", 0, 1);
+ test("abcdefghij", 0, 1, "abcde", 1, 0);
+ test("abcdefghij", 0, 1, "abcde", 2, -1);
+ test("abcdefghij", 0, 1, "abcde", 4, -3);
+ test("abcdefghij", 0, 1, "abcde", 5, -4);
+ test("abcdefghij", 0, 1, "abcdefghij", 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghij", 1, 0);
+ test("abcdefghij", 0, 1, "abcdefghij", 5, -4);
+ test("abcdefghij", 0, 1, "abcdefghij", 9, -8);
+ test("abcdefghij", 0, 1, "abcdefghij", 10, -9);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 0);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, -9);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, -18);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 20, -19);
+ test("abcdefghij", 0, 5, "", 0, 5);
+ test("abcdefghij", 0, 5, "abcde", 0, 5);
+ test("abcdefghij", 0, 5, "abcde", 1, 4);
+ test("abcdefghij", 0, 5, "abcde", 2, 3);
+ test("abcdefghij", 0, 5, "abcde", 4, 1);
+ test("abcdefghij", 0, 5, "abcde", 5, 0);
+ test("abcdefghij", 0, 5, "abcdefghij", 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghij", 1, 4);
+ test("abcdefghij", 0, 5, "abcdefghij", 5, 0);
+ test("abcdefghij", 0, 5, "abcdefghij", 9, -4);
+ test("abcdefghij", 0, 5, "abcdefghij", 10, -5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 4);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, -5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, -14);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 20, -15);
+ test("abcdefghij", 0, 9, "", 0, 9);
+ test("abcdefghij", 0, 9, "abcde", 0, 9);
+ test("abcdefghij", 0, 9, "abcde", 1, 8);
+ test("abcdefghij", 0, 9, "abcde", 2, 7);
+ test("abcdefghij", 0, 9, "abcde", 4, 5);
+ test("abcdefghij", 0, 9, "abcde", 5, 4);
+ test("abcdefghij", 0, 9, "abcdefghij", 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghij", 1, 8);
+ test("abcdefghij", 0, 9, "abcdefghij", 5, 4);
+ test("abcdefghij", 0, 9, "abcdefghij", 9, 0);
+ test("abcdefghij", 0, 9, "abcdefghij", 10, -1);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 8);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, -1);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, -10);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 20, -11);
+ test("abcdefghij", 0, 10, "", 0, 10);
+ test("abcdefghij", 0, 10, "abcde", 0, 10);
+ test("abcdefghij", 0, 10, "abcde", 1, 9);
+ test("abcdefghij", 0, 10, "abcde", 2, 8);
+ test("abcdefghij", 0, 10, "abcde", 4, 6);
+ test("abcdefghij", 0, 10, "abcde", 5, 5);
+ test("abcdefghij", 0, 10, "abcdefghij", 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghij", 1, 9);
+ test("abcdefghij", 0, 10, "abcdefghij", 5, 5);
+ test("abcdefghij", 0, 10, "abcdefghij", 9, 1);
+ test("abcdefghij", 0, 10, "abcdefghij", 10, 0);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 9);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 0);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, -9);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 20, -10);
+ test("abcdefghij", 0, 11, "", 0, 10);
+ test("abcdefghij", 0, 11, "abcde", 0, 10);
+ test("abcdefghij", 0, 11, "abcde", 1, 9);
+ test("abcdefghij", 0, 11, "abcde", 2, 8);
+}
+
+
+void test5()
+{
+ test("abcdefghij", 0, 11, "abcde", 4, 6);
+ test("abcdefghij", 0, 11, "abcde", 5, 5);
+ test("abcdefghij", 0, 11, "abcdefghij", 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghij", 1, 9);
+ test("abcdefghij", 0, 11, "abcdefghij", 5, 5);
+ test("abcdefghij", 0, 11, "abcdefghij", 9, 1);
+ test("abcdefghij", 0, 11, "abcdefghij", 10, 0);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 9);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 0);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, -9);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 20, -10);
+ test("abcdefghij", 1, 0, "", 0, 0);
+ test("abcdefghij", 1, 0, "abcde", 0, 0);
+ test("abcdefghij", 1, 0, "abcde", 1, -1);
+ test("abcdefghij", 1, 0, "abcde", 2, -2);
+ test("abcdefghij", 1, 0, "abcde", 4, -4);
+ test("abcdefghij", 1, 0, "abcde", 5, -5);
+ test("abcdefghij", 1, 0, "abcdefghij", 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghij", 1, -1);
+ test("abcdefghij", 1, 0, "abcdefghij", 5, -5);
+ test("abcdefghij", 1, 0, "abcdefghij", 9, -9);
+ test("abcdefghij", 1, 0, "abcdefghij", 10, -10);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghij", 1, 1, "", 0, 1);
+ test("abcdefghij", 1, 1, "abcde", 0, 1);
+ test("abcdefghij", 1, 1, "abcde", 1, 1);
+ test("abcdefghij", 1, 1, "abcde", 2, 1);
+ test("abcdefghij", 1, 1, "abcde", 4, 1);
+ test("abcdefghij", 1, 1, "abcde", 5, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 1, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 5, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 9, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 10, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 20, 1);
+ test("abcdefghij", 1, 4, "", 0, 4);
+ test("abcdefghij", 1, 4, "abcde", 0, 4);
+ test("abcdefghij", 1, 4, "abcde", 1, 1);
+ test("abcdefghij", 1, 4, "abcde", 2, 1);
+ test("abcdefghij", 1, 4, "abcde", 4, 1);
+ test("abcdefghij", 1, 4, "abcde", 5, 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghij", 1, 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 5, 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 9, 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 10, 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 20, 1);
+ test("abcdefghij", 1, 8, "", 0, 8);
+ test("abcdefghij", 1, 8, "abcde", 0, 8);
+ test("abcdefghij", 1, 8, "abcde", 1, 1);
+ test("abcdefghij", 1, 8, "abcde", 2, 1);
+ test("abcdefghij", 1, 8, "abcde", 4, 1);
+ test("abcdefghij", 1, 8, "abcde", 5, 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghij", 1, 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 5, 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 9, 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 10, 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 20, 1);
+ test("abcdefghij", 1, 9, "", 0, 9);
+ test("abcdefghij", 1, 9, "abcde", 0, 9);
+ test("abcdefghij", 1, 9, "abcde", 1, 1);
+ test("abcdefghij", 1, 9, "abcde", 2, 1);
+ test("abcdefghij", 1, 9, "abcde", 4, 1);
+ test("abcdefghij", 1, 9, "abcde", 5, 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghij", 1, 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 5, 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 9, 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 10, 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 20, 1);
+ test("abcdefghij", 1, 10, "", 0, 9);
+ test("abcdefghij", 1, 10, "abcde", 0, 9);
+ test("abcdefghij", 1, 10, "abcde", 1, 1);
+ test("abcdefghij", 1, 10, "abcde", 2, 1);
+ test("abcdefghij", 1, 10, "abcde", 4, 1);
+ test("abcdefghij", 1, 10, "abcde", 5, 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghij", 1, 1);
+}
+
+
+void test6()
+{
+ test("abcdefghij", 1, 10, "abcdefghij", 5, 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 9, 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 10, 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 20, 1);
+ test("abcdefghij", 5, 0, "", 0, 0);
+ test("abcdefghij", 5, 0, "abcde", 0, 0);
+ test("abcdefghij", 5, 0, "abcde", 1, -1);
+ test("abcdefghij", 5, 0, "abcde", 2, -2);
+ test("abcdefghij", 5, 0, "abcde", 4, -4);
+ test("abcdefghij", 5, 0, "abcde", 5, -5);
+ test("abcdefghij", 5, 0, "abcdefghij", 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghij", 1, -1);
+ test("abcdefghij", 5, 0, "abcdefghij", 5, -5);
+ test("abcdefghij", 5, 0, "abcdefghij", 9, -9);
+ test("abcdefghij", 5, 0, "abcdefghij", 10, -10);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghij", 5, 1, "", 0, 1);
+ test("abcdefghij", 5, 1, "abcde", 0, 1);
+ test("abcdefghij", 5, 1, "abcde", 1, 5);
+ test("abcdefghij", 5, 1, "abcde", 2, 5);
+ test("abcdefghij", 5, 1, "abcde", 4, 5);
+ test("abcdefghij", 5, 1, "abcde", 5, 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghij", 1, 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 5, 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 9, 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 10, 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 20, 5);
+ test("abcdefghij", 5, 2, "", 0, 2);
+ test("abcdefghij", 5, 2, "abcde", 0, 2);
+ test("abcdefghij", 5, 2, "abcde", 1, 5);
+ test("abcdefghij", 5, 2, "abcde", 2, 5);
+ test("abcdefghij", 5, 2, "abcde", 4, 5);
+ test("abcdefghij", 5, 2, "abcde", 5, 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghij", 1, 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 5, 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 9, 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 10, 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 20, 5);
+ test("abcdefghij", 5, 4, "", 0, 4);
+ test("abcdefghij", 5, 4, "abcde", 0, 4);
+ test("abcdefghij", 5, 4, "abcde", 1, 5);
+ test("abcdefghij", 5, 4, "abcde", 2, 5);
+ test("abcdefghij", 5, 4, "abcde", 4, 5);
+ test("abcdefghij", 5, 4, "abcde", 5, 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 1, 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 5, 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 9, 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 10, 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 20, 5);
+ test("abcdefghij", 5, 5, "", 0, 5);
+ test("abcdefghij", 5, 5, "abcde", 0, 5);
+ test("abcdefghij", 5, 5, "abcde", 1, 5);
+ test("abcdefghij", 5, 5, "abcde", 2, 5);
+ test("abcdefghij", 5, 5, "abcde", 4, 5);
+ test("abcdefghij", 5, 5, "abcde", 5, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 1, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 5, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 9, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 10, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 20, 5);
+ test("abcdefghij", 5, 6, "", 0, 5);
+ test("abcdefghij", 5, 6, "abcde", 0, 5);
+ test("abcdefghij", 5, 6, "abcde", 1, 5);
+ test("abcdefghij", 5, 6, "abcde", 2, 5);
+ test("abcdefghij", 5, 6, "abcde", 4, 5);
+ test("abcdefghij", 5, 6, "abcde", 5, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 1, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 5, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 9, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 10, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 5);
+}
+
+
+void test7()
+{
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 20, 5);
+ test("abcdefghij", 9, 0, "", 0, 0);
+ test("abcdefghij", 9, 0, "abcde", 0, 0);
+ test("abcdefghij", 9, 0, "abcde", 1, -1);
+ test("abcdefghij", 9, 0, "abcde", 2, -2);
+ test("abcdefghij", 9, 0, "abcde", 4, -4);
+ test("abcdefghij", 9, 0, "abcde", 5, -5);
+ test("abcdefghij", 9, 0, "abcdefghij", 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghij", 1, -1);
+ test("abcdefghij", 9, 0, "abcdefghij", 5, -5);
+ test("abcdefghij", 9, 0, "abcdefghij", 9, -9);
+ test("abcdefghij", 9, 0, "abcdefghij", 10, -10);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghij", 9, 1, "", 0, 1);
+ test("abcdefghij", 9, 1, "abcde", 0, 1);
+ test("abcdefghij", 9, 1, "abcde", 1, 9);
+ test("abcdefghij", 9, 1, "abcde", 2, 9);
+ test("abcdefghij", 9, 1, "abcde", 4, 9);
+ test("abcdefghij", 9, 1, "abcde", 5, 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghij", 1, 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 5, 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 9, 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 10, 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 20, 9);
+ test("abcdefghij", 9, 2, "", 0, 1);
+ test("abcdefghij", 9, 2, "abcde", 0, 1);
+ test("abcdefghij", 9, 2, "abcde", 1, 9);
+ test("abcdefghij", 9, 2, "abcde", 2, 9);
+ test("abcdefghij", 9, 2, "abcde", 4, 9);
+ test("abcdefghij", 9, 2, "abcde", 5, 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghij", 1, 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 5, 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 9, 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 10, 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 20, 9);
+ test("abcdefghij", 10, 0, "", 0, 0);
+ test("abcdefghij", 10, 0, "abcde", 0, 0);
+ test("abcdefghij", 10, 0, "abcde", 1, -1);
+ test("abcdefghij", 10, 0, "abcde", 2, -2);
+ test("abcdefghij", 10, 0, "abcde", 4, -4);
+ test("abcdefghij", 10, 0, "abcde", 5, -5);
+ test("abcdefghij", 10, 0, "abcdefghij", 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghij", 1, -1);
+ test("abcdefghij", 10, 0, "abcdefghij", 5, -5);
+ test("abcdefghij", 10, 0, "abcdefghij", 9, -9);
+ test("abcdefghij", 10, 0, "abcdefghij", 10, -10);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghij", 10, 1, "", 0, 0);
+ test("abcdefghij", 10, 1, "abcde", 0, 0);
+ test("abcdefghij", 10, 1, "abcde", 1, -1);
+ test("abcdefghij", 10, 1, "abcde", 2, -2);
+ test("abcdefghij", 10, 1, "abcde", 4, -4);
+ test("abcdefghij", 10, 1, "abcde", 5, -5);
+ test("abcdefghij", 10, 1, "abcdefghij", 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghij", 1, -1);
+ test("abcdefghij", 10, 1, "abcdefghij", 5, -5);
+ test("abcdefghij", 10, 1, "abcdefghij", 9, -9);
+ test("abcdefghij", 10, 1, "abcdefghij", 10, -10);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghij", 11, 0, "", 0, 0);
+ test("abcdefghij", 11, 0, "abcde", 0, 0);
+ test("abcdefghij", 11, 0, "abcde", 1, 0);
+ test("abcdefghij", 11, 0, "abcde", 2, 0);
+ test("abcdefghij", 11, 0, "abcde", 4, 0);
+ test("abcdefghij", 11, 0, "abcde", 5, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 5, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 9, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 10, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 20, 0);
+}
+
+void test8()
+{
+ test("abcdefghijklmnopqrst", 0, 0, "", 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, -2);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, -4);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 5, -5);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, -5);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, -9);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 10, -10);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghijklmnopqrst", 0, 1, "", 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 0);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, -3);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 5, -4);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 0);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, -4);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, -8);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 10, -9);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 0);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, -9);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, -18);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 20, -19);
+ test("abcdefghijklmnopqrst", 0, 10, "", 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 9);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 8);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 6);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 5, 5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 9);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 10, 0);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 9);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 0);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, -9);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 20, -10);
+ test("abcdefghijklmnopqrst", 0, 19, "", 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 18);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 17);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 15);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 5, 14);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 18);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 14);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 10);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 10, 9);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 18);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 9);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 0);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 20, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "", 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 19);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 18);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 16);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 5, 15);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 19);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 15);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 11);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10, 10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 19);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 20, 0);
+ test("abcdefghijklmnopqrst", 0, 21, "", 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 19);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 18);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 16);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 5, 15);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 19);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 15);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 11);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10, 10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 19);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 20, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "", 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, -2);
+}
+
+
+void test9()
+{
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, -4);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 5, -5);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, -5);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, -9);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 10, -10);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghijklmnopqrst", 1, 1, "", 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 5, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 10, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 20, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "", 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 5, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 10, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 20, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "", 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 5, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 10, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 20, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "", 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 5, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 10, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 20, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "", 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 5, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 10, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 20, 1);
+ test("abcdefghijklmnopqrst", 10, 0, "", 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, -2);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, -4);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 5, -5);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, -1);
+}
+
+
+void test10()
+{
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, -5);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, -9);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, -10);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghijklmnopqrst", 10, 1, "", 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 5, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 20, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "", 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 5, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 20, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "", 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 5, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 20, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "", 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 5, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 20, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "", 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 5, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 20, 10);
+ test("abcdefghijklmnopqrst", 19, 0, "", 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, -2);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, -4);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 5, -5);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, -5);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, -9);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 10, -10);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 0);
+}
+
+
+void test11()
+{
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghijklmnopqrst", 19, 1, "", 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 5, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 10, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 20, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "", 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 5, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 10, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 20, 19);
+ test("abcdefghijklmnopqrst", 20, 0, "", 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, -2);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, -4);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 5, -5);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, -5);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, -9);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 10, -10);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghijklmnopqrst", 20, 1, "", 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, -2);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, -4);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 5, -5);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, -5);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, -9);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 10, -10);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, -10);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, -19);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 20, -20);
+ test("abcdefghijklmnopqrst", 21, 0, "", 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 5, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 10, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 20, 0);
+ }
+
+
+int main () {
+ test0();
+ test1();
+ test2();
+ test3();
+ test4();
+ test5();
+ test6();
+ test7();
+ test8();
+ test9();
+ test10();
+ test11();
+
+ {
+ test("", 0, 0, "abcde", 0, 0);
+ test("", 0, 0, "abcde", 1, -1);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, -10);
+ }
+
+ {
+ test(L"", 0, 0, L"abcde", 0, 0);
+ test(L"", 0, 0, L"abcde", 1, -1);
+ test(L"abcdefghijklmnopqrst", 21, 0, L"abcde", 0, 0);
+ test(L"abcdefghijklmnopqrst", 21, 0, L"abcde", 1, 0);
+ test(L"abcdefghijklmnopqrst", 10, 0, L"abcdefghij", 10, -10);
+ }
+
+#if TEST_STD_VER >= 11
+ {
+ test(U"", 0, 0, U"abcde", 0, 0);
+ test(U"", 0, 0, U"abcde", 1, -1);
+ test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 0, 0);
+ test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 1, 0);
+ test(U"abcdefghijklmnopqrst", 10, 0, U"abcdefghij", 10, -10);
+ }
+
+ {
+ test(U"", 0, 0, U"abcde", 0, 0);
+ test(U"", 0, 0, U"abcde", 1, -1);
+ test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 0, 0);
+ test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 1, 0);
+ test(U"abcdefghijklmnopqrst", 10, 0, U"abcdefghij", 10, -10);
+ }
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1;
+ constexpr SV sv2 { "abcdefghijklmnopqrst", 21 };
+ static_assert ( sv1.compare(0, 0, "abcde", 0) == 0, "" );
+ static_assert ( sv1.compare(0, 0, "abcde", 1) == -1, "" );
+ static_assert ( sv2.compare(0, 0, "abcde", 1, 0) == 0, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp b/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
new file mode 100644
index 000000000000..5b47486192cd
--- /dev/null
+++ b/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp
@@ -0,0 +1,5847 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr int compare(size_type pos1, size_type n1, basic_string_view str,
+// size_type pos2, size_type n2) const;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
+
+template<typename CharT>
+void test1 ( std::basic_string_view<CharT> sv1, size_t pos1, size_t n1,
+ std::basic_string_view<CharT> sv2, size_t pos2, size_t n2,
+ int expected ) {
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (pos1 <= sv1.size() && pos2 <= sv2.size())
+ assert (sign( sv1.compare(pos1, n1, sv2, pos2, n2)) == sign(expected));
+#else
+ try {
+ assert (sign( sv1.compare(pos1, n1, sv2, pos2, n2)) == sign(expected));
+ assert(pos1 <= sv1.size() && pos2 <= sv2.size());
+ }
+ catch (const std::out_of_range&) {
+ assert(pos1 > sv1.size() || pos2 > sv2.size());
+ }
+#endif
+}
+
+
+template<typename CharT>
+void test ( const CharT *s1, size_t pos1, size_t n1,
+ const CharT *s2, size_t pos2, size_t n2,
+ int expected ) {
+ typedef std::basic_string_view<CharT> string_view_t;
+
+ string_view_t sv1 ( s1 );
+ string_view_t sv2 ( s2 );
+ test1(sv1, pos1, n1, sv2, pos2, n2, expected);
+}
+
+void test0()
+{
+ test("", 0, 0, "", 0, 0, 0);
+ test("", 0, 0, "", 0, 1, 0);
+ test("", 0, 0, "", 1, 0, 0);
+ test("", 0, 0, "abcde", 0, 0, 0);
+ test("", 0, 0, "abcde", 0, 1, -1);
+ test("", 0, 0, "abcde", 0, 2, -2);
+ test("", 0, 0, "abcde", 0, 4, -4);
+ test("", 0, 0, "abcde", 0, 5, -5);
+ test("", 0, 0, "abcde", 0, 6, -5);
+ test("", 0, 0, "abcde", 1, 0, 0);
+ test("", 0, 0, "abcde", 1, 1, -1);
+ test("", 0, 0, "abcde", 1, 2, -2);
+ test("", 0, 0, "abcde", 1, 3, -3);
+ test("", 0, 0, "abcde", 1, 4, -4);
+ test("", 0, 0, "abcde", 1, 5, -4);
+ test("", 0, 0, "abcde", 2, 0, 0);
+ test("", 0, 0, "abcde", 2, 1, -1);
+ test("", 0, 0, "abcde", 2, 2, -2);
+ test("", 0, 0, "abcde", 2, 3, -3);
+ test("", 0, 0, "abcde", 2, 4, -3);
+ test("", 0, 0, "abcde", 4, 0, 0);
+ test("", 0, 0, "abcde", 4, 1, -1);
+ test("", 0, 0, "abcde", 4, 2, -1);
+ test("", 0, 0, "abcde", 5, 0, 0);
+ test("", 0, 0, "abcde", 5, 1, 0);
+ test("", 0, 0, "abcde", 6, 0, 0);
+ test("", 0, 0, "abcdefghij", 0, 0, 0);
+ test("", 0, 0, "abcdefghij", 0, 1, -1);
+ test("", 0, 0, "abcdefghij", 0, 5, -5);
+ test("", 0, 0, "abcdefghij", 0, 9, -9);
+ test("", 0, 0, "abcdefghij", 0, 10, -10);
+ test("", 0, 0, "abcdefghij", 0, 11, -10);
+ test("", 0, 0, "abcdefghij", 1, 0, 0);
+ test("", 0, 0, "abcdefghij", 1, 1, -1);
+ test("", 0, 0, "abcdefghij", 1, 4, -4);
+ test("", 0, 0, "abcdefghij", 1, 8, -8);
+ test("", 0, 0, "abcdefghij", 1, 9, -9);
+ test("", 0, 0, "abcdefghij", 1, 10, -9);
+ test("", 0, 0, "abcdefghij", 5, 0, 0);
+ test("", 0, 0, "abcdefghij", 5, 1, -1);
+ test("", 0, 0, "abcdefghij", 5, 2, -2);
+ test("", 0, 0, "abcdefghij", 5, 4, -4);
+ test("", 0, 0, "abcdefghij", 5, 5, -5);
+ test("", 0, 0, "abcdefghij", 5, 6, -5);
+ test("", 0, 0, "abcdefghij", 9, 0, 0);
+ test("", 0, 0, "abcdefghij", 9, 1, -1);
+ test("", 0, 0, "abcdefghij", 9, 2, -1);
+ test("", 0, 0, "abcdefghij", 10, 0, 0);
+ test("", 0, 0, "abcdefghij", 10, 1, 0);
+ test("", 0, 0, "abcdefghij", 11, 0, 0);
+ test("", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("", 0, 1, "", 0, 0, 0);
+ test("", 0, 1, "", 0, 1, 0);
+ test("", 0, 1, "", 1, 0, 0);
+ test("", 0, 1, "abcde", 0, 0, 0);
+ test("", 0, 1, "abcde", 0, 1, -1);
+ test("", 0, 1, "abcde", 0, 2, -2);
+ test("", 0, 1, "abcde", 0, 4, -4);
+ test("", 0, 1, "abcde", 0, 5, -5);
+ test("", 0, 1, "abcde", 0, 6, -5);
+ test("", 0, 1, "abcde", 1, 0, 0);
+ test("", 0, 1, "abcde", 1, 1, -1);
+ test("", 0, 1, "abcde", 1, 2, -2);
+ test("", 0, 1, "abcde", 1, 3, -3);
+ test("", 0, 1, "abcde", 1, 4, -4);
+ test("", 0, 1, "abcde", 1, 5, -4);
+ test("", 0, 1, "abcde", 2, 0, 0);
+ test("", 0, 1, "abcde", 2, 1, -1);
+ test("", 0, 1, "abcde", 2, 2, -2);
+ test("", 0, 1, "abcde", 2, 3, -3);
+ test("", 0, 1, "abcde", 2, 4, -3);
+ test("", 0, 1, "abcde", 4, 0, 0);
+ test("", 0, 1, "abcde", 4, 1, -1);
+ test("", 0, 1, "abcde", 4, 2, -1);
+ test("", 0, 1, "abcde", 5, 0, 0);
+ test("", 0, 1, "abcde", 5, 1, 0);
+ test("", 0, 1, "abcde", 6, 0, 0);
+}
+
+void test1()
+{
+ test("", 0, 1, "abcdefghij", 0, 0, 0);
+ test("", 0, 1, "abcdefghij", 0, 1, -1);
+ test("", 0, 1, "abcdefghij", 0, 5, -5);
+ test("", 0, 1, "abcdefghij", 0, 9, -9);
+ test("", 0, 1, "abcdefghij", 0, 10, -10);
+ test("", 0, 1, "abcdefghij", 0, 11, -10);
+ test("", 0, 1, "abcdefghij", 1, 0, 0);
+ test("", 0, 1, "abcdefghij", 1, 1, -1);
+ test("", 0, 1, "abcdefghij", 1, 4, -4);
+ test("", 0, 1, "abcdefghij", 1, 8, -8);
+ test("", 0, 1, "abcdefghij", 1, 9, -9);
+ test("", 0, 1, "abcdefghij", 1, 10, -9);
+ test("", 0, 1, "abcdefghij", 5, 0, 0);
+ test("", 0, 1, "abcdefghij", 5, 1, -1);
+ test("", 0, 1, "abcdefghij", 5, 2, -2);
+ test("", 0, 1, "abcdefghij", 5, 4, -4);
+ test("", 0, 1, "abcdefghij", 5, 5, -5);
+ test("", 0, 1, "abcdefghij", 5, 6, -5);
+ test("", 0, 1, "abcdefghij", 9, 0, 0);
+ test("", 0, 1, "abcdefghij", 9, 1, -1);
+ test("", 0, 1, "abcdefghij", 9, 2, -1);
+ test("", 0, 1, "abcdefghij", 10, 0, 0);
+ test("", 0, 1, "abcdefghij", 10, 1, 0);
+ test("", 0, 1, "abcdefghij", 11, 0, 0);
+ test("", 0, 1, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("", 0, 1, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("", 0, 1, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("", 0, 1, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("", 0, 1, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("", 0, 1, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("", 0, 1, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("", 0, 1, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("", 0, 1, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("", 0, 1, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("", 0, 1, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("", 0, 1, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("", 0, 1, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("", 0, 1, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("", 0, 1, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("", 0, 1, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("", 0, 1, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("", 0, 1, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("", 0, 1, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("", 0, 1, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("", 1, 0, "", 0, 0, 0);
+ test("", 1, 0, "", 0, 1, 0);
+ test("", 1, 0, "", 1, 0, 0);
+ test("", 1, 0, "abcde", 0, 0, 0);
+ test("", 1, 0, "abcde", 0, 1, 0);
+ test("", 1, 0, "abcde", 0, 2, 0);
+ test("", 1, 0, "abcde", 0, 4, 0);
+ test("", 1, 0, "abcde", 0, 5, 0);
+ test("", 1, 0, "abcde", 0, 6, 0);
+ test("", 1, 0, "abcde", 1, 0, 0);
+ test("", 1, 0, "abcde", 1, 1, 0);
+ test("", 1, 0, "abcde", 1, 2, 0);
+ test("", 1, 0, "abcde", 1, 3, 0);
+ test("", 1, 0, "abcde", 1, 4, 0);
+ test("", 1, 0, "abcde", 1, 5, 0);
+ test("", 1, 0, "abcde", 2, 0, 0);
+ test("", 1, 0, "abcde", 2, 1, 0);
+ test("", 1, 0, "abcde", 2, 2, 0);
+ test("", 1, 0, "abcde", 2, 3, 0);
+ test("", 1, 0, "abcde", 2, 4, 0);
+ test("", 1, 0, "abcde", 4, 0, 0);
+ test("", 1, 0, "abcde", 4, 1, 0);
+ test("", 1, 0, "abcde", 4, 2, 0);
+ test("", 1, 0, "abcde", 5, 0, 0);
+ test("", 1, 0, "abcde", 5, 1, 0);
+ test("", 1, 0, "abcde", 6, 0, 0);
+ test("", 1, 0, "abcdefghij", 0, 0, 0);
+ test("", 1, 0, "abcdefghij", 0, 1, 0);
+ test("", 1, 0, "abcdefghij", 0, 5, 0);
+ test("", 1, 0, "abcdefghij", 0, 9, 0);
+ test("", 1, 0, "abcdefghij", 0, 10, 0);
+ test("", 1, 0, "abcdefghij", 0, 11, 0);
+ test("", 1, 0, "abcdefghij", 1, 0, 0);
+ test("", 1, 0, "abcdefghij", 1, 1, 0);
+ test("", 1, 0, "abcdefghij", 1, 4, 0);
+ test("", 1, 0, "abcdefghij", 1, 8, 0);
+ test("", 1, 0, "abcdefghij", 1, 9, 0);
+ test("", 1, 0, "abcdefghij", 1, 10, 0);
+ test("", 1, 0, "abcdefghij", 5, 0, 0);
+ test("", 1, 0, "abcdefghij", 5, 1, 0);
+ test("", 1, 0, "abcdefghij", 5, 2, 0);
+ test("", 1, 0, "abcdefghij", 5, 4, 0);
+ test("", 1, 0, "abcdefghij", 5, 5, 0);
+ test("", 1, 0, "abcdefghij", 5, 6, 0);
+ test("", 1, 0, "abcdefghij", 9, 0, 0);
+ test("", 1, 0, "abcdefghij", 9, 1, 0);
+ test("", 1, 0, "abcdefghij", 9, 2, 0);
+ test("", 1, 0, "abcdefghij", 10, 0, 0);
+ test("", 1, 0, "abcdefghij", 10, 1, 0);
+ test("", 1, 0, "abcdefghij", 11, 0, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 0, 1, 0);
+}
+
+void test2()
+{
+ test("", 1, 0, "abcdefghijklmnopqrst", 0, 10, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 0, 19, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 0, 20, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 0, 21, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 1, 1, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 1, 9, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 1, 18, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 1, 19, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 1, 20, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 10, 1, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 10, 5, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 10, 9, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 10, 10, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 10, 11, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 19, 1, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 19, 2, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 0, 0, "", 0, 0, 0);
+ test("abcde", 0, 0, "", 0, 1, 0);
+ test("abcde", 0, 0, "", 1, 0, 0);
+ test("abcde", 0, 0, "abcde", 0, 0, 0);
+ test("abcde", 0, 0, "abcde", 0, 1, -1);
+ test("abcde", 0, 0, "abcde", 0, 2, -2);
+ test("abcde", 0, 0, "abcde", 0, 4, -4);
+ test("abcde", 0, 0, "abcde", 0, 5, -5);
+ test("abcde", 0, 0, "abcde", 0, 6, -5);
+ test("abcde", 0, 0, "abcde", 1, 0, 0);
+ test("abcde", 0, 0, "abcde", 1, 1, -1);
+ test("abcde", 0, 0, "abcde", 1, 2, -2);
+ test("abcde", 0, 0, "abcde", 1, 3, -3);
+ test("abcde", 0, 0, "abcde", 1, 4, -4);
+ test("abcde", 0, 0, "abcde", 1, 5, -4);
+ test("abcde", 0, 0, "abcde", 2, 0, 0);
+ test("abcde", 0, 0, "abcde", 2, 1, -1);
+ test("abcde", 0, 0, "abcde", 2, 2, -2);
+ test("abcde", 0, 0, "abcde", 2, 3, -3);
+ test("abcde", 0, 0, "abcde", 2, 4, -3);
+ test("abcde", 0, 0, "abcde", 4, 0, 0);
+ test("abcde", 0, 0, "abcde", 4, 1, -1);
+ test("abcde", 0, 0, "abcde", 4, 2, -1);
+ test("abcde", 0, 0, "abcde", 5, 0, 0);
+ test("abcde", 0, 0, "abcde", 5, 1, 0);
+ test("abcde", 0, 0, "abcde", 6, 0, 0);
+ test("abcde", 0, 0, "abcdefghij", 0, 0, 0);
+ test("abcde", 0, 0, "abcdefghij", 0, 1, -1);
+ test("abcde", 0, 0, "abcdefghij", 0, 5, -5);
+ test("abcde", 0, 0, "abcdefghij", 0, 9, -9);
+ test("abcde", 0, 0, "abcdefghij", 0, 10, -10);
+ test("abcde", 0, 0, "abcdefghij", 0, 11, -10);
+ test("abcde", 0, 0, "abcdefghij", 1, 0, 0);
+ test("abcde", 0, 0, "abcdefghij", 1, 1, -1);
+ test("abcde", 0, 0, "abcdefghij", 1, 4, -4);
+ test("abcde", 0, 0, "abcdefghij", 1, 8, -8);
+ test("abcde", 0, 0, "abcdefghij", 1, 9, -9);
+ test("abcde", 0, 0, "abcdefghij", 1, 10, -9);
+ test("abcde", 0, 0, "abcdefghij", 5, 0, 0);
+ test("abcde", 0, 0, "abcdefghij", 5, 1, -1);
+ test("abcde", 0, 0, "abcdefghij", 5, 2, -2);
+ test("abcde", 0, 0, "abcdefghij", 5, 4, -4);
+ test("abcde", 0, 0, "abcdefghij", 5, 5, -5);
+ test("abcde", 0, 0, "abcdefghij", 5, 6, -5);
+ test("abcde", 0, 0, "abcdefghij", 9, 0, 0);
+ test("abcde", 0, 0, "abcdefghij", 9, 1, -1);
+ test("abcde", 0, 0, "abcdefghij", 9, 2, -1);
+ test("abcde", 0, 0, "abcdefghij", 10, 0, 0);
+ test("abcde", 0, 0, "abcdefghij", 10, 1, 0);
+ test("abcde", 0, 0, "abcdefghij", 11, 0, 0);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcde", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 0, 1, "", 0, 0, 1);
+ test("abcde", 0, 1, "", 0, 1, 1);
+ test("abcde", 0, 1, "", 1, 0, 0);
+ test("abcde", 0, 1, "abcde", 0, 0, 1);
+}
+
+void test3()
+{
+ test("abcde", 0, 1, "abcde", 0, 1, 0);
+ test("abcde", 0, 1, "abcde", 0, 2, -1);
+ test("abcde", 0, 1, "abcde", 0, 4, -3);
+ test("abcde", 0, 1, "abcde", 0, 5, -4);
+ test("abcde", 0, 1, "abcde", 0, 6, -4);
+ test("abcde", 0, 1, "abcde", 1, 0, 1);
+ test("abcde", 0, 1, "abcde", 1, 1, -1);
+ test("abcde", 0, 1, "abcde", 1, 2, -1);
+ test("abcde", 0, 1, "abcde", 1, 3, -1);
+ test("abcde", 0, 1, "abcde", 1, 4, -1);
+ test("abcde", 0, 1, "abcde", 1, 5, -1);
+ test("abcde", 0, 1, "abcde", 2, 0, 1);
+ test("abcde", 0, 1, "abcde", 2, 1, -2);
+ test("abcde", 0, 1, "abcde", 2, 2, -2);
+ test("abcde", 0, 1, "abcde", 2, 3, -2);
+ test("abcde", 0, 1, "abcde", 2, 4, -2);
+ test("abcde", 0, 1, "abcde", 4, 0, 1);
+ test("abcde", 0, 1, "abcde", 4, 1, -4);
+ test("abcde", 0, 1, "abcde", 4, 2, -4);
+ test("abcde", 0, 1, "abcde", 5, 0, 1);
+ test("abcde", 0, 1, "abcde", 5, 1, 1);
+ test("abcde", 0, 1, "abcde", 6, 0, 0);
+ test("abcde", 0, 1, "abcdefghij", 0, 0, 1);
+ test("abcde", 0, 1, "abcdefghij", 0, 1, 0);
+ test("abcde", 0, 1, "abcdefghij", 0, 5, -4);
+ test("abcde", 0, 1, "abcdefghij", 0, 9, -8);
+ test("abcde", 0, 1, "abcdefghij", 0, 10, -9);
+ test("abcde", 0, 1, "abcdefghij", 0, 11, -9);
+ test("abcde", 0, 1, "abcdefghij", 1, 0, 1);
+ test("abcde", 0, 1, "abcdefghij", 1, 1, -1);
+ test("abcde", 0, 1, "abcdefghij", 1, 4, -1);
+ test("abcde", 0, 1, "abcdefghij", 1, 8, -1);
+ test("abcde", 0, 1, "abcdefghij", 1, 9, -1);
+ test("abcde", 0, 1, "abcdefghij", 1, 10, -1);
+ test("abcde", 0, 1, "abcdefghij", 5, 0, 1);
+ test("abcde", 0, 1, "abcdefghij", 5, 1, -5);
+ test("abcde", 0, 1, "abcdefghij", 5, 2, -5);
+ test("abcde", 0, 1, "abcdefghij", 5, 4, -5);
+ test("abcde", 0, 1, "abcdefghij", 5, 5, -5);
+ test("abcde", 0, 1, "abcdefghij", 5, 6, -5);
+ test("abcde", 0, 1, "abcdefghij", 9, 0, 1);
+ test("abcde", 0, 1, "abcdefghij", 9, 1, -9);
+ test("abcde", 0, 1, "abcdefghij", 9, 2, -9);
+ test("abcde", 0, 1, "abcdefghij", 10, 0, 1);
+ test("abcde", 0, 1, "abcdefghij", 10, 1, 1);
+ test("abcde", 0, 1, "abcdefghij", 11, 0, 0);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 1, 0);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 10, -9);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 19, -18);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 20, -19);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 21, -19);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcde", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 0, 2, "", 0, 0, 2);
+ test("abcde", 0, 2, "", 0, 1, 2);
+ test("abcde", 0, 2, "", 1, 0, 0);
+ test("abcde", 0, 2, "abcde", 0, 0, 2);
+ test("abcde", 0, 2, "abcde", 0, 1, 1);
+ test("abcde", 0, 2, "abcde", 0, 2, 0);
+ test("abcde", 0, 2, "abcde", 0, 4, -2);
+ test("abcde", 0, 2, "abcde", 0, 5, -3);
+ test("abcde", 0, 2, "abcde", 0, 6, -3);
+ test("abcde", 0, 2, "abcde", 1, 0, 2);
+ test("abcde", 0, 2, "abcde", 1, 1, -1);
+ test("abcde", 0, 2, "abcde", 1, 2, -1);
+ test("abcde", 0, 2, "abcde", 1, 3, -1);
+ test("abcde", 0, 2, "abcde", 1, 4, -1);
+ test("abcde", 0, 2, "abcde", 1, 5, -1);
+ test("abcde", 0, 2, "abcde", 2, 0, 2);
+ test("abcde", 0, 2, "abcde", 2, 1, -2);
+ test("abcde", 0, 2, "abcde", 2, 2, -2);
+ test("abcde", 0, 2, "abcde", 2, 3, -2);
+ test("abcde", 0, 2, "abcde", 2, 4, -2);
+ test("abcde", 0, 2, "abcde", 4, 0, 2);
+ test("abcde", 0, 2, "abcde", 4, 1, -4);
+ test("abcde", 0, 2, "abcde", 4, 2, -4);
+ test("abcde", 0, 2, "abcde", 5, 0, 2);
+ test("abcde", 0, 2, "abcde", 5, 1, 2);
+ test("abcde", 0, 2, "abcde", 6, 0, 0);
+ test("abcde", 0, 2, "abcdefghij", 0, 0, 2);
+ test("abcde", 0, 2, "abcdefghij", 0, 1, 1);
+ test("abcde", 0, 2, "abcdefghij", 0, 5, -3);
+ test("abcde", 0, 2, "abcdefghij", 0, 9, -7);
+}
+
+void test4()
+{
+ test("abcde", 0, 2, "abcdefghij", 0, 10, -8);
+ test("abcde", 0, 2, "abcdefghij", 0, 11, -8);
+ test("abcde", 0, 2, "abcdefghij", 1, 0, 2);
+ test("abcde", 0, 2, "abcdefghij", 1, 1, -1);
+ test("abcde", 0, 2, "abcdefghij", 1, 4, -1);
+ test("abcde", 0, 2, "abcdefghij", 1, 8, -1);
+ test("abcde", 0, 2, "abcdefghij", 1, 9, -1);
+ test("abcde", 0, 2, "abcdefghij", 1, 10, -1);
+ test("abcde", 0, 2, "abcdefghij", 5, 0, 2);
+ test("abcde", 0, 2, "abcdefghij", 5, 1, -5);
+ test("abcde", 0, 2, "abcdefghij", 5, 2, -5);
+ test("abcde", 0, 2, "abcdefghij", 5, 4, -5);
+ test("abcde", 0, 2, "abcdefghij", 5, 5, -5);
+ test("abcde", 0, 2, "abcdefghij", 5, 6, -5);
+ test("abcde", 0, 2, "abcdefghij", 9, 0, 2);
+ test("abcde", 0, 2, "abcdefghij", 9, 1, -9);
+ test("abcde", 0, 2, "abcdefghij", 9, 2, -9);
+ test("abcde", 0, 2, "abcdefghij", 10, 0, 2);
+ test("abcde", 0, 2, "abcdefghij", 10, 1, 2);
+ test("abcde", 0, 2, "abcdefghij", 11, 0, 0);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 0, 2);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 10, -8);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 19, -17);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 20, -18);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 21, -18);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 0, 2);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 0, 2);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, 0, 2);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 20, 0, 2);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 20, 1, 2);
+ test("abcde", 0, 2, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 0, 4, "", 0, 0, 4);
+ test("abcde", 0, 4, "", 0, 1, 4);
+ test("abcde", 0, 4, "", 1, 0, 0);
+ test("abcde", 0, 4, "abcde", 0, 0, 4);
+ test("abcde", 0, 4, "abcde", 0, 1, 3);
+ test("abcde", 0, 4, "abcde", 0, 2, 2);
+ test("abcde", 0, 4, "abcde", 0, 4, 0);
+ test("abcde", 0, 4, "abcde", 0, 5, -1);
+ test("abcde", 0, 4, "abcde", 0, 6, -1);
+ test("abcde", 0, 4, "abcde", 1, 0, 4);
+ test("abcde", 0, 4, "abcde", 1, 1, -1);
+ test("abcde", 0, 4, "abcde", 1, 2, -1);
+ test("abcde", 0, 4, "abcde", 1, 3, -1);
+ test("abcde", 0, 4, "abcde", 1, 4, -1);
+ test("abcde", 0, 4, "abcde", 1, 5, -1);
+ test("abcde", 0, 4, "abcde", 2, 0, 4);
+ test("abcde", 0, 4, "abcde", 2, 1, -2);
+ test("abcde", 0, 4, "abcde", 2, 2, -2);
+ test("abcde", 0, 4, "abcde", 2, 3, -2);
+ test("abcde", 0, 4, "abcde", 2, 4, -2);
+ test("abcde", 0, 4, "abcde", 4, 0, 4);
+ test("abcde", 0, 4, "abcde", 4, 1, -4);
+ test("abcde", 0, 4, "abcde", 4, 2, -4);
+ test("abcde", 0, 4, "abcde", 5, 0, 4);
+ test("abcde", 0, 4, "abcde", 5, 1, 4);
+ test("abcde", 0, 4, "abcde", 6, 0, 0);
+ test("abcde", 0, 4, "abcdefghij", 0, 0, 4);
+ test("abcde", 0, 4, "abcdefghij", 0, 1, 3);
+ test("abcde", 0, 4, "abcdefghij", 0, 5, -1);
+ test("abcde", 0, 4, "abcdefghij", 0, 9, -5);
+ test("abcde", 0, 4, "abcdefghij", 0, 10, -6);
+ test("abcde", 0, 4, "abcdefghij", 0, 11, -6);
+ test("abcde", 0, 4, "abcdefghij", 1, 0, 4);
+ test("abcde", 0, 4, "abcdefghij", 1, 1, -1);
+ test("abcde", 0, 4, "abcdefghij", 1, 4, -1);
+ test("abcde", 0, 4, "abcdefghij", 1, 8, -1);
+ test("abcde", 0, 4, "abcdefghij", 1, 9, -1);
+ test("abcde", 0, 4, "abcdefghij", 1, 10, -1);
+ test("abcde", 0, 4, "abcdefghij", 5, 0, 4);
+ test("abcde", 0, 4, "abcdefghij", 5, 1, -5);
+ test("abcde", 0, 4, "abcdefghij", 5, 2, -5);
+ test("abcde", 0, 4, "abcdefghij", 5, 4, -5);
+ test("abcde", 0, 4, "abcdefghij", 5, 5, -5);
+ test("abcde", 0, 4, "abcdefghij", 5, 6, -5);
+ test("abcde", 0, 4, "abcdefghij", 9, 0, 4);
+ test("abcde", 0, 4, "abcdefghij", 9, 1, -9);
+ test("abcde", 0, 4, "abcdefghij", 9, 2, -9);
+ test("abcde", 0, 4, "abcdefghij", 10, 0, 4);
+ test("abcde", 0, 4, "abcdefghij", 10, 1, 4);
+ test("abcde", 0, 4, "abcdefghij", 11, 0, 0);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 0, 4);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 1, 3);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 10, -6);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 19, -15);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 20, -16);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 21, -16);
+}
+
+void test5()
+{
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 0, 4);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 0, 4);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, 0, 4);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 20, 0, 4);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 20, 1, 4);
+ test("abcde", 0, 4, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 0, 5, "", 0, 0, 5);
+ test("abcde", 0, 5, "", 0, 1, 5);
+ test("abcde", 0, 5, "", 1, 0, 0);
+ test("abcde", 0, 5, "abcde", 0, 0, 5);
+ test("abcde", 0, 5, "abcde", 0, 1, 4);
+ test("abcde", 0, 5, "abcde", 0, 2, 3);
+ test("abcde", 0, 5, "abcde", 0, 4, 1);
+ test("abcde", 0, 5, "abcde", 0, 5, 0);
+ test("abcde", 0, 5, "abcde", 0, 6, 0);
+ test("abcde", 0, 5, "abcde", 1, 0, 5);
+ test("abcde", 0, 5, "abcde", 1, 1, -1);
+ test("abcde", 0, 5, "abcde", 1, 2, -1);
+ test("abcde", 0, 5, "abcde", 1, 3, -1);
+ test("abcde", 0, 5, "abcde", 1, 4, -1);
+ test("abcde", 0, 5, "abcde", 1, 5, -1);
+ test("abcde", 0, 5, "abcde", 2, 0, 5);
+ test("abcde", 0, 5, "abcde", 2, 1, -2);
+ test("abcde", 0, 5, "abcde", 2, 2, -2);
+ test("abcde", 0, 5, "abcde", 2, 3, -2);
+ test("abcde", 0, 5, "abcde", 2, 4, -2);
+ test("abcde", 0, 5, "abcde", 4, 0, 5);
+ test("abcde", 0, 5, "abcde", 4, 1, -4);
+ test("abcde", 0, 5, "abcde", 4, 2, -4);
+ test("abcde", 0, 5, "abcde", 5, 0, 5);
+ test("abcde", 0, 5, "abcde", 5, 1, 5);
+ test("abcde", 0, 5, "abcde", 6, 0, 0);
+ test("abcde", 0, 5, "abcdefghij", 0, 0, 5);
+ test("abcde", 0, 5, "abcdefghij", 0, 1, 4);
+ test("abcde", 0, 5, "abcdefghij", 0, 5, 0);
+ test("abcde", 0, 5, "abcdefghij", 0, 9, -4);
+ test("abcde", 0, 5, "abcdefghij", 0, 10, -5);
+ test("abcde", 0, 5, "abcdefghij", 0, 11, -5);
+ test("abcde", 0, 5, "abcdefghij", 1, 0, 5);
+ test("abcde", 0, 5, "abcdefghij", 1, 1, -1);
+ test("abcde", 0, 5, "abcdefghij", 1, 4, -1);
+ test("abcde", 0, 5, "abcdefghij", 1, 8, -1);
+ test("abcde", 0, 5, "abcdefghij", 1, 9, -1);
+ test("abcde", 0, 5, "abcdefghij", 1, 10, -1);
+ test("abcde", 0, 5, "abcdefghij", 5, 0, 5);
+ test("abcde", 0, 5, "abcdefghij", 5, 1, -5);
+ test("abcde", 0, 5, "abcdefghij", 5, 2, -5);
+ test("abcde", 0, 5, "abcdefghij", 5, 4, -5);
+ test("abcde", 0, 5, "abcdefghij", 5, 5, -5);
+ test("abcde", 0, 5, "abcdefghij", 5, 6, -5);
+ test("abcde", 0, 5, "abcdefghij", 9, 0, 5);
+ test("abcde", 0, 5, "abcdefghij", 9, 1, -9);
+ test("abcde", 0, 5, "abcdefghij", 9, 2, -9);
+ test("abcde", 0, 5, "abcdefghij", 10, 0, 5);
+ test("abcde", 0, 5, "abcdefghij", 10, 1, 5);
+ test("abcde", 0, 5, "abcdefghij", 11, 0, 0);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 0, 5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 1, 4);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 10, -5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 19, -14);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 20, -15);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 21, -15);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 0, 5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 0, 5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, 0, 5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 20, 0, 5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 20, 1, 5);
+ test("abcde", 0, 5, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 0, 6, "", 0, 0, 5);
+ test("abcde", 0, 6, "", 0, 1, 5);
+ test("abcde", 0, 6, "", 1, 0, 0);
+ test("abcde", 0, 6, "abcde", 0, 0, 5);
+ test("abcde", 0, 6, "abcde", 0, 1, 4);
+ test("abcde", 0, 6, "abcde", 0, 2, 3);
+ test("abcde", 0, 6, "abcde", 0, 4, 1);
+ test("abcde", 0, 6, "abcde", 0, 5, 0);
+}
+
+void test6()
+{
+ test("abcde", 0, 6, "abcde", 0, 6, 0);
+ test("abcde", 0, 6, "abcde", 1, 0, 5);
+ test("abcde", 0, 6, "abcde", 1, 1, -1);
+ test("abcde", 0, 6, "abcde", 1, 2, -1);
+ test("abcde", 0, 6, "abcde", 1, 3, -1);
+ test("abcde", 0, 6, "abcde", 1, 4, -1);
+ test("abcde", 0, 6, "abcde", 1, 5, -1);
+ test("abcde", 0, 6, "abcde", 2, 0, 5);
+ test("abcde", 0, 6, "abcde", 2, 1, -2);
+ test("abcde", 0, 6, "abcde", 2, 2, -2);
+ test("abcde", 0, 6, "abcde", 2, 3, -2);
+ test("abcde", 0, 6, "abcde", 2, 4, -2);
+ test("abcde", 0, 6, "abcde", 4, 0, 5);
+ test("abcde", 0, 6, "abcde", 4, 1, -4);
+ test("abcde", 0, 6, "abcde", 4, 2, -4);
+ test("abcde", 0, 6, "abcde", 5, 0, 5);
+ test("abcde", 0, 6, "abcde", 5, 1, 5);
+ test("abcde", 0, 6, "abcde", 6, 0, 0);
+ test("abcde", 0, 6, "abcdefghij", 0, 0, 5);
+ test("abcde", 0, 6, "abcdefghij", 0, 1, 4);
+ test("abcde", 0, 6, "abcdefghij", 0, 5, 0);
+ test("abcde", 0, 6, "abcdefghij", 0, 9, -4);
+ test("abcde", 0, 6, "abcdefghij", 0, 10, -5);
+ test("abcde", 0, 6, "abcdefghij", 0, 11, -5);
+ test("abcde", 0, 6, "abcdefghij", 1, 0, 5);
+ test("abcde", 0, 6, "abcdefghij", 1, 1, -1);
+ test("abcde", 0, 6, "abcdefghij", 1, 4, -1);
+ test("abcde", 0, 6, "abcdefghij", 1, 8, -1);
+ test("abcde", 0, 6, "abcdefghij", 1, 9, -1);
+ test("abcde", 0, 6, "abcdefghij", 1, 10, -1);
+ test("abcde", 0, 6, "abcdefghij", 5, 0, 5);
+ test("abcde", 0, 6, "abcdefghij", 5, 1, -5);
+ test("abcde", 0, 6, "abcdefghij", 5, 2, -5);
+ test("abcde", 0, 6, "abcdefghij", 5, 4, -5);
+ test("abcde", 0, 6, "abcdefghij", 5, 5, -5);
+ test("abcde", 0, 6, "abcdefghij", 5, 6, -5);
+ test("abcde", 0, 6, "abcdefghij", 9, 0, 5);
+ test("abcde", 0, 6, "abcdefghij", 9, 1, -9);
+ test("abcde", 0, 6, "abcdefghij", 9, 2, -9);
+ test("abcde", 0, 6, "abcdefghij", 10, 0, 5);
+ test("abcde", 0, 6, "abcdefghij", 10, 1, 5);
+ test("abcde", 0, 6, "abcdefghij", 11, 0, 0);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 0, 5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 1, 4);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 10, -5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 19, -14);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 20, -15);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 21, -15);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 0, 5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 0, 5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, 0, 5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 20, 0, 5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 20, 1, 5);
+ test("abcde", 0, 6, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 1, 0, "", 0, 0, 0);
+ test("abcde", 1, 0, "", 0, 1, 0);
+ test("abcde", 1, 0, "", 1, 0, 0);
+ test("abcde", 1, 0, "abcde", 0, 0, 0);
+ test("abcde", 1, 0, "abcde", 0, 1, -1);
+ test("abcde", 1, 0, "abcde", 0, 2, -2);
+ test("abcde", 1, 0, "abcde", 0, 4, -4);
+ test("abcde", 1, 0, "abcde", 0, 5, -5);
+ test("abcde", 1, 0, "abcde", 0, 6, -5);
+ test("abcde", 1, 0, "abcde", 1, 0, 0);
+ test("abcde", 1, 0, "abcde", 1, 1, -1);
+ test("abcde", 1, 0, "abcde", 1, 2, -2);
+ test("abcde", 1, 0, "abcde", 1, 3, -3);
+ test("abcde", 1, 0, "abcde", 1, 4, -4);
+ test("abcde", 1, 0, "abcde", 1, 5, -4);
+ test("abcde", 1, 0, "abcde", 2, 0, 0);
+ test("abcde", 1, 0, "abcde", 2, 1, -1);
+ test("abcde", 1, 0, "abcde", 2, 2, -2);
+ test("abcde", 1, 0, "abcde", 2, 3, -3);
+ test("abcde", 1, 0, "abcde", 2, 4, -3);
+ test("abcde", 1, 0, "abcde", 4, 0, 0);
+ test("abcde", 1, 0, "abcde", 4, 1, -1);
+ test("abcde", 1, 0, "abcde", 4, 2, -1);
+ test("abcde", 1, 0, "abcde", 5, 0, 0);
+ test("abcde", 1, 0, "abcde", 5, 1, 0);
+ test("abcde", 1, 0, "abcde", 6, 0, 0);
+ test("abcde", 1, 0, "abcdefghij", 0, 0, 0);
+ test("abcde", 1, 0, "abcdefghij", 0, 1, -1);
+ test("abcde", 1, 0, "abcdefghij", 0, 5, -5);
+ test("abcde", 1, 0, "abcdefghij", 0, 9, -9);
+ test("abcde", 1, 0, "abcdefghij", 0, 10, -10);
+ test("abcde", 1, 0, "abcdefghij", 0, 11, -10);
+ test("abcde", 1, 0, "abcdefghij", 1, 0, 0);
+ test("abcde", 1, 0, "abcdefghij", 1, 1, -1);
+}
+
+void test7()
+{
+ test("abcde", 1, 0, "abcdefghij", 1, 4, -4);
+ test("abcde", 1, 0, "abcdefghij", 1, 8, -8);
+ test("abcde", 1, 0, "abcdefghij", 1, 9, -9);
+ test("abcde", 1, 0, "abcdefghij", 1, 10, -9);
+ test("abcde", 1, 0, "abcdefghij", 5, 0, 0);
+ test("abcde", 1, 0, "abcdefghij", 5, 1, -1);
+ test("abcde", 1, 0, "abcdefghij", 5, 2, -2);
+ test("abcde", 1, 0, "abcdefghij", 5, 4, -4);
+ test("abcde", 1, 0, "abcdefghij", 5, 5, -5);
+ test("abcde", 1, 0, "abcdefghij", 5, 6, -5);
+ test("abcde", 1, 0, "abcdefghij", 9, 0, 0);
+ test("abcde", 1, 0, "abcdefghij", 9, 1, -1);
+ test("abcde", 1, 0, "abcdefghij", 9, 2, -1);
+ test("abcde", 1, 0, "abcdefghij", 10, 0, 0);
+ test("abcde", 1, 0, "abcdefghij", 10, 1, 0);
+ test("abcde", 1, 0, "abcdefghij", 11, 0, 0);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcde", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 1, 1, "", 0, 0, 1);
+ test("abcde", 1, 1, "", 0, 1, 1);
+ test("abcde", 1, 1, "", 1, 0, 0);
+ test("abcde", 1, 1, "abcde", 0, 0, 1);
+ test("abcde", 1, 1, "abcde", 0, 1, 1);
+ test("abcde", 1, 1, "abcde", 0, 2, 1);
+ test("abcde", 1, 1, "abcde", 0, 4, 1);
+ test("abcde", 1, 1, "abcde", 0, 5, 1);
+ test("abcde", 1, 1, "abcde", 0, 6, 1);
+ test("abcde", 1, 1, "abcde", 1, 0, 1);
+ test("abcde", 1, 1, "abcde", 1, 1, 0);
+ test("abcde", 1, 1, "abcde", 1, 2, -1);
+ test("abcde", 1, 1, "abcde", 1, 3, -2);
+ test("abcde", 1, 1, "abcde", 1, 4, -3);
+ test("abcde", 1, 1, "abcde", 1, 5, -3);
+ test("abcde", 1, 1, "abcde", 2, 0, 1);
+ test("abcde", 1, 1, "abcde", 2, 1, -1);
+ test("abcde", 1, 1, "abcde", 2, 2, -1);
+ test("abcde", 1, 1, "abcde", 2, 3, -1);
+ test("abcde", 1, 1, "abcde", 2, 4, -1);
+ test("abcde", 1, 1, "abcde", 4, 0, 1);
+ test("abcde", 1, 1, "abcde", 4, 1, -3);
+ test("abcde", 1, 1, "abcde", 4, 2, -3);
+ test("abcde", 1, 1, "abcde", 5, 0, 1);
+ test("abcde", 1, 1, "abcde", 5, 1, 1);
+ test("abcde", 1, 1, "abcde", 6, 0, 0);
+ test("abcde", 1, 1, "abcdefghij", 0, 0, 1);
+ test("abcde", 1, 1, "abcdefghij", 0, 1, 1);
+ test("abcde", 1, 1, "abcdefghij", 0, 5, 1);
+ test("abcde", 1, 1, "abcdefghij", 0, 9, 1);
+ test("abcde", 1, 1, "abcdefghij", 0, 10, 1);
+ test("abcde", 1, 1, "abcdefghij", 0, 11, 1);
+ test("abcde", 1, 1, "abcdefghij", 1, 0, 1);
+ test("abcde", 1, 1, "abcdefghij", 1, 1, 0);
+ test("abcde", 1, 1, "abcdefghij", 1, 4, -3);
+ test("abcde", 1, 1, "abcdefghij", 1, 8, -7);
+ test("abcde", 1, 1, "abcdefghij", 1, 9, -8);
+ test("abcde", 1, 1, "abcdefghij", 1, 10, -8);
+ test("abcde", 1, 1, "abcdefghij", 5, 0, 1);
+ test("abcde", 1, 1, "abcdefghij", 5, 1, -4);
+ test("abcde", 1, 1, "abcdefghij", 5, 2, -4);
+ test("abcde", 1, 1, "abcdefghij", 5, 4, -4);
+ test("abcde", 1, 1, "abcdefghij", 5, 5, -4);
+ test("abcde", 1, 1, "abcdefghij", 5, 6, -4);
+ test("abcde", 1, 1, "abcdefghij", 9, 0, 1);
+ test("abcde", 1, 1, "abcdefghij", 9, 1, -8);
+ test("abcde", 1, 1, "abcdefghij", 9, 2, -8);
+ test("abcde", 1, 1, "abcdefghij", 10, 0, 1);
+ test("abcde", 1, 1, "abcdefghij", 10, 1, 1);
+ test("abcde", 1, 1, "abcdefghij", 11, 0, 0);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 1, 0);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 9, -8);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 18, -17);
+}
+
+void test8()
+{
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 19, -18);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 20, -18);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcde", 1, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 1, 2, "", 0, 0, 2);
+ test("abcde", 1, 2, "", 0, 1, 2);
+ test("abcde", 1, 2, "", 1, 0, 0);
+ test("abcde", 1, 2, "abcde", 0, 0, 2);
+ test("abcde", 1, 2, "abcde", 0, 1, 1);
+ test("abcde", 1, 2, "abcde", 0, 2, 1);
+ test("abcde", 1, 2, "abcde", 0, 4, 1);
+ test("abcde", 1, 2, "abcde", 0, 5, 1);
+ test("abcde", 1, 2, "abcde", 0, 6, 1);
+ test("abcde", 1, 2, "abcde", 1, 0, 2);
+ test("abcde", 1, 2, "abcde", 1, 1, 1);
+ test("abcde", 1, 2, "abcde", 1, 2, 0);
+ test("abcde", 1, 2, "abcde", 1, 3, -1);
+ test("abcde", 1, 2, "abcde", 1, 4, -2);
+ test("abcde", 1, 2, "abcde", 1, 5, -2);
+ test("abcde", 1, 2, "abcde", 2, 0, 2);
+ test("abcde", 1, 2, "abcde", 2, 1, -1);
+ test("abcde", 1, 2, "abcde", 2, 2, -1);
+ test("abcde", 1, 2, "abcde", 2, 3, -1);
+ test("abcde", 1, 2, "abcde", 2, 4, -1);
+ test("abcde", 1, 2, "abcde", 4, 0, 2);
+ test("abcde", 1, 2, "abcde", 4, 1, -3);
+ test("abcde", 1, 2, "abcde", 4, 2, -3);
+ test("abcde", 1, 2, "abcde", 5, 0, 2);
+ test("abcde", 1, 2, "abcde", 5, 1, 2);
+ test("abcde", 1, 2, "abcde", 6, 0, 0);
+ test("abcde", 1, 2, "abcdefghij", 0, 0, 2);
+ test("abcde", 1, 2, "abcdefghij", 0, 1, 1);
+ test("abcde", 1, 2, "abcdefghij", 0, 5, 1);
+ test("abcde", 1, 2, "abcdefghij", 0, 9, 1);
+ test("abcde", 1, 2, "abcdefghij", 0, 10, 1);
+ test("abcde", 1, 2, "abcdefghij", 0, 11, 1);
+ test("abcde", 1, 2, "abcdefghij", 1, 0, 2);
+ test("abcde", 1, 2, "abcdefghij", 1, 1, 1);
+ test("abcde", 1, 2, "abcdefghij", 1, 4, -2);
+ test("abcde", 1, 2, "abcdefghij", 1, 8, -6);
+ test("abcde", 1, 2, "abcdefghij", 1, 9, -7);
+ test("abcde", 1, 2, "abcdefghij", 1, 10, -7);
+ test("abcde", 1, 2, "abcdefghij", 5, 0, 2);
+ test("abcde", 1, 2, "abcdefghij", 5, 1, -4);
+ test("abcde", 1, 2, "abcdefghij", 5, 2, -4);
+ test("abcde", 1, 2, "abcdefghij", 5, 4, -4);
+ test("abcde", 1, 2, "abcdefghij", 5, 5, -4);
+ test("abcde", 1, 2, "abcdefghij", 5, 6, -4);
+ test("abcde", 1, 2, "abcdefghij", 9, 0, 2);
+ test("abcde", 1, 2, "abcdefghij", 9, 1, -8);
+ test("abcde", 1, 2, "abcdefghij", 9, 2, -8);
+ test("abcde", 1, 2, "abcdefghij", 10, 0, 2);
+ test("abcde", 1, 2, "abcdefghij", 10, 1, 2);
+ test("abcde", 1, 2, "abcdefghij", 11, 0, 0);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 0, 2);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 0, 2);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 1, 1);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 9, -7);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 18, -16);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 19, -17);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 20, -17);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 0, 2);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 0, 2);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 20, 0, 2);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 20, 1, 2);
+ test("abcde", 1, 2, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 1, 3, "", 0, 0, 3);
+ test("abcde", 1, 3, "", 0, 1, 3);
+ test("abcde", 1, 3, "", 1, 0, 0);
+ test("abcde", 1, 3, "abcde", 0, 0, 3);
+ test("abcde", 1, 3, "abcde", 0, 1, 1);
+ test("abcde", 1, 3, "abcde", 0, 2, 1);
+ test("abcde", 1, 3, "abcde", 0, 4, 1);
+ test("abcde", 1, 3, "abcde", 0, 5, 1);
+ test("abcde", 1, 3, "abcde", 0, 6, 1);
+ test("abcde", 1, 3, "abcde", 1, 0, 3);
+ test("abcde", 1, 3, "abcde", 1, 1, 2);
+ test("abcde", 1, 3, "abcde", 1, 2, 1);
+}
+
+void test9()
+{
+ test("abcde", 1, 3, "abcde", 1, 3, 0);
+ test("abcde", 1, 3, "abcde", 1, 4, -1);
+ test("abcde", 1, 3, "abcde", 1, 5, -1);
+ test("abcde", 1, 3, "abcde", 2, 0, 3);
+ test("abcde", 1, 3, "abcde", 2, 1, -1);
+ test("abcde", 1, 3, "abcde", 2, 2, -1);
+ test("abcde", 1, 3, "abcde", 2, 3, -1);
+ test("abcde", 1, 3, "abcde", 2, 4, -1);
+ test("abcde", 1, 3, "abcde", 4, 0, 3);
+ test("abcde", 1, 3, "abcde", 4, 1, -3);
+ test("abcde", 1, 3, "abcde", 4, 2, -3);
+ test("abcde", 1, 3, "abcde", 5, 0, 3);
+ test("abcde", 1, 3, "abcde", 5, 1, 3);
+ test("abcde", 1, 3, "abcde", 6, 0, 0);
+ test("abcde", 1, 3, "abcdefghij", 0, 0, 3);
+ test("abcde", 1, 3, "abcdefghij", 0, 1, 1);
+ test("abcde", 1, 3, "abcdefghij", 0, 5, 1);
+ test("abcde", 1, 3, "abcdefghij", 0, 9, 1);
+ test("abcde", 1, 3, "abcdefghij", 0, 10, 1);
+ test("abcde", 1, 3, "abcdefghij", 0, 11, 1);
+ test("abcde", 1, 3, "abcdefghij", 1, 0, 3);
+ test("abcde", 1, 3, "abcdefghij", 1, 1, 2);
+ test("abcde", 1, 3, "abcdefghij", 1, 4, -1);
+ test("abcde", 1, 3, "abcdefghij", 1, 8, -5);
+ test("abcde", 1, 3, "abcdefghij", 1, 9, -6);
+ test("abcde", 1, 3, "abcdefghij", 1, 10, -6);
+ test("abcde", 1, 3, "abcdefghij", 5, 0, 3);
+ test("abcde", 1, 3, "abcdefghij", 5, 1, -4);
+ test("abcde", 1, 3, "abcdefghij", 5, 2, -4);
+ test("abcde", 1, 3, "abcdefghij", 5, 4, -4);
+ test("abcde", 1, 3, "abcdefghij", 5, 5, -4);
+ test("abcde", 1, 3, "abcdefghij", 5, 6, -4);
+ test("abcde", 1, 3, "abcdefghij", 9, 0, 3);
+ test("abcde", 1, 3, "abcdefghij", 9, 1, -8);
+ test("abcde", 1, 3, "abcdefghij", 9, 2, -8);
+ test("abcde", 1, 3, "abcdefghij", 10, 0, 3);
+ test("abcde", 1, 3, "abcdefghij", 10, 1, 3);
+ test("abcde", 1, 3, "abcdefghij", 11, 0, 0);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 0, 3);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 0, 3);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 1, 2);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 9, -6);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 18, -15);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 19, -16);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 20, -16);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 0, 3);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 0, 3);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 20, 0, 3);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 20, 1, 3);
+ test("abcde", 1, 3, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 1, 4, "", 0, 0, 4);
+ test("abcde", 1, 4, "", 0, 1, 4);
+ test("abcde", 1, 4, "", 1, 0, 0);
+ test("abcde", 1, 4, "abcde", 0, 0, 4);
+ test("abcde", 1, 4, "abcde", 0, 1, 1);
+ test("abcde", 1, 4, "abcde", 0, 2, 1);
+ test("abcde", 1, 4, "abcde", 0, 4, 1);
+ test("abcde", 1, 4, "abcde", 0, 5, 1);
+ test("abcde", 1, 4, "abcde", 0, 6, 1);
+ test("abcde", 1, 4, "abcde", 1, 0, 4);
+ test("abcde", 1, 4, "abcde", 1, 1, 3);
+ test("abcde", 1, 4, "abcde", 1, 2, 2);
+ test("abcde", 1, 4, "abcde", 1, 3, 1);
+ test("abcde", 1, 4, "abcde", 1, 4, 0);
+ test("abcde", 1, 4, "abcde", 1, 5, 0);
+ test("abcde", 1, 4, "abcde", 2, 0, 4);
+ test("abcde", 1, 4, "abcde", 2, 1, -1);
+ test("abcde", 1, 4, "abcde", 2, 2, -1);
+ test("abcde", 1, 4, "abcde", 2, 3, -1);
+ test("abcde", 1, 4, "abcde", 2, 4, -1);
+ test("abcde", 1, 4, "abcde", 4, 0, 4);
+ test("abcde", 1, 4, "abcde", 4, 1, -3);
+ test("abcde", 1, 4, "abcde", 4, 2, -3);
+ test("abcde", 1, 4, "abcde", 5, 0, 4);
+ test("abcde", 1, 4, "abcde", 5, 1, 4);
+ test("abcde", 1, 4, "abcde", 6, 0, 0);
+ test("abcde", 1, 4, "abcdefghij", 0, 0, 4);
+ test("abcde", 1, 4, "abcdefghij", 0, 1, 1);
+ test("abcde", 1, 4, "abcdefghij", 0, 5, 1);
+ test("abcde", 1, 4, "abcdefghij", 0, 9, 1);
+ test("abcde", 1, 4, "abcdefghij", 0, 10, 1);
+ test("abcde", 1, 4, "abcdefghij", 0, 11, 1);
+ test("abcde", 1, 4, "abcdefghij", 1, 0, 4);
+ test("abcde", 1, 4, "abcdefghij", 1, 1, 3);
+ test("abcde", 1, 4, "abcdefghij", 1, 4, 0);
+ test("abcde", 1, 4, "abcdefghij", 1, 8, -4);
+ test("abcde", 1, 4, "abcdefghij", 1, 9, -5);
+ test("abcde", 1, 4, "abcdefghij", 1, 10, -5);
+}
+
+void test10()
+{
+ test("abcde", 1, 4, "abcdefghij", 5, 0, 4);
+ test("abcde", 1, 4, "abcdefghij", 5, 1, -4);
+ test("abcde", 1, 4, "abcdefghij", 5, 2, -4);
+ test("abcde", 1, 4, "abcdefghij", 5, 4, -4);
+ test("abcde", 1, 4, "abcdefghij", 5, 5, -4);
+ test("abcde", 1, 4, "abcdefghij", 5, 6, -4);
+ test("abcde", 1, 4, "abcdefghij", 9, 0, 4);
+ test("abcde", 1, 4, "abcdefghij", 9, 1, -8);
+ test("abcde", 1, 4, "abcdefghij", 9, 2, -8);
+ test("abcde", 1, 4, "abcdefghij", 10, 0, 4);
+ test("abcde", 1, 4, "abcdefghij", 10, 1, 4);
+ test("abcde", 1, 4, "abcdefghij", 11, 0, 0);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 0, 4);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 0, 4);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 1, 3);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 9, -5);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 18, -14);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 19, -15);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 20, -15);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 0, 4);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 0, 4);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 20, 0, 4);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 20, 1, 4);
+ test("abcde", 1, 4, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 1, 5, "", 0, 0, 4);
+ test("abcde", 1, 5, "", 0, 1, 4);
+ test("abcde", 1, 5, "", 1, 0, 0);
+ test("abcde", 1, 5, "abcde", 0, 0, 4);
+ test("abcde", 1, 5, "abcde", 0, 1, 1);
+ test("abcde", 1, 5, "abcde", 0, 2, 1);
+ test("abcde", 1, 5, "abcde", 0, 4, 1);
+ test("abcde", 1, 5, "abcde", 0, 5, 1);
+ test("abcde", 1, 5, "abcde", 0, 6, 1);
+ test("abcde", 1, 5, "abcde", 1, 0, 4);
+ test("abcde", 1, 5, "abcde", 1, 1, 3);
+ test("abcde", 1, 5, "abcde", 1, 2, 2);
+ test("abcde", 1, 5, "abcde", 1, 3, 1);
+ test("abcde", 1, 5, "abcde", 1, 4, 0);
+ test("abcde", 1, 5, "abcde", 1, 5, 0);
+ test("abcde", 1, 5, "abcde", 2, 0, 4);
+ test("abcde", 1, 5, "abcde", 2, 1, -1);
+ test("abcde", 1, 5, "abcde", 2, 2, -1);
+ test("abcde", 1, 5, "abcde", 2, 3, -1);
+ test("abcde", 1, 5, "abcde", 2, 4, -1);
+ test("abcde", 1, 5, "abcde", 4, 0, 4);
+ test("abcde", 1, 5, "abcde", 4, 1, -3);
+ test("abcde", 1, 5, "abcde", 4, 2, -3);
+ test("abcde", 1, 5, "abcde", 5, 0, 4);
+ test("abcde", 1, 5, "abcde", 5, 1, 4);
+ test("abcde", 1, 5, "abcde", 6, 0, 0);
+ test("abcde", 1, 5, "abcdefghij", 0, 0, 4);
+ test("abcde", 1, 5, "abcdefghij", 0, 1, 1);
+ test("abcde", 1, 5, "abcdefghij", 0, 5, 1);
+ test("abcde", 1, 5, "abcdefghij", 0, 9, 1);
+ test("abcde", 1, 5, "abcdefghij", 0, 10, 1);
+ test("abcde", 1, 5, "abcdefghij", 0, 11, 1);
+ test("abcde", 1, 5, "abcdefghij", 1, 0, 4);
+ test("abcde", 1, 5, "abcdefghij", 1, 1, 3);
+ test("abcde", 1, 5, "abcdefghij", 1, 4, 0);
+ test("abcde", 1, 5, "abcdefghij", 1, 8, -4);
+ test("abcde", 1, 5, "abcdefghij", 1, 9, -5);
+ test("abcde", 1, 5, "abcdefghij", 1, 10, -5);
+ test("abcde", 1, 5, "abcdefghij", 5, 0, 4);
+ test("abcde", 1, 5, "abcdefghij", 5, 1, -4);
+ test("abcde", 1, 5, "abcdefghij", 5, 2, -4);
+ test("abcde", 1, 5, "abcdefghij", 5, 4, -4);
+ test("abcde", 1, 5, "abcdefghij", 5, 5, -4);
+ test("abcde", 1, 5, "abcdefghij", 5, 6, -4);
+ test("abcde", 1, 5, "abcdefghij", 9, 0, 4);
+ test("abcde", 1, 5, "abcdefghij", 9, 1, -8);
+ test("abcde", 1, 5, "abcdefghij", 9, 2, -8);
+ test("abcde", 1, 5, "abcdefghij", 10, 0, 4);
+ test("abcde", 1, 5, "abcdefghij", 10, 1, 4);
+ test("abcde", 1, 5, "abcdefghij", 11, 0, 0);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 0, 4);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 0, 4);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 1, 3);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 9, -5);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 18, -14);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 19, -15);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 20, -15);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 0, 4);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 1, -9);
+}
+
+void test11()
+{
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 0, 4);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 20, 0, 4);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 20, 1, 4);
+ test("abcde", 1, 5, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 2, 0, "", 0, 0, 0);
+ test("abcde", 2, 0, "", 0, 1, 0);
+ test("abcde", 2, 0, "", 1, 0, 0);
+ test("abcde", 2, 0, "abcde", 0, 0, 0);
+ test("abcde", 2, 0, "abcde", 0, 1, -1);
+ test("abcde", 2, 0, "abcde", 0, 2, -2);
+ test("abcde", 2, 0, "abcde", 0, 4, -4);
+ test("abcde", 2, 0, "abcde", 0, 5, -5);
+ test("abcde", 2, 0, "abcde", 0, 6, -5);
+ test("abcde", 2, 0, "abcde", 1, 0, 0);
+ test("abcde", 2, 0, "abcde", 1, 1, -1);
+ test("abcde", 2, 0, "abcde", 1, 2, -2);
+ test("abcde", 2, 0, "abcde", 1, 3, -3);
+ test("abcde", 2, 0, "abcde", 1, 4, -4);
+ test("abcde", 2, 0, "abcde", 1, 5, -4);
+ test("abcde", 2, 0, "abcde", 2, 0, 0);
+ test("abcde", 2, 0, "abcde", 2, 1, -1);
+ test("abcde", 2, 0, "abcde", 2, 2, -2);
+ test("abcde", 2, 0, "abcde", 2, 3, -3);
+ test("abcde", 2, 0, "abcde", 2, 4, -3);
+ test("abcde", 2, 0, "abcde", 4, 0, 0);
+ test("abcde", 2, 0, "abcde", 4, 1, -1);
+ test("abcde", 2, 0, "abcde", 4, 2, -1);
+ test("abcde", 2, 0, "abcde", 5, 0, 0);
+ test("abcde", 2, 0, "abcde", 5, 1, 0);
+ test("abcde", 2, 0, "abcde", 6, 0, 0);
+ test("abcde", 2, 0, "abcdefghij", 0, 0, 0);
+ test("abcde", 2, 0, "abcdefghij", 0, 1, -1);
+ test("abcde", 2, 0, "abcdefghij", 0, 5, -5);
+ test("abcde", 2, 0, "abcdefghij", 0, 9, -9);
+ test("abcde", 2, 0, "abcdefghij", 0, 10, -10);
+ test("abcde", 2, 0, "abcdefghij", 0, 11, -10);
+ test("abcde", 2, 0, "abcdefghij", 1, 0, 0);
+ test("abcde", 2, 0, "abcdefghij", 1, 1, -1);
+ test("abcde", 2, 0, "abcdefghij", 1, 4, -4);
+ test("abcde", 2, 0, "abcdefghij", 1, 8, -8);
+ test("abcde", 2, 0, "abcdefghij", 1, 9, -9);
+ test("abcde", 2, 0, "abcdefghij", 1, 10, -9);
+ test("abcde", 2, 0, "abcdefghij", 5, 0, 0);
+ test("abcde", 2, 0, "abcdefghij", 5, 1, -1);
+ test("abcde", 2, 0, "abcdefghij", 5, 2, -2);
+ test("abcde", 2, 0, "abcdefghij", 5, 4, -4);
+ test("abcde", 2, 0, "abcdefghij", 5, 5, -5);
+ test("abcde", 2, 0, "abcdefghij", 5, 6, -5);
+ test("abcde", 2, 0, "abcdefghij", 9, 0, 0);
+ test("abcde", 2, 0, "abcdefghij", 9, 1, -1);
+ test("abcde", 2, 0, "abcdefghij", 9, 2, -1);
+ test("abcde", 2, 0, "abcdefghij", 10, 0, 0);
+ test("abcde", 2, 0, "abcdefghij", 10, 1, 0);
+ test("abcde", 2, 0, "abcdefghij", 11, 0, 0);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcde", 2, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 2, 1, "", 0, 0, 1);
+ test("abcde", 2, 1, "", 0, 1, 1);
+ test("abcde", 2, 1, "", 1, 0, 0);
+ test("abcde", 2, 1, "abcde", 0, 0, 1);
+ test("abcde", 2, 1, "abcde", 0, 1, 2);
+ test("abcde", 2, 1, "abcde", 0, 2, 2);
+ test("abcde", 2, 1, "abcde", 0, 4, 2);
+ test("abcde", 2, 1, "abcde", 0, 5, 2);
+ test("abcde", 2, 1, "abcde", 0, 6, 2);
+ test("abcde", 2, 1, "abcde", 1, 0, 1);
+ test("abcde", 2, 1, "abcde", 1, 1, 1);
+ test("abcde", 2, 1, "abcde", 1, 2, 1);
+ test("abcde", 2, 1, "abcde", 1, 3, 1);
+ test("abcde", 2, 1, "abcde", 1, 4, 1);
+ test("abcde", 2, 1, "abcde", 1, 5, 1);
+ test("abcde", 2, 1, "abcde", 2, 0, 1);
+}
+
+void test12()
+{
+ test("abcde", 2, 1, "abcde", 2, 1, 0);
+ test("abcde", 2, 1, "abcde", 2, 2, -1);
+ test("abcde", 2, 1, "abcde", 2, 3, -2);
+ test("abcde", 2, 1, "abcde", 2, 4, -2);
+ test("abcde", 2, 1, "abcde", 4, 0, 1);
+ test("abcde", 2, 1, "abcde", 4, 1, -2);
+ test("abcde", 2, 1, "abcde", 4, 2, -2);
+ test("abcde", 2, 1, "abcde", 5, 0, 1);
+ test("abcde", 2, 1, "abcde", 5, 1, 1);
+ test("abcde", 2, 1, "abcde", 6, 0, 0);
+ test("abcde", 2, 1, "abcdefghij", 0, 0, 1);
+ test("abcde", 2, 1, "abcdefghij", 0, 1, 2);
+ test("abcde", 2, 1, "abcdefghij", 0, 5, 2);
+ test("abcde", 2, 1, "abcdefghij", 0, 9, 2);
+ test("abcde", 2, 1, "abcdefghij", 0, 10, 2);
+ test("abcde", 2, 1, "abcdefghij", 0, 11, 2);
+ test("abcde", 2, 1, "abcdefghij", 1, 0, 1);
+ test("abcde", 2, 1, "abcdefghij", 1, 1, 1);
+ test("abcde", 2, 1, "abcdefghij", 1, 4, 1);
+ test("abcde", 2, 1, "abcdefghij", 1, 8, 1);
+ test("abcde", 2, 1, "abcdefghij", 1, 9, 1);
+ test("abcde", 2, 1, "abcdefghij", 1, 10, 1);
+ test("abcde", 2, 1, "abcdefghij", 5, 0, 1);
+ test("abcde", 2, 1, "abcdefghij", 5, 1, -3);
+ test("abcde", 2, 1, "abcdefghij", 5, 2, -3);
+ test("abcde", 2, 1, "abcdefghij", 5, 4, -3);
+ test("abcde", 2, 1, "abcdefghij", 5, 5, -3);
+ test("abcde", 2, 1, "abcdefghij", 5, 6, -3);
+ test("abcde", 2, 1, "abcdefghij", 9, 0, 1);
+ test("abcde", 2, 1, "abcdefghij", 9, 1, -7);
+ test("abcde", 2, 1, "abcdefghij", 9, 2, -7);
+ test("abcde", 2, 1, "abcdefghij", 10, 0, 1);
+ test("abcde", 2, 1, "abcdefghij", 10, 1, 1);
+ test("abcde", 2, 1, "abcdefghij", 11, 0, 0);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 1, 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 10, 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 19, 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 20, 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 21, 2);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 1, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 9, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 18, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 19, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 20, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 1, -8);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 5, -8);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 9, -8);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 10, -8);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 11, -8);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 1, -17);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 2, -17);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcde", 2, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 2, 2, "", 0, 0, 2);
+ test("abcde", 2, 2, "", 0, 1, 2);
+ test("abcde", 2, 2, "", 1, 0, 0);
+ test("abcde", 2, 2, "abcde", 0, 0, 2);
+ test("abcde", 2, 2, "abcde", 0, 1, 2);
+ test("abcde", 2, 2, "abcde", 0, 2, 2);
+ test("abcde", 2, 2, "abcde", 0, 4, 2);
+ test("abcde", 2, 2, "abcde", 0, 5, 2);
+ test("abcde", 2, 2, "abcde", 0, 6, 2);
+ test("abcde", 2, 2, "abcde", 1, 0, 2);
+ test("abcde", 2, 2, "abcde", 1, 1, 1);
+ test("abcde", 2, 2, "abcde", 1, 2, 1);
+ test("abcde", 2, 2, "abcde", 1, 3, 1);
+ test("abcde", 2, 2, "abcde", 1, 4, 1);
+ test("abcde", 2, 2, "abcde", 1, 5, 1);
+ test("abcde", 2, 2, "abcde", 2, 0, 2);
+ test("abcde", 2, 2, "abcde", 2, 1, 1);
+ test("abcde", 2, 2, "abcde", 2, 2, 0);
+ test("abcde", 2, 2, "abcde", 2, 3, -1);
+ test("abcde", 2, 2, "abcde", 2, 4, -1);
+ test("abcde", 2, 2, "abcde", 4, 0, 2);
+ test("abcde", 2, 2, "abcde", 4, 1, -2);
+ test("abcde", 2, 2, "abcde", 4, 2, -2);
+ test("abcde", 2, 2, "abcde", 5, 0, 2);
+ test("abcde", 2, 2, "abcde", 5, 1, 2);
+ test("abcde", 2, 2, "abcde", 6, 0, 0);
+ test("abcde", 2, 2, "abcdefghij", 0, 0, 2);
+ test("abcde", 2, 2, "abcdefghij", 0, 1, 2);
+ test("abcde", 2, 2, "abcdefghij", 0, 5, 2);
+ test("abcde", 2, 2, "abcdefghij", 0, 9, 2);
+ test("abcde", 2, 2, "abcdefghij", 0, 10, 2);
+ test("abcde", 2, 2, "abcdefghij", 0, 11, 2);
+ test("abcde", 2, 2, "abcdefghij", 1, 0, 2);
+ test("abcde", 2, 2, "abcdefghij", 1, 1, 1);
+ test("abcde", 2, 2, "abcdefghij", 1, 4, 1);
+ test("abcde", 2, 2, "abcdefghij", 1, 8, 1);
+ test("abcde", 2, 2, "abcdefghij", 1, 9, 1);
+ test("abcde", 2, 2, "abcdefghij", 1, 10, 1);
+ test("abcde", 2, 2, "abcdefghij", 5, 0, 2);
+ test("abcde", 2, 2, "abcdefghij", 5, 1, -3);
+ test("abcde", 2, 2, "abcdefghij", 5, 2, -3);
+ test("abcde", 2, 2, "abcdefghij", 5, 4, -3);
+}
+
+void test13()
+{
+ test("abcde", 2, 2, "abcdefghij", 5, 5, -3);
+ test("abcde", 2, 2, "abcdefghij", 5, 6, -3);
+ test("abcde", 2, 2, "abcdefghij", 9, 0, 2);
+ test("abcde", 2, 2, "abcdefghij", 9, 1, -7);
+ test("abcde", 2, 2, "abcdefghij", 9, 2, -7);
+ test("abcde", 2, 2, "abcdefghij", 10, 0, 2);
+ test("abcde", 2, 2, "abcdefghij", 10, 1, 2);
+ test("abcde", 2, 2, "abcdefghij", 11, 0, 0);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 0, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 1, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 10, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 19, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 20, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 21, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 0, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 1, 1);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 9, 1);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 18, 1);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 19, 1);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 20, 1);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 0, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 1, -8);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 5, -8);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 9, -8);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 10, -8);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 11, -8);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 0, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 1, -17);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 2, -17);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 20, 0, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 20, 1, 2);
+ test("abcde", 2, 2, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 2, 3, "", 0, 0, 3);
+ test("abcde", 2, 3, "", 0, 1, 3);
+ test("abcde", 2, 3, "", 1, 0, 0);
+ test("abcde", 2, 3, "abcde", 0, 0, 3);
+ test("abcde", 2, 3, "abcde", 0, 1, 2);
+ test("abcde", 2, 3, "abcde", 0, 2, 2);
+ test("abcde", 2, 3, "abcde", 0, 4, 2);
+ test("abcde", 2, 3, "abcde", 0, 5, 2);
+ test("abcde", 2, 3, "abcde", 0, 6, 2);
+ test("abcde", 2, 3, "abcde", 1, 0, 3);
+ test("abcde", 2, 3, "abcde", 1, 1, 1);
+ test("abcde", 2, 3, "abcde", 1, 2, 1);
+ test("abcde", 2, 3, "abcde", 1, 3, 1);
+ test("abcde", 2, 3, "abcde", 1, 4, 1);
+ test("abcde", 2, 3, "abcde", 1, 5, 1);
+ test("abcde", 2, 3, "abcde", 2, 0, 3);
+ test("abcde", 2, 3, "abcde", 2, 1, 2);
+ test("abcde", 2, 3, "abcde", 2, 2, 1);
+ test("abcde", 2, 3, "abcde", 2, 3, 0);
+ test("abcde", 2, 3, "abcde", 2, 4, 0);
+ test("abcde", 2, 3, "abcde", 4, 0, 3);
+ test("abcde", 2, 3, "abcde", 4, 1, -2);
+ test("abcde", 2, 3, "abcde", 4, 2, -2);
+ test("abcde", 2, 3, "abcde", 5, 0, 3);
+ test("abcde", 2, 3, "abcde", 5, 1, 3);
+ test("abcde", 2, 3, "abcde", 6, 0, 0);
+ test("abcde", 2, 3, "abcdefghij", 0, 0, 3);
+ test("abcde", 2, 3, "abcdefghij", 0, 1, 2);
+ test("abcde", 2, 3, "abcdefghij", 0, 5, 2);
+ test("abcde", 2, 3, "abcdefghij", 0, 9, 2);
+ test("abcde", 2, 3, "abcdefghij", 0, 10, 2);
+ test("abcde", 2, 3, "abcdefghij", 0, 11, 2);
+ test("abcde", 2, 3, "abcdefghij", 1, 0, 3);
+ test("abcde", 2, 3, "abcdefghij", 1, 1, 1);
+ test("abcde", 2, 3, "abcdefghij", 1, 4, 1);
+ test("abcde", 2, 3, "abcdefghij", 1, 8, 1);
+ test("abcde", 2, 3, "abcdefghij", 1, 9, 1);
+ test("abcde", 2, 3, "abcdefghij", 1, 10, 1);
+ test("abcde", 2, 3, "abcdefghij", 5, 0, 3);
+ test("abcde", 2, 3, "abcdefghij", 5, 1, -3);
+ test("abcde", 2, 3, "abcdefghij", 5, 2, -3);
+ test("abcde", 2, 3, "abcdefghij", 5, 4, -3);
+ test("abcde", 2, 3, "abcdefghij", 5, 5, -3);
+ test("abcde", 2, 3, "abcdefghij", 5, 6, -3);
+ test("abcde", 2, 3, "abcdefghij", 9, 0, 3);
+ test("abcde", 2, 3, "abcdefghij", 9, 1, -7);
+ test("abcde", 2, 3, "abcdefghij", 9, 2, -7);
+ test("abcde", 2, 3, "abcdefghij", 10, 0, 3);
+ test("abcde", 2, 3, "abcdefghij", 10, 1, 3);
+ test("abcde", 2, 3, "abcdefghij", 11, 0, 0);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 0, 3);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 1, 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 10, 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 19, 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 20, 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 21, 2);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 0, 3);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 1, 1);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 9, 1);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 18, 1);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 19, 1);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 20, 1);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 0, 3);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 1, -8);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 5, -8);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 9, -8);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 10, -8);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 11, -8);
+}
+
+void test14()
+{
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 0, 3);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 1, -17);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 2, -17);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 20, 0, 3);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 20, 1, 3);
+ test("abcde", 2, 3, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 2, 4, "", 0, 0, 3);
+ test("abcde", 2, 4, "", 0, 1, 3);
+ test("abcde", 2, 4, "", 1, 0, 0);
+ test("abcde", 2, 4, "abcde", 0, 0, 3);
+ test("abcde", 2, 4, "abcde", 0, 1, 2);
+ test("abcde", 2, 4, "abcde", 0, 2, 2);
+ test("abcde", 2, 4, "abcde", 0, 4, 2);
+ test("abcde", 2, 4, "abcde", 0, 5, 2);
+ test("abcde", 2, 4, "abcde", 0, 6, 2);
+ test("abcde", 2, 4, "abcde", 1, 0, 3);
+ test("abcde", 2, 4, "abcde", 1, 1, 1);
+ test("abcde", 2, 4, "abcde", 1, 2, 1);
+ test("abcde", 2, 4, "abcde", 1, 3, 1);
+ test("abcde", 2, 4, "abcde", 1, 4, 1);
+ test("abcde", 2, 4, "abcde", 1, 5, 1);
+ test("abcde", 2, 4, "abcde", 2, 0, 3);
+ test("abcde", 2, 4, "abcde", 2, 1, 2);
+ test("abcde", 2, 4, "abcde", 2, 2, 1);
+ test("abcde", 2, 4, "abcde", 2, 3, 0);
+ test("abcde", 2, 4, "abcde", 2, 4, 0);
+ test("abcde", 2, 4, "abcde", 4, 0, 3);
+ test("abcde", 2, 4, "abcde", 4, 1, -2);
+ test("abcde", 2, 4, "abcde", 4, 2, -2);
+ test("abcde", 2, 4, "abcde", 5, 0, 3);
+ test("abcde", 2, 4, "abcde", 5, 1, 3);
+ test("abcde", 2, 4, "abcde", 6, 0, 0);
+ test("abcde", 2, 4, "abcdefghij", 0, 0, 3);
+ test("abcde", 2, 4, "abcdefghij", 0, 1, 2);
+ test("abcde", 2, 4, "abcdefghij", 0, 5, 2);
+ test("abcde", 2, 4, "abcdefghij", 0, 9, 2);
+ test("abcde", 2, 4, "abcdefghij", 0, 10, 2);
+ test("abcde", 2, 4, "abcdefghij", 0, 11, 2);
+ test("abcde", 2, 4, "abcdefghij", 1, 0, 3);
+ test("abcde", 2, 4, "abcdefghij", 1, 1, 1);
+ test("abcde", 2, 4, "abcdefghij", 1, 4, 1);
+ test("abcde", 2, 4, "abcdefghij", 1, 8, 1);
+ test("abcde", 2, 4, "abcdefghij", 1, 9, 1);
+ test("abcde", 2, 4, "abcdefghij", 1, 10, 1);
+ test("abcde", 2, 4, "abcdefghij", 5, 0, 3);
+ test("abcde", 2, 4, "abcdefghij", 5, 1, -3);
+ test("abcde", 2, 4, "abcdefghij", 5, 2, -3);
+ test("abcde", 2, 4, "abcdefghij", 5, 4, -3);
+ test("abcde", 2, 4, "abcdefghij", 5, 5, -3);
+ test("abcde", 2, 4, "abcdefghij", 5, 6, -3);
+ test("abcde", 2, 4, "abcdefghij", 9, 0, 3);
+ test("abcde", 2, 4, "abcdefghij", 9, 1, -7);
+ test("abcde", 2, 4, "abcdefghij", 9, 2, -7);
+ test("abcde", 2, 4, "abcdefghij", 10, 0, 3);
+ test("abcde", 2, 4, "abcdefghij", 10, 1, 3);
+ test("abcde", 2, 4, "abcdefghij", 11, 0, 0);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 0, 3);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 1, 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 10, 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 19, 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 20, 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 21, 2);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 0, 3);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 1, 1);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 9, 1);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 18, 1);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 19, 1);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 20, 1);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 0, 3);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 1, -8);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 5, -8);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 9, -8);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 10, -8);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 11, -8);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 0, 3);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 1, -17);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 2, -17);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 20, 0, 3);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 20, 1, 3);
+ test("abcde", 2, 4, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 4, 0, "", 0, 0, 0);
+ test("abcde", 4, 0, "", 0, 1, 0);
+ test("abcde", 4, 0, "", 1, 0, 0);
+ test("abcde", 4, 0, "abcde", 0, 0, 0);
+ test("abcde", 4, 0, "abcde", 0, 1, -1);
+ test("abcde", 4, 0, "abcde", 0, 2, -2);
+ test("abcde", 4, 0, "abcde", 0, 4, -4);
+ test("abcde", 4, 0, "abcde", 0, 5, -5);
+ test("abcde", 4, 0, "abcde", 0, 6, -5);
+ test("abcde", 4, 0, "abcde", 1, 0, 0);
+ test("abcde", 4, 0, "abcde", 1, 1, -1);
+ test("abcde", 4, 0, "abcde", 1, 2, -2);
+ test("abcde", 4, 0, "abcde", 1, 3, -3);
+ test("abcde", 4, 0, "abcde", 1, 4, -4);
+ test("abcde", 4, 0, "abcde", 1, 5, -4);
+ test("abcde", 4, 0, "abcde", 2, 0, 0);
+ test("abcde", 4, 0, "abcde", 2, 1, -1);
+ test("abcde", 4, 0, "abcde", 2, 2, -2);
+ test("abcde", 4, 0, "abcde", 2, 3, -3);
+ test("abcde", 4, 0, "abcde", 2, 4, -3);
+}
+
+void test15()
+{
+ test("abcde", 4, 0, "abcde", 4, 0, 0);
+ test("abcde", 4, 0, "abcde", 4, 1, -1);
+ test("abcde", 4, 0, "abcde", 4, 2, -1);
+ test("abcde", 4, 0, "abcde", 5, 0, 0);
+ test("abcde", 4, 0, "abcde", 5, 1, 0);
+ test("abcde", 4, 0, "abcde", 6, 0, 0);
+ test("abcde", 4, 0, "abcdefghij", 0, 0, 0);
+ test("abcde", 4, 0, "abcdefghij", 0, 1, -1);
+ test("abcde", 4, 0, "abcdefghij", 0, 5, -5);
+ test("abcde", 4, 0, "abcdefghij", 0, 9, -9);
+ test("abcde", 4, 0, "abcdefghij", 0, 10, -10);
+ test("abcde", 4, 0, "abcdefghij", 0, 11, -10);
+ test("abcde", 4, 0, "abcdefghij", 1, 0, 0);
+ test("abcde", 4, 0, "abcdefghij", 1, 1, -1);
+ test("abcde", 4, 0, "abcdefghij", 1, 4, -4);
+ test("abcde", 4, 0, "abcdefghij", 1, 8, -8);
+ test("abcde", 4, 0, "abcdefghij", 1, 9, -9);
+ test("abcde", 4, 0, "abcdefghij", 1, 10, -9);
+ test("abcde", 4, 0, "abcdefghij", 5, 0, 0);
+ test("abcde", 4, 0, "abcdefghij", 5, 1, -1);
+ test("abcde", 4, 0, "abcdefghij", 5, 2, -2);
+ test("abcde", 4, 0, "abcdefghij", 5, 4, -4);
+ test("abcde", 4, 0, "abcdefghij", 5, 5, -5);
+ test("abcde", 4, 0, "abcdefghij", 5, 6, -5);
+ test("abcde", 4, 0, "abcdefghij", 9, 0, 0);
+ test("abcde", 4, 0, "abcdefghij", 9, 1, -1);
+ test("abcde", 4, 0, "abcdefghij", 9, 2, -1);
+ test("abcde", 4, 0, "abcdefghij", 10, 0, 0);
+ test("abcde", 4, 0, "abcdefghij", 10, 1, 0);
+ test("abcde", 4, 0, "abcdefghij", 11, 0, 0);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcde", 4, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 4, 1, "", 0, 0, 1);
+ test("abcde", 4, 1, "", 0, 1, 1);
+ test("abcde", 4, 1, "", 1, 0, 0);
+ test("abcde", 4, 1, "abcde", 0, 0, 1);
+ test("abcde", 4, 1, "abcde", 0, 1, 4);
+ test("abcde", 4, 1, "abcde", 0, 2, 4);
+ test("abcde", 4, 1, "abcde", 0, 4, 4);
+ test("abcde", 4, 1, "abcde", 0, 5, 4);
+ test("abcde", 4, 1, "abcde", 0, 6, 4);
+ test("abcde", 4, 1, "abcde", 1, 0, 1);
+ test("abcde", 4, 1, "abcde", 1, 1, 3);
+ test("abcde", 4, 1, "abcde", 1, 2, 3);
+ test("abcde", 4, 1, "abcde", 1, 3, 3);
+ test("abcde", 4, 1, "abcde", 1, 4, 3);
+ test("abcde", 4, 1, "abcde", 1, 5, 3);
+ test("abcde", 4, 1, "abcde", 2, 0, 1);
+ test("abcde", 4, 1, "abcde", 2, 1, 2);
+ test("abcde", 4, 1, "abcde", 2, 2, 2);
+ test("abcde", 4, 1, "abcde", 2, 3, 2);
+ test("abcde", 4, 1, "abcde", 2, 4, 2);
+ test("abcde", 4, 1, "abcde", 4, 0, 1);
+ test("abcde", 4, 1, "abcde", 4, 1, 0);
+ test("abcde", 4, 1, "abcde", 4, 2, 0);
+ test("abcde", 4, 1, "abcde", 5, 0, 1);
+ test("abcde", 4, 1, "abcde", 5, 1, 1);
+ test("abcde", 4, 1, "abcde", 6, 0, 0);
+ test("abcde", 4, 1, "abcdefghij", 0, 0, 1);
+ test("abcde", 4, 1, "abcdefghij", 0, 1, 4);
+ test("abcde", 4, 1, "abcdefghij", 0, 5, 4);
+ test("abcde", 4, 1, "abcdefghij", 0, 9, 4);
+ test("abcde", 4, 1, "abcdefghij", 0, 10, 4);
+ test("abcde", 4, 1, "abcdefghij", 0, 11, 4);
+ test("abcde", 4, 1, "abcdefghij", 1, 0, 1);
+ test("abcde", 4, 1, "abcdefghij", 1, 1, 3);
+ test("abcde", 4, 1, "abcdefghij", 1, 4, 3);
+ test("abcde", 4, 1, "abcdefghij", 1, 8, 3);
+ test("abcde", 4, 1, "abcdefghij", 1, 9, 3);
+ test("abcde", 4, 1, "abcdefghij", 1, 10, 3);
+ test("abcde", 4, 1, "abcdefghij", 5, 0, 1);
+ test("abcde", 4, 1, "abcdefghij", 5, 1, -1);
+ test("abcde", 4, 1, "abcdefghij", 5, 2, -1);
+ test("abcde", 4, 1, "abcdefghij", 5, 4, -1);
+ test("abcde", 4, 1, "abcdefghij", 5, 5, -1);
+ test("abcde", 4, 1, "abcdefghij", 5, 6, -1);
+ test("abcde", 4, 1, "abcdefghij", 9, 0, 1);
+ test("abcde", 4, 1, "abcdefghij", 9, 1, -5);
+}
+
+void test16()
+{
+ test("abcde", 4, 1, "abcdefghij", 9, 2, -5);
+ test("abcde", 4, 1, "abcdefghij", 10, 0, 1);
+ test("abcde", 4, 1, "abcdefghij", 10, 1, 1);
+ test("abcde", 4, 1, "abcdefghij", 11, 0, 0);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 1, 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 10, 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 19, 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 20, 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 21, 4);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 1, 3);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 9, 3);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 18, 3);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 19, 3);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 20, 3);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 1, -6);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 5, -6);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 9, -6);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 10, -6);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 11, -6);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 1, -15);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 2, -15);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcde", 4, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 4, 2, "", 0, 0, 1);
+ test("abcde", 4, 2, "", 0, 1, 1);
+ test("abcde", 4, 2, "", 1, 0, 0);
+ test("abcde", 4, 2, "abcde", 0, 0, 1);
+ test("abcde", 4, 2, "abcde", 0, 1, 4);
+ test("abcde", 4, 2, "abcde", 0, 2, 4);
+ test("abcde", 4, 2, "abcde", 0, 4, 4);
+ test("abcde", 4, 2, "abcde", 0, 5, 4);
+ test("abcde", 4, 2, "abcde", 0, 6, 4);
+ test("abcde", 4, 2, "abcde", 1, 0, 1);
+ test("abcde", 4, 2, "abcde", 1, 1, 3);
+ test("abcde", 4, 2, "abcde", 1, 2, 3);
+ test("abcde", 4, 2, "abcde", 1, 3, 3);
+ test("abcde", 4, 2, "abcde", 1, 4, 3);
+ test("abcde", 4, 2, "abcde", 1, 5, 3);
+ test("abcde", 4, 2, "abcde", 2, 0, 1);
+ test("abcde", 4, 2, "abcde", 2, 1, 2);
+ test("abcde", 4, 2, "abcde", 2, 2, 2);
+ test("abcde", 4, 2, "abcde", 2, 3, 2);
+ test("abcde", 4, 2, "abcde", 2, 4, 2);
+ test("abcde", 4, 2, "abcde", 4, 0, 1);
+ test("abcde", 4, 2, "abcde", 4, 1, 0);
+ test("abcde", 4, 2, "abcde", 4, 2, 0);
+ test("abcde", 4, 2, "abcde", 5, 0, 1);
+ test("abcde", 4, 2, "abcde", 5, 1, 1);
+ test("abcde", 4, 2, "abcde", 6, 0, 0);
+ test("abcde", 4, 2, "abcdefghij", 0, 0, 1);
+ test("abcde", 4, 2, "abcdefghij", 0, 1, 4);
+ test("abcde", 4, 2, "abcdefghij", 0, 5, 4);
+ test("abcde", 4, 2, "abcdefghij", 0, 9, 4);
+ test("abcde", 4, 2, "abcdefghij", 0, 10, 4);
+ test("abcde", 4, 2, "abcdefghij", 0, 11, 4);
+ test("abcde", 4, 2, "abcdefghij", 1, 0, 1);
+ test("abcde", 4, 2, "abcdefghij", 1, 1, 3);
+ test("abcde", 4, 2, "abcdefghij", 1, 4, 3);
+ test("abcde", 4, 2, "abcdefghij", 1, 8, 3);
+ test("abcde", 4, 2, "abcdefghij", 1, 9, 3);
+ test("abcde", 4, 2, "abcdefghij", 1, 10, 3);
+ test("abcde", 4, 2, "abcdefghij", 5, 0, 1);
+ test("abcde", 4, 2, "abcdefghij", 5, 1, -1);
+ test("abcde", 4, 2, "abcdefghij", 5, 2, -1);
+ test("abcde", 4, 2, "abcdefghij", 5, 4, -1);
+ test("abcde", 4, 2, "abcdefghij", 5, 5, -1);
+ test("abcde", 4, 2, "abcdefghij", 5, 6, -1);
+ test("abcde", 4, 2, "abcdefghij", 9, 0, 1);
+ test("abcde", 4, 2, "abcdefghij", 9, 1, -5);
+ test("abcde", 4, 2, "abcdefghij", 9, 2, -5);
+ test("abcde", 4, 2, "abcdefghij", 10, 0, 1);
+ test("abcde", 4, 2, "abcdefghij", 10, 1, 1);
+ test("abcde", 4, 2, "abcdefghij", 11, 0, 0);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 1, 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 10, 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 19, 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 20, 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 21, 4);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 1, 3);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 9, 3);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 18, 3);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 19, 3);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 20, 3);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 1, -6);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 5, -6);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 9, -6);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 10, -6);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 11, -6);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 1, -15);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 2, -15);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 20, 0, 1);
+}
+
+void test17()
+{
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcde", 4, 2, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 5, 0, "", 0, 0, 0);
+ test("abcde", 5, 0, "", 0, 1, 0);
+ test("abcde", 5, 0, "", 1, 0, 0);
+ test("abcde", 5, 0, "abcde", 0, 0, 0);
+ test("abcde", 5, 0, "abcde", 0, 1, -1);
+ test("abcde", 5, 0, "abcde", 0, 2, -2);
+ test("abcde", 5, 0, "abcde", 0, 4, -4);
+ test("abcde", 5, 0, "abcde", 0, 5, -5);
+ test("abcde", 5, 0, "abcde", 0, 6, -5);
+ test("abcde", 5, 0, "abcde", 1, 0, 0);
+ test("abcde", 5, 0, "abcde", 1, 1, -1);
+ test("abcde", 5, 0, "abcde", 1, 2, -2);
+ test("abcde", 5, 0, "abcde", 1, 3, -3);
+ test("abcde", 5, 0, "abcde", 1, 4, -4);
+ test("abcde", 5, 0, "abcde", 1, 5, -4);
+ test("abcde", 5, 0, "abcde", 2, 0, 0);
+ test("abcde", 5, 0, "abcde", 2, 1, -1);
+ test("abcde", 5, 0, "abcde", 2, 2, -2);
+ test("abcde", 5, 0, "abcde", 2, 3, -3);
+ test("abcde", 5, 0, "abcde", 2, 4, -3);
+ test("abcde", 5, 0, "abcde", 4, 0, 0);
+ test("abcde", 5, 0, "abcde", 4, 1, -1);
+ test("abcde", 5, 0, "abcde", 4, 2, -1);
+ test("abcde", 5, 0, "abcde", 5, 0, 0);
+ test("abcde", 5, 0, "abcde", 5, 1, 0);
+ test("abcde", 5, 0, "abcde", 6, 0, 0);
+ test("abcde", 5, 0, "abcdefghij", 0, 0, 0);
+ test("abcde", 5, 0, "abcdefghij", 0, 1, -1);
+ test("abcde", 5, 0, "abcdefghij", 0, 5, -5);
+ test("abcde", 5, 0, "abcdefghij", 0, 9, -9);
+ test("abcde", 5, 0, "abcdefghij", 0, 10, -10);
+ test("abcde", 5, 0, "abcdefghij", 0, 11, -10);
+ test("abcde", 5, 0, "abcdefghij", 1, 0, 0);
+ test("abcde", 5, 0, "abcdefghij", 1, 1, -1);
+ test("abcde", 5, 0, "abcdefghij", 1, 4, -4);
+ test("abcde", 5, 0, "abcdefghij", 1, 8, -8);
+ test("abcde", 5, 0, "abcdefghij", 1, 9, -9);
+ test("abcde", 5, 0, "abcdefghij", 1, 10, -9);
+ test("abcde", 5, 0, "abcdefghij", 5, 0, 0);
+ test("abcde", 5, 0, "abcdefghij", 5, 1, -1);
+ test("abcde", 5, 0, "abcdefghij", 5, 2, -2);
+ test("abcde", 5, 0, "abcdefghij", 5, 4, -4);
+ test("abcde", 5, 0, "abcdefghij", 5, 5, -5);
+ test("abcde", 5, 0, "abcdefghij", 5, 6, -5);
+ test("abcde", 5, 0, "abcdefghij", 9, 0, 0);
+ test("abcde", 5, 0, "abcdefghij", 9, 1, -1);
+ test("abcde", 5, 0, "abcdefghij", 9, 2, -1);
+ test("abcde", 5, 0, "abcdefghij", 10, 0, 0);
+ test("abcde", 5, 0, "abcdefghij", 10, 1, 0);
+ test("abcde", 5, 0, "abcdefghij", 11, 0, 0);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcde", 5, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 5, 1, "", 0, 0, 0);
+ test("abcde", 5, 1, "", 0, 1, 0);
+ test("abcde", 5, 1, "", 1, 0, 0);
+ test("abcde", 5, 1, "abcde", 0, 0, 0);
+ test("abcde", 5, 1, "abcde", 0, 1, -1);
+ test("abcde", 5, 1, "abcde", 0, 2, -2);
+ test("abcde", 5, 1, "abcde", 0, 4, -4);
+ test("abcde", 5, 1, "abcde", 0, 5, -5);
+ test("abcde", 5, 1, "abcde", 0, 6, -5);
+ test("abcde", 5, 1, "abcde", 1, 0, 0);
+ test("abcde", 5, 1, "abcde", 1, 1, -1);
+ test("abcde", 5, 1, "abcde", 1, 2, -2);
+ test("abcde", 5, 1, "abcde", 1, 3, -3);
+ test("abcde", 5, 1, "abcde", 1, 4, -4);
+ test("abcde", 5, 1, "abcde", 1, 5, -4);
+ test("abcde", 5, 1, "abcde", 2, 0, 0);
+ test("abcde", 5, 1, "abcde", 2, 1, -1);
+ test("abcde", 5, 1, "abcde", 2, 2, -2);
+ test("abcde", 5, 1, "abcde", 2, 3, -3);
+ test("abcde", 5, 1, "abcde", 2, 4, -3);
+ test("abcde", 5, 1, "abcde", 4, 0, 0);
+ test("abcde", 5, 1, "abcde", 4, 1, -1);
+ test("abcde", 5, 1, "abcde", 4, 2, -1);
+ test("abcde", 5, 1, "abcde", 5, 0, 0);
+}
+
+void test18()
+{
+ test("abcde", 5, 1, "abcde", 5, 1, 0);
+ test("abcde", 5, 1, "abcde", 6, 0, 0);
+ test("abcde", 5, 1, "abcdefghij", 0, 0, 0);
+ test("abcde", 5, 1, "abcdefghij", 0, 1, -1);
+ test("abcde", 5, 1, "abcdefghij", 0, 5, -5);
+ test("abcde", 5, 1, "abcdefghij", 0, 9, -9);
+ test("abcde", 5, 1, "abcdefghij", 0, 10, -10);
+ test("abcde", 5, 1, "abcdefghij", 0, 11, -10);
+ test("abcde", 5, 1, "abcdefghij", 1, 0, 0);
+ test("abcde", 5, 1, "abcdefghij", 1, 1, -1);
+ test("abcde", 5, 1, "abcdefghij", 1, 4, -4);
+ test("abcde", 5, 1, "abcdefghij", 1, 8, -8);
+ test("abcde", 5, 1, "abcdefghij", 1, 9, -9);
+ test("abcde", 5, 1, "abcdefghij", 1, 10, -9);
+ test("abcde", 5, 1, "abcdefghij", 5, 0, 0);
+ test("abcde", 5, 1, "abcdefghij", 5, 1, -1);
+ test("abcde", 5, 1, "abcdefghij", 5, 2, -2);
+ test("abcde", 5, 1, "abcdefghij", 5, 4, -4);
+ test("abcde", 5, 1, "abcdefghij", 5, 5, -5);
+ test("abcde", 5, 1, "abcdefghij", 5, 6, -5);
+ test("abcde", 5, 1, "abcdefghij", 9, 0, 0);
+ test("abcde", 5, 1, "abcdefghij", 9, 1, -1);
+ test("abcde", 5, 1, "abcdefghij", 9, 2, -1);
+ test("abcde", 5, 1, "abcdefghij", 10, 0, 0);
+ test("abcde", 5, 1, "abcdefghij", 10, 1, 0);
+ test("abcde", 5, 1, "abcdefghij", 11, 0, 0);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcde", 5, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcde", 6, 0, "", 0, 0, 0);
+ test("abcde", 6, 0, "", 0, 1, 0);
+ test("abcde", 6, 0, "", 1, 0, 0);
+ test("abcde", 6, 0, "abcde", 0, 0, 0);
+ test("abcde", 6, 0, "abcde", 0, 1, 0);
+ test("abcde", 6, 0, "abcde", 0, 2, 0);
+ test("abcde", 6, 0, "abcde", 0, 4, 0);
+ test("abcde", 6, 0, "abcde", 0, 5, 0);
+ test("abcde", 6, 0, "abcde", 0, 6, 0);
+ test("abcde", 6, 0, "abcde", 1, 0, 0);
+ test("abcde", 6, 0, "abcde", 1, 1, 0);
+ test("abcde", 6, 0, "abcde", 1, 2, 0);
+ test("abcde", 6, 0, "abcde", 1, 3, 0);
+ test("abcde", 6, 0, "abcde", 1, 4, 0);
+ test("abcde", 6, 0, "abcde", 1, 5, 0);
+ test("abcde", 6, 0, "abcde", 2, 0, 0);
+ test("abcde", 6, 0, "abcde", 2, 1, 0);
+ test("abcde", 6, 0, "abcde", 2, 2, 0);
+ test("abcde", 6, 0, "abcde", 2, 3, 0);
+ test("abcde", 6, 0, "abcde", 2, 4, 0);
+ test("abcde", 6, 0, "abcde", 4, 0, 0);
+ test("abcde", 6, 0, "abcde", 4, 1, 0);
+ test("abcde", 6, 0, "abcde", 4, 2, 0);
+ test("abcde", 6, 0, "abcde", 5, 0, 0);
+ test("abcde", 6, 0, "abcde", 5, 1, 0);
+ test("abcde", 6, 0, "abcde", 6, 0, 0);
+ test("abcde", 6, 0, "abcdefghij", 0, 0, 0);
+ test("abcde", 6, 0, "abcdefghij", 0, 1, 0);
+ test("abcde", 6, 0, "abcdefghij", 0, 5, 0);
+ test("abcde", 6, 0, "abcdefghij", 0, 9, 0);
+ test("abcde", 6, 0, "abcdefghij", 0, 10, 0);
+ test("abcde", 6, 0, "abcdefghij", 0, 11, 0);
+ test("abcde", 6, 0, "abcdefghij", 1, 0, 0);
+ test("abcde", 6, 0, "abcdefghij", 1, 1, 0);
+ test("abcde", 6, 0, "abcdefghij", 1, 4, 0);
+ test("abcde", 6, 0, "abcdefghij", 1, 8, 0);
+ test("abcde", 6, 0, "abcdefghij", 1, 9, 0);
+ test("abcde", 6, 0, "abcdefghij", 1, 10, 0);
+ test("abcde", 6, 0, "abcdefghij", 5, 0, 0);
+ test("abcde", 6, 0, "abcdefghij", 5, 1, 0);
+ test("abcde", 6, 0, "abcdefghij", 5, 2, 0);
+ test("abcde", 6, 0, "abcdefghij", 5, 4, 0);
+ test("abcde", 6, 0, "abcdefghij", 5, 5, 0);
+ test("abcde", 6, 0, "abcdefghij", 5, 6, 0);
+ test("abcde", 6, 0, "abcdefghij", 9, 0, 0);
+ test("abcde", 6, 0, "abcdefghij", 9, 1, 0);
+ test("abcde", 6, 0, "abcdefghij", 9, 2, 0);
+ test("abcde", 6, 0, "abcdefghij", 10, 0, 0);
+ test("abcde", 6, 0, "abcdefghij", 10, 1, 0);
+ test("abcde", 6, 0, "abcdefghij", 11, 0, 0);
+}
+
+void test19()
+{
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 1, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 10, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 19, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 20, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 21, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 1, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 9, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 18, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 19, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 20, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 1, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 5, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 9, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 10, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 11, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 1, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 2, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcde", 6, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 0, 0, "", 0, 0, 0);
+ test("abcdefghij", 0, 0, "", 0, 1, 0);
+ test("abcdefghij", 0, 0, "", 1, 0, 0);
+ test("abcdefghij", 0, 0, "abcde", 0, 0, 0);
+ test("abcdefghij", 0, 0, "abcde", 0, 1, -1);
+ test("abcdefghij", 0, 0, "abcde", 0, 2, -2);
+ test("abcdefghij", 0, 0, "abcde", 0, 4, -4);
+ test("abcdefghij", 0, 0, "abcde", 0, 5, -5);
+ test("abcdefghij", 0, 0, "abcde", 0, 6, -5);
+ test("abcdefghij", 0, 0, "abcde", 1, 0, 0);
+ test("abcdefghij", 0, 0, "abcde", 1, 1, -1);
+ test("abcdefghij", 0, 0, "abcde", 1, 2, -2);
+ test("abcdefghij", 0, 0, "abcde", 1, 3, -3);
+ test("abcdefghij", 0, 0, "abcde", 1, 4, -4);
+ test("abcdefghij", 0, 0, "abcde", 1, 5, -4);
+ test("abcdefghij", 0, 0, "abcde", 2, 0, 0);
+ test("abcdefghij", 0, 0, "abcde", 2, 1, -1);
+ test("abcdefghij", 0, 0, "abcde", 2, 2, -2);
+ test("abcdefghij", 0, 0, "abcde", 2, 3, -3);
+ test("abcdefghij", 0, 0, "abcde", 2, 4, -3);
+ test("abcdefghij", 0, 0, "abcde", 4, 0, 0);
+ test("abcdefghij", 0, 0, "abcde", 4, 1, -1);
+ test("abcdefghij", 0, 0, "abcde", 4, 2, -1);
+ test("abcdefghij", 0, 0, "abcde", 5, 0, 0);
+ test("abcdefghij", 0, 0, "abcde", 5, 1, 0);
+ test("abcdefghij", 0, 0, "abcde", 6, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghij", 0, 1, -1);
+ test("abcdefghij", 0, 0, "abcdefghij", 0, 5, -5);
+ test("abcdefghij", 0, 0, "abcdefghij", 0, 9, -9);
+ test("abcdefghij", 0, 0, "abcdefghij", 0, 10, -10);
+ test("abcdefghij", 0, 0, "abcdefghij", 0, 11, -10);
+ test("abcdefghij", 0, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 0, 0, "abcdefghij", 1, 4, -4);
+ test("abcdefghij", 0, 0, "abcdefghij", 1, 8, -8);
+ test("abcdefghij", 0, 0, "abcdefghij", 1, 9, -9);
+ test("abcdefghij", 0, 0, "abcdefghij", 1, 10, -9);
+ test("abcdefghij", 0, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghij", 5, 1, -1);
+ test("abcdefghij", 0, 0, "abcdefghij", 5, 2, -2);
+ test("abcdefghij", 0, 0, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 0, 0, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 0, 0, "abcdefghij", 5, 6, -5);
+ test("abcdefghij", 0, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghij", 9, 1, -1);
+ test("abcdefghij", 0, 0, "abcdefghij", 9, 2, -1);
+ test("abcdefghij", 0, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghij", 0, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 0, 1, "", 0, 0, 1);
+ test("abcdefghij", 0, 1, "", 0, 1, 1);
+}
+
+void test20()
+{
+ test("abcdefghij", 0, 1, "", 1, 0, 0);
+ test("abcdefghij", 0, 1, "abcde", 0, 0, 1);
+ test("abcdefghij", 0, 1, "abcde", 0, 1, 0);
+ test("abcdefghij", 0, 1, "abcde", 0, 2, -1);
+ test("abcdefghij", 0, 1, "abcde", 0, 4, -3);
+ test("abcdefghij", 0, 1, "abcde", 0, 5, -4);
+ test("abcdefghij", 0, 1, "abcde", 0, 6, -4);
+ test("abcdefghij", 0, 1, "abcde", 1, 0, 1);
+ test("abcdefghij", 0, 1, "abcde", 1, 1, -1);
+ test("abcdefghij", 0, 1, "abcde", 1, 2, -1);
+ test("abcdefghij", 0, 1, "abcde", 1, 3, -1);
+ test("abcdefghij", 0, 1, "abcde", 1, 4, -1);
+ test("abcdefghij", 0, 1, "abcde", 1, 5, -1);
+ test("abcdefghij", 0, 1, "abcde", 2, 0, 1);
+ test("abcdefghij", 0, 1, "abcde", 2, 1, -2);
+ test("abcdefghij", 0, 1, "abcde", 2, 2, -2);
+ test("abcdefghij", 0, 1, "abcde", 2, 3, -2);
+ test("abcdefghij", 0, 1, "abcde", 2, 4, -2);
+ test("abcdefghij", 0, 1, "abcde", 4, 0, 1);
+ test("abcdefghij", 0, 1, "abcde", 4, 1, -4);
+ test("abcdefghij", 0, 1, "abcde", 4, 2, -4);
+ test("abcdefghij", 0, 1, "abcde", 5, 0, 1);
+ test("abcdefghij", 0, 1, "abcde", 5, 1, 1);
+ test("abcdefghij", 0, 1, "abcde", 6, 0, 0);
+ test("abcdefghij", 0, 1, "abcdefghij", 0, 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghij", 0, 1, 0);
+ test("abcdefghij", 0, 1, "abcdefghij", 0, 5, -4);
+ test("abcdefghij", 0, 1, "abcdefghij", 0, 9, -8);
+ test("abcdefghij", 0, 1, "abcdefghij", 0, 10, -9);
+ test("abcdefghij", 0, 1, "abcdefghij", 0, 11, -9);
+ test("abcdefghij", 0, 1, "abcdefghij", 1, 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 0, 1, "abcdefghij", 1, 4, -1);
+ test("abcdefghij", 0, 1, "abcdefghij", 1, 8, -1);
+ test("abcdefghij", 0, 1, "abcdefghij", 1, 9, -1);
+ test("abcdefghij", 0, 1, "abcdefghij", 1, 10, -1);
+ test("abcdefghij", 0, 1, "abcdefghij", 5, 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghij", 5, 1, -5);
+ test("abcdefghij", 0, 1, "abcdefghij", 5, 2, -5);
+ test("abcdefghij", 0, 1, "abcdefghij", 5, 4, -5);
+ test("abcdefghij", 0, 1, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 0, 1, "abcdefghij", 5, 6, -5);
+ test("abcdefghij", 0, 1, "abcdefghij", 9, 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghij", 9, 1, -9);
+ test("abcdefghij", 0, 1, "abcdefghij", 9, 2, -9);
+ test("abcdefghij", 0, 1, "abcdefghij", 10, 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghij", 10, 1, 1);
+ test("abcdefghij", 0, 1, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 1, 0);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 10, -9);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 19, -18);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 20, -19);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 21, -19);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 0, 5, "", 0, 0, 5);
+ test("abcdefghij", 0, 5, "", 0, 1, 5);
+ test("abcdefghij", 0, 5, "", 1, 0, 0);
+ test("abcdefghij", 0, 5, "abcde", 0, 0, 5);
+ test("abcdefghij", 0, 5, "abcde", 0, 1, 4);
+ test("abcdefghij", 0, 5, "abcde", 0, 2, 3);
+ test("abcdefghij", 0, 5, "abcde", 0, 4, 1);
+ test("abcdefghij", 0, 5, "abcde", 0, 5, 0);
+ test("abcdefghij", 0, 5, "abcde", 0, 6, 0);
+ test("abcdefghij", 0, 5, "abcde", 1, 0, 5);
+ test("abcdefghij", 0, 5, "abcde", 1, 1, -1);
+ test("abcdefghij", 0, 5, "abcde", 1, 2, -1);
+ test("abcdefghij", 0, 5, "abcde", 1, 3, -1);
+ test("abcdefghij", 0, 5, "abcde", 1, 4, -1);
+ test("abcdefghij", 0, 5, "abcde", 1, 5, -1);
+ test("abcdefghij", 0, 5, "abcde", 2, 0, 5);
+ test("abcdefghij", 0, 5, "abcde", 2, 1, -2);
+ test("abcdefghij", 0, 5, "abcde", 2, 2, -2);
+ test("abcdefghij", 0, 5, "abcde", 2, 3, -2);
+ test("abcdefghij", 0, 5, "abcde", 2, 4, -2);
+ test("abcdefghij", 0, 5, "abcde", 4, 0, 5);
+ test("abcdefghij", 0, 5, "abcde", 4, 1, -4);
+ test("abcdefghij", 0, 5, "abcde", 4, 2, -4);
+ test("abcdefghij", 0, 5, "abcde", 5, 0, 5);
+ test("abcdefghij", 0, 5, "abcde", 5, 1, 5);
+ test("abcdefghij", 0, 5, "abcde", 6, 0, 0);
+ test("abcdefghij", 0, 5, "abcdefghij", 0, 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghij", 0, 1, 4);
+}
+
+void test21()
+{
+ test("abcdefghij", 0, 5, "abcdefghij", 0, 5, 0);
+ test("abcdefghij", 0, 5, "abcdefghij", 0, 9, -4);
+ test("abcdefghij", 0, 5, "abcdefghij", 0, 10, -5);
+ test("abcdefghij", 0, 5, "abcdefghij", 0, 11, -5);
+ test("abcdefghij", 0, 5, "abcdefghij", 1, 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 0, 5, "abcdefghij", 1, 4, -1);
+ test("abcdefghij", 0, 5, "abcdefghij", 1, 8, -1);
+ test("abcdefghij", 0, 5, "abcdefghij", 1, 9, -1);
+ test("abcdefghij", 0, 5, "abcdefghij", 1, 10, -1);
+ test("abcdefghij", 0, 5, "abcdefghij", 5, 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghij", 5, 1, -5);
+ test("abcdefghij", 0, 5, "abcdefghij", 5, 2, -5);
+ test("abcdefghij", 0, 5, "abcdefghij", 5, 4, -5);
+ test("abcdefghij", 0, 5, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 0, 5, "abcdefghij", 5, 6, -5);
+ test("abcdefghij", 0, 5, "abcdefghij", 9, 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghij", 9, 1, -9);
+ test("abcdefghij", 0, 5, "abcdefghij", 9, 2, -9);
+ test("abcdefghij", 0, 5, "abcdefghij", 10, 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghij", 10, 1, 5);
+ test("abcdefghij", 0, 5, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 1, 4);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 10, -5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 19, -14);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 20, -15);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 21, -15);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 20, 0, 5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 20, 1, 5);
+ test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 0, 9, "", 0, 0, 9);
+ test("abcdefghij", 0, 9, "", 0, 1, 9);
+ test("abcdefghij", 0, 9, "", 1, 0, 0);
+ test("abcdefghij", 0, 9, "abcde", 0, 0, 9);
+ test("abcdefghij", 0, 9, "abcde", 0, 1, 8);
+ test("abcdefghij", 0, 9, "abcde", 0, 2, 7);
+ test("abcdefghij", 0, 9, "abcde", 0, 4, 5);
+ test("abcdefghij", 0, 9, "abcde", 0, 5, 4);
+ test("abcdefghij", 0, 9, "abcde", 0, 6, 4);
+ test("abcdefghij", 0, 9, "abcde", 1, 0, 9);
+ test("abcdefghij", 0, 9, "abcde", 1, 1, -1);
+ test("abcdefghij", 0, 9, "abcde", 1, 2, -1);
+ test("abcdefghij", 0, 9, "abcde", 1, 3, -1);
+ test("abcdefghij", 0, 9, "abcde", 1, 4, -1);
+ test("abcdefghij", 0, 9, "abcde", 1, 5, -1);
+ test("abcdefghij", 0, 9, "abcde", 2, 0, 9);
+ test("abcdefghij", 0, 9, "abcde", 2, 1, -2);
+ test("abcdefghij", 0, 9, "abcde", 2, 2, -2);
+ test("abcdefghij", 0, 9, "abcde", 2, 3, -2);
+ test("abcdefghij", 0, 9, "abcde", 2, 4, -2);
+ test("abcdefghij", 0, 9, "abcde", 4, 0, 9);
+ test("abcdefghij", 0, 9, "abcde", 4, 1, -4);
+ test("abcdefghij", 0, 9, "abcde", 4, 2, -4);
+ test("abcdefghij", 0, 9, "abcde", 5, 0, 9);
+ test("abcdefghij", 0, 9, "abcde", 5, 1, 9);
+ test("abcdefghij", 0, 9, "abcde", 6, 0, 0);
+ test("abcdefghij", 0, 9, "abcdefghij", 0, 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghij", 0, 1, 8);
+ test("abcdefghij", 0, 9, "abcdefghij", 0, 5, 4);
+ test("abcdefghij", 0, 9, "abcdefghij", 0, 9, 0);
+ test("abcdefghij", 0, 9, "abcdefghij", 0, 10, -1);
+ test("abcdefghij", 0, 9, "abcdefghij", 0, 11, -1);
+ test("abcdefghij", 0, 9, "abcdefghij", 1, 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 0, 9, "abcdefghij", 1, 4, -1);
+ test("abcdefghij", 0, 9, "abcdefghij", 1, 8, -1);
+ test("abcdefghij", 0, 9, "abcdefghij", 1, 9, -1);
+ test("abcdefghij", 0, 9, "abcdefghij", 1, 10, -1);
+ test("abcdefghij", 0, 9, "abcdefghij", 5, 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghij", 5, 1, -5);
+ test("abcdefghij", 0, 9, "abcdefghij", 5, 2, -5);
+ test("abcdefghij", 0, 9, "abcdefghij", 5, 4, -5);
+ test("abcdefghij", 0, 9, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 0, 9, "abcdefghij", 5, 6, -5);
+ test("abcdefghij", 0, 9, "abcdefghij", 9, 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghij", 9, 1, -9);
+ test("abcdefghij", 0, 9, "abcdefghij", 9, 2, -9);
+ test("abcdefghij", 0, 9, "abcdefghij", 10, 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghij", 10, 1, 9);
+ test("abcdefghij", 0, 9, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 1, 8);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 10, -1);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 19, -10);
+}
+
+void test22()
+{
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 20, -11);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 21, -11);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 20, 0, 9);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 20, 1, 9);
+ test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 0, 10, "", 0, 0, 10);
+ test("abcdefghij", 0, 10, "", 0, 1, 10);
+ test("abcdefghij", 0, 10, "", 1, 0, 0);
+ test("abcdefghij", 0, 10, "abcde", 0, 0, 10);
+ test("abcdefghij", 0, 10, "abcde", 0, 1, 9);
+ test("abcdefghij", 0, 10, "abcde", 0, 2, 8);
+ test("abcdefghij", 0, 10, "abcde", 0, 4, 6);
+ test("abcdefghij", 0, 10, "abcde", 0, 5, 5);
+ test("abcdefghij", 0, 10, "abcde", 0, 6, 5);
+ test("abcdefghij", 0, 10, "abcde", 1, 0, 10);
+ test("abcdefghij", 0, 10, "abcde", 1, 1, -1);
+ test("abcdefghij", 0, 10, "abcde", 1, 2, -1);
+ test("abcdefghij", 0, 10, "abcde", 1, 3, -1);
+ test("abcdefghij", 0, 10, "abcde", 1, 4, -1);
+ test("abcdefghij", 0, 10, "abcde", 1, 5, -1);
+ test("abcdefghij", 0, 10, "abcde", 2, 0, 10);
+ test("abcdefghij", 0, 10, "abcde", 2, 1, -2);
+ test("abcdefghij", 0, 10, "abcde", 2, 2, -2);
+ test("abcdefghij", 0, 10, "abcde", 2, 3, -2);
+ test("abcdefghij", 0, 10, "abcde", 2, 4, -2);
+ test("abcdefghij", 0, 10, "abcde", 4, 0, 10);
+ test("abcdefghij", 0, 10, "abcde", 4, 1, -4);
+ test("abcdefghij", 0, 10, "abcde", 4, 2, -4);
+ test("abcdefghij", 0, 10, "abcde", 5, 0, 10);
+ test("abcdefghij", 0, 10, "abcde", 5, 1, 10);
+ test("abcdefghij", 0, 10, "abcde", 6, 0, 0);
+ test("abcdefghij", 0, 10, "abcdefghij", 0, 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghij", 0, 1, 9);
+ test("abcdefghij", 0, 10, "abcdefghij", 0, 5, 5);
+ test("abcdefghij", 0, 10, "abcdefghij", 0, 9, 1);
+ test("abcdefghij", 0, 10, "abcdefghij", 0, 10, 0);
+ test("abcdefghij", 0, 10, "abcdefghij", 0, 11, 0);
+ test("abcdefghij", 0, 10, "abcdefghij", 1, 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 0, 10, "abcdefghij", 1, 4, -1);
+ test("abcdefghij", 0, 10, "abcdefghij", 1, 8, -1);
+ test("abcdefghij", 0, 10, "abcdefghij", 1, 9, -1);
+ test("abcdefghij", 0, 10, "abcdefghij", 1, 10, -1);
+ test("abcdefghij", 0, 10, "abcdefghij", 5, 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghij", 5, 1, -5);
+ test("abcdefghij", 0, 10, "abcdefghij", 5, 2, -5);
+ test("abcdefghij", 0, 10, "abcdefghij", 5, 4, -5);
+ test("abcdefghij", 0, 10, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 0, 10, "abcdefghij", 5, 6, -5);
+ test("abcdefghij", 0, 10, "abcdefghij", 9, 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghij", 9, 1, -9);
+ test("abcdefghij", 0, 10, "abcdefghij", 9, 2, -9);
+ test("abcdefghij", 0, 10, "abcdefghij", 10, 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghij", 10, 1, 10);
+ test("abcdefghij", 0, 10, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 1, 9);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 10, 0);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 19, -9);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 20, -10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 21, -10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 20, 0, 10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 20, 1, 10);
+ test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 0, 11, "", 0, 0, 10);
+ test("abcdefghij", 0, 11, "", 0, 1, 10);
+ test("abcdefghij", 0, 11, "", 1, 0, 0);
+ test("abcdefghij", 0, 11, "abcde", 0, 0, 10);
+ test("abcdefghij", 0, 11, "abcde", 0, 1, 9);
+ test("abcdefghij", 0, 11, "abcde", 0, 2, 8);
+}
+
+void test23()
+{
+ test("abcdefghij", 0, 11, "abcde", 0, 4, 6);
+ test("abcdefghij", 0, 11, "abcde", 0, 5, 5);
+ test("abcdefghij", 0, 11, "abcde", 0, 6, 5);
+ test("abcdefghij", 0, 11, "abcde", 1, 0, 10);
+ test("abcdefghij", 0, 11, "abcde", 1, 1, -1);
+ test("abcdefghij", 0, 11, "abcde", 1, 2, -1);
+ test("abcdefghij", 0, 11, "abcde", 1, 3, -1);
+ test("abcdefghij", 0, 11, "abcde", 1, 4, -1);
+ test("abcdefghij", 0, 11, "abcde", 1, 5, -1);
+ test("abcdefghij", 0, 11, "abcde", 2, 0, 10);
+ test("abcdefghij", 0, 11, "abcde", 2, 1, -2);
+ test("abcdefghij", 0, 11, "abcde", 2, 2, -2);
+ test("abcdefghij", 0, 11, "abcde", 2, 3, -2);
+ test("abcdefghij", 0, 11, "abcde", 2, 4, -2);
+ test("abcdefghij", 0, 11, "abcde", 4, 0, 10);
+ test("abcdefghij", 0, 11, "abcde", 4, 1, -4);
+ test("abcdefghij", 0, 11, "abcde", 4, 2, -4);
+ test("abcdefghij", 0, 11, "abcde", 5, 0, 10);
+ test("abcdefghij", 0, 11, "abcde", 5, 1, 10);
+ test("abcdefghij", 0, 11, "abcde", 6, 0, 0);
+ test("abcdefghij", 0, 11, "abcdefghij", 0, 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghij", 0, 1, 9);
+ test("abcdefghij", 0, 11, "abcdefghij", 0, 5, 5);
+ test("abcdefghij", 0, 11, "abcdefghij", 0, 9, 1);
+ test("abcdefghij", 0, 11, "abcdefghij", 0, 10, 0);
+ test("abcdefghij", 0, 11, "abcdefghij", 0, 11, 0);
+ test("abcdefghij", 0, 11, "abcdefghij", 1, 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 0, 11, "abcdefghij", 1, 4, -1);
+ test("abcdefghij", 0, 11, "abcdefghij", 1, 8, -1);
+ test("abcdefghij", 0, 11, "abcdefghij", 1, 9, -1);
+ test("abcdefghij", 0, 11, "abcdefghij", 1, 10, -1);
+ test("abcdefghij", 0, 11, "abcdefghij", 5, 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghij", 5, 1, -5);
+ test("abcdefghij", 0, 11, "abcdefghij", 5, 2, -5);
+ test("abcdefghij", 0, 11, "abcdefghij", 5, 4, -5);
+ test("abcdefghij", 0, 11, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 0, 11, "abcdefghij", 5, 6, -5);
+ test("abcdefghij", 0, 11, "abcdefghij", 9, 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghij", 9, 1, -9);
+ test("abcdefghij", 0, 11, "abcdefghij", 9, 2, -9);
+ test("abcdefghij", 0, 11, "abcdefghij", 10, 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghij", 10, 1, 10);
+ test("abcdefghij", 0, 11, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 1, 9);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 10, 0);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 19, -9);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 20, -10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 21, -10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 20, 0, 10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 20, 1, 10);
+ test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 1, 0, "", 0, 0, 0);
+ test("abcdefghij", 1, 0, "", 0, 1, 0);
+ test("abcdefghij", 1, 0, "", 1, 0, 0);
+ test("abcdefghij", 1, 0, "abcde", 0, 0, 0);
+ test("abcdefghij", 1, 0, "abcde", 0, 1, -1);
+ test("abcdefghij", 1, 0, "abcde", 0, 2, -2);
+ test("abcdefghij", 1, 0, "abcde", 0, 4, -4);
+ test("abcdefghij", 1, 0, "abcde", 0, 5, -5);
+ test("abcdefghij", 1, 0, "abcde", 0, 6, -5);
+ test("abcdefghij", 1, 0, "abcde", 1, 0, 0);
+ test("abcdefghij", 1, 0, "abcde", 1, 1, -1);
+ test("abcdefghij", 1, 0, "abcde", 1, 2, -2);
+ test("abcdefghij", 1, 0, "abcde", 1, 3, -3);
+ test("abcdefghij", 1, 0, "abcde", 1, 4, -4);
+ test("abcdefghij", 1, 0, "abcde", 1, 5, -4);
+ test("abcdefghij", 1, 0, "abcde", 2, 0, 0);
+ test("abcdefghij", 1, 0, "abcde", 2, 1, -1);
+ test("abcdefghij", 1, 0, "abcde", 2, 2, -2);
+ test("abcdefghij", 1, 0, "abcde", 2, 3, -3);
+ test("abcdefghij", 1, 0, "abcde", 2, 4, -3);
+ test("abcdefghij", 1, 0, "abcde", 4, 0, 0);
+ test("abcdefghij", 1, 0, "abcde", 4, 1, -1);
+ test("abcdefghij", 1, 0, "abcde", 4, 2, -1);
+ test("abcdefghij", 1, 0, "abcde", 5, 0, 0);
+ test("abcdefghij", 1, 0, "abcde", 5, 1, 0);
+ test("abcdefghij", 1, 0, "abcde", 6, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghij", 0, 1, -1);
+ test("abcdefghij", 1, 0, "abcdefghij", 0, 5, -5);
+ test("abcdefghij", 1, 0, "abcdefghij", 0, 9, -9);
+ test("abcdefghij", 1, 0, "abcdefghij", 0, 10, -10);
+ test("abcdefghij", 1, 0, "abcdefghij", 0, 11, -10);
+}
+
+void test24()
+{
+ test("abcdefghij", 1, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 1, 0, "abcdefghij", 1, 4, -4);
+ test("abcdefghij", 1, 0, "abcdefghij", 1, 8, -8);
+ test("abcdefghij", 1, 0, "abcdefghij", 1, 9, -9);
+ test("abcdefghij", 1, 0, "abcdefghij", 1, 10, -9);
+ test("abcdefghij", 1, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghij", 5, 1, -1);
+ test("abcdefghij", 1, 0, "abcdefghij", 5, 2, -2);
+ test("abcdefghij", 1, 0, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 1, 0, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 1, 0, "abcdefghij", 5, 6, -5);
+ test("abcdefghij", 1, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghij", 9, 1, -1);
+ test("abcdefghij", 1, 0, "abcdefghij", 9, 2, -1);
+ test("abcdefghij", 1, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghij", 1, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 1, 1, "", 0, 0, 1);
+ test("abcdefghij", 1, 1, "", 0, 1, 1);
+ test("abcdefghij", 1, 1, "", 1, 0, 0);
+ test("abcdefghij", 1, 1, "abcde", 0, 0, 1);
+ test("abcdefghij", 1, 1, "abcde", 0, 1, 1);
+ test("abcdefghij", 1, 1, "abcde", 0, 2, 1);
+ test("abcdefghij", 1, 1, "abcde", 0, 4, 1);
+ test("abcdefghij", 1, 1, "abcde", 0, 5, 1);
+ test("abcdefghij", 1, 1, "abcde", 0, 6, 1);
+ test("abcdefghij", 1, 1, "abcde", 1, 0, 1);
+ test("abcdefghij", 1, 1, "abcde", 1, 1, 0);
+ test("abcdefghij", 1, 1, "abcde", 1, 2, -1);
+ test("abcdefghij", 1, 1, "abcde", 1, 3, -2);
+ test("abcdefghij", 1, 1, "abcde", 1, 4, -3);
+ test("abcdefghij", 1, 1, "abcde", 1, 5, -3);
+ test("abcdefghij", 1, 1, "abcde", 2, 0, 1);
+ test("abcdefghij", 1, 1, "abcde", 2, 1, -1);
+ test("abcdefghij", 1, 1, "abcde", 2, 2, -1);
+ test("abcdefghij", 1, 1, "abcde", 2, 3, -1);
+ test("abcdefghij", 1, 1, "abcde", 2, 4, -1);
+ test("abcdefghij", 1, 1, "abcde", 4, 0, 1);
+ test("abcdefghij", 1, 1, "abcde", 4, 1, -3);
+ test("abcdefghij", 1, 1, "abcde", 4, 2, -3);
+ test("abcdefghij", 1, 1, "abcde", 5, 0, 1);
+ test("abcdefghij", 1, 1, "abcde", 5, 1, 1);
+ test("abcdefghij", 1, 1, "abcde", 6, 0, 0);
+ test("abcdefghij", 1, 1, "abcdefghij", 0, 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 0, 1, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 0, 5, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 0, 9, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 0, 10, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 0, 11, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 1, 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 1, 1, 0);
+ test("abcdefghij", 1, 1, "abcdefghij", 1, 4, -3);
+ test("abcdefghij", 1, 1, "abcdefghij", 1, 8, -7);
+ test("abcdefghij", 1, 1, "abcdefghij", 1, 9, -8);
+ test("abcdefghij", 1, 1, "abcdefghij", 1, 10, -8);
+ test("abcdefghij", 1, 1, "abcdefghij", 5, 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 5, 1, -4);
+ test("abcdefghij", 1, 1, "abcdefghij", 5, 2, -4);
+ test("abcdefghij", 1, 1, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 1, 1, "abcdefghij", 5, 5, -4);
+ test("abcdefghij", 1, 1, "abcdefghij", 5, 6, -4);
+ test("abcdefghij", 1, 1, "abcdefghij", 9, 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 9, 1, -8);
+ test("abcdefghij", 1, 1, "abcdefghij", 9, 2, -8);
+ test("abcdefghij", 1, 1, "abcdefghij", 10, 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 10, 1, 1);
+ test("abcdefghij", 1, 1, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 1, 0);
+}
+
+void test25()
+{
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 9, -8);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 18, -17);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 19, -18);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 20, -18);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 1, 4, "", 0, 0, 4);
+ test("abcdefghij", 1, 4, "", 0, 1, 4);
+ test("abcdefghij", 1, 4, "", 1, 0, 0);
+ test("abcdefghij", 1, 4, "abcde", 0, 0, 4);
+ test("abcdefghij", 1, 4, "abcde", 0, 1, 1);
+ test("abcdefghij", 1, 4, "abcde", 0, 2, 1);
+ test("abcdefghij", 1, 4, "abcde", 0, 4, 1);
+ test("abcdefghij", 1, 4, "abcde", 0, 5, 1);
+ test("abcdefghij", 1, 4, "abcde", 0, 6, 1);
+ test("abcdefghij", 1, 4, "abcde", 1, 0, 4);
+ test("abcdefghij", 1, 4, "abcde", 1, 1, 3);
+ test("abcdefghij", 1, 4, "abcde", 1, 2, 2);
+ test("abcdefghij", 1, 4, "abcde", 1, 3, 1);
+ test("abcdefghij", 1, 4, "abcde", 1, 4, 0);
+ test("abcdefghij", 1, 4, "abcde", 1, 5, 0);
+ test("abcdefghij", 1, 4, "abcde", 2, 0, 4);
+ test("abcdefghij", 1, 4, "abcde", 2, 1, -1);
+ test("abcdefghij", 1, 4, "abcde", 2, 2, -1);
+ test("abcdefghij", 1, 4, "abcde", 2, 3, -1);
+ test("abcdefghij", 1, 4, "abcde", 2, 4, -1);
+ test("abcdefghij", 1, 4, "abcde", 4, 0, 4);
+ test("abcdefghij", 1, 4, "abcde", 4, 1, -3);
+ test("abcdefghij", 1, 4, "abcde", 4, 2, -3);
+ test("abcdefghij", 1, 4, "abcde", 5, 0, 4);
+ test("abcdefghij", 1, 4, "abcde", 5, 1, 4);
+ test("abcdefghij", 1, 4, "abcde", 6, 0, 0);
+ test("abcdefghij", 1, 4, "abcdefghij", 0, 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghij", 0, 1, 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 0, 5, 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 0, 9, 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 0, 10, 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 0, 11, 1);
+ test("abcdefghij", 1, 4, "abcdefghij", 1, 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghij", 1, 1, 3);
+ test("abcdefghij", 1, 4, "abcdefghij", 1, 4, 0);
+ test("abcdefghij", 1, 4, "abcdefghij", 1, 8, -4);
+ test("abcdefghij", 1, 4, "abcdefghij", 1, 9, -5);
+ test("abcdefghij", 1, 4, "abcdefghij", 1, 10, -5);
+ test("abcdefghij", 1, 4, "abcdefghij", 5, 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghij", 5, 1, -4);
+ test("abcdefghij", 1, 4, "abcdefghij", 5, 2, -4);
+ test("abcdefghij", 1, 4, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 1, 4, "abcdefghij", 5, 5, -4);
+ test("abcdefghij", 1, 4, "abcdefghij", 5, 6, -4);
+ test("abcdefghij", 1, 4, "abcdefghij", 9, 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghij", 9, 1, -8);
+ test("abcdefghij", 1, 4, "abcdefghij", 9, 2, -8);
+ test("abcdefghij", 1, 4, "abcdefghij", 10, 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghij", 10, 1, 4);
+ test("abcdefghij", 1, 4, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 1, 3);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 9, -5);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 18, -14);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 19, -15);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 20, -15);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 20, 0, 4);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 20, 1, 4);
+ test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 1, 8, "", 0, 0, 8);
+ test("abcdefghij", 1, 8, "", 0, 1, 8);
+ test("abcdefghij", 1, 8, "", 1, 0, 0);
+ test("abcdefghij", 1, 8, "abcde", 0, 0, 8);
+ test("abcdefghij", 1, 8, "abcde", 0, 1, 1);
+ test("abcdefghij", 1, 8, "abcde", 0, 2, 1);
+ test("abcdefghij", 1, 8, "abcde", 0, 4, 1);
+ test("abcdefghij", 1, 8, "abcde", 0, 5, 1);
+ test("abcdefghij", 1, 8, "abcde", 0, 6, 1);
+ test("abcdefghij", 1, 8, "abcde", 1, 0, 8);
+}
+
+void test26()
+{
+ test("abcdefghij", 1, 8, "abcde", 1, 1, 7);
+ test("abcdefghij", 1, 8, "abcde", 1, 2, 6);
+ test("abcdefghij", 1, 8, "abcde", 1, 3, 5);
+ test("abcdefghij", 1, 8, "abcde", 1, 4, 4);
+ test("abcdefghij", 1, 8, "abcde", 1, 5, 4);
+ test("abcdefghij", 1, 8, "abcde", 2, 0, 8);
+ test("abcdefghij", 1, 8, "abcde", 2, 1, -1);
+ test("abcdefghij", 1, 8, "abcde", 2, 2, -1);
+ test("abcdefghij", 1, 8, "abcde", 2, 3, -1);
+ test("abcdefghij", 1, 8, "abcde", 2, 4, -1);
+ test("abcdefghij", 1, 8, "abcde", 4, 0, 8);
+ test("abcdefghij", 1, 8, "abcde", 4, 1, -3);
+ test("abcdefghij", 1, 8, "abcde", 4, 2, -3);
+ test("abcdefghij", 1, 8, "abcde", 5, 0, 8);
+ test("abcdefghij", 1, 8, "abcde", 5, 1, 8);
+ test("abcdefghij", 1, 8, "abcde", 6, 0, 0);
+ test("abcdefghij", 1, 8, "abcdefghij", 0, 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghij", 0, 1, 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 0, 5, 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 0, 9, 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 0, 10, 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 0, 11, 1);
+ test("abcdefghij", 1, 8, "abcdefghij", 1, 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghij", 1, 1, 7);
+ test("abcdefghij", 1, 8, "abcdefghij", 1, 4, 4);
+ test("abcdefghij", 1, 8, "abcdefghij", 1, 8, 0);
+ test("abcdefghij", 1, 8, "abcdefghij", 1, 9, -1);
+ test("abcdefghij", 1, 8, "abcdefghij", 1, 10, -1);
+ test("abcdefghij", 1, 8, "abcdefghij", 5, 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghij", 5, 1, -4);
+ test("abcdefghij", 1, 8, "abcdefghij", 5, 2, -4);
+ test("abcdefghij", 1, 8, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 1, 8, "abcdefghij", 5, 5, -4);
+ test("abcdefghij", 1, 8, "abcdefghij", 5, 6, -4);
+ test("abcdefghij", 1, 8, "abcdefghij", 9, 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghij", 9, 1, -8);
+ test("abcdefghij", 1, 8, "abcdefghij", 9, 2, -8);
+ test("abcdefghij", 1, 8, "abcdefghij", 10, 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghij", 10, 1, 8);
+ test("abcdefghij", 1, 8, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 1, 7);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 18, -10);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 19, -11);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 20, -11);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 20, 0, 8);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 20, 1, 8);
+ test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 1, 9, "", 0, 0, 9);
+ test("abcdefghij", 1, 9, "", 0, 1, 9);
+ test("abcdefghij", 1, 9, "", 1, 0, 0);
+ test("abcdefghij", 1, 9, "abcde", 0, 0, 9);
+ test("abcdefghij", 1, 9, "abcde", 0, 1, 1);
+ test("abcdefghij", 1, 9, "abcde", 0, 2, 1);
+ test("abcdefghij", 1, 9, "abcde", 0, 4, 1);
+ test("abcdefghij", 1, 9, "abcde", 0, 5, 1);
+ test("abcdefghij", 1, 9, "abcde", 0, 6, 1);
+ test("abcdefghij", 1, 9, "abcde", 1, 0, 9);
+ test("abcdefghij", 1, 9, "abcde", 1, 1, 8);
+ test("abcdefghij", 1, 9, "abcde", 1, 2, 7);
+ test("abcdefghij", 1, 9, "abcde", 1, 3, 6);
+ test("abcdefghij", 1, 9, "abcde", 1, 4, 5);
+ test("abcdefghij", 1, 9, "abcde", 1, 5, 5);
+ test("abcdefghij", 1, 9, "abcde", 2, 0, 9);
+ test("abcdefghij", 1, 9, "abcde", 2, 1, -1);
+ test("abcdefghij", 1, 9, "abcde", 2, 2, -1);
+ test("abcdefghij", 1, 9, "abcde", 2, 3, -1);
+ test("abcdefghij", 1, 9, "abcde", 2, 4, -1);
+ test("abcdefghij", 1, 9, "abcde", 4, 0, 9);
+ test("abcdefghij", 1, 9, "abcde", 4, 1, -3);
+ test("abcdefghij", 1, 9, "abcde", 4, 2, -3);
+ test("abcdefghij", 1, 9, "abcde", 5, 0, 9);
+ test("abcdefghij", 1, 9, "abcde", 5, 1, 9);
+ test("abcdefghij", 1, 9, "abcde", 6, 0, 0);
+ test("abcdefghij", 1, 9, "abcdefghij", 0, 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghij", 0, 1, 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 0, 5, 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 0, 9, 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 0, 10, 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 0, 11, 1);
+ test("abcdefghij", 1, 9, "abcdefghij", 1, 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghij", 1, 1, 8);
+ test("abcdefghij", 1, 9, "abcdefghij", 1, 4, 5);
+ test("abcdefghij", 1, 9, "abcdefghij", 1, 8, 1);
+}
+
+void test27()
+{
+ test("abcdefghij", 1, 9, "abcdefghij", 1, 9, 0);
+ test("abcdefghij", 1, 9, "abcdefghij", 1, 10, 0);
+ test("abcdefghij", 1, 9, "abcdefghij", 5, 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghij", 5, 1, -4);
+ test("abcdefghij", 1, 9, "abcdefghij", 5, 2, -4);
+ test("abcdefghij", 1, 9, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 1, 9, "abcdefghij", 5, 5, -4);
+ test("abcdefghij", 1, 9, "abcdefghij", 5, 6, -4);
+ test("abcdefghij", 1, 9, "abcdefghij", 9, 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghij", 9, 1, -8);
+ test("abcdefghij", 1, 9, "abcdefghij", 9, 2, -8);
+ test("abcdefghij", 1, 9, "abcdefghij", 10, 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghij", 10, 1, 9);
+ test("abcdefghij", 1, 9, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 1, 8);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 9, 0);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 18, -9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 19, -10);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 20, -10);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 20, 0, 9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 20, 1, 9);
+ test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 1, 10, "", 0, 0, 9);
+ test("abcdefghij", 1, 10, "", 0, 1, 9);
+ test("abcdefghij", 1, 10, "", 1, 0, 0);
+ test("abcdefghij", 1, 10, "abcde", 0, 0, 9);
+ test("abcdefghij", 1, 10, "abcde", 0, 1, 1);
+ test("abcdefghij", 1, 10, "abcde", 0, 2, 1);
+ test("abcdefghij", 1, 10, "abcde", 0, 4, 1);
+ test("abcdefghij", 1, 10, "abcde", 0, 5, 1);
+ test("abcdefghij", 1, 10, "abcde", 0, 6, 1);
+ test("abcdefghij", 1, 10, "abcde", 1, 0, 9);
+ test("abcdefghij", 1, 10, "abcde", 1, 1, 8);
+ test("abcdefghij", 1, 10, "abcde", 1, 2, 7);
+ test("abcdefghij", 1, 10, "abcde", 1, 3, 6);
+ test("abcdefghij", 1, 10, "abcde", 1, 4, 5);
+ test("abcdefghij", 1, 10, "abcde", 1, 5, 5);
+ test("abcdefghij", 1, 10, "abcde", 2, 0, 9);
+ test("abcdefghij", 1, 10, "abcde", 2, 1, -1);
+ test("abcdefghij", 1, 10, "abcde", 2, 2, -1);
+ test("abcdefghij", 1, 10, "abcde", 2, 3, -1);
+ test("abcdefghij", 1, 10, "abcde", 2, 4, -1);
+ test("abcdefghij", 1, 10, "abcde", 4, 0, 9);
+ test("abcdefghij", 1, 10, "abcde", 4, 1, -3);
+ test("abcdefghij", 1, 10, "abcde", 4, 2, -3);
+ test("abcdefghij", 1, 10, "abcde", 5, 0, 9);
+ test("abcdefghij", 1, 10, "abcde", 5, 1, 9);
+ test("abcdefghij", 1, 10, "abcde", 6, 0, 0);
+ test("abcdefghij", 1, 10, "abcdefghij", 0, 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghij", 0, 1, 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 0, 5, 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 0, 9, 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 0, 10, 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 0, 11, 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 1, 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghij", 1, 1, 8);
+ test("abcdefghij", 1, 10, "abcdefghij", 1, 4, 5);
+ test("abcdefghij", 1, 10, "abcdefghij", 1, 8, 1);
+ test("abcdefghij", 1, 10, "abcdefghij", 1, 9, 0);
+ test("abcdefghij", 1, 10, "abcdefghij", 1, 10, 0);
+ test("abcdefghij", 1, 10, "abcdefghij", 5, 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghij", 5, 1, -4);
+ test("abcdefghij", 1, 10, "abcdefghij", 5, 2, -4);
+ test("abcdefghij", 1, 10, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 1, 10, "abcdefghij", 5, 5, -4);
+ test("abcdefghij", 1, 10, "abcdefghij", 5, 6, -4);
+ test("abcdefghij", 1, 10, "abcdefghij", 9, 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghij", 9, 1, -8);
+ test("abcdefghij", 1, 10, "abcdefghij", 9, 2, -8);
+ test("abcdefghij", 1, 10, "abcdefghij", 10, 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghij", 10, 1, 9);
+ test("abcdefghij", 1, 10, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 1, 8);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 9, 0);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 18, -9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 19, -10);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 20, -10);
+}
+
+void test28()
+{
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 20, 0, 9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 20, 1, 9);
+ test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 5, 0, "", 0, 0, 0);
+ test("abcdefghij", 5, 0, "", 0, 1, 0);
+ test("abcdefghij", 5, 0, "", 1, 0, 0);
+ test("abcdefghij", 5, 0, "abcde", 0, 0, 0);
+ test("abcdefghij", 5, 0, "abcde", 0, 1, -1);
+ test("abcdefghij", 5, 0, "abcde", 0, 2, -2);
+ test("abcdefghij", 5, 0, "abcde", 0, 4, -4);
+ test("abcdefghij", 5, 0, "abcde", 0, 5, -5);
+ test("abcdefghij", 5, 0, "abcde", 0, 6, -5);
+ test("abcdefghij", 5, 0, "abcde", 1, 0, 0);
+ test("abcdefghij", 5, 0, "abcde", 1, 1, -1);
+ test("abcdefghij", 5, 0, "abcde", 1, 2, -2);
+ test("abcdefghij", 5, 0, "abcde", 1, 3, -3);
+ test("abcdefghij", 5, 0, "abcde", 1, 4, -4);
+ test("abcdefghij", 5, 0, "abcde", 1, 5, -4);
+ test("abcdefghij", 5, 0, "abcde", 2, 0, 0);
+ test("abcdefghij", 5, 0, "abcde", 2, 1, -1);
+ test("abcdefghij", 5, 0, "abcde", 2, 2, -2);
+ test("abcdefghij", 5, 0, "abcde", 2, 3, -3);
+ test("abcdefghij", 5, 0, "abcde", 2, 4, -3);
+ test("abcdefghij", 5, 0, "abcde", 4, 0, 0);
+ test("abcdefghij", 5, 0, "abcde", 4, 1, -1);
+ test("abcdefghij", 5, 0, "abcde", 4, 2, -1);
+ test("abcdefghij", 5, 0, "abcde", 5, 0, 0);
+ test("abcdefghij", 5, 0, "abcde", 5, 1, 0);
+ test("abcdefghij", 5, 0, "abcde", 6, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghij", 0, 1, -1);
+ test("abcdefghij", 5, 0, "abcdefghij", 0, 5, -5);
+ test("abcdefghij", 5, 0, "abcdefghij", 0, 9, -9);
+ test("abcdefghij", 5, 0, "abcdefghij", 0, 10, -10);
+ test("abcdefghij", 5, 0, "abcdefghij", 0, 11, -10);
+ test("abcdefghij", 5, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 5, 0, "abcdefghij", 1, 4, -4);
+ test("abcdefghij", 5, 0, "abcdefghij", 1, 8, -8);
+ test("abcdefghij", 5, 0, "abcdefghij", 1, 9, -9);
+ test("abcdefghij", 5, 0, "abcdefghij", 1, 10, -9);
+ test("abcdefghij", 5, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghij", 5, 1, -1);
+ test("abcdefghij", 5, 0, "abcdefghij", 5, 2, -2);
+ test("abcdefghij", 5, 0, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 5, 0, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 5, 0, "abcdefghij", 5, 6, -5);
+ test("abcdefghij", 5, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghij", 9, 1, -1);
+ test("abcdefghij", 5, 0, "abcdefghij", 9, 2, -1);
+ test("abcdefghij", 5, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghij", 5, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 5, 1, "", 0, 0, 1);
+ test("abcdefghij", 5, 1, "", 0, 1, 1);
+ test("abcdefghij", 5, 1, "", 1, 0, 0);
+ test("abcdefghij", 5, 1, "abcde", 0, 0, 1);
+ test("abcdefghij", 5, 1, "abcde", 0, 1, 5);
+ test("abcdefghij", 5, 1, "abcde", 0, 2, 5);
+ test("abcdefghij", 5, 1, "abcde", 0, 4, 5);
+ test("abcdefghij", 5, 1, "abcde", 0, 5, 5);
+ test("abcdefghij", 5, 1, "abcde", 0, 6, 5);
+ test("abcdefghij", 5, 1, "abcde", 1, 0, 1);
+ test("abcdefghij", 5, 1, "abcde", 1, 1, 4);
+ test("abcdefghij", 5, 1, "abcde", 1, 2, 4);
+ test("abcdefghij", 5, 1, "abcde", 1, 3, 4);
+ test("abcdefghij", 5, 1, "abcde", 1, 4, 4);
+}
+
+void test29()
+{
+ test("abcdefghij", 5, 1, "abcde", 1, 5, 4);
+ test("abcdefghij", 5, 1, "abcde", 2, 0, 1);
+ test("abcdefghij", 5, 1, "abcde", 2, 1, 3);
+ test("abcdefghij", 5, 1, "abcde", 2, 2, 3);
+ test("abcdefghij", 5, 1, "abcde", 2, 3, 3);
+ test("abcdefghij", 5, 1, "abcde", 2, 4, 3);
+ test("abcdefghij", 5, 1, "abcde", 4, 0, 1);
+ test("abcdefghij", 5, 1, "abcde", 4, 1, 1);
+ test("abcdefghij", 5, 1, "abcde", 4, 2, 1);
+ test("abcdefghij", 5, 1, "abcde", 5, 0, 1);
+ test("abcdefghij", 5, 1, "abcde", 5, 1, 1);
+ test("abcdefghij", 5, 1, "abcde", 6, 0, 0);
+ test("abcdefghij", 5, 1, "abcdefghij", 0, 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghij", 0, 1, 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 0, 5, 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 0, 9, 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 0, 10, 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 0, 11, 5);
+ test("abcdefghij", 5, 1, "abcdefghij", 1, 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghij", 1, 1, 4);
+ test("abcdefghij", 5, 1, "abcdefghij", 1, 4, 4);
+ test("abcdefghij", 5, 1, "abcdefghij", 1, 8, 4);
+ test("abcdefghij", 5, 1, "abcdefghij", 1, 9, 4);
+ test("abcdefghij", 5, 1, "abcdefghij", 1, 10, 4);
+ test("abcdefghij", 5, 1, "abcdefghij", 5, 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghij", 5, 1, 0);
+ test("abcdefghij", 5, 1, "abcdefghij", 5, 2, -1);
+ test("abcdefghij", 5, 1, "abcdefghij", 5, 4, -3);
+ test("abcdefghij", 5, 1, "abcdefghij", 5, 5, -4);
+ test("abcdefghij", 5, 1, "abcdefghij", 5, 6, -4);
+ test("abcdefghij", 5, 1, "abcdefghij", 9, 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghij", 9, 1, -4);
+ test("abcdefghij", 5, 1, "abcdefghij", 9, 2, -4);
+ test("abcdefghij", 5, 1, "abcdefghij", 10, 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghij", 10, 1, 1);
+ test("abcdefghij", 5, 1, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 1, 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 10, 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 19, 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 20, 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 21, 5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 1, 4);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 9, 4);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 18, 4);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 19, 4);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 20, 4);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 1, -5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 9, -5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 10, -5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 11, -5);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 1, -14);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 2, -14);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 5, 2, "", 0, 0, 2);
+ test("abcdefghij", 5, 2, "", 0, 1, 2);
+ test("abcdefghij", 5, 2, "", 1, 0, 0);
+ test("abcdefghij", 5, 2, "abcde", 0, 0, 2);
+ test("abcdefghij", 5, 2, "abcde", 0, 1, 5);
+ test("abcdefghij", 5, 2, "abcde", 0, 2, 5);
+ test("abcdefghij", 5, 2, "abcde", 0, 4, 5);
+ test("abcdefghij", 5, 2, "abcde", 0, 5, 5);
+ test("abcdefghij", 5, 2, "abcde", 0, 6, 5);
+ test("abcdefghij", 5, 2, "abcde", 1, 0, 2);
+ test("abcdefghij", 5, 2, "abcde", 1, 1, 4);
+ test("abcdefghij", 5, 2, "abcde", 1, 2, 4);
+ test("abcdefghij", 5, 2, "abcde", 1, 3, 4);
+ test("abcdefghij", 5, 2, "abcde", 1, 4, 4);
+ test("abcdefghij", 5, 2, "abcde", 1, 5, 4);
+ test("abcdefghij", 5, 2, "abcde", 2, 0, 2);
+ test("abcdefghij", 5, 2, "abcde", 2, 1, 3);
+ test("abcdefghij", 5, 2, "abcde", 2, 2, 3);
+ test("abcdefghij", 5, 2, "abcde", 2, 3, 3);
+ test("abcdefghij", 5, 2, "abcde", 2, 4, 3);
+ test("abcdefghij", 5, 2, "abcde", 4, 0, 2);
+ test("abcdefghij", 5, 2, "abcde", 4, 1, 1);
+ test("abcdefghij", 5, 2, "abcde", 4, 2, 1);
+ test("abcdefghij", 5, 2, "abcde", 5, 0, 2);
+ test("abcdefghij", 5, 2, "abcde", 5, 1, 2);
+ test("abcdefghij", 5, 2, "abcde", 6, 0, 0);
+ test("abcdefghij", 5, 2, "abcdefghij", 0, 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghij", 0, 1, 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 0, 5, 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 0, 9, 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 0, 10, 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 0, 11, 5);
+ test("abcdefghij", 5, 2, "abcdefghij", 1, 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghij", 1, 1, 4);
+ test("abcdefghij", 5, 2, "abcdefghij", 1, 4, 4);
+ test("abcdefghij", 5, 2, "abcdefghij", 1, 8, 4);
+ test("abcdefghij", 5, 2, "abcdefghij", 1, 9, 4);
+ test("abcdefghij", 5, 2, "abcdefghij", 1, 10, 4);
+ test("abcdefghij", 5, 2, "abcdefghij", 5, 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghij", 5, 1, 1);
+}
+
+void test30()
+{
+ test("abcdefghij", 5, 2, "abcdefghij", 5, 2, 0);
+ test("abcdefghij", 5, 2, "abcdefghij", 5, 4, -2);
+ test("abcdefghij", 5, 2, "abcdefghij", 5, 5, -3);
+ test("abcdefghij", 5, 2, "abcdefghij", 5, 6, -3);
+ test("abcdefghij", 5, 2, "abcdefghij", 9, 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghij", 9, 1, -4);
+ test("abcdefghij", 5, 2, "abcdefghij", 9, 2, -4);
+ test("abcdefghij", 5, 2, "abcdefghij", 10, 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghij", 10, 1, 2);
+ test("abcdefghij", 5, 2, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 1, 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 10, 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 19, 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 20, 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 21, 5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 1, 4);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 9, 4);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 18, 4);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 19, 4);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 20, 4);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 1, -5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 9, -5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 10, -5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 11, -5);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 1, -14);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 2, -14);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 20, 0, 2);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 20, 1, 2);
+ test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 5, 4, "", 0, 0, 4);
+ test("abcdefghij", 5, 4, "", 0, 1, 4);
+ test("abcdefghij", 5, 4, "", 1, 0, 0);
+ test("abcdefghij", 5, 4, "abcde", 0, 0, 4);
+ test("abcdefghij", 5, 4, "abcde", 0, 1, 5);
+ test("abcdefghij", 5, 4, "abcde", 0, 2, 5);
+ test("abcdefghij", 5, 4, "abcde", 0, 4, 5);
+ test("abcdefghij", 5, 4, "abcde", 0, 5, 5);
+ test("abcdefghij", 5, 4, "abcde", 0, 6, 5);
+ test("abcdefghij", 5, 4, "abcde", 1, 0, 4);
+ test("abcdefghij", 5, 4, "abcde", 1, 1, 4);
+ test("abcdefghij", 5, 4, "abcde", 1, 2, 4);
+ test("abcdefghij", 5, 4, "abcde", 1, 3, 4);
+ test("abcdefghij", 5, 4, "abcde", 1, 4, 4);
+ test("abcdefghij", 5, 4, "abcde", 1, 5, 4);
+ test("abcdefghij", 5, 4, "abcde", 2, 0, 4);
+ test("abcdefghij", 5, 4, "abcde", 2, 1, 3);
+ test("abcdefghij", 5, 4, "abcde", 2, 2, 3);
+ test("abcdefghij", 5, 4, "abcde", 2, 3, 3);
+ test("abcdefghij", 5, 4, "abcde", 2, 4, 3);
+ test("abcdefghij", 5, 4, "abcde", 4, 0, 4);
+ test("abcdefghij", 5, 4, "abcde", 4, 1, 1);
+ test("abcdefghij", 5, 4, "abcde", 4, 2, 1);
+ test("abcdefghij", 5, 4, "abcde", 5, 0, 4);
+ test("abcdefghij", 5, 4, "abcde", 5, 1, 4);
+ test("abcdefghij", 5, 4, "abcde", 6, 0, 0);
+ test("abcdefghij", 5, 4, "abcdefghij", 0, 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 0, 1, 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 0, 5, 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 0, 9, 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 0, 10, 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 0, 11, 5);
+ test("abcdefghij", 5, 4, "abcdefghij", 1, 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 1, 1, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 1, 4, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 1, 8, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 1, 9, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 1, 10, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 5, 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 5, 1, 3);
+ test("abcdefghij", 5, 4, "abcdefghij", 5, 2, 2);
+ test("abcdefghij", 5, 4, "abcdefghij", 5, 4, 0);
+ test("abcdefghij", 5, 4, "abcdefghij", 5, 5, -1);
+ test("abcdefghij", 5, 4, "abcdefghij", 5, 6, -1);
+ test("abcdefghij", 5, 4, "abcdefghij", 9, 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 9, 1, -4);
+ test("abcdefghij", 5, 4, "abcdefghij", 9, 2, -4);
+ test("abcdefghij", 5, 4, "abcdefghij", 10, 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 10, 1, 4);
+ test("abcdefghij", 5, 4, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 1, 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 10, 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 19, 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 20, 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 21, 5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 1, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 9, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 18, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 19, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 20, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 1, -5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 9, -5);
+}
+
+void test31()
+{
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 10, -5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 11, -5);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 1, -14);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 2, -14);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 20, 0, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 20, 1, 4);
+ test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 5, 5, "", 0, 0, 5);
+ test("abcdefghij", 5, 5, "", 0, 1, 5);
+ test("abcdefghij", 5, 5, "", 1, 0, 0);
+ test("abcdefghij", 5, 5, "abcde", 0, 0, 5);
+ test("abcdefghij", 5, 5, "abcde", 0, 1, 5);
+ test("abcdefghij", 5, 5, "abcde", 0, 2, 5);
+ test("abcdefghij", 5, 5, "abcde", 0, 4, 5);
+ test("abcdefghij", 5, 5, "abcde", 0, 5, 5);
+ test("abcdefghij", 5, 5, "abcde", 0, 6, 5);
+ test("abcdefghij", 5, 5, "abcde", 1, 0, 5);
+ test("abcdefghij", 5, 5, "abcde", 1, 1, 4);
+ test("abcdefghij", 5, 5, "abcde", 1, 2, 4);
+ test("abcdefghij", 5, 5, "abcde", 1, 3, 4);
+ test("abcdefghij", 5, 5, "abcde", 1, 4, 4);
+ test("abcdefghij", 5, 5, "abcde", 1, 5, 4);
+ test("abcdefghij", 5, 5, "abcde", 2, 0, 5);
+ test("abcdefghij", 5, 5, "abcde", 2, 1, 3);
+ test("abcdefghij", 5, 5, "abcde", 2, 2, 3);
+ test("abcdefghij", 5, 5, "abcde", 2, 3, 3);
+ test("abcdefghij", 5, 5, "abcde", 2, 4, 3);
+ test("abcdefghij", 5, 5, "abcde", 4, 0, 5);
+ test("abcdefghij", 5, 5, "abcde", 4, 1, 1);
+ test("abcdefghij", 5, 5, "abcde", 4, 2, 1);
+ test("abcdefghij", 5, 5, "abcde", 5, 0, 5);
+ test("abcdefghij", 5, 5, "abcde", 5, 1, 5);
+ test("abcdefghij", 5, 5, "abcde", 6, 0, 0);
+ test("abcdefghij", 5, 5, "abcdefghij", 0, 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 0, 1, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 0, 5, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 0, 9, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 0, 10, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 0, 11, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 1, 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 1, 1, 4);
+ test("abcdefghij", 5, 5, "abcdefghij", 1, 4, 4);
+ test("abcdefghij", 5, 5, "abcdefghij", 1, 8, 4);
+ test("abcdefghij", 5, 5, "abcdefghij", 1, 9, 4);
+ test("abcdefghij", 5, 5, "abcdefghij", 1, 10, 4);
+ test("abcdefghij", 5, 5, "abcdefghij", 5, 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 5, 1, 4);
+ test("abcdefghij", 5, 5, "abcdefghij", 5, 2, 3);
+ test("abcdefghij", 5, 5, "abcdefghij", 5, 4, 1);
+ test("abcdefghij", 5, 5, "abcdefghij", 5, 5, 0);
+ test("abcdefghij", 5, 5, "abcdefghij", 5, 6, 0);
+ test("abcdefghij", 5, 5, "abcdefghij", 9, 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 9, 1, -4);
+ test("abcdefghij", 5, 5, "abcdefghij", 9, 2, -4);
+ test("abcdefghij", 5, 5, "abcdefghij", 10, 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 10, 1, 5);
+ test("abcdefghij", 5, 5, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 1, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 10, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 19, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 20, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 21, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 1, 4);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 9, 4);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 18, 4);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 19, 4);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 20, 4);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 1, -5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 9, -5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 10, -5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 11, -5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 1, -14);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 2, -14);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 20, 0, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 20, 1, 5);
+ test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 5, 6, "", 0, 0, 5);
+ test("abcdefghij", 5, 6, "", 0, 1, 5);
+ test("abcdefghij", 5, 6, "", 1, 0, 0);
+ test("abcdefghij", 5, 6, "abcde", 0, 0, 5);
+ test("abcdefghij", 5, 6, "abcde", 0, 1, 5);
+ test("abcdefghij", 5, 6, "abcde", 0, 2, 5);
+ test("abcdefghij", 5, 6, "abcde", 0, 4, 5);
+ test("abcdefghij", 5, 6, "abcde", 0, 5, 5);
+ test("abcdefghij", 5, 6, "abcde", 0, 6, 5);
+ test("abcdefghij", 5, 6, "abcde", 1, 0, 5);
+ test("abcdefghij", 5, 6, "abcde", 1, 1, 4);
+ test("abcdefghij", 5, 6, "abcde", 1, 2, 4);
+ test("abcdefghij", 5, 6, "abcde", 1, 3, 4);
+ test("abcdefghij", 5, 6, "abcde", 1, 4, 4);
+ test("abcdefghij", 5, 6, "abcde", 1, 5, 4);
+ test("abcdefghij", 5, 6, "abcde", 2, 0, 5);
+ test("abcdefghij", 5, 6, "abcde", 2, 1, 3);
+ test("abcdefghij", 5, 6, "abcde", 2, 2, 3);
+}
+
+void test32()
+{
+ test("abcdefghij", 5, 6, "abcde", 2, 3, 3);
+ test("abcdefghij", 5, 6, "abcde", 2, 4, 3);
+ test("abcdefghij", 5, 6, "abcde", 4, 0, 5);
+ test("abcdefghij", 5, 6, "abcde", 4, 1, 1);
+ test("abcdefghij", 5, 6, "abcde", 4, 2, 1);
+ test("abcdefghij", 5, 6, "abcde", 5, 0, 5);
+ test("abcdefghij", 5, 6, "abcde", 5, 1, 5);
+ test("abcdefghij", 5, 6, "abcde", 6, 0, 0);
+ test("abcdefghij", 5, 6, "abcdefghij", 0, 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 0, 1, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 0, 5, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 0, 9, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 0, 10, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 0, 11, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 1, 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 1, 1, 4);
+ test("abcdefghij", 5, 6, "abcdefghij", 1, 4, 4);
+ test("abcdefghij", 5, 6, "abcdefghij", 1, 8, 4);
+ test("abcdefghij", 5, 6, "abcdefghij", 1, 9, 4);
+ test("abcdefghij", 5, 6, "abcdefghij", 1, 10, 4);
+ test("abcdefghij", 5, 6, "abcdefghij", 5, 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 5, 1, 4);
+ test("abcdefghij", 5, 6, "abcdefghij", 5, 2, 3);
+ test("abcdefghij", 5, 6, "abcdefghij", 5, 4, 1);
+ test("abcdefghij", 5, 6, "abcdefghij", 5, 5, 0);
+ test("abcdefghij", 5, 6, "abcdefghij", 5, 6, 0);
+ test("abcdefghij", 5, 6, "abcdefghij", 9, 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 9, 1, -4);
+ test("abcdefghij", 5, 6, "abcdefghij", 9, 2, -4);
+ test("abcdefghij", 5, 6, "abcdefghij", 10, 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 10, 1, 5);
+ test("abcdefghij", 5, 6, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 1, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 10, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 19, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 20, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 21, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 1, 4);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 9, 4);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 18, 4);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 19, 4);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 20, 4);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 1, -5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 9, -5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 10, -5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 11, -5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 1, -14);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 2, -14);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 20, 0, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 20, 1, 5);
+ test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 9, 0, "", 0, 0, 0);
+ test("abcdefghij", 9, 0, "", 0, 1, 0);
+ test("abcdefghij", 9, 0, "", 1, 0, 0);
+ test("abcdefghij", 9, 0, "abcde", 0, 0, 0);
+ test("abcdefghij", 9, 0, "abcde", 0, 1, -1);
+ test("abcdefghij", 9, 0, "abcde", 0, 2, -2);
+ test("abcdefghij", 9, 0, "abcde", 0, 4, -4);
+ test("abcdefghij", 9, 0, "abcde", 0, 5, -5);
+ test("abcdefghij", 9, 0, "abcde", 0, 6, -5);
+ test("abcdefghij", 9, 0, "abcde", 1, 0, 0);
+ test("abcdefghij", 9, 0, "abcde", 1, 1, -1);
+ test("abcdefghij", 9, 0, "abcde", 1, 2, -2);
+ test("abcdefghij", 9, 0, "abcde", 1, 3, -3);
+ test("abcdefghij", 9, 0, "abcde", 1, 4, -4);
+ test("abcdefghij", 9, 0, "abcde", 1, 5, -4);
+ test("abcdefghij", 9, 0, "abcde", 2, 0, 0);
+ test("abcdefghij", 9, 0, "abcde", 2, 1, -1);
+ test("abcdefghij", 9, 0, "abcde", 2, 2, -2);
+ test("abcdefghij", 9, 0, "abcde", 2, 3, -3);
+ test("abcdefghij", 9, 0, "abcde", 2, 4, -3);
+ test("abcdefghij", 9, 0, "abcde", 4, 0, 0);
+ test("abcdefghij", 9, 0, "abcde", 4, 1, -1);
+ test("abcdefghij", 9, 0, "abcde", 4, 2, -1);
+ test("abcdefghij", 9, 0, "abcde", 5, 0, 0);
+ test("abcdefghij", 9, 0, "abcde", 5, 1, 0);
+ test("abcdefghij", 9, 0, "abcde", 6, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghij", 0, 1, -1);
+ test("abcdefghij", 9, 0, "abcdefghij", 0, 5, -5);
+ test("abcdefghij", 9, 0, "abcdefghij", 0, 9, -9);
+ test("abcdefghij", 9, 0, "abcdefghij", 0, 10, -10);
+ test("abcdefghij", 9, 0, "abcdefghij", 0, 11, -10);
+ test("abcdefghij", 9, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 9, 0, "abcdefghij", 1, 4, -4);
+ test("abcdefghij", 9, 0, "abcdefghij", 1, 8, -8);
+ test("abcdefghij", 9, 0, "abcdefghij", 1, 9, -9);
+ test("abcdefghij", 9, 0, "abcdefghij", 1, 10, -9);
+ test("abcdefghij", 9, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghij", 5, 1, -1);
+ test("abcdefghij", 9, 0, "abcdefghij", 5, 2, -2);
+ test("abcdefghij", 9, 0, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 9, 0, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 9, 0, "abcdefghij", 5, 6, -5);
+}
+
+void test33()
+{
+ test("abcdefghij", 9, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghij", 9, 1, -1);
+ test("abcdefghij", 9, 0, "abcdefghij", 9, 2, -1);
+ test("abcdefghij", 9, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghij", 9, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 9, 1, "", 0, 0, 1);
+ test("abcdefghij", 9, 1, "", 0, 1, 1);
+ test("abcdefghij", 9, 1, "", 1, 0, 0);
+ test("abcdefghij", 9, 1, "abcde", 0, 0, 1);
+ test("abcdefghij", 9, 1, "abcde", 0, 1, 9);
+ test("abcdefghij", 9, 1, "abcde", 0, 2, 9);
+ test("abcdefghij", 9, 1, "abcde", 0, 4, 9);
+ test("abcdefghij", 9, 1, "abcde", 0, 5, 9);
+ test("abcdefghij", 9, 1, "abcde", 0, 6, 9);
+ test("abcdefghij", 9, 1, "abcde", 1, 0, 1);
+ test("abcdefghij", 9, 1, "abcde", 1, 1, 8);
+ test("abcdefghij", 9, 1, "abcde", 1, 2, 8);
+ test("abcdefghij", 9, 1, "abcde", 1, 3, 8);
+ test("abcdefghij", 9, 1, "abcde", 1, 4, 8);
+ test("abcdefghij", 9, 1, "abcde", 1, 5, 8);
+ test("abcdefghij", 9, 1, "abcde", 2, 0, 1);
+ test("abcdefghij", 9, 1, "abcde", 2, 1, 7);
+ test("abcdefghij", 9, 1, "abcde", 2, 2, 7);
+ test("abcdefghij", 9, 1, "abcde", 2, 3, 7);
+ test("abcdefghij", 9, 1, "abcde", 2, 4, 7);
+ test("abcdefghij", 9, 1, "abcde", 4, 0, 1);
+ test("abcdefghij", 9, 1, "abcde", 4, 1, 5);
+ test("abcdefghij", 9, 1, "abcde", 4, 2, 5);
+ test("abcdefghij", 9, 1, "abcde", 5, 0, 1);
+ test("abcdefghij", 9, 1, "abcde", 5, 1, 1);
+ test("abcdefghij", 9, 1, "abcde", 6, 0, 0);
+ test("abcdefghij", 9, 1, "abcdefghij", 0, 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghij", 0, 1, 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 0, 5, 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 0, 9, 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 0, 10, 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 0, 11, 9);
+ test("abcdefghij", 9, 1, "abcdefghij", 1, 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghij", 1, 1, 8);
+ test("abcdefghij", 9, 1, "abcdefghij", 1, 4, 8);
+ test("abcdefghij", 9, 1, "abcdefghij", 1, 8, 8);
+ test("abcdefghij", 9, 1, "abcdefghij", 1, 9, 8);
+ test("abcdefghij", 9, 1, "abcdefghij", 1, 10, 8);
+ test("abcdefghij", 9, 1, "abcdefghij", 5, 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghij", 5, 1, 4);
+ test("abcdefghij", 9, 1, "abcdefghij", 5, 2, 4);
+ test("abcdefghij", 9, 1, "abcdefghij", 5, 4, 4);
+ test("abcdefghij", 9, 1, "abcdefghij", 5, 5, 4);
+ test("abcdefghij", 9, 1, "abcdefghij", 5, 6, 4);
+ test("abcdefghij", 9, 1, "abcdefghij", 9, 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghij", 9, 1, 0);
+ test("abcdefghij", 9, 1, "abcdefghij", 9, 2, 0);
+ test("abcdefghij", 9, 1, "abcdefghij", 10, 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghij", 10, 1, 1);
+ test("abcdefghij", 9, 1, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 1, 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 10, 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 19, 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 20, 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 21, 9);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 1, 8);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 9, 8);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 18, 8);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 19, 8);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 20, 8);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 5, -1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 9, -1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 10, -1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 11, -1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 1, -10);
+}
+
+void test34()
+{
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 2, -10);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 9, 2, "", 0, 0, 1);
+ test("abcdefghij", 9, 2, "", 0, 1, 1);
+ test("abcdefghij", 9, 2, "", 1, 0, 0);
+ test("abcdefghij", 9, 2, "abcde", 0, 0, 1);
+ test("abcdefghij", 9, 2, "abcde", 0, 1, 9);
+ test("abcdefghij", 9, 2, "abcde", 0, 2, 9);
+ test("abcdefghij", 9, 2, "abcde", 0, 4, 9);
+ test("abcdefghij", 9, 2, "abcde", 0, 5, 9);
+ test("abcdefghij", 9, 2, "abcde", 0, 6, 9);
+ test("abcdefghij", 9, 2, "abcde", 1, 0, 1);
+ test("abcdefghij", 9, 2, "abcde", 1, 1, 8);
+ test("abcdefghij", 9, 2, "abcde", 1, 2, 8);
+ test("abcdefghij", 9, 2, "abcde", 1, 3, 8);
+ test("abcdefghij", 9, 2, "abcde", 1, 4, 8);
+ test("abcdefghij", 9, 2, "abcde", 1, 5, 8);
+ test("abcdefghij", 9, 2, "abcde", 2, 0, 1);
+ test("abcdefghij", 9, 2, "abcde", 2, 1, 7);
+ test("abcdefghij", 9, 2, "abcde", 2, 2, 7);
+ test("abcdefghij", 9, 2, "abcde", 2, 3, 7);
+ test("abcdefghij", 9, 2, "abcde", 2, 4, 7);
+ test("abcdefghij", 9, 2, "abcde", 4, 0, 1);
+ test("abcdefghij", 9, 2, "abcde", 4, 1, 5);
+ test("abcdefghij", 9, 2, "abcde", 4, 2, 5);
+ test("abcdefghij", 9, 2, "abcde", 5, 0, 1);
+ test("abcdefghij", 9, 2, "abcde", 5, 1, 1);
+ test("abcdefghij", 9, 2, "abcde", 6, 0, 0);
+ test("abcdefghij", 9, 2, "abcdefghij", 0, 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghij", 0, 1, 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 0, 5, 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 0, 9, 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 0, 10, 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 0, 11, 9);
+ test("abcdefghij", 9, 2, "abcdefghij", 1, 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghij", 1, 1, 8);
+ test("abcdefghij", 9, 2, "abcdefghij", 1, 4, 8);
+ test("abcdefghij", 9, 2, "abcdefghij", 1, 8, 8);
+ test("abcdefghij", 9, 2, "abcdefghij", 1, 9, 8);
+ test("abcdefghij", 9, 2, "abcdefghij", 1, 10, 8);
+ test("abcdefghij", 9, 2, "abcdefghij", 5, 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghij", 5, 1, 4);
+ test("abcdefghij", 9, 2, "abcdefghij", 5, 2, 4);
+ test("abcdefghij", 9, 2, "abcdefghij", 5, 4, 4);
+ test("abcdefghij", 9, 2, "abcdefghij", 5, 5, 4);
+ test("abcdefghij", 9, 2, "abcdefghij", 5, 6, 4);
+ test("abcdefghij", 9, 2, "abcdefghij", 9, 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghij", 9, 1, 0);
+ test("abcdefghij", 9, 2, "abcdefghij", 9, 2, 0);
+ test("abcdefghij", 9, 2, "abcdefghij", 10, 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghij", 10, 1, 1);
+ test("abcdefghij", 9, 2, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 1, 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 10, 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 19, 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 20, 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 21, 9);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 1, 8);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 9, 8);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 18, 8);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 19, 8);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 20, 8);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 5, -1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 9, -1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 10, -1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 11, -1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 1, -10);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 2, -10);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 10, 0, "", 0, 0, 0);
+ test("abcdefghij", 10, 0, "", 0, 1, 0);
+ test("abcdefghij", 10, 0, "", 1, 0, 0);
+ test("abcdefghij", 10, 0, "abcde", 0, 0, 0);
+ test("abcdefghij", 10, 0, "abcde", 0, 1, -1);
+ test("abcdefghij", 10, 0, "abcde", 0, 2, -2);
+ test("abcdefghij", 10, 0, "abcde", 0, 4, -4);
+ test("abcdefghij", 10, 0, "abcde", 0, 5, -5);
+ test("abcdefghij", 10, 0, "abcde", 0, 6, -5);
+ test("abcdefghij", 10, 0, "abcde", 1, 0, 0);
+ test("abcdefghij", 10, 0, "abcde", 1, 1, -1);
+ test("abcdefghij", 10, 0, "abcde", 1, 2, -2);
+ test("abcdefghij", 10, 0, "abcde", 1, 3, -3);
+ test("abcdefghij", 10, 0, "abcde", 1, 4, -4);
+ test("abcdefghij", 10, 0, "abcde", 1, 5, -4);
+ test("abcdefghij", 10, 0, "abcde", 2, 0, 0);
+ test("abcdefghij", 10, 0, "abcde", 2, 1, -1);
+ test("abcdefghij", 10, 0, "abcde", 2, 2, -2);
+ test("abcdefghij", 10, 0, "abcde", 2, 3, -3);
+ test("abcdefghij", 10, 0, "abcde", 2, 4, -3);
+ test("abcdefghij", 10, 0, "abcde", 4, 0, 0);
+ test("abcdefghij", 10, 0, "abcde", 4, 1, -1);
+}
+
+void test35()
+{
+ test("abcdefghij", 10, 0, "abcde", 4, 2, -1);
+ test("abcdefghij", 10, 0, "abcde", 5, 0, 0);
+ test("abcdefghij", 10, 0, "abcde", 5, 1, 0);
+ test("abcdefghij", 10, 0, "abcde", 6, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghij", 0, 1, -1);
+ test("abcdefghij", 10, 0, "abcdefghij", 0, 5, -5);
+ test("abcdefghij", 10, 0, "abcdefghij", 0, 9, -9);
+ test("abcdefghij", 10, 0, "abcdefghij", 0, 10, -10);
+ test("abcdefghij", 10, 0, "abcdefghij", 0, 11, -10);
+ test("abcdefghij", 10, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 10, 0, "abcdefghij", 1, 4, -4);
+ test("abcdefghij", 10, 0, "abcdefghij", 1, 8, -8);
+ test("abcdefghij", 10, 0, "abcdefghij", 1, 9, -9);
+ test("abcdefghij", 10, 0, "abcdefghij", 1, 10, -9);
+ test("abcdefghij", 10, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghij", 5, 1, -1);
+ test("abcdefghij", 10, 0, "abcdefghij", 5, 2, -2);
+ test("abcdefghij", 10, 0, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 10, 0, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 10, 0, "abcdefghij", 5, 6, -5);
+ test("abcdefghij", 10, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghij", 9, 1, -1);
+ test("abcdefghij", 10, 0, "abcdefghij", 9, 2, -1);
+ test("abcdefghij", 10, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghij", 10, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 10, 1, "", 0, 0, 0);
+ test("abcdefghij", 10, 1, "", 0, 1, 0);
+ test("abcdefghij", 10, 1, "", 1, 0, 0);
+ test("abcdefghij", 10, 1, "abcde", 0, 0, 0);
+ test("abcdefghij", 10, 1, "abcde", 0, 1, -1);
+ test("abcdefghij", 10, 1, "abcde", 0, 2, -2);
+ test("abcdefghij", 10, 1, "abcde", 0, 4, -4);
+ test("abcdefghij", 10, 1, "abcde", 0, 5, -5);
+ test("abcdefghij", 10, 1, "abcde", 0, 6, -5);
+ test("abcdefghij", 10, 1, "abcde", 1, 0, 0);
+ test("abcdefghij", 10, 1, "abcde", 1, 1, -1);
+ test("abcdefghij", 10, 1, "abcde", 1, 2, -2);
+ test("abcdefghij", 10, 1, "abcde", 1, 3, -3);
+ test("abcdefghij", 10, 1, "abcde", 1, 4, -4);
+ test("abcdefghij", 10, 1, "abcde", 1, 5, -4);
+ test("abcdefghij", 10, 1, "abcde", 2, 0, 0);
+ test("abcdefghij", 10, 1, "abcde", 2, 1, -1);
+ test("abcdefghij", 10, 1, "abcde", 2, 2, -2);
+ test("abcdefghij", 10, 1, "abcde", 2, 3, -3);
+ test("abcdefghij", 10, 1, "abcde", 2, 4, -3);
+ test("abcdefghij", 10, 1, "abcde", 4, 0, 0);
+ test("abcdefghij", 10, 1, "abcde", 4, 1, -1);
+ test("abcdefghij", 10, 1, "abcde", 4, 2, -1);
+ test("abcdefghij", 10, 1, "abcde", 5, 0, 0);
+ test("abcdefghij", 10, 1, "abcde", 5, 1, 0);
+ test("abcdefghij", 10, 1, "abcde", 6, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghij", 0, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghij", 0, 1, -1);
+ test("abcdefghij", 10, 1, "abcdefghij", 0, 5, -5);
+ test("abcdefghij", 10, 1, "abcdefghij", 0, 9, -9);
+ test("abcdefghij", 10, 1, "abcdefghij", 0, 10, -10);
+ test("abcdefghij", 10, 1, "abcdefghij", 0, 11, -10);
+ test("abcdefghij", 10, 1, "abcdefghij", 1, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghij", 1, 1, -1);
+ test("abcdefghij", 10, 1, "abcdefghij", 1, 4, -4);
+ test("abcdefghij", 10, 1, "abcdefghij", 1, 8, -8);
+ test("abcdefghij", 10, 1, "abcdefghij", 1, 9, -9);
+ test("abcdefghij", 10, 1, "abcdefghij", 1, 10, -9);
+ test("abcdefghij", 10, 1, "abcdefghij", 5, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghij", 5, 1, -1);
+ test("abcdefghij", 10, 1, "abcdefghij", 5, 2, -2);
+ test("abcdefghij", 10, 1, "abcdefghij", 5, 4, -4);
+ test("abcdefghij", 10, 1, "abcdefghij", 5, 5, -5);
+ test("abcdefghij", 10, 1, "abcdefghij", 5, 6, -5);
+ test("abcdefghij", 10, 1, "abcdefghij", 9, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghij", 9, 1, -1);
+ test("abcdefghij", 10, 1, "abcdefghij", 9, 2, -1);
+ test("abcdefghij", 10, 1, "abcdefghij", 10, 0, 0);
+}
+
+void test36()
+{
+ test("abcdefghij", 10, 1, "abcdefghij", 10, 1, 0);
+ test("abcdefghij", 10, 1, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghij", 11, 0, "", 0, 0, 0);
+ test("abcdefghij", 11, 0, "", 0, 1, 0);
+ test("abcdefghij", 11, 0, "", 1, 0, 0);
+ test("abcdefghij", 11, 0, "abcde", 0, 0, 0);
+ test("abcdefghij", 11, 0, "abcde", 0, 1, 0);
+ test("abcdefghij", 11, 0, "abcde", 0, 2, 0);
+ test("abcdefghij", 11, 0, "abcde", 0, 4, 0);
+ test("abcdefghij", 11, 0, "abcde", 0, 5, 0);
+ test("abcdefghij", 11, 0, "abcde", 0, 6, 0);
+ test("abcdefghij", 11, 0, "abcde", 1, 0, 0);
+ test("abcdefghij", 11, 0, "abcde", 1, 1, 0);
+ test("abcdefghij", 11, 0, "abcde", 1, 2, 0);
+ test("abcdefghij", 11, 0, "abcde", 1, 3, 0);
+ test("abcdefghij", 11, 0, "abcde", 1, 4, 0);
+ test("abcdefghij", 11, 0, "abcde", 1, 5, 0);
+ test("abcdefghij", 11, 0, "abcde", 2, 0, 0);
+ test("abcdefghij", 11, 0, "abcde", 2, 1, 0);
+ test("abcdefghij", 11, 0, "abcde", 2, 2, 0);
+ test("abcdefghij", 11, 0, "abcde", 2, 3, 0);
+ test("abcdefghij", 11, 0, "abcde", 2, 4, 0);
+ test("abcdefghij", 11, 0, "abcde", 4, 0, 0);
+ test("abcdefghij", 11, 0, "abcde", 4, 1, 0);
+ test("abcdefghij", 11, 0, "abcde", 4, 2, 0);
+ test("abcdefghij", 11, 0, "abcde", 5, 0, 0);
+ test("abcdefghij", 11, 0, "abcde", 5, 1, 0);
+ test("abcdefghij", 11, 0, "abcde", 6, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 0, 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 0, 5, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 0, 9, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 0, 10, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 0, 11, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 1, 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 1, 4, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 1, 8, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 1, 9, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 1, 10, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 5, 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 5, 2, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 5, 4, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 5, 5, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 5, 6, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 9, 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 9, 2, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 10, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 19, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 20, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 21, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 9, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 18, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 19, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 20, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 5, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 9, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 10, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 11, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 2, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+}
+
+void test37()
+{
+ test("abcdefghijklmnopqrst", 0, 0, "", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 2, -2);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 4, -4);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 6, -5);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 2, -2);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 3, -3);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 5, -4);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 3, -3);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 4, -3);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, 2, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 5, 1, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 9, -9);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 11, -10);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 8, -8);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 10, -9);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 2, -2);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, 2, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 1, "", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 2, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 4, -3);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 5, -4);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 6, -4);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 2, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 3, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 4, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 5, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 1, -2);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 3, -2);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 4, -2);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, 1, -4);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, 2, -4);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 5, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 5, 1, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcde", 6, 0, 0);
+}
+
+void test38()
+{
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 5, -4);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 9, -8);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 10, -9);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 11, -9);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 4, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 8, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 9, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 10, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 1, -5);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 2, -5);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 4, -5);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, 1, -9);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, 2, -9);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 10, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 10, 1, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 10, -9);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 19, -18);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 20, -19);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 21, -19);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 10, "", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 1, 9);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 2, 8);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 4, 6);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 5, 5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 6, 5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 2, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 3, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 4, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 5, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 1, -2);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 3, -2);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 4, -2);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 1, -4);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 2, -4);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 5, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 5, 1, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 1, 9);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 5, 5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 9, 1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 10, 0);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 11, 0);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 4, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 8, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 9, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 10, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 1, -5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 2, -5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 4, -5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 1, -9);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 2, -9);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 10, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 10, 1, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 1, 9);
+}
+
+void test39()
+{
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 10, 0);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 19, -9);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 20, -10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 21, -10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 20, 0, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 20, 1, 10);
+ test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 19, "", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 1, 18);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 2, 17);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 4, 15);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 5, 14);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 6, 14);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 2, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 3, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 4, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 5, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 1, -2);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 3, -2);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 4, -2);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 1, -4);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 2, -4);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 5, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 5, 1, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 1, 18);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 5, 14);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 9, 10);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 10, 9);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 11, 9);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 4, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 8, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 9, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 10, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 1, -5);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 2, -5);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 4, -5);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 1, -9);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 2, -9);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 10, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 10, 1, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 1, 18);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 10, 9);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 19, 0);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 20, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 21, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 20, 0, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 20, 1, 19);
+ test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 20, "", 0, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "", 0, 1, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 0, 20);
+}
+
+void test40()
+{
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 2, 18);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 4, 16);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 5, 15);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 6, 15);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 2, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 3, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 4, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 5, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 1, -2);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 3, -2);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 4, -2);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 1, -4);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 2, -4);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 5, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 5, 1, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 5, 15);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 9, 11);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 11, 10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 4, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 8, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 9, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 10, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 1, -5);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 2, -5);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 4, -5);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 1, -9);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 2, -9);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10, 1, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 20, 0);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 21, 0);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 20, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 20, 1, 20);
+ test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 21, "", 0, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "", 0, 1, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 2, 18);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 4, 16);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 5, 15);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 6, 15);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 2, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 3, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 4, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 5, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 1, -2);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 3, -2);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 4, -2);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 1, -4);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 2, -4);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 5, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 5, 1, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 5, 15);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 9, 11);
+}
+
+void test41()
+{
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 11, 10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 4, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 8, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 9, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 10, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 1, -5);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 2, -5);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 4, -5);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 1, -9);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 2, -9);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10, 1, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 20, 0);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 21, 0);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 9, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 18, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 1, -10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 5, -10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 9, -10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 1, -19);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 2, -19);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 20, 0, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 20, 1, 20);
+ test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 2, -2);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 4, -4);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 6, -5);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 2, -2);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 3, -3);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 5, -4);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 3, -3);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 4, -3);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, 2, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 5, 1, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 9, -9);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 11, -10);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 8, -8);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 10, -9);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 2, -2);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, 2, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+}
+
+void test42()
+{
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 1, "", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 2, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 4, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 5, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 6, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 1, 0);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 2, -1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 3, -2);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 4, -3);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 5, -3);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 2, -1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 3, -1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 4, -1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 1, -3);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 2, -3);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 5, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 5, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 5, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 9, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 10, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 11, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 1, 0);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 4, -3);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 8, -7);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 9, -8);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 10, -8);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 1, -4);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 2, -4);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 5, -4);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 6, -4);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 1, -8);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 2, -8);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 10, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 10, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 1, 0);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 9, -8);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 18, -17);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 19, -18);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 20, -18);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 9, "", 0, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "", 0, 1, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 2, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 4, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 5, 1);
+}
+
+void test43()
+{
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 6, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 1, 8);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 2, 7);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 3, 6);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 4, 5);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 5, 5);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 2, -1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 3, -1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 4, -1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 1, -3);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 2, -3);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 5, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 5, 1, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 5, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 9, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 10, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 11, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 1, 8);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 4, 5);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 8, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 9, 0);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 10, 0);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 1, -4);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 2, -4);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 5, -4);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 6, -4);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 1, -8);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 2, -8);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 10, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 10, 1, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 1, 8);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 9, 0);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 18, -9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 19, -10);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 20, -10);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 20, 0, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 20, 1, 9);
+ test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 18, "", 0, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "", 0, 1, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 2, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 4, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 5, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 6, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 1, 17);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 2, 16);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 3, 15);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 4, 14);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 5, 14);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 2, -1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 3, -1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 4, -1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 1, -3);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 2, -3);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 5, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 5, 1, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 5, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 9, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 10, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 11, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 1, 17);
+}
+
+void test44()
+{
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 4, 14);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 8, 10);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 10, 9);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 1, -4);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 2, -4);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 5, -4);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 6, -4);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 1, -8);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 2, -8);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 10, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 10, 1, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 1, 17);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 18, 0);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 19, -1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 20, -1);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 20, 0, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 20, 1, 18);
+ test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 19, "", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 2, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 4, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 5, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 6, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 2, 17);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 3, 16);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 4, 15);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 5, 15);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 2, -1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 3, -1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 4, -1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 1, -3);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 2, -3);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 5, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 5, 1, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 5, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 9, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 10, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 11, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 4, 15);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 8, 11);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 9, 10);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 10, 10);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 1, -4);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 2, -4);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 5, -4);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 6, -4);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 1, -8);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 2, -8);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 10, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 10, 1, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 9, 10);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 18, 1);
+}
+
+void test45()
+{
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 19, 0);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 20, 0);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 20, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 20, 1, 19);
+ test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 20, "", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 2, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 4, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 5, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 6, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 2, 17);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 3, 16);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 4, 15);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 5, 15);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 2, -1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 3, -1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 4, -1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 1, -3);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 2, -3);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 5, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 5, 1, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 5, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 9, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 10, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 11, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 4, 15);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 8, 11);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 9, 10);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 10, 10);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 1, -4);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 2, -4);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 5, -4);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 6, -4);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 1, -8);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 2, -8);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 10, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 10, 1, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 10, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 19, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 20, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 21, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 9, 10);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 18, 1);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 19, 0);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 20, 0);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 1, -9);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 5, -9);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 1, -18);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 2, -18);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 20, 0, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 20, 1, 19);
+ test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 2, -2);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 4, -4);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 6, -5);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 2, -2);
+}
+
+void test46()
+{
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 3, -3);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 5, -4);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 3, -3);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 4, -3);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, 2, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 5, 1, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 9, -9);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 11, -10);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 8, -8);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 10, -9);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 2, -2);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, 2, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 1, "", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 2, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 4, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 5, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 6, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 2, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 3, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 4, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 5, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 1, 8);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 2, 8);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 3, 8);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 4, 8);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 1, 6);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 2, 6);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 5, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 5, 1, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 5, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 9, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 11, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 4, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 8, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 10, 9);
+}
+
+void test47()
+{
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 1, 5);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 2, 5);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 4, 5);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 5, 5);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 6, 5);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 1, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 2, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10, 1, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 19, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 20, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 21, 10);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 18, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 19, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 20, 9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 1, 0);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 5, -4);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 9, -8);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 10, -9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 11, -9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 1, -9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 2, -9);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 5, "", 0, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "", 0, 1, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 2, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 4, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 5, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 6, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 2, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 3, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 4, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 5, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 1, 8);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 2, 8);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 3, 8);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 4, 8);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 1, 6);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 2, 6);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 5, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 5, 1, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 5, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 9, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 11, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 4, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 8, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 10, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 1, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 2, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 4, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 5, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 6, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 1, 1);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 2, 1);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10, 1, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 19, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 20, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 21, 10);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 18, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 19, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 20, 9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 1, 4);
+}
+
+void test48()
+{
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 5, 0);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 9, -4);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 10, -5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 11, -5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 1, -9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 2, -9);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 20, 0, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 20, 1, 5);
+ test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 9, "", 0, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "", 0, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 2, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 4, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 5, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 6, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 2, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 3, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 4, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 5, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 1, 8);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 2, 8);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 3, 8);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 4, 8);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 1, 6);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 2, 6);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 5, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 5, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 5, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 9, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 11, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 4, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 8, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 10, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 1, 5);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 2, 5);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 4, 5);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 5, 5);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 6, 5);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 1, 1);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 2, 1);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 19, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 20, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 21, 10);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 18, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 19, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 20, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 1, 8);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 5, 4);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 9, 0);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 10, -1);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 11, -1);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 1, -9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 2, -9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 20, 0, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 20, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 10, "", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 2, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 4, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 5, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 6, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 2, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 3, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 4, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 5, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 0, 10);
+}
+
+void test49()
+{
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 1, 8);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 2, 8);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 3, 8);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 4, 8);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 1, 6);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 2, 6);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 5, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 5, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 5, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 9, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 11, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 4, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 8, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 10, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 1, 5);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 2, 5);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 4, 5);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 5, 5);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 6, 5);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 1, 1);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 2, 1);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 19, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 20, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 21, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 18, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 19, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 20, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 5, 5);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 9, 1);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 10, 0);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 11, 0);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 1, -9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 2, -9);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 20, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 20, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 11, "", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 2, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 4, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 5, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 6, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 2, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 3, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 4, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 5, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 1, 8);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 2, 8);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 3, 8);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 4, 8);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 1, 6);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 2, 6);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 5, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 5, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 5, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 9, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 11, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 4, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 8, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 10, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 1, 5);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 2, 5);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 4, 5);
+}
+
+void test50()
+{
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 5, 5);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 6, 5);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 1, 1);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 2, 1);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 10, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 19, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 20, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 21, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 9, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 18, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 19, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 20, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 1, 9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 5, 5);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 9, 1);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 10, 0);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 11, 0);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 1, -9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 2, -9);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 20, 0, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 20, 1, 10);
+ test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 2, -2);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 4, -4);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 6, -5);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 2, -2);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 3, -3);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 5, -4);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 3, -3);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 4, -3);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, 2, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 5, 1, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 9, -9);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 11, -10);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 8, -8);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 10, -9);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 2, -2);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, 2, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+}
+
+void test51()
+{
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 1, "", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 2, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 4, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 5, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 6, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 2, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 3, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 4, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 5, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 1, 17);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 2, 17);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 3, 17);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 4, 17);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 1, 15);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 2, 15);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 5, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 5, 1, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 5, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 9, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 10, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 11, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 4, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 8, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 9, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 10, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 1, 14);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 2, 14);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 4, 14);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 5, 14);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 6, 14);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 1, 10);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 2, 10);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 10, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 10, 1, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 10, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 19, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 20, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 21, 19);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 9, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 18, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 19, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 20, 18);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 1, 9);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 5, 9);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 9, 9);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 10, 9);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 11, 9);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 1, 0);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 2, 0);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 2, "", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "", 0, 1, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 2, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 4, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 5, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 6, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 2, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 3, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 4, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 5, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 1, 17);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 2, 17);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 3, 17);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 4, 17);
+}
+
+void test52()
+{
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 1, 15);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 2, 15);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 5, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 5, 1, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 5, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 9, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 10, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 11, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 4, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 8, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 9, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 10, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 1, 14);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 2, 14);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 4, 14);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 5, 14);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 6, 14);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 1, 10);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 2, 10);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 10, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 10, 1, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 1, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 10, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 19, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 20, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 21, 19);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 1, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 9, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 18, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 19, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 20, 18);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 1, 9);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 5, 9);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 9, 9);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 10, 9);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 11, 9);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 1, 0);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 2, 0);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 20, 0, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 20, 1, 1);
+ test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 2, -2);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 4, -4);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 6, -5);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 2, -2);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 3, -3);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 5, -4);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 3, -3);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 4, -3);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, 2, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 5, 1, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 9, -9);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 11, -10);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 8, -8);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 10, -9);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 2, -2);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, 1, -1);
+}
+
+void test53()
+{
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, 2, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 2, -2);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 4, -4);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 6, -5);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 2, -2);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 3, -3);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 5, -4);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 2, -2);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 3, -3);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 4, -3);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, 2, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 5, 1, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 5, -5);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 9, -9);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 11, -10);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 4, -4);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 8, -8);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 10, -9);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 2, -2);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 4, -4);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 5, -5);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 6, -5);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, 2, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 10, 1, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 10, -10);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 19, -19);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 20, -20);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 21, -20);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 9, -9);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 18, -18);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 19, -19);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 20, -19);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 5, -5);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 9, -9);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 10, -10);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 11, -10);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, 1, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, 2, -1);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 20, 0, 0);
+}
+
+void test54()
+{
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 21, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 2, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 4, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 5, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 6, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 2, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 3, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 4, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 5, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 2, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 3, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 4, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 2, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 5, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcde", 6, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 5, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 9, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 10, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 11, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 4, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 8, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 9, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 10, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 2, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 4, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 5, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 6, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 2, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 10, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 11, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 10, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 19, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 20, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 21, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 9, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 18, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 19, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 20, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 5, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 9, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 10, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 11, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 2, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 20, 0, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 20, 1, 0);
+ test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 21, 0, 0);
+}
+
+
+int main () {
+ test0();
+ test1();
+ test2();
+ test3();
+ test4();
+ test5();
+ test6();
+ test7();
+ test8();
+ test9();
+ test10();
+ test11();
+ test12();
+ test13();
+ test14();
+ test15();
+ test16();
+ test17();
+ test18();
+ test19();
+ test20();
+ test21();
+ test22();
+ test23();
+ test24();
+ test25();
+ test26();
+ test27();
+ test28();
+ test29();
+ test30();
+ test31();
+ test32();
+ test33();
+ test34();
+ test35();
+ test36();
+ test37();
+ test38();
+ test39();
+ test40();
+ test41();
+ test42();
+ test43();
+ test44();
+ test45();
+ test46();
+ test47();
+ test48();
+ test49();
+ test50();
+ test51();
+ test52();
+ test53();
+ test54();
+
+
+ {
+ test("abcde", 5, 1, "", 0, 0, 0);
+ test("abcde", 2, 4, "", 0, 0, 3);
+ test("abcde", 2, 4, "abcde", 3, 4, -2);
+ test("ABCde", 2, 4, "abcde", 2, 4, -1);
+ }
+
+ {
+ test(L"abcde", 5, 1, L"", 0, 0, 0);
+ test(L"abcde", 2, 4, L"", 0, 0, 3);
+ test(L"abcde", 2, 4, L"abcde", 3, 4, -2);
+ test(L"ABCde", 2, 4, L"abcde", 2, 4, -1);
+ }
+
+#if TEST_STD_VER >= 11
+ {
+ test(u"abcde", 5, 1, u"", 0, 0, 0);
+ test(u"abcde", 2, 4, u"", 0, 0, 3);
+ test(u"abcde", 2, 4, u"abcde", 3, 4, -2);
+ test(u"ABCde", 2, 4, u"abcde", 2, 4, -1);
+ }
+
+ {
+ test(U"abcde", 5, 1, U"", 0, 0, 0);
+ test(U"abcde", 2, 4, U"", 0, 0, 3);
+ test(U"abcde", 2, 4, U"abcde", 3, 4, -2);
+ test(U"ABCde", 2, 4, U"abcde", 2, 4, -1);
+ }
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1 { "abcde", 5 };
+ static_assert ( sv1.compare(5, 1, "", 0, 0) == 0, "" );
+ static_assert ( sv1.compare(2, 4, "", 0, 0) == 1, "" );
+ static_assert ( sv1.compare(2, 4, "abcde", 3, 4) == -1, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.ops/compare.sv.pass.cpp b/test/std/strings/string.view/string.view.ops/compare.sv.pass.cpp
new file mode 100644
index 000000000000..ddff1dd0afdb
--- /dev/null
+++ b/test/std/strings/string.view/string.view.ops/compare.sv.pass.cpp
@@ -0,0 +1,122 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+// constexpr int compare(basic_string_view str) const noexcept;
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "constexpr_char_traits.hpp"
+
+int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
+
+template<typename CharT>
+void test1 ( std::basic_string_view<CharT> sv1,
+ std::basic_string_view<CharT> sv2, int expected ) {
+ assert ( sign( sv1.compare(sv2)) == sign(expected));
+}
+
+
+template<typename CharT>
+void test ( const CharT *s1, const CharT *s2, int expected ) {
+ typedef std::basic_string_view<CharT> string_view_t;
+
+ string_view_t sv1 ( s1 );
+ string_view_t sv2 ( s2 );
+ test1(sv1, sv2, expected);
+}
+
+int main () {
+
+ test("", "", 0);
+ test("", "abcde", -5);
+ test("", "abcdefghij", -10);
+ test("", "abcdefghijklmnopqrst", -20);
+ test("abcde", "", 5);
+ test("abcde", "abcde", 0);
+ test("abcde", "abcdefghij", -5);
+ test("abcde", "abcdefghijklmnopqrst", -15);
+ test("abcdefghij", "", 10);
+ test("abcdefghij", "abcde", 5);
+ test("abcdefghij", "abcdefghij", 0);
+ test("abcdefghij", "abcdefghijklmnopqrst", -10);
+ test("abcdefghijklmnopqrst", "", 20);
+ test("abcdefghijklmnopqrst", "abcde", 15);
+ test("abcdefghijklmnopqrst", "abcdefghij", 10);
+ test("abcdefghijklmnopqrst", "abcdefghijklmnopqrst", 0);
+
+ test(L"", L"", 0);
+ test(L"", L"abcde", -5);
+ test(L"", L"abcdefghij", -10);
+ test(L"", L"abcdefghijklmnopqrst", -20);
+ test(L"abcde", L"", 5);
+ test(L"abcde", L"abcde", 0);
+ test(L"abcde", L"abcdefghij", -5);
+ test(L"abcde", L"abcdefghijklmnopqrst", -15);
+ test(L"abcdefghij", L"", 10);
+ test(L"abcdefghij", L"abcde", 5);
+ test(L"abcdefghij", L"abcdefghij", 0);
+ test(L"abcdefghij", L"abcdefghijklmnopqrst", -10);
+ test(L"abcdefghijklmnopqrst", L"", 20);
+ test(L"abcdefghijklmnopqrst", L"abcde", 15);
+ test(L"abcdefghijklmnopqrst", L"abcdefghij", 10);
+ test(L"abcdefghijklmnopqrst", L"abcdefghijklmnopqrst", 0);
+
+#if TEST_STD_VER >= 11
+ test(u"", u"", 0);
+ test(u"", u"abcde", -5);
+ test(u"", u"abcdefghij", -10);
+ test(u"", u"abcdefghijklmnopqrst", -20);
+ test(u"abcde", u"", 5);
+ test(u"abcde", u"abcde", 0);
+ test(u"abcde", u"abcdefghij", -5);
+ test(u"abcde", u"abcdefghijklmnopqrst", -15);
+ test(u"abcdefghij", u"", 10);
+ test(u"abcdefghij", u"abcde", 5);
+ test(u"abcdefghij", u"abcdefghij", 0);
+ test(u"abcdefghij", u"abcdefghijklmnopqrst", -10);
+ test(u"abcdefghijklmnopqrst", u"", 20);
+ test(u"abcdefghijklmnopqrst", u"abcde", 15);
+ test(u"abcdefghijklmnopqrst", u"abcdefghij", 10);
+ test(u"abcdefghijklmnopqrst", u"abcdefghijklmnopqrst", 0);
+
+ test(U"", U"", 0);
+ test(U"", U"abcde", -5);
+ test(U"", U"abcdefghij", -10);
+ test(U"", U"abcdefghijklmnopqrst", -20);
+ test(U"abcde", U"", 5);
+ test(U"abcde", U"abcde", 0);
+ test(U"abcde", U"abcdefghij", -5);
+ test(U"abcde", U"abcdefghijklmnopqrst", -15);
+ test(U"abcdefghij", U"", 10);
+ test(U"abcdefghij", U"abcde", 5);
+ test(U"abcdefghij", U"abcdefghij", 0);
+ test(U"abcdefghij", U"abcdefghijklmnopqrst", -10);
+ test(U"abcdefghijklmnopqrst", U"", 20);
+ test(U"abcdefghijklmnopqrst", U"abcde", 15);
+ test(U"abcdefghijklmnopqrst", U"abcdefghij", 10);
+ test(U"abcdefghijklmnopqrst", U"abcdefghijklmnopqrst", 0);
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
+ constexpr SV sv1 { "abcde", 5 };
+ constexpr SV sv2 { "abcde", 5 };
+ constexpr SV sv3 { "edcba0", 6 };
+ static_assert ( sv1.compare(sv2) == 0, "" );
+ static_assert ( sv2.compare(sv1) == 0, "" );
+ static_assert ( sv3.compare(sv2) > 0, "" );
+ static_assert ( sv2.compare(sv3) < 0, "" );
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.ops/copy.pass.cpp b/test/std/strings/string.view/string.view.ops/copy.pass.cpp
new file mode 100644
index 000000000000..41601467b812
--- /dev/null
+++ b/test/std/strings/string.view/string.view.ops/copy.pass.cpp
@@ -0,0 +1,102 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// size_type copy(charT* s, size_type n, size_type pos = 0) const;
+
+// Throws: out_of_range if pos > size().
+// Remarks: Let rlen be the smaller of n and size() - pos.
+// Requires: [s, s+rlen) is a valid range.
+// Effects: Equivalent to std::copy_n(begin() + pos, rlen, s).
+// Returns: rlen.
+
+
+#include <string_view>
+#include <algorithm>
+#include <cassert>
+
+#include "test_macros.h"
+
+template<typename CharT>
+void test1 ( std::basic_string_view<CharT> sv, size_t n, size_t pos ) {
+ const size_t rlen = std::min ( n, sv.size() - pos );
+
+ CharT *dest1 = new CharT [rlen + 1]; dest1[rlen] = 0;
+ CharT *dest2 = new CharT [rlen + 1]; dest2[rlen] = 0;
+
+ if (pos > sv.size()) {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try {
+ sv.copy(dest1, n, pos);
+ assert(false);
+ } catch (const std::out_of_range&) {
+ } catch (...) {
+ assert(false);
+ }
+#endif
+ } else {
+ sv.copy(dest1, n, pos);
+ std::copy_n(sv.begin() + pos, rlen, dest2);
+ for ( size_t i = 0; i <= rlen; ++i )
+ assert ( dest1[i] == dest2[i] );
+ }
+ delete [] dest1;
+ delete [] dest2;
+}
+
+
+template<typename CharT>
+void test ( const CharT *s ) {
+ typedef std::basic_string_view<CharT> string_view_t;
+
+ string_view_t sv1 ( s );
+
+ test1(sv1, 0, 0);
+ test1(sv1, 1, 0);
+ test1(sv1, 20, 0);
+ test1(sv1, sv1.size(), 0);
+ test1(sv1, 20, string_view_t::npos);
+
+ test1(sv1, 0, 3);
+ test1(sv1, 2, 3);
+ test1(sv1, 100, 3);
+ test1(sv1, 100, string_view_t::npos);
+
+ test1(sv1, sv1.size(), string_view_t::npos);
+
+ test1(sv1, sv1.size() + 1, 0);
+ test1(sv1, sv1.size() + 1, 1);
+ test1(sv1, sv1.size() + 1, string_view_t::npos);
+
+}
+
+int main () {
+ test ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
+ test ( "ABCDE");
+ test ( "a" );
+ test ( "" );
+
+ test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
+ test ( L"ABCDE" );
+ test ( L"a" );
+ test ( L"" );
+
+#if TEST_STD_VER >= 11
+ test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
+ test ( u"ABCDE" );
+ test ( u"a" );
+ test ( u"" );
+
+ test ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
+ test ( U"ABCDE" );
+ test ( U"a" );
+ test ( U"" );
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.ops/substr.pass.cpp b/test/std/strings/string.view/string.view.ops/substr.pass.cpp
new file mode 100644
index 000000000000..5f9a60067b43
--- /dev/null
+++ b/test/std/strings/string.view/string.view.ops/substr.pass.cpp
@@ -0,0 +1,121 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <string_view>
+
+// constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
+
+// Throws: out_of_range if pos > size().
+// Effects: Determines the effective length rlen of the string to reference as the smaller of n and size() - pos.
+// Returns: basic_string_view(data()+pos, rlen).
+
+#include <string_view>
+#include <algorithm>
+#include <stdexcept>
+#include <cassert>
+
+#include "test_macros.h"
+
+template<typename CharT>
+void test1(std::basic_string_view<CharT> sv, size_t n, size_t pos) {
+ std::basic_string_view<CharT> sv1;
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (pos > sv.size())
+ return ; // would throw if exceptions were enabled
+ sv1 = sv.substr(pos, n);
+#else
+ try {
+ sv1 = sv.substr(pos, n);
+ assert(pos <= sv.size());
+ }
+ catch (const std::out_of_range&) {
+ assert(pos > sv.size());
+ return ;
+ }
+#endif
+ const size_t rlen = std::min(n, sv.size() - pos);
+ assert (sv1.size() == rlen);
+ for (size_t i = 0; i < rlen; ++i)
+ assert(sv[pos+i] == sv1[i]);
+}
+
+
+template<typename CharT>
+void test ( const CharT *s ) {
+ typedef std::basic_string_view<CharT> string_view_t;
+
+ string_view_t sv1 ( s );
+
+ test1(sv1, 0, 0);
+ test1(sv1, 1, 0);
+ test1(sv1, 20, 0);
+ test1(sv1, sv1.size(), 0);
+
+ test1(sv1, 0, 3);
+ test1(sv1, 2, 3);
+ test1(sv1, 100, 3);
+
+ test1(sv1, 0, string_view_t::npos);
+ test1(sv1, 2, string_view_t::npos);
+ test1(sv1, sv1.size(), string_view_t::npos);
+
+ test1(sv1, sv1.size() + 1, 0);
+ test1(sv1, sv1.size() + 1, 1);
+ test1(sv1, sv1.size() + 1, string_view_t::npos);
+}
+
+int main () {
+ test ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
+ test ( "ABCDE");
+ test ( "a" );
+ test ( "" );
+
+ test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
+ test ( L"ABCDE" );
+ test ( L"a" );
+ test ( L"" );
+
+#if TEST_STD_VER >= 11
+ test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
+ test ( u"ABCDE" );
+ test ( u"a" );
+ test ( u"" );
+
+ test ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" );
+ test ( U"ABCDE" );
+ test ( U"a" );
+ test ( U"" );
+#endif
+
+#if TEST_STD_VER > 11
+ {
+ constexpr std::string_view sv1 { "ABCDE", 5 };
+
+ {
+ constexpr std::string_view sv2 = sv1.substr ( 0, 3 );
+ static_assert ( sv2.size() == 3, "" );
+ static_assert ( sv2[0] == 'A', "" );
+ static_assert ( sv2[1] == 'B', "" );
+ static_assert ( sv2[2] == 'C', "" );
+ }
+
+ {
+ constexpr std::string_view sv2 = sv1.substr ( 3, 0 );
+ static_assert ( sv2.size() == 0, "" );
+ }
+
+ {
+ constexpr std::string_view sv2 = sv1.substr ( 3, 3 );
+ static_assert ( sv2.size() == 2, "" );
+ static_assert ( sv2[0] == 'D', "" );
+ static_assert ( sv2[1] == 'E', "" );
+ }
+ }
+#endif
+}
diff --git a/test/std/strings/string.view/string.view.synop/nothing_to_do.pass.cpp b/test/std/strings/string.view/string.view.synop/nothing_to_do.pass.cpp
new file mode 100644
index 000000000000..353dd98f415e
--- /dev/null
+++ b/test/std/strings/string.view/string.view.synop/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+#include <string_view>
+
+int main () {}
diff --git a/test/std/strings/string.view/string.view.template/nothing_to_do.pass.cpp b/test/std/strings/string.view/string.view.template/nothing_to_do.pass.cpp
new file mode 100644
index 000000000000..353dd98f415e
--- /dev/null
+++ b/test/std/strings/string.view/string.view.template/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+#include <string_view>
+
+int main () {}
diff --git a/test/std/thread/futures/futures.async/async.pass.cpp b/test/std/thread/futures/futures.async/async.pass.cpp
index 5cb824d48224..9adebb285111 100644
--- a/test/std/thread/futures/futures.async/async.pass.cpp
+++ b/test/std/thread/futures/futures.async/async.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -73,7 +72,8 @@ std::unique_ptr<int> f4(std::unique_ptr<int>&& p)
void f5(int j)
{
std::this_thread::sleep_for(ms(200));
- throw j;
+ ((void)j);
+ TEST_THROW(j);
}
template <class Ret, class CheckLamdba, class ...Args>
@@ -140,6 +140,7 @@ int main()
test<Ret>(checkUPtr, DPID, f3, 3);
test<Ret>(checkUPtr, DPID, f4, std::unique_ptr<int>(new int(3)));
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::future<void> f = std::async(f5, 3);
std::this_thread::sleep_for(ms(300));
@@ -150,4 +151,5 @@ int main()
std::this_thread::sleep_for(ms(300));
try { f.get(); assert (false); } catch ( int ) {}
}
+#endif
}
diff --git a/test/std/thread/futures/futures.future_error/code.pass.cpp b/test/std/thread/futures/futures.future_error/code.pass.cpp
index e02af486fc39..35d44df5bbbf 100644
--- a/test/std/thread/futures/futures.future_error/code.pass.cpp
+++ b/test/std/thread/futures/futures.future_error/code.pass.cpp
@@ -12,12 +12,16 @@
// <future>
// class future_error
+// future_error(error_code __ec); // exposition only
+// explicit future_error(future_errc _Ev) : __ec_(make_error_code(_Ev)) {} // C++17
// const error_code& code() const throw();
#include <future>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -40,4 +44,14 @@ int main()
std::future_error f(ec);
assert(f.code() == ec);
}
+#if TEST_STD_VER > 14
+ {
+ std::future_error f(std::future_errc::broken_promise);
+ assert(f.code() == std::make_error_code(std::future_errc::broken_promise));
+ }
+ {
+ std::future_error f(std::future_errc::no_state);
+ assert(f.code() == std::make_error_code(std::future_errc::no_state));
+ }
+#endif
}
diff --git a/test/std/thread/futures/futures.future_error/what.pass.cpp b/test/std/thread/futures/futures.future_error/what.pass.cpp
index 52d2e944a684..a44f8af7d41b 100644
--- a/test/std/thread/futures/futures.future_error/what.pass.cpp
+++ b/test/std/thread/futures/futures.future_error/what.pass.cpp
@@ -26,25 +26,27 @@
#include <cstring>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
std::future_error f(std::make_error_code(std::future_errc::broken_promise));
- assert(std::strcmp(f.what(), "The associated promise has been destructed prior "
+ LIBCPP_ASSERT(std::strcmp(f.what(), "The associated promise has been destructed prior "
"to the associated state becoming ready.") == 0);
}
{
std::future_error f(std::make_error_code(std::future_errc::future_already_retrieved));
- assert(std::strcmp(f.what(), "The future has already been retrieved from "
+ LIBCPP_ASSERT(std::strcmp(f.what(), "The future has already been retrieved from "
"the promise or packaged_task.") == 0);
}
{
std::future_error f(std::make_error_code(std::future_errc::promise_already_satisfied));
- assert(std::strcmp(f.what(), "The state of the promise has already been set.") == 0);
+ LIBCPP_ASSERT(std::strcmp(f.what(), "The state of the promise has already been set.") == 0);
}
{
std::future_error f(std::make_error_code(std::future_errc::no_state));
- assert(std::strcmp(f.what(), "Operation not permitted on an object without "
+ LIBCPP_ASSERT(std::strcmp(f.what(), "Operation not permitted on an object without "
"an associated state.") == 0);
}
}
diff --git a/test/std/thread/futures/futures.overview/is_error_code_enum_future_errc.pass.cpp b/test/std/thread/futures/futures.overview/is_error_code_enum_future_errc.pass.cpp
index 499de52598b6..8a3987cb5127 100644
--- a/test/std/thread/futures/futures.overview/is_error_code_enum_future_errc.pass.cpp
+++ b/test/std/thread/futures/futures.overview/is_error_code_enum_future_errc.pass.cpp
@@ -14,8 +14,12 @@
// template <> struct is_error_code_enum<future_errc> : public true_type {};
#include <future>
+#include "test_macros.h"
int main()
{
- static_assert(std::is_error_code_enum<std::future_errc>::value, "");
+ static_assert(std::is_error_code_enum <std::future_errc>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(std::is_error_code_enum_v<std::future_errc>, "");
+#endif
}
diff --git a/test/std/thread/futures/futures.promise/dtor.pass.cpp b/test/std/thread/futures/futures.promise/dtor.pass.cpp
index e3151ab38322..49010a67b39e 100644
--- a/test/std/thread/futures/futures.promise/dtor.pass.cpp
+++ b/test/std/thread/futures/futures.promise/dtor.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,6 +19,8 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -32,6 +33,7 @@ int main()
}
assert(f.get() == 3);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
typedef int T;
std::future<T> f;
@@ -42,6 +44,7 @@ int main()
try
{
T i = f.get();
+ ((void)i); // Prevent unused warning
assert(false);
}
catch (const std::future_error& e)
@@ -49,6 +52,7 @@ int main()
assert(e.code() == make_error_code(std::future_errc::broken_promise));
}
}
+#endif
{
typedef int& T;
@@ -61,6 +65,7 @@ int main()
}
assert(&f.get() == &i);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
typedef int& T;
std::future<T> f;
@@ -71,6 +76,7 @@ int main()
try
{
T i = f.get();
+ ((void)i); // Prevent unused warning
assert(false);
}
catch (const std::future_error& e)
@@ -78,6 +84,7 @@ int main()
assert(e.code() == make_error_code(std::future_errc::broken_promise));
}
}
+#endif
{
typedef void T;
@@ -90,6 +97,7 @@ int main()
f.get();
assert(true);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
typedef void T;
std::future<T> f;
@@ -115,4 +123,5 @@ int main()
e.code() == std::error_code(0, std::future_category()));
}
}
+#endif
}
diff --git a/test/std/thread/futures/futures.promise/get_future.pass.cpp b/test/std/thread/futures/futures.promise/get_future.pass.cpp
index bc45e28a9f96..fc606c6c8366 100644
--- a/test/std/thread/futures/futures.promise/get_future.pass.cpp
+++ b/test/std/thread/futures/futures.promise/get_future.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,6 +19,8 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -28,6 +29,7 @@ int main()
p.set_value(105.5);
assert(f.get() == 105.5);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::promise<double> p;
std::future<double> f = p.get_future();
@@ -54,4 +56,5 @@ int main()
assert(e.code() == make_error_code(std::future_errc::no_state));
}
}
+#endif
}
diff --git a/test/std/thread/futures/futures.promise/move_assign.pass.cpp b/test/std/thread/futures/futures.promise/move_assign.pass.cpp
index 9dd8a9daef80..ad72bf78e0a4 100644
--- a/test/std/thread/futures/futures.promise/move_assign.pass.cpp
+++ b/test/std/thread/futures/futures.promise/move_assign.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,6 +19,7 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
int main()
@@ -34,6 +34,7 @@ int main()
std::future<int> f = p.get_future();
assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
f = p0.get_future();
@@ -43,6 +44,7 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
+#endif
assert(test_alloc_base::alloc_count == 1);
}
assert(test_alloc_base::alloc_count == 0);
@@ -55,6 +57,7 @@ int main()
std::future<int&> f = p.get_future();
assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
f = p0.get_future();
@@ -64,6 +67,7 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
+#endif
assert(test_alloc_base::alloc_count == 1);
}
assert(test_alloc_base::alloc_count == 0);
@@ -76,6 +80,7 @@ int main()
std::future<void> f = p.get_future();
assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
f = p0.get_future();
@@ -85,6 +90,7 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
+#endif
assert(test_alloc_base::alloc_count == 1);
}
assert(test_alloc_base::alloc_count == 0);
diff --git a/test/std/thread/futures/futures.promise/move_ctor.pass.cpp b/test/std/thread/futures/futures.promise/move_ctor.pass.cpp
index 9a68b5c1b4e1..c9971b0a3f04 100644
--- a/test/std/thread/futures/futures.promise/move_ctor.pass.cpp
+++ b/test/std/thread/futures/futures.promise/move_ctor.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,6 +19,7 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
int main()
@@ -32,6 +32,7 @@ int main()
std::future<int> f = p.get_future();
assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
f = p0.get_future();
@@ -42,6 +43,7 @@ int main()
assert(e.code() == make_error_code(std::future_errc::no_state));
}
assert(test_alloc_base::alloc_count == 1);
+#endif
}
assert(test_alloc_base::alloc_count == 0);
{
@@ -51,6 +53,7 @@ int main()
std::future<int&> f = p.get_future();
assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
f = p0.get_future();
@@ -61,6 +64,7 @@ int main()
assert(e.code() == make_error_code(std::future_errc::no_state));
}
assert(test_alloc_base::alloc_count == 1);
+#endif
}
assert(test_alloc_base::alloc_count == 0);
{
@@ -70,6 +74,7 @@ int main()
std::future<void> f = p.get_future();
assert(test_alloc_base::alloc_count == 1);
assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
f = p0.get_future();
@@ -80,6 +85,7 @@ int main()
assert(e.code() == make_error_code(std::future_errc::no_state));
}
assert(test_alloc_base::alloc_count == 1);
+#endif
}
assert(test_alloc_base::alloc_count == 0);
}
diff --git a/test/std/thread/futures/futures.promise/set_exception.pass.cpp b/test/std/thread/futures/futures.promise/set_exception.pass.cpp
index 6ef41af94545..8788c6314d0f 100644
--- a/test/std/thread/futures/futures.promise/set_exception.pass.cpp
+++ b/test/std/thread/futures/futures.promise/set_exception.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
diff --git a/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp b/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
index f54d7cd16bdb..1cdeadf84958 100644
--- a/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
+++ b/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -22,7 +22,6 @@
void func(std::promise<int> p)
{
- const int i = 5;
p.set_exception_at_thread_exit(std::make_exception_ptr(3));
}
diff --git a/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp b/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp
index 98394871e703..6e2a4a5d9109 100644
--- a/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp
+++ b/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,6 +19,8 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -32,6 +33,7 @@ int main()
assert(j == 3);
++i;
assert(j == 4);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
p.set_value(i);
@@ -41,5 +43,6 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied));
}
+#endif
}
}
diff --git a/test/std/thread/futures/futures.promise/set_value_const.pass.cpp b/test/std/thread/futures/futures.promise/set_value_const.pass.cpp
index db7465ceab85..9c670c1e3f77 100644
--- a/test/std/thread/futures/futures.promise/set_value_const.pass.cpp
+++ b/test/std/thread/futures/futures.promise/set_value_const.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,10 +19,14 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
struct A
{
A() {}
- A(const A&) {throw 10;}
+ A(const A&) {
+ TEST_THROW(10);
+ }
};
int main()
@@ -36,6 +39,7 @@ int main()
p.set_value(i);
++i;
assert(f.get() == 3);
+#ifndef TEST_HAS_NO_EXCEPTIONS
--i;
try
{
@@ -46,12 +50,14 @@ int main()
{
assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied));
}
+#endif
}
{
typedef A T;
T i;
std::promise<T> p;
std::future<T> f = p.get_future();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
p.set_value(i);
@@ -61,5 +67,6 @@ int main()
{
assert(j == 10);
}
+#endif
}
}
diff --git a/test/std/thread/futures/futures.promise/set_value_void.pass.cpp b/test/std/thread/futures/futures.promise/set_value_void.pass.cpp
index 87be8cd60a5e..30c6853c973b 100644
--- a/test/std/thread/futures/futures.promise/set_value_void.pass.cpp
+++ b/test/std/thread/futures/futures.promise/set_value_void.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
diff --git a/test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp b/test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp
index 3f9e945dddaf..abb9928e88a1 100644
--- a/test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp
+++ b/test/std/thread/futures/futures.shared_future/copy_assign.pass.cpp
@@ -15,10 +15,13 @@
// class shared_future<R>
// shared_future& operator=(const shared_future& rhs);
+// noexcept in C++17
#include <future>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -27,6 +30,9 @@ int main()
std::shared_future<T> f0 = p.get_future();
std::shared_future<T> f;
f = f0;
+#if TEST_STD_VER > 14
+ static_assert(noexcept(f = f0), "" );
+#endif
assert(f0.valid());
assert(f.valid());
}
diff --git a/test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp b/test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp
index 1da08808db2e..2b6633138879 100644
--- a/test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp
+++ b/test/std/thread/futures/futures.shared_future/copy_ctor.pass.cpp
@@ -15,10 +15,13 @@
// class shared_future<R>
// shared_future(const shared_future& rhs);
+// noexcept in C++17
#include <future>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -26,6 +29,9 @@ int main()
std::promise<T> p;
std::shared_future<T> f0 = p.get_future();
std::shared_future<T> f = f0;
+#if TEST_STD_VER > 14
+ static_assert(noexcept(std::shared_future<T>{f0}), "" );
+#endif
assert(f0.valid());
assert(f.valid());
}
diff --git a/test/std/thread/futures/futures.shared_future/get.pass.cpp b/test/std/thread/futures/futures.shared_future/get.pass.cpp
index 6eea1d889b6d..23d33138e3bc 100644
--- a/test/std/thread/futures/futures.shared_future/get.pass.cpp
+++ b/test/std/thread/futures/futures.shared_future/get.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -22,6 +21,8 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
void func1(std::promise<int> p)
{
std::this_thread::sleep_for(std::chrono::milliseconds(500));
@@ -73,6 +74,7 @@ int main()
assert(f.get() == 3);
assert(f.valid());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::promise<T> p;
std::shared_future<T> f = p.get_future();
@@ -89,6 +91,7 @@ int main()
}
assert(f.valid());
}
+#endif
}
{
typedef int& T;
@@ -100,6 +103,7 @@ int main()
assert(f.get() == 5);
assert(f.valid());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::promise<T> p;
std::shared_future<T> f = p.get_future();
@@ -116,6 +120,7 @@ int main()
}
assert(f.valid());
}
+#endif
}
{
typedef void T;
@@ -127,6 +132,7 @@ int main()
f.get();
assert(f.valid());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::promise<T> p;
std::shared_future<T> f = p.get_future();
@@ -143,5 +149,6 @@ int main()
}
assert(f.valid());
}
+#endif
}
}
diff --git a/test/std/thread/futures/futures.task/futures.task.members/ctor1.fail.cpp b/test/std/thread/futures/futures.task/futures.task.members/ctor1.fail.cpp
index 6d7d734bd5e7..9d1ad61cef69 100644
--- a/test/std/thread/futures/futures.task/futures.task.members/ctor1.fail.cpp
+++ b/test/std/thread/futures/futures.task/futures.task.members/ctor1.fail.cpp
@@ -28,6 +28,9 @@ typedef volatile std::packaged_task<A(int, char)> VPT;
int main()
{
- PT p { VPT{} }; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
- // expected-note@future:* 1 {{candidate template ignored: disabled by 'enable_if'}}
+ VPT init{};
+ auto const& c_init = init;
+ PT p1{init}; // expected-error {{no matching constructor}}
+ PT p2{c_init}; // expected-error {{no matching constructor}}
+ PT p3{std::move(init)}; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
}
diff --git a/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp b/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp
index 7fafd1005649..07eeaaa46afe 100644
--- a/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp
+++ b/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,6 +19,8 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
class A
{
long data_;
@@ -30,7 +31,7 @@ public:
long operator()(long i, long j) const {return data_ + i + j;}
};
-void func(std::packaged_task<double(int, char)> p)
+void func(std::packaged_task<double(int, char)>)
{
}
@@ -41,6 +42,7 @@ void func2(std::packaged_task<double(int, char)> p)
int main()
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::packaged_task<double(int, char)> p(A(5));
std::future<double> f = p.get_future();
@@ -48,6 +50,7 @@ int main()
try
{
double i = f.get();
+ ((void)i); // Prevent unused warning
assert(false);
}
catch (const std::future_error& e)
@@ -55,6 +58,7 @@ int main()
assert(e.code() == make_error_code(std::future_errc::broken_promise));
}
}
+#endif
{
std::packaged_task<double(int, char)> p(A(5));
std::future<double> f = p.get_future();
diff --git a/test/std/thread/futures/futures.task/futures.task.members/get_future.pass.cpp b/test/std/thread/futures/futures.task/futures.task.members/get_future.pass.cpp
index c8e5d6efd6b4..8f51dccd8d30 100644
--- a/test/std/thread/futures/futures.task/futures.task.members/get_future.pass.cpp
+++ b/test/std/thread/futures/futures.task/futures.task.members/get_future.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,6 +19,8 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
class A
{
long data_;
@@ -38,6 +39,7 @@ int main()
p(3, 'a');
assert(f.get() == 105.0);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::packaged_task<double(int, char)> p(A(5));
std::future<double> f = p.get_future();
@@ -63,4 +65,5 @@ int main()
assert(e.code() == make_error_code(std::future_errc::no_state));
}
}
+#endif
}
diff --git a/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp b/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp
index 54ac64458248..a597c9d8304d 100644
--- a/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp
+++ b/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,6 +19,8 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
class A
{
long data_;
@@ -30,7 +31,7 @@ public:
long operator()(long i, long j) const
{
if (j == 'z')
- throw A(6);
+ TEST_THROW(A(6));
return data_ + i + j;
}
};
@@ -49,6 +50,7 @@ void func1(std::packaged_task<double(int, char)> p)
void func2(std::packaged_task<double(int, char)> p)
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
p.make_ready_at_thread_exit(3, 'a');
try
{
@@ -58,10 +60,14 @@ void func2(std::packaged_task<double(int, char)> p)
{
assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied));
}
+#else
+ ((void)p);
+#endif
}
void func3(std::packaged_task<double(int, char)> p)
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
p.make_ready_at_thread_exit(3, 'a');
@@ -70,6 +76,9 @@ void func3(std::packaged_task<double(int, char)> p)
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
+#else
+ ((void)p);
+#endif
}
int main()
@@ -80,6 +89,7 @@ int main()
std::thread(func0, std::move(p)).detach();
assert(f.get() == 105.0);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::packaged_task<double(int, char)> p(A(5));
std::future<double> f = p.get_future();
@@ -105,4 +115,5 @@ int main()
std::thread t(func3, std::move(p));
t.join();
}
+#endif
}
diff --git a/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp b/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp
index 9ad1509517f6..6acf8c5a619b 100644
--- a/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp
+++ b/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,6 +19,8 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
class A
{
long data_;
@@ -30,7 +31,7 @@ public:
long operator()(long i, long j) const
{
if (j == 'z')
- throw A(6);
+ TEST_THROW(A(6));
return data_ + i + j;
}
};
@@ -49,6 +50,7 @@ void func1(std::packaged_task<double(int, char)> p)
void func2(std::packaged_task<double(int, char)> p)
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
p(3, 'a');
try
{
@@ -58,10 +60,14 @@ void func2(std::packaged_task<double(int, char)> p)
{
assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied));
}
+#else
+ ((void)p);
+#endif
}
void func3(std::packaged_task<double(int, char)> p)
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
p(3, 'a');
@@ -70,6 +76,9 @@ void func3(std::packaged_task<double(int, char)> p)
{
assert(e.code() == make_error_code(std::future_errc::no_state));
}
+#else
+ ((void)p);
+#endif
}
int main()
@@ -80,6 +89,7 @@ int main()
std::thread(func0, std::move(p)).detach();
assert(f.get() == 105.0);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::packaged_task<double(int, char)> p(A(5));
std::future<double> f = p.get_future();
@@ -106,4 +116,5 @@ int main()
std::thread t(func3, std::move(p));
t.join();
}
+#endif
}
diff --git a/test/std/thread/futures/futures.task/futures.task.members/reset.pass.cpp b/test/std/thread/futures/futures.task/futures.task.members/reset.pass.cpp
index 02a567500ee2..190afdc6af66 100644
--- a/test/std/thread/futures/futures.task/futures.task.members/reset.pass.cpp
+++ b/test/std/thread/futures/futures.task/futures.task.members/reset.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -20,6 +19,8 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
class A
{
long data_;
@@ -29,8 +30,6 @@ public:
long operator()(long i, long j) const
{
- if (j == 'z')
- throw A(6);
return data_ + i + j;
}
};
@@ -47,6 +46,7 @@ int main()
f = p.get_future();
assert(f.get() == 106.0);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::packaged_task<double(int, char)> p;
try
@@ -59,4 +59,5 @@ int main()
assert(e.code() == make_error_code(std::future_errc::no_state));
}
}
+#endif
}
diff --git a/test/std/thread/futures/futures.unique_future/get.pass.cpp b/test/std/thread/futures/futures.unique_future/get.pass.cpp
index 67b1052c175d..87a54251ecde 100644
--- a/test/std/thread/futures/futures.unique_future/get.pass.cpp
+++ b/test/std/thread/futures/futures.unique_future/get.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -22,6 +21,8 @@
#include <future>
#include <cassert>
+#include "test_macros.h"
+
void func1(std::promise<int> p)
{
std::this_thread::sleep_for(std::chrono::milliseconds(500));
@@ -73,6 +74,7 @@ int main()
assert(f.get() == 3);
assert(!f.valid());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::promise<T> p;
std::future<T> f = p.get_future();
@@ -89,6 +91,7 @@ int main()
}
assert(!f.valid());
}
+#endif
}
{
typedef int& T;
@@ -100,6 +103,7 @@ int main()
assert(f.get() == 5);
assert(!f.valid());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::promise<T> p;
std::future<T> f = p.get_future();
@@ -116,6 +120,7 @@ int main()
}
assert(!f.valid());
}
+#endif
}
{
typedef void T;
@@ -127,6 +132,7 @@ int main()
f.get();
assert(!f.valid());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::promise<T> p;
std::future<T> f = p.get_future();
@@ -143,5 +149,6 @@ int main()
}
assert(!f.valid());
}
+#endif
}
}
diff --git a/test/std/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp b/test/std/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
new file mode 100644
index 000000000000..d60e42918860
--- /dev/null
+++ b/test/std/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: libcpp-has-no-threads
+
+// notify_all_at_thread_exit(...) requires move semantics to transfer the
+// unique_lock.
+// UNSUPPORTED: c++98, c++03
+
+// <condition_variable>
+
+// void
+// notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
+
+// Test that this function works with threads that were not created by
+// std::thread. See http://llvm.org/PR30202.
+
+
+#include <condition_variable>
+#include <mutex>
+#include <thread>
+#include <chrono>
+#include <cassert>
+#include <pthread.h>
+
+std::condition_variable cv;
+std::mutex mut;
+bool exited = false;
+
+typedef std::chrono::milliseconds ms;
+typedef std::chrono::high_resolution_clock Clock;
+
+void* func(void*)
+{
+ std::unique_lock<std::mutex> lk(mut);
+ std::notify_all_at_thread_exit(cv, std::move(lk));
+ std::this_thread::sleep_for(ms(300));
+ exited = true;
+ return nullptr;
+}
+
+int main()
+{
+ {
+ std::unique_lock<std::mutex> lk(mut);
+ pthread_t id;
+ int res = pthread_create(&id, 0, &func, nullptr);
+ assert(res == 0);
+ Clock::time_point t0 = Clock::now();
+ assert(exited == false);
+ cv.wait(lk);
+ Clock::time_point t1 = Clock::now();
+ assert(exited);
+ assert(t1-t0 > ms(250));
+ pthread_join(id, 0);
+ }
+ exited = false;
+ {
+ std::unique_lock<std::mutex> lk(mut);
+ std::thread t(&func, nullptr);
+ Clock::time_point t0 = Clock::now();
+ assert(exited == false);
+ cv.wait(lk);
+ Clock::time_point t1 = Clock::now();
+ assert(exited);
+ assert(t1-t0 > ms(250));
+ t.join();
+ }
+}
diff --git a/test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp b/test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp
index 0ee40d161b7b..9c0af808686e 100644
--- a/test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp
+++ b/test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp
@@ -52,6 +52,7 @@ void f()
cv.notify_one();
Clock::time_point t0 = Clock::now();
bool r = cv.wait_for(lk, milliseconds(250), Pred(test2));
+ ((void)r); // Prevent unused warning
Clock::time_point t1 = Clock::now();
if (runs == 0)
{
diff --git a/test/std/thread/thread.condition/thread.condition.condvarany/wait_for_pred.pass.cpp b/test/std/thread/thread.condition/thread.condition.condvarany/wait_for_pred.pass.cpp
index b2403079275d..47da788335c2 100644
--- a/test/std/thread/thread.condition/thread.condition.condvarany/wait_for_pred.pass.cpp
+++ b/test/std/thread/thread.condition/thread.condition.condvarany/wait_for_pred.pass.cpp
@@ -44,6 +44,7 @@ int test1 = 0;
int test2 = 0;
int runs = 0;
+bool expect_result = false;
void f()
{
@@ -54,7 +55,8 @@ void f()
test1 = 1;
cv.notify_one();
Clock::time_point t0 = Clock::now();
- bool r = cv.wait_for(lk, milliseconds(250), Pred(test2));
+ bool result = cv.wait_for(lk, milliseconds(250), Pred(test2));
+ assert(result == expect_result);
Clock::time_point t1 = Clock::now();
if (runs == 0)
{
@@ -72,6 +74,7 @@ void f()
int main()
{
{
+ expect_result = true;
L1 lk(m0);
std::thread t(f);
assert(test1 == 0);
@@ -86,6 +89,7 @@ int main()
test1 = 0;
test2 = 0;
{
+ expect_result = false;
L1 lk(m0);
std::thread t(f);
assert(test1 == 0);
diff --git a/test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp b/test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp
index f9a35cc905c7..a2b7061c2546 100644
--- a/test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp
+++ b/test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <condition_variable>
diff --git a/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
index eac7600b5d11..46d04cdac350 100644
--- a/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
@@ -7,9 +7,13 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
+// This test hangs forever when built against libstdc++. In order to allow
+// validation of the test suite against other STLs we have to mark it
+// unsupported.
+// UNSUPPORTED: libstdc++
+
// <mutex>
// template <class L1, class L2, class... L3>
@@ -18,6 +22,8 @@
#include <mutex>
#include <cassert>
+#include "test_macros.h"
+
class L0
{
bool locked_;
@@ -73,12 +79,12 @@ public:
void lock()
{
- throw 1;
+ TEST_THROW(1);
}
bool try_lock()
{
- throw 1;
+ TEST_THROW(1);
return locked_;
}
@@ -110,6 +116,7 @@ int main()
assert(l0.locked());
assert(l1.locked());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
L0 l0;
L2 l1;
@@ -180,6 +187,7 @@ int main()
assert(!l1.locked());
}
}
+#endif
#ifndef _LIBCPP_HAS_NO_VARIADICS
{
L0 l0;
@@ -190,6 +198,7 @@ int main()
assert(l1.locked());
assert(l2.locked());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
L2 l0;
L2 l1;
@@ -206,6 +215,7 @@ int main()
assert(!l2.locked());
}
}
+#endif
{
L0 l0;
L0 l1;
@@ -233,6 +243,7 @@ int main()
assert(l1.locked());
assert(l2.locked());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
L0 l0;
L0 l1;
@@ -377,6 +388,7 @@ int main()
assert(!l2.locked());
}
}
+#endif // TEST_HAS_NO_EXCEPTIONS
{
L0 l0;
L0 l1;
@@ -432,6 +444,7 @@ int main()
assert(l2.locked());
assert(l3.locked());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
L0 l0;
L0 l1;
@@ -504,5 +517,6 @@ int main()
assert(!l3.locked());
}
}
+#endif // TEST_HAS_NO_EXCEPTIONS
#endif // _LIBCPP_HAS_NO_VARIADICS
}
diff --git a/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
index 8889408be2d7..fb563cbe0b14 100644
--- a/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
@@ -18,6 +17,8 @@
#include <mutex>
#include <cassert>
+#include "test_macros.h"
+
class L0
{
bool locked_;
@@ -63,7 +64,7 @@ public:
bool try_lock()
{
- throw 1;
+ TEST_THROW(1);
return locked_;
}
@@ -95,6 +96,7 @@ int main()
assert(!l0.locked());
assert(!l1.locked());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
L0 l0;
L2 l1;
@@ -123,6 +125,7 @@ int main()
assert(!l1.locked());
}
}
+#endif
#ifndef _LIBCPP_HAS_NO_VARIADICS
{
L0 l0;
@@ -142,6 +145,7 @@ int main()
assert(!l1.locked());
assert(!l2.locked());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
L2 l0;
L2 l1;
@@ -167,6 +171,7 @@ int main()
assert(!l1.locked());
assert(!l2.locked());
}
+#endif
{
L0 l0;
L0 l1;
@@ -194,6 +199,7 @@ int main()
assert(!l1.locked());
assert(!l2.locked());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
L0 l0;
L0 l1;
@@ -242,6 +248,7 @@ int main()
assert(!l2.locked());
}
}
+#endif
{
L1 l0;
L1 l1;
@@ -269,6 +276,7 @@ int main()
assert(!l1.locked());
assert(!l2.locked());
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
L1 l0;
L1 l1;
@@ -458,6 +466,7 @@ int main()
assert(!l2.locked());
}
}
+#endif // TEST_HAS_NO_EXCEPTIONS
{
L0 l0;
L0 l1;
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_adopt_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_adopt_lock.pass.cpp
index 840af6788d04..81fc0d368f6a 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_adopt_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_adopt_lock.pass.cpp
@@ -16,6 +16,7 @@
// lock_guard(Mutex&..., adopt_lock_t);
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#include <mutex>
#include <cassert>
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp
index 18193e000edc..1b4c9d4bfd5d 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp
@@ -16,6 +16,7 @@
// lock_guard& operator=(lock_guard const&) = delete;
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#include <mutex>
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp
index 6dc37e970fb6..c7fd0e94b771 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp
@@ -16,6 +16,7 @@
// lock_guard(lock_guard const&) = delete;
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#include <mutex>
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp
index 866538a2834f..1eef7e268fb2 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp
@@ -16,6 +16,7 @@
// explicit lock_guard(Mutex&...);
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#include <mutex>
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp
index 4910d837cae3..8d83ddf98c6d 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp
@@ -16,6 +16,7 @@
// explicit lock_guard(mutex_type& m);
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#include <mutex>
#include <cassert>
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp
index 3c134e0b8861..0ad16e2856fd 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
-
// <mutex>
// template <class ...Mutex> class lock_guard;
@@ -17,5 +16,6 @@
// dialects, including C++03, even though it is forward declared using
// variadic templates.
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#include "mutex.pass.cpp" // Use the existing non-variadic test
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp
index 2b06742a673e..600399d9793e 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp
@@ -20,6 +20,7 @@
// ...
// };
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#include <mutex>
#include <type_traits>
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
index 12bef34cf87b..f9a537085c30 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03, c++11
+// FLAKY_TEST.
+
// <shared_mutex>
// template <class Mutex> class shared_lock;
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp
index 84f868d6810b..839e12dba685 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03, c++11
+// FLAKY_TEST.
+
// <shared_mutex>
// class timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp
index 9359731486dd..9401cea2ed10 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03, c++11
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
index 5c3513c98e03..25d78ab19021 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03, c++11
@@ -54,6 +53,7 @@ void f()
assert(lk.owns_lock() == true);
ns d = t1 - t0 - WaitTime;
assert(d < Tolerance); // within tolerance
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.lock();
@@ -63,8 +63,10 @@ void f()
{
assert(e.code().value() == EDEADLK);
}
+#endif
lk.unlock();
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.lock();
@@ -74,6 +76,7 @@ void f()
{
assert(e.code().value() == EPERM);
}
+#endif
}
int main()
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
index 01693c77ea39..947b1ad012ec 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03, c++11
@@ -20,6 +19,8 @@
#include <shared_mutex>
#include <cassert>
+#include "test_macros.h"
+
bool try_lock_called = false;
struct mutex
@@ -36,11 +37,11 @@ mutex m;
int main()
{
-
std::shared_lock<mutex> lk(m, std::defer_lock);
assert(lk.try_lock() == true);
assert(try_lock_called == true);
assert(lk.owns_lock() == true);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock();
@@ -50,11 +51,13 @@ int main()
{
assert(e.code().value() == EDEADLK);
}
+#endif
lk.unlock();
assert(lk.try_lock() == false);
assert(try_lock_called == false);
assert(lk.owns_lock() == false);
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock();
@@ -64,4 +67,5 @@ int main()
{
assert(e.code().value() == EPERM);
}
+#endif
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
index 852a94eb65ec..5cb805412563 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03, c++11
@@ -21,6 +20,8 @@
#include <shared_mutex>
#include <cassert>
+#include "test_macros.h"
+
bool try_lock_for_called = false;
typedef std::chrono::milliseconds ms;
@@ -45,6 +46,7 @@ int main()
assert(lk.try_lock_for(ms(5)) == true);
assert(try_lock_for_called == true);
assert(lk.owns_lock() == true);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock_for(ms(5));
@@ -54,11 +56,13 @@ int main()
{
assert(e.code().value() == EDEADLK);
}
+#endif
lk.unlock();
assert(lk.try_lock_for(ms(5)) == false);
assert(try_lock_for_called == false);
assert(lk.owns_lock() == false);
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock_for(ms(5));
@@ -68,4 +72,5 @@ int main()
{
assert(e.code().value() == EPERM);
}
+#endif
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
index 31574afd7d8f..3ba4128d719c 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03, c++11
@@ -21,6 +20,8 @@
#include <shared_mutex>
#include <cassert>
+#include "test_macros.h"
+
bool try_lock_until_called = false;
struct mutex
@@ -45,6 +46,7 @@ int main()
assert(lk.try_lock_until(Clock::now()) == true);
assert(try_lock_until_called == true);
assert(lk.owns_lock() == true);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock_until(Clock::now());
@@ -54,11 +56,13 @@ int main()
{
assert(e.code().value() == EDEADLK);
}
+#endif
lk.unlock();
assert(lk.try_lock_until(Clock::now()) == false);
assert(try_lock_until_called == false);
assert(lk.owns_lock() == false);
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock_until(Clock::now());
@@ -68,4 +72,5 @@ int main()
{
assert(e.code().value() == EPERM);
}
+#endif
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp
index 6a7385ed42a6..903b53ace0f2 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03, c++11
@@ -20,6 +19,8 @@
#include <shared_mutex>
#include <cassert>
+#include "test_macros.h"
+
bool unlock_called = false;
struct mutex
@@ -36,6 +37,7 @@ int main()
lk.unlock();
assert(unlock_called == true);
assert(lk.owns_lock() == false);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.unlock();
@@ -45,7 +47,9 @@ int main()
{
assert(e.code().value() == EPERM);
}
+#endif
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.unlock();
@@ -55,4 +59,5 @@ int main()
{
assert(e.code().value() == EPERM);
}
+#endif
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp
index 33e400b0da80..0939a5792644 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp
@@ -9,6 +9,8 @@
//
// UNSUPPORTED: libcpp-has-no-threads
+// FLAKY_TEST.
+
// <mutex>
// class timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp
index 2ead67097730..ceb29370182d 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp
@@ -9,6 +9,8 @@
//
// UNSUPPORTED: libcpp-has-no-threads
+// FLAKY_TEST.
+
// <mutex>
// class timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp
index 6ce33761068f..cb5c55925eef 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
@@ -21,6 +20,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
std::mutex m;
typedef std::chrono::system_clock Clock;
@@ -38,6 +39,7 @@ void f()
assert(lk.owns_lock() == true);
ns d = t1 - t0 - ms(250);
assert(d < ms(25)); // within 25ms
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.lock();
@@ -47,8 +49,10 @@ void f()
{
assert(e.code().value() == EDEADLK);
}
+#endif
lk.unlock();
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.lock();
@@ -58,6 +62,7 @@ void f()
{
assert(e.code().value() == EPERM);
}
+#endif
}
int main()
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
index 27d0562de31f..709c56978af8 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
@@ -19,6 +18,8 @@
#include <mutex>
#include <cassert>
+#include "test_macros.h"
+
bool try_lock_called = false;
struct mutex
@@ -39,6 +40,7 @@ int main()
assert(lk.try_lock() == true);
assert(try_lock_called == true);
assert(lk.owns_lock() == true);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock();
@@ -48,11 +50,13 @@ int main()
{
assert(e.code().value() == EDEADLK);
}
+#endif
lk.unlock();
assert(lk.try_lock() == false);
assert(try_lock_called == false);
assert(lk.owns_lock() == false);
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock();
@@ -62,4 +66,5 @@ int main()
{
assert(e.code().value() == EPERM);
}
+#endif
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
index 6f0a7219d2d8..6c981787d4b4 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
@@ -20,6 +19,8 @@
#include <mutex>
#include <cassert>
+#include "test_macros.h"
+
bool try_lock_for_called = false;
typedef std::chrono::milliseconds ms;
@@ -44,6 +45,7 @@ int main()
assert(lk.try_lock_for(ms(5)) == true);
assert(try_lock_for_called == true);
assert(lk.owns_lock() == true);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock_for(ms(5));
@@ -53,11 +55,13 @@ int main()
{
assert(e.code().value() == EDEADLK);
}
+#endif
lk.unlock();
assert(lk.try_lock_for(ms(5)) == false);
assert(try_lock_for_called == false);
assert(lk.owns_lock() == false);
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock_for(ms(5));
@@ -67,4 +71,5 @@ int main()
{
assert(e.code().value() == EPERM);
}
+#endif
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
index b7e87249b596..57231b207a72 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
@@ -20,6 +19,8 @@
#include <mutex>
#include <cassert>
+#include "test_macros.h"
+
bool try_lock_until_called = false;
struct mutex
@@ -44,6 +45,7 @@ int main()
assert(lk.try_lock_until(Clock::now()) == true);
assert(try_lock_until_called == true);
assert(lk.owns_lock() == true);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock_until(Clock::now());
@@ -53,11 +55,13 @@ int main()
{
assert(e.code().value() == EDEADLK);
}
+#endif
lk.unlock();
assert(lk.try_lock_until(Clock::now()) == false);
assert(try_lock_until_called == false);
assert(lk.owns_lock() == false);
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.try_lock_until(Clock::now());
@@ -67,4 +71,5 @@ int main()
{
assert(e.code().value() == EPERM);
}
+#endif
}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp
index 62497c9ec45a..124ff551f947 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
@@ -19,6 +18,8 @@
#include <mutex>
#include <cassert>
+#include "test_macros.h"
+
bool unlock_called = false;
struct mutex
@@ -35,6 +36,7 @@ int main()
lk.unlock();
assert(unlock_called == true);
assert(lk.owns_lock() == false);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.unlock();
@@ -44,7 +46,9 @@ int main()
{
assert(e.code().value() == EPERM);
}
+#endif
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.unlock();
@@ -54,4 +58,5 @@ int main()
{
assert(e.code().value() == EPERM);
}
+#endif
}
diff --git a/test/std/thread/thread.mutex/thread.lock/types.pass.cpp b/test/std/thread/thread.mutex/thread.lock/types.pass.cpp
index 64df0680b0b9..5baaee533a6a 100644
--- a/test/std/thread/thread.mutex/thread.lock/types.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/types.pass.cpp
@@ -28,7 +28,7 @@ int main()
typedef std::try_to_lock_t T2;
typedef std::adopt_lock_t T3;
- T1 t1 = std::defer_lock;
- T2 t2 = std::try_to_lock;
- T3 t3 = std::adopt_lock;
+ T1 t1 = std::defer_lock; ((void)t1);
+ T2 t2 = std::try_to_lock; ((void)t2);
+ T3 t3 = std::adopt_lock; ((void)t3);
}
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp
index 75ddebff0ed9..0a6d6e3683ed 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++98, c++11, c++14
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_mutex;
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp
index 6b5089d38859..b7edc50978d2 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++98, c++11, c++14
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_mutex;
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp
index 52007155ba5f..f615981bc94d 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/try_lock_shared.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++98, c++11, c++14
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_mutex;
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp
index 2818bd617542..83979d4c4e51 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++98, c++11
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp
index 77a9107de923..516f43192580 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++98, c++11
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp
index 320a268ae77d..3d36911889b1 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++98, c++11
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp
index 3d5604d886cb..452fc3c19d65 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++98, c++11
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp
index 4cdb5873f9a1..f478a29367a1 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++98, c++11
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp
index f7ddbaeef498..f33edfc1a534 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++98, c++11
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp
index 1560af2c9ecc..d5715c76f458 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp
@@ -10,6 +10,8 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++98, c++11
+// FLAKY_TEST.
+
// <shared_mutex>
// class shared_timed_mutex;
diff --git a/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp b/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
index 71b054fced88..138b657196da 100644
--- a/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
@@ -50,12 +49,13 @@ void init3()
++init3_called;
std::this_thread::sleep_for(ms(250));
if (init3_called == 1)
- throw 1;
+ TEST_THROW(1);
++init3_completed;
}
void f3()
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
std::call_once(flg3, init3);
@@ -63,6 +63,7 @@ void f3()
catch (...)
{
}
+#endif
}
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -197,6 +198,7 @@ int main()
t1.join();
assert(init0_called == 1);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
// check basic exception safety
{
std::thread t0(f3);
@@ -206,6 +208,7 @@ int main()
assert(init3_called == 2);
assert(init3_completed == 1);
}
+#endif
// check deadlock avoidance
{
std::thread t0(f41);
diff --git a/test/std/thread/thread.mutex/thread.once/thread.once.callonce/race.pass.cpp b/test/std/thread/thread.mutex/thread.once/thread.once.callonce/race.pass.cpp
new file mode 100644
index 000000000000..33215819f585
--- /dev/null
+++ b/test/std/thread/thread.mutex/thread.once/thread.once.callonce/race.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: libcpp-has-no-threads
+
+// <mutex>
+
+// struct once_flag;
+
+// template<class Callable, class ...Args>
+// void call_once(once_flag& flag, Callable&& func, Args&&... args);
+
+// This test is supposed to be run with ThreadSanitizer and verifies that
+// call_once properly synchronizes user state, a data race that was fixed
+// in r280621.
+
+#include <mutex>
+#include <thread>
+#include <cassert>
+
+std::once_flag flg0;
+long global = 0;
+
+void init0()
+{
+ ++global;
+}
+
+void f0()
+{
+ std::call_once(flg0, init0);
+ assert(global == 1);
+}
+
+int main()
+{
+ std::thread t0(f0);
+ std::thread t1(f0);
+ t0.join();
+ t1.join();
+ assert(global == 1);
+}
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp
index 6c31df593c0e..e452ac98c49e 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.assign/move2.pass.cpp
@@ -58,7 +58,6 @@ int main()
{
G g;
std::thread t0(g, 5, 5.5);
- std::thread::id id = t0.get_id();
std::thread t1;
t0 = std::move(t1);
assert(false);
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
index 5dd6a40a0eb7..437b42037913 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <thread>
@@ -30,10 +29,10 @@ std::atomic<unsigned> throw_one(0xFFFF);
std::atomic<unsigned> outstanding_new(0);
-void* operator new(std::size_t s) throw(std::bad_alloc)
+void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
if (throw_one == 0)
- throw std::bad_alloc();
+ TEST_THROW(std::bad_alloc());
--throw_one;
++outstanding_new;
void* ret = std::malloc(s);
@@ -41,7 +40,7 @@ void* operator new(std::size_t s) throw(std::bad_alloc)
return ret;
}
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
--outstanding_new;
std::free(p);
@@ -118,6 +117,7 @@ public:
// 3 Finally check that a thread runs successfully if we throw after 'N+1'
// allocations.
void test_throwing_new_during_thread_creation() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
throw_one = 0xFFF;
{
std::thread t(f);
@@ -142,6 +142,7 @@ void test_throwing_new_during_thread_creation() {
}
f_run = false;
throw_one = 0xFFF;
+#endif
}
int main()
@@ -162,6 +163,7 @@ int main()
assert(G::op_run);
}
G::op_run = false;
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
try
{
@@ -178,6 +180,7 @@ int main()
assert(!G::op_run);
}
}
+#endif
#if TEST_STD_VER >= 11
{
assert(G::n_alive == 0);
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/get_id.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/get_id.pass.cpp
index 5cca7b0b66b8..f9f38c85f0e9 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/get_id.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/get_id.pass.cpp
@@ -50,7 +50,8 @@ int main()
std::thread::id id0 = t0.get_id();
std::thread t1;
std::thread::id id1 = t1.get_id();
- assert(t0.get_id() != id1);
+ assert(t0.get_id() == id0);
+ assert(id0 != id1);
assert(t1.get_id() == std::thread::id());
t0.join();
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
index a5663a2e063e..0aef2af85ccf 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -23,8 +25,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
A1<int> a3(3);
@@ -108,5 +108,4 @@ int main()
std::scoped_allocator_adaptor<A2<int>, A3<int>>(A2<int>(5), A3<int>(6))));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp
index 9d40cf55a144..8fbbcebe1268 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -23,8 +25,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<double>> B;
typedef std::scoped_allocator_adaptor<A1<int>> A;
@@ -65,5 +65,4 @@ int main()
assert(a2 == a1);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp
index 02e9dff7d7d3..8b585e5f6243 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -23,8 +25,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<double>> B;
typedef std::scoped_allocator_adaptor<A1<int>> A;
@@ -70,6 +70,4 @@ int main()
assert(A3<int>::move_called == true);
assert(a2 == a1);
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp
index 21055325112f..86f16891ac3c 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,8 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
A a1(A1<int>(3));
@@ -65,6 +65,4 @@ int main()
assert(A3<int>::move_called == false);
assert(a2 == a1);
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp
index 2a1d781eb9cd..b335935e333d 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,8 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
A a;
@@ -54,5 +54,4 @@ int main()
assert(A3<int>::move_called == false);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp
index 727907e3ec76..dd8cf4273272 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,8 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
A a;
@@ -45,5 +45,4 @@ int main()
assert(A1<int>::allocate_called == true);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp
index cae42de66905..f5ce83aa4f6c 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,8 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
A a;
@@ -66,5 +66,4 @@ int main()
assert(a.allocate(10, (const void*)20) == (int*)20);
assert(A2<int>::allocate_called == true);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
index f94b0e19ac90..dc629edec54a 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -20,8 +22,6 @@
#include "allocators.h"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
struct B
{
static bool constructed;
@@ -111,11 +111,8 @@ struct F
bool F::constructed = false;
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::scoped_allocator_adaptor<A1<std::string>> A;
@@ -188,6 +185,4 @@ int main()
assert(A3<F>::constructed);
s->~S();
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp
new file mode 100644
index 000000000000..4e73d8064317
--- /dev/null
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp
@@ -0,0 +1,139 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <scoped_allocator>
+
+// template <class OtherAlloc, class ...InnerAlloc>
+// class scoped_allocator_adaptor
+
+// template <class U1, class U2>
+// void scoped_allocator_adaptor::construct(pair<U1, U2>*)
+
+#include <scoped_allocator>
+#include <type_traits>
+#include <utility>
+#include <tuple>
+#include <cassert>
+#include <cstdlib>
+#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
+
+
+void test_no_inner_alloc()
+{
+ using VoidAlloc = CountingAllocator<void>;
+ AllocController P;
+ {
+ using T = UsesAllocatorV1<VoidAlloc, 0>;
+ using U = UsesAllocatorV2<VoidAlloc, 0>;
+ using Pair = std::pair<T, U>;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr);
+ assert(checkConstruct<>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<>(ptr->second, UA_AllocLast, CA));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&>&&,
+ std::tuple<SA&>&&
+ >(CA, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+
+ }
+ P.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc, 0>;
+ using U = NotUsesAllocator<VoidAlloc, 0>;
+ using Pair = std::pair<T, U>;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr);
+ assert(checkConstruct<>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<>(ptr->second, UA_None));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&>&&,
+ std::tuple<>&&
+ >(CA, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+}
+
+void test_with_inner_alloc()
+{
+ using VoidAlloc1 = CountingAllocator<void, 1>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
+
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 0>;
+ using U = UsesAllocatorV2<VoidAlloc2, 0>;
+ using Pair = std::pair<T, U>;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr);
+ assert(checkConstruct<>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<>(ptr->second, UA_AllocLast));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&>&&,
+ std::tuple<SAInner&>&&
+ >(O, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc2, 0>;
+ using U = NotUsesAllocator<VoidAlloc2, 0>;
+ using Pair = std::pair<T, U>;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr);
+ assert(checkConstruct<>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<>(ptr->second, UA_None));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&>&&,
+ std::tuple<>&&
+ >(O, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+}
+int main() {
+ test_no_inner_alloc();
+ test_with_inner_alloc();
+}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
new file mode 100644
index 000000000000..9effb6eded37
--- /dev/null
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
@@ -0,0 +1,155 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <scoped_allocator>
+
+// template <class OtherAlloc, class ...InnerAlloc>
+// class scoped_allocator_adaptor
+
+// template <class U1, class U2>
+// void scoped_allocator_adaptor::construct(pair<U1, U2>*, pair<T1, T2>const&)
+
+#include <scoped_allocator>
+#include <type_traits>
+#include <utility>
+#include <tuple>
+#include <cassert>
+#include <cstdlib>
+#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
+
+
+void test_no_inner_alloc()
+{
+ using VoidAlloc = CountingAllocator<void>;
+ AllocController P;
+ {
+ using T = UsesAllocatorV1<VoidAlloc, 1>;
+ using U = UsesAllocatorV2<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int&, int const&&>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Alloc CA(P);
+ SA A(CA);
+ const PairIn in(x, std::move(y));
+ A.construct(ptr, in);
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&>(ptr->second, UA_AllocLast, CA));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&>&&,
+ std::tuple<int const&, SA&>&&
+ >(CA, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+
+ }
+ P.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc, 1>;
+ using U = NotUsesAllocator<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int, int const&>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Alloc CA(P);
+ SA A(CA);
+ const PairIn in(x, y);
+ A.construct(ptr, in);
+ assert(checkConstruct<int const&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int const&>&&,
+ std::tuple<int const&>&&
+ >(CA, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+}
+
+void test_with_inner_alloc()
+{
+ using VoidAlloc1 = CountingAllocator<void, 1>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
+
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 1>;
+ using U = UsesAllocatorV2<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int&, int const&&>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ const PairIn in(x, std::move(y));
+ A.construct(ptr, in);
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&>(ptr->second, UA_AllocLast));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
+ std::tuple<int const&, SAInner&>&&
+ >(O, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc2, 1>;
+ using U = NotUsesAllocator<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int, int const &>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ const PairIn in(x, y);
+ A.construct(ptr, in);
+ assert(checkConstruct<int const&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int const&>&&,
+ std::tuple<int const&>&&
+ >(O, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+}
+int main() {
+ test_no_inner_alloc();
+ test_with_inner_alloc();
+}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
new file mode 100644
index 000000000000..4d371f206e65
--- /dev/null
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
@@ -0,0 +1,156 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <scoped_allocator>
+
+// template <class OtherAlloc, class ...InnerAlloc>
+// class scoped_allocator_adaptor
+
+// template <class U1, class U2, class ...Args1, class ...Args2>
+// void scoped_allocator_adaptor::construct(pair<U1, U2>*,
+// piecewise_construct_t, tuple<Args1...>, tuple<Args2...>)
+
+#include <scoped_allocator>
+#include <type_traits>
+#include <utility>
+#include <tuple>
+#include <cassert>
+#include <cstdlib>
+#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
+
+
+void test_no_inner_alloc()
+{
+ using VoidAlloc = CountingAllocator<void>;
+ AllocController P;
+ {
+ using T = UsesAllocatorV1<VoidAlloc, 1>;
+ using U = UsesAllocatorV2<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr, std::piecewise_construct,
+ std::forward_as_tuple(x),
+ std::forward_as_tuple(std::move(y)));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast, CA));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&>&&,
+ std::tuple<int const&&, SA&>&&
+ >(CA, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+
+ }
+ P.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc, 1>;
+ using U = NotUsesAllocator<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr, std::piecewise_construct,
+ std::forward_as_tuple(std::move(x)),
+ std::forward_as_tuple(y));
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&&>&&,
+ std::tuple<int const&>&&
+ >(CA, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+}
+
+void test_with_inner_alloc()
+{
+ using VoidAlloc1 = CountingAllocator<void, 1>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
+
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 1>;
+ using U = UsesAllocatorV2<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr, std::piecewise_construct,
+ std::forward_as_tuple(x),
+ std::forward_as_tuple(std::move(y)));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int &&>(ptr->second, UA_AllocLast));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
+ std::tuple<int &&, SAInner&>&&
+ >(O, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc2, 1>;
+ using U = NotUsesAllocator<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr, std::piecewise_construct,
+ std::forward_as_tuple(std::move(x)),
+ std::forward_as_tuple(std::move(y)));
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&&>(ptr->second, UA_None));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&&>&&,
+ std::tuple<int const&&>&&
+ >(O, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+}
+int main() {
+ test_no_inner_alloc();
+ test_with_inner_alloc();
+}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
new file mode 100644
index 000000000000..1d0fb5157c02
--- /dev/null
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
@@ -0,0 +1,155 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <scoped_allocator>
+
+// template <class OtherAlloc, class ...InnerAlloc>
+// class scoped_allocator_adaptor
+
+// template <class U1, class U2>
+// void scoped_allocator_adaptor::construct(pair<U1, U2>*, pair<T1, T2>&&)
+
+#include <scoped_allocator>
+#include <type_traits>
+#include <utility>
+#include <tuple>
+#include <cassert>
+#include <cstdlib>
+#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
+
+
+void test_no_inner_alloc()
+{
+ using VoidAlloc = CountingAllocator<void>;
+ AllocController P;
+ {
+ using T = UsesAllocatorV1<VoidAlloc, 1>;
+ using U = UsesAllocatorV2<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int&, int const&&>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Alloc CA(P);
+ SA A(CA);
+ PairIn in(x, std::move(y));
+ A.construct(ptr, std::move(in));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast, CA));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&>&&,
+ std::tuple<int const&&, SA&>&&
+ >(CA, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+
+ }
+ P.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc, 1>;
+ using U = NotUsesAllocator<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int, int const&>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Alloc CA(P);
+ SA A(CA);
+ PairIn in(x, y);
+ A.construct(ptr, std::move(in));
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&&>&&,
+ std::tuple<int const&>&&
+ >(CA, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+}
+
+void test_with_inner_alloc()
+{
+ using VoidAlloc1 = CountingAllocator<void, 1>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
+
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 1>;
+ using U = UsesAllocatorV2<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int&, int const&&>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ PairIn in(x, std::move(y));
+ A.construct(ptr, std::move(in));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
+ std::tuple<int const&&, SAInner&>&&
+ >(O, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc2, 1>;
+ using U = NotUsesAllocator<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int, int const &>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ PairIn in(x, y);
+ A.construct(ptr, std::move(in));
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&&>&&,
+ std::tuple<int const&>&&
+ >(O, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+}
+int main() {
+ test_no_inner_alloc();
+ test_with_inner_alloc();
+}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
new file mode 100644
index 000000000000..840f4ecc616d
--- /dev/null
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
@@ -0,0 +1,147 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <scoped_allocator>
+
+// template <class OtherAlloc, class ...InnerAlloc>
+// class scoped_allocator_adaptor
+
+// template <class U1, class U2, class Tp, class Vp>
+// void scoped_allocator_adaptor::construct(pair<U1, U2>*, Tp&&, Up&&)
+
+#include <scoped_allocator>
+#include <type_traits>
+#include <utility>
+#include <tuple>
+#include <cassert>
+#include <cstdlib>
+#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
+
+
+void test_no_inner_alloc()
+{
+ using VoidAlloc = CountingAllocator<void>;
+ AllocController P;
+ {
+ using T = UsesAllocatorV1<VoidAlloc, 1>;
+ using U = UsesAllocatorV2<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr, x, std::move(y));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast, CA));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&>&&,
+ std::tuple<int const&&, SA&>&&
+ >(CA, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+
+ }
+ P.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc, 1>;
+ using U = NotUsesAllocator<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr, std::move(x), y);
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&&>&&,
+ std::tuple<int const&>&&
+ >(CA, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+}
+
+void test_with_inner_alloc()
+{
+ using VoidAlloc1 = CountingAllocator<void, 1>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
+
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 1>;
+ using U = UsesAllocatorV2<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr, x, std::move(y));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int &&>(ptr->second, UA_AllocLast));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
+ std::tuple<int &&, SAInner&>&&
+ >(O, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc2, 1>;
+ using U = NotUsesAllocator<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr, std::move(x), std::move(y));
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&&>(ptr->second, UA_None));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&&>&&,
+ std::tuple<int const&&>&&
+ >(O, ptr)));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+}
+int main() {
+ test_no_inner_alloc();
+ test_with_inner_alloc();
+}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
new file mode 100644
index 000000000000..867cc74082e7
--- /dev/null
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
@@ -0,0 +1,139 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <scoped_allocator>
+
+// template <class OtherAlloc, class ...InnerAlloc>
+// class scoped_allocator_adaptor
+
+// template <class T, class ...Args>
+// void scoped_allocator_adaptor::construct(T*, Args&&...)
+
+#include <scoped_allocator>
+#include <type_traits>
+#include <utility>
+#include <tuple>
+#include <cassert>
+#include <cstdlib>
+#include "uses_alloc_types.hpp"
+#include "controlled_allocators.hpp"
+
+// — If uses_allocator_v<T, inner_allocator_type> is false and
+// is_constructible_v<T, Args...> is true, calls
+// OUTERMOST_ALLOC_TRAITS(*this)::construct(
+// OUTERMOST (*this), p, std::forward<Args>(args)...).
+void test_bullet_one() {
+ using VoidAlloc1 = CountingAllocator<void, 1>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
+
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = NotUsesAllocator<VoidAlloc2, 3>;
+ using Outer = CountingAllocator<T, 1>;
+ using Inner = CountingAllocator<T, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(!std::uses_allocator<T, Inner>::value, "");
+ T* ptr = (T*)::operator new(sizeof(T));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ int x = 42;
+ int const& cx = x;
+ A.construct(ptr, x, cx, std::move(x));
+ assert((checkConstruct<int&, int const&, int&&>(*ptr, UA_None)));
+ assert((POuter.checkConstruct<int&, int const&, int&&>(O, ptr)));
+ A.destroy(ptr);
+ ::operator delete((void*)ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+}
+
+
+// Otherwise, if uses_allocator_v<T, inner_allocator_type> is true and
+// is_constructible_v<T, allocator_arg_t, inner_allocator_type&, Args...> is
+// true, calls OUTERMOST_ALLOC_TRAITS(*this)::construct(OUTERMOST (*this), p,
+// allocator_arg, inner_allocator(), std::forward<Args>(args)...).
+void test_bullet_two() {
+ using VoidAlloc1 = CountingAllocator<void, 1>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
+
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 3>;
+ using Outer = CountingAllocator<T, 1>;
+ using Inner = CountingAllocator<T, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ T* ptr = (T*)::operator new(sizeof(T));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ int x = 42;
+ int const& cx = x;
+ A.construct(ptr, x, cx, std::move(x));
+ assert((checkConstruct<int&, int const&, int&&>(*ptr, UA_AllocArg, I)));
+ assert((POuter.checkConstruct<std::allocator_arg_t const&,
+ SA::inner_allocator_type&, int&, int const&, int&&>(O, ptr)));
+ A.destroy(ptr);
+ ::operator delete((void*)ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+}
+
+// Otherwise, if uses_allocator_v<T, inner_allocator_type> is true and
+// is_constructible_v<T, Args..., inner_allocator_type&> is true, calls
+// OUTERMOST_ALLOC_TRAITS(*this)::construct(OUTERMOST (*this), p,
+// std::forward<Args>(args)..., inner_allocator()).
+void test_bullet_three() {
+ using VoidAlloc1 = CountingAllocator<void, 1>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
+
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV2<VoidAlloc2, 3>;
+ using Outer = CountingAllocator<T, 1>;
+ using Inner = CountingAllocator<T, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ T* ptr = (T*)::operator new(sizeof(T));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ int x = 42;
+ int const& cx = x;
+ A.construct(ptr, x, cx, std::move(x));
+ assert((checkConstruct<int&, int const&, int&&>(*ptr, UA_AllocLast, I)));
+ assert((POuter.checkConstruct<
+ int&, int const&, int&&,
+ SA::inner_allocator_type&>(O, ptr)));
+ A.destroy(ptr);
+ ::operator delete((void*)ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+}
+
+int main() {
+ test_bullet_one();
+ test_bullet_two();
+ test_bullet_three();
+}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp
index bf77f29f7145..7924140cf2cd 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,7 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
@@ -42,5 +43,4 @@ int main()
assert((A1<int>::deallocate_called == std::pair<int*, std::size_t>((int*)10, 20)));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp
index 0ff3880f9fc1..96850d783b99 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -32,8 +34,6 @@ bool B::constructed = false;
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<B>> A;
A a;
@@ -66,5 +66,4 @@ int main()
assert(A3<S>::destroy_called);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp
index 0fb55b692cdb..9b892abd81f3 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -22,8 +24,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
A a(A1<int>(5));
@@ -41,5 +41,4 @@ int main()
std::scoped_allocator_adaptor<A2<int>, A3<int>>(A2<int>(6), A3<int>(8))));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp
index a5275ee30253..8b88dcc963dd 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,8 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
const A a(A1<int>(100));
@@ -39,5 +39,4 @@ int main()
assert(a.max_size() == 200);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp
index 2297612e6098..238d46017b0a 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -22,7 +24,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
@@ -39,6 +40,4 @@ int main()
A a(A1<int>(5), A2<int>(6), A3<int>(8));
assert(a.outer_allocator() == A1<int>(5));
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp
index f9f0ffa2ad2a..8ee048bb99f1 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,8 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
A a1(A1<int>(3));
@@ -51,5 +51,4 @@ int main()
assert(a2.inner_allocator().inner_allocator().outer_allocator().id() == -1);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp
index 4303b95166c7..f4c106014a15 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,8 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
static_assert((std::is_same<
std::scoped_allocator_adaptor<A1<int>>::inner_allocator_type,
std::scoped_allocator_adaptor<A1<int>>>::value), "");
@@ -34,6 +34,4 @@ int main()
static_assert((std::is_same<
std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::inner_allocator_type,
std::scoped_allocator_adaptor<A2<int>, A3<int>>>::value), "");
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.types/is_always_equal.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.types/is_always_equal.pass.cpp
index 90fe944125b5..f8a9ea0f9eca 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.types/is_always_equal.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.types/is_always_equal.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -22,8 +24,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
// sanity checks
static_assert( (std::is_same<
std::allocator_traits<A1<int>>::is_always_equal, std::false_type>::value
@@ -69,7 +69,4 @@ int main()
std::allocator_traits<A2<int>>::is_always_equal::value &&
std::allocator_traits<A3<int>>::is_always_equal::value)
), "");
-
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp
index ceb941380dc7..4c6aabe2160e 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,8 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
static_assert((std::is_same<
std::scoped_allocator_adaptor<A1<int>>::propagate_on_container_copy_assignment,
std::false_type>::value), "");
@@ -35,5 +35,4 @@ int main()
std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::propagate_on_container_copy_assignment,
std::true_type>::value), "");
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp
index 04da50706536..f6f092ba575a 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,8 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
static_assert((std::is_same<
std::scoped_allocator_adaptor<A1<int>>::propagate_on_container_move_assignment,
std::false_type>::value), "");
@@ -35,5 +35,4 @@ int main()
std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::propagate_on_container_move_assignment,
std::true_type>::value), "");
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp
index 4a66bbd46749..6b7273e266be 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -21,8 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
static_assert((std::is_same<
std::scoped_allocator_adaptor<A1<int>>::propagate_on_container_swap,
std::false_type>::value), "");
@@ -34,6 +34,4 @@ int main()
static_assert((std::is_same<
std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::propagate_on_container_swap,
std::true_type>::value), "");
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp b/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp
index 72f0e867b1d2..2cf548550e1f 100644
--- a/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -22,7 +24,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
A a1(A1<int>(3));
@@ -68,5 +69,4 @@ int main()
assert(A3<int>::move_called == false);
assert(aN == a1);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/eq.pass.cpp b/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/eq.pass.cpp
index 51dd67f9ffdc..4f7a3af12544 100644
--- a/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/eq.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/eq.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -29,8 +31,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
A a1(A1<int>(3));
@@ -59,6 +59,4 @@ int main()
assert(a2 != a1);
assert(!(a2 == a1));
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp b/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp
index 0dc479c246c9..68f5a7ea2879 100644
--- a/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -22,7 +24,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::scoped_allocator_adaptor<A1<int>> A;
A a1(A1<int>(3));
@@ -68,5 +69,4 @@ int main()
assert(A3<int>::move_called == true);
assert(aN == a1);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/allocator.adaptor/types.pass.cpp b/test/std/utilities/allocator.adaptor/types.pass.cpp
index 7beff48bbf46..fcc99b191108 100644
--- a/test/std/utilities/allocator.adaptor/types.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/types.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// template <class OuterAlloc, class... InnerAllocs>
@@ -30,8 +32,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
static_assert((std::is_base_of<
A1<int>,
std::scoped_allocator_adaptor<A1<int>>
@@ -97,6 +97,4 @@ int main()
static_assert((std::is_same<
std::scoped_allocator_adaptor<A2<int>, A1<int>>::const_void_pointer,
const void*>::value), "");
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/any/any.class/any.assign/copy.pass.cpp b/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
new file mode 100644
index 000000000000..eba9bc6d5feb
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
@@ -0,0 +1,197 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// any& operator=(any const &);
+
+// Test copy assignment
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::any;
+using std::any_cast;
+
+template <class LHS, class RHS>
+void test_copy_assign() {
+ assert(LHS::count == 0);
+ assert(RHS::count == 0);
+ LHS::reset();
+ RHS::reset();
+ {
+ any lhs(LHS(1));
+ any const rhs(RHS(2));
+
+ assert(LHS::count == 1);
+ assert(RHS::count == 1);
+ assert(RHS::copied == 0);
+
+ lhs = rhs;
+
+ assert(RHS::copied == 1);
+ assert(LHS::count == 0);
+ assert(RHS::count == 2);
+
+ assertContains<RHS>(lhs, 2);
+ assertContains<RHS>(rhs, 2);
+ }
+ assert(LHS::count == 0);
+ assert(RHS::count == 0);
+}
+
+template <class LHS>
+void test_copy_assign_empty() {
+ assert(LHS::count == 0);
+ LHS::reset();
+ {
+ any lhs;
+ any const rhs(LHS(42));
+
+ assert(LHS::count == 1);
+ assert(LHS::copied == 0);
+
+ lhs = rhs;
+
+ assert(LHS::copied == 1);
+ assert(LHS::count == 2);
+
+ assertContains<LHS>(lhs, 42);
+ assertContains<LHS>(rhs, 42);
+ }
+ assert(LHS::count == 0);
+ LHS::reset();
+ {
+ any lhs(LHS(1));
+ any const rhs;
+
+ assert(LHS::count == 1);
+ assert(LHS::copied == 0);
+
+ lhs = rhs;
+
+ assert(LHS::copied == 0);
+ assert(LHS::count == 0);
+
+ assertEmpty<LHS>(lhs);
+ assertEmpty(rhs);
+ }
+ assert(LHS::count == 0);
+}
+
+void test_copy_assign_self() {
+ // empty
+ {
+ any a;
+ a = a;
+ assertEmpty(a);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ }
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ // small
+ {
+ any a((small(1)));
+ assert(small::count == 1);
+
+ a = a;
+
+ assert(small::count == 1);
+ assertContains<small>(a, 1);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ }
+ assert(small::count == 0);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ // large
+ {
+ any a(large(1));
+ assert(large::count == 1);
+
+ a = a;
+
+ assert(large::count == 1);
+ assertContains<large>(a, 1);
+ assert(globalMemCounter.checkOutstandingNewEq(1));
+ }
+ assert(large::count == 0);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+}
+
+template <class Tp>
+void test_copy_assign_throws()
+{
+#if !defined(TEST_HAS_NO_EXCEPTIONS)
+ auto try_throw =
+ [](any& lhs, any const& rhs) {
+ try {
+ lhs = rhs;
+ assert(false);
+ } catch (my_any_exception const &) {
+ // do nothing
+ } catch (...) {
+ assert(false);
+ }
+ };
+ // const lvalue to empty
+ {
+ any lhs;
+ any const rhs((Tp(1)));
+ assert(Tp::count == 1);
+
+ try_throw(lhs, rhs);
+
+ assert(Tp::count == 1);
+ assertEmpty<Tp>(lhs);
+ assertContains<Tp>(rhs, 1);
+ }
+ {
+ any lhs((small(2)));
+ any const rhs((Tp(1)));
+ assert(small::count == 1);
+ assert(Tp::count == 1);
+
+ try_throw(lhs, rhs);
+
+ assert(small::count == 1);
+ assert(Tp::count == 1);
+ assertContains<small>(lhs, 2);
+ assertContains<Tp>(rhs, 1);
+ }
+ {
+ any lhs((large(2)));
+ any const rhs((Tp(1)));
+ assert(large::count == 1);
+ assert(Tp::count == 1);
+
+ try_throw(lhs, rhs);
+
+ assert(large::count == 1);
+ assert(Tp::count == 1);
+ assertContains<large>(lhs, 2);
+ assertContains<Tp>(rhs, 1);
+ }
+#endif
+}
+
+int main() {
+ test_copy_assign<small1, small2>();
+ test_copy_assign<large1, large2>();
+ test_copy_assign<small, large>();
+ test_copy_assign<large, small>();
+ test_copy_assign_empty<small>();
+ test_copy_assign_empty<large>();
+ test_copy_assign_self();
+ test_copy_assign_throws<small_throws_on_copy>();
+ test_copy_assign_throws<large_throws_on_copy>();
+}
diff --git a/test/std/utilities/any/any.class/any.assign/move.pass.cpp b/test/std/utilities/any/any.class/any.assign/move.pass.cpp
new file mode 100644
index 000000000000..2063e4f1e9f1
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.assign/move.pass.cpp
@@ -0,0 +1,108 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// any& operator=(any &&);
+
+// Test move assignment.
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "test_macros.h"
+
+using std::any;
+using std::any_cast;
+
+template <class LHS, class RHS>
+void test_move_assign() {
+ assert(LHS::count == 0);
+ assert(RHS::count == 0);
+ {
+ LHS const s1(1);
+ any a(s1);
+ RHS const s2(2);
+ any a2(s2);
+
+ assert(LHS::count == 2);
+ assert(RHS::count == 2);
+
+ a = std::move(a2);
+
+ assert(LHS::count == 1);
+ assert(RHS::count == 2 + a2.has_value());
+ LIBCPP_ASSERT(RHS::count == 2); // libc++ leaves the object empty
+
+ assertContains<RHS>(a, 2);
+ if (a2.has_value())
+ assertContains<RHS>(a2, 0);
+ LIBCPP_ASSERT(!a2.has_value());
+ }
+ assert(LHS::count == 0);
+ assert(RHS::count == 0);
+}
+
+template <class LHS>
+void test_move_assign_empty() {
+ assert(LHS::count == 0);
+ {
+ any a;
+ any a2((LHS(1)));
+
+ assert(LHS::count == 1);
+
+ a = std::move(a2);
+
+ assert(LHS::count == 1 + a2.has_value());
+ LIBCPP_ASSERT(LHS::count == 1);
+
+ assertContains<LHS>(a, 1);
+ if (a2.has_value())
+ assertContains<LHS>(a2, 0);
+ LIBCPP_ASSERT(!a2.has_value());
+ }
+ assert(LHS::count == 0);
+ {
+ any a((LHS(1)));
+ any a2;
+
+ assert(LHS::count == 1);
+
+ a = std::move(a2);
+
+ assert(LHS::count == 0);
+
+ assertEmpty<LHS>(a);
+ assertEmpty(a2);
+ }
+ assert(LHS::count == 0);
+}
+
+void test_move_assign_noexcept() {
+ any a1;
+ any a2;
+ static_assert(
+ noexcept(a1 = std::move(a2))
+ , "any & operator=(any &&) must be noexcept"
+ );
+}
+
+int main() {
+ test_move_assign_noexcept();
+ test_move_assign<small1, small2>();
+ test_move_assign<large1, large2>();
+ test_move_assign<small, large>();
+ test_move_assign<large, small>();
+ test_move_assign_empty<small>();
+ test_move_assign_empty<large>();
+}
diff --git a/test/std/utilities/any/any.class/any.assign/value.pass.cpp b/test/std/utilities/any/any.class/any.assign/value.pass.cpp
new file mode 100644
index 000000000000..6af481714922
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.assign/value.pass.cpp
@@ -0,0 +1,209 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class ValueType>
+// any& operator=(ValueType&&);
+
+// Test value copy and move assignment.
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::any;
+using std::any_cast;
+
+template <class LHS, class RHS>
+void test_assign_value() {
+ assert(LHS::count == 0);
+ assert(RHS::count == 0);
+ LHS::reset();
+ RHS::reset();
+ {
+ any lhs(LHS(1));
+ any const rhs(RHS(2));
+
+ assert(LHS::count == 1);
+ assert(RHS::count == 1);
+ assert(RHS::copied == 0);
+
+ lhs = rhs;
+
+ assert(RHS::copied == 1);
+ assert(LHS::count == 0);
+ assert(RHS::count == 2);
+
+ assertContains<RHS>(lhs, 2);
+ assertContains<RHS>(rhs, 2);
+ }
+ assert(LHS::count == 0);
+ assert(RHS::count == 0);
+ LHS::reset();
+ RHS::reset();
+ {
+ any lhs(LHS(1));
+ any rhs(RHS(2));
+
+ assert(LHS::count == 1);
+ assert(RHS::count == 1);
+ assert(RHS::moved == 1);
+
+ lhs = std::move(rhs);
+
+ assert(RHS::moved >= 1);
+ assert(RHS::copied == 0);
+ assert(LHS::count == 0);
+ assert(RHS::count == 1 + rhs.has_value());
+ LIBCPP_ASSERT(!rhs.has_value());
+
+ assertContains<RHS>(lhs, 2);
+ if (rhs.has_value())
+ assertContains<RHS>(rhs, 0);
+ }
+ assert(LHS::count == 0);
+ assert(RHS::count == 0);
+}
+
+template <class RHS>
+void test_assign_value_empty() {
+ assert(RHS::count == 0);
+ RHS::reset();
+ {
+ any lhs;
+ RHS rhs(42);
+ assert(RHS::count == 1);
+ assert(RHS::copied == 0);
+
+ lhs = rhs;
+
+ assert(RHS::count == 2);
+ assert(RHS::copied == 1);
+ assert(RHS::moved >= 0);
+ assertContains<RHS>(lhs, 42);
+ }
+ assert(RHS::count == 0);
+ RHS::reset();
+ {
+ any lhs;
+ RHS rhs(42);
+ assert(RHS::count == 1);
+ assert(RHS::moved == 0);
+
+ lhs = std::move(rhs);
+
+ assert(RHS::count == 2);
+ assert(RHS::copied == 0);
+ assert(RHS::moved >= 1);
+ assertContains<RHS>(lhs, 42);
+ }
+ assert(RHS::count == 0);
+ RHS::reset();
+}
+
+
+template <class Tp, bool Move = false>
+void test_assign_throws() {
+#if !defined(TEST_HAS_NO_EXCEPTIONS)
+ auto try_throw =
+ [](any& lhs, auto&& rhs) {
+ try {
+ Move ? lhs = std::move(rhs)
+ : lhs = rhs;
+ assert(false);
+ } catch (my_any_exception const &) {
+ // do nothing
+ } catch (...) {
+ assert(false);
+ }
+ };
+ // const lvalue to empty
+ {
+ any lhs;
+ Tp rhs(1);
+ assert(Tp::count == 1);
+
+ try_throw(lhs, rhs);
+
+ assert(Tp::count == 1);
+ assertEmpty<Tp>(lhs);
+ }
+ {
+ any lhs((small(2)));
+ Tp rhs(1);
+ assert(small::count == 1);
+ assert(Tp::count == 1);
+
+ try_throw(lhs, rhs);
+
+ assert(small::count == 1);
+ assert(Tp::count == 1);
+ assertContains<small>(lhs, 2);
+ }
+ {
+ any lhs((large(2)));
+ Tp rhs(1);
+ assert(large::count == 1);
+ assert(Tp::count == 1);
+
+ try_throw(lhs, rhs);
+
+ assert(large::count == 1);
+ assert(Tp::count == 1);
+ assertContains<large>(lhs, 2);
+ }
+#endif
+}
+
+
+// Test that any& operator=(ValueType&&) is *never* selected for:
+// * std::in_place type.
+// * Non-copyable types
+void test_sfinae_constraints() {
+ { // Only the constructors are required to SFINAE on in_place_t
+ using Tag = std::in_place_type_t<int>;
+ using RawTag = std::remove_reference_t<Tag>;
+ static_assert(std::is_assignable<std::any, RawTag&&>::value, "");
+ }
+ {
+ struct Dummy { Dummy() = delete; };
+ using T = std::in_place_type_t<Dummy>;
+ static_assert(std::is_assignable<std::any, T>::value, "");
+ }
+ {
+ // Test that the ValueType&& constructor SFINAE's away when the
+ // argument is non-copyable
+ struct NoCopy {
+ NoCopy() = default;
+ NoCopy(NoCopy const&) = delete;
+ NoCopy(NoCopy&&) = default;
+ };
+ static_assert(!std::is_assignable<std::any, NoCopy>::value, "");
+ static_assert(!std::is_assignable<std::any, NoCopy&>::value, "");
+ }
+}
+
+int main() {
+ test_assign_value<small1, small2>();
+ test_assign_value<large1, large2>();
+ test_assign_value<small, large>();
+ test_assign_value<large, small>();
+ test_assign_value_empty<small>();
+ test_assign_value_empty<large>();
+ test_assign_throws<small_throws_on_copy>();
+ test_assign_throws<large_throws_on_copy>();
+ test_assign_throws<throws_on_move, /* Move = */ true>();
+ test_sfinae_constraints();
+}
diff --git a/test/std/utilities/any/any.class/any.cons/copy.pass.cpp b/test/std/utilities/any/any.class/any.cons/copy.pass.cpp
new file mode 100644
index 000000000000..021c9e452841
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.cons/copy.pass.cpp
@@ -0,0 +1,100 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// any(any const &);
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::any;
+using std::any_cast;
+
+template <class Type>
+void test_copy_throws() {
+#if !defined(TEST_HAS_NO_EXCEPTIONS)
+ assert(Type::count == 0);
+ {
+ any const a((Type(42)));
+ assert(Type::count == 1);
+ try {
+ any const a2(a);
+ assert(false);
+ } catch (my_any_exception const &) {
+ // do nothing
+ } catch (...) {
+ assert(false);
+ }
+ assert(Type::count == 1);
+ assertContains<Type>(a, 42);
+ }
+ assert(Type::count == 0);
+#endif
+}
+
+void test_copy_empty() {
+ DisableAllocationGuard g; ((void)g); // No allocations should occur.
+ any a1;
+ any a2(a1);
+
+ assertEmpty(a1);
+ assertEmpty(a2);
+}
+
+template <class Type>
+void test_copy()
+{
+ // Copying small types should not perform any allocations.
+ DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a((Type(42)));
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+
+ any a2(a);
+
+ assert(Type::copied == 1);
+ assert(Type::count == 2);
+ assertContains<Type>(a, 42);
+ assertContains<Type>(a2, 42);
+
+ // Modify a and check that a2 is unchanged
+ modifyValue<Type>(a, -1);
+ assertContains<Type>(a, -1);
+ assertContains<Type>(a2, 42);
+
+ // modify a2 and check that a is unchanged
+ modifyValue<Type>(a2, 999);
+ assertContains<Type>(a, -1);
+ assertContains<Type>(a2, 999);
+
+ // clear a and check that a2 is unchanged
+ a.reset();
+ assertEmpty(a);
+ assertContains<Type>(a2, 999);
+ }
+ assert(Type::count == 0);
+}
+
+int main() {
+ test_copy<small>();
+ test_copy<large>();
+ test_copy_empty();
+ test_copy_throws<small_throws_on_copy>();
+ test_copy_throws<large_throws_on_copy>();
+}
diff --git a/test/std/utilities/any/any.class/any.cons/default.pass.cpp b/test/std/utilities/any/any.class/any.cons/default.pass.cpp
new file mode 100644
index 000000000000..ed7a948e00a2
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.cons/default.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// any() noexcept;
+
+#include <any>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "any_helpers.h"
+#include "count_new.hpp"
+
+int main()
+{
+ using std::any;
+ {
+ static_assert(
+ std::is_nothrow_default_constructible<any>::value
+ , "Must be default constructible"
+ );
+ }
+ {
+ struct TestConstexpr : public std::any {
+ constexpr TestConstexpr() : std::any() {}
+ };
+#ifdef _LIBCPP_SAFE_STATIC
+ _LIBCPP_SAFE_STATIC static std::any a;
+ ((void)a);
+#endif
+ }
+ {
+ DisableAllocationGuard g; ((void)g);
+ any const a;
+ assertEmpty(a);
+ }
+}
diff --git a/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp b/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp
new file mode 100644
index 000000000000..4cf5d914f31d
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp
@@ -0,0 +1,194 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class T, class ...Args> any(in_place_type_t<T>, Args&&...);
+// template <class T, class U, class ...Args>
+// any(in_place_type_t<T>, initializer_list<U>, Args&&...);
+
+// Test construction from a value.
+// Concerns:
+// ---------
+// 1. The value is properly move/copied depending on the value category.
+// 2. Both small and large values are properly handled.
+
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+#include "test_convertible.hpp"
+
+using std::any;
+using std::any_cast;
+
+template <class Type>
+void test_in_place_type() {
+ // constructing from a small type should perform no allocations.
+ DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a(std::in_place_type<Type>);
+
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 0);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+ { // Test that the in_place argument is properly decayed
+ any a(std::in_place_type<Type&>);
+
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 0);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a(std::in_place_type<Type>, 101);
+
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 101);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a(std::in_place_type<Type>, -1, 42, -1);
+
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 42);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+}
+
+template <class Type>
+void test_in_place_type_tracked() {
+ // constructing from a small type should perform no allocations.
+ DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
+ {
+ any a(std::in_place_type<Type>);
+ assertArgsMatch<Type>(a);
+ }
+ {
+ any a(std::in_place_type<Type>, -1, 42, -1);
+ assertArgsMatch<Type, int, int, int>(a);
+ }
+ // initializer_list constructor tests
+ {
+ any a(std::in_place_type<Type>, {-1, 42, -1});
+ assertArgsMatch<Type, std::initializer_list<int>>(a);
+ }
+ {
+ int x = 42;
+ any a(std::in_place_type<Type&>, {-1, 42, -1}, x);
+ assertArgsMatch<Type, std::initializer_list<int>, int&>(a);
+ }
+}
+
+void test_func() {}
+
+void test_in_place_type_decayed() {
+ {
+ using Type = decltype(test_func);
+ using DecayT = void(*)();
+ any a(std::in_place_type<Type>, test_func);
+ assert(containsType<DecayT>(a));
+ assert(any_cast<DecayT>(a) == test_func);
+ }
+ {
+ int my_arr[5];
+ using Type = int(&)[5];
+ using DecayT = int*;
+ any a(std::in_place_type<Type>, my_arr);
+ assert(containsType<DecayT>(a));
+ assert(any_cast<DecayT>(a) == my_arr);
+ }
+ {
+ using Type = int[5];
+ using DecayT = int*;
+ any a(std::in_place_type<Type>);
+ assert(containsType<DecayT>(a));
+ assert(any_cast<DecayT>(a) == nullptr);
+ }
+}
+
+void test_ctor_sfinae() {
+ {
+ // Test that the init-list ctor SFINAE's away properly when
+ // construction would be ill-formed.
+ using IL = std::initializer_list<int>;
+ static_assert(!std::is_constructible<std::any,
+ std::in_place_type_t<int>, IL>::value, "");
+ static_assert(std::is_constructible<std::any,
+ std::in_place_type_t<small_tracked_t>, IL>::value, "");
+ }
+ {
+ // Test that the tagged dispatch constructor SFINAE's away when the
+ // argument is non-copyable
+ struct NoCopy {
+ NoCopy() = default;
+ NoCopy(NoCopy const&) = delete;
+ NoCopy(int) {}
+ NoCopy(std::initializer_list<int>, int) {}
+ };
+ using Tag = std::in_place_type_t<NoCopy>;
+ using RefTag = std::in_place_type_t<NoCopy&>;
+ using IL = std::initializer_list<int>;
+ static_assert(!std::is_constructible<std::any, Tag>::value, "");
+ static_assert(!std::is_constructible<std::any, Tag, int>::value, "");
+ static_assert(!std::is_constructible<std::any, Tag, IL, int>::value, "");
+ static_assert(!std::is_constructible<std::any, RefTag>::value, "");
+ static_assert(!std::is_constructible<std::any, RefTag, int>::value, "");
+ static_assert(!std::is_constructible<std::any, RefTag, IL, int>::value, "");
+ }
+}
+
+struct Implicit {
+ Implicit(int) {}
+ Implicit(int, int, int) {}
+ Implicit(std::initializer_list<int>, int) {}
+};
+
+void test_constructor_explicit() {
+ using I = Implicit;
+ using IT = std::in_place_type_t<I>;
+ static_assert(!test_convertible<std::any, IT, int>(), "");
+ static_assert(std::is_constructible<std::any, IT, int>::value, "");
+ static_assert(!test_convertible<std::any, IT, int, int, int>(), "");
+ static_assert(std::is_constructible<std::any, IT, int, int, int>::value, "");
+ static_assert(!test_convertible<std::any, IT, std::initializer_list<int>&, int>(), "");
+ static_assert(std::is_constructible<std::any, IT, std::initializer_list<int>&, int>::value, "");
+}
+
+int main() {
+ test_in_place_type<small>();
+ test_in_place_type<large>();
+ test_in_place_type<small_throws_on_copy>();
+ test_in_place_type<large_throws_on_copy>();
+ test_in_place_type<throws_on_move>();
+ test_in_place_type_tracked<small_tracked_t>();
+ test_in_place_type_tracked<large_tracked_t>();
+ test_in_place_type_decayed();
+ test_ctor_sfinae();
+ test_constructor_explicit();
+}
diff --git a/test/std/utilities/any/any.class/any.cons/move.pass.cpp b/test/std/utilities/any/any.class/any.cons/move.pass.cpp
new file mode 100644
index 000000000000..fb7dda886fe7
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.cons/move.pass.cpp
@@ -0,0 +1,104 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// any(any &&) noexcept;
+
+#include <any>
+#include <utility>
+#include <type_traits>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::any;
+using std::any_cast;
+
+// Moves are always noexcept. The throws_on_move object
+// must be stored dynamically so the pointer is moved and
+// not the stored object.
+void test_move_does_not_throw()
+{
+#if !defined(TEST_HAS_NO_EXCEPTIONS)
+ assert(throws_on_move::count == 0);
+ {
+ throws_on_move v(42);
+ any a(v);
+ assert(throws_on_move::count == 2);
+ // No allocations should be performed after this point.
+ DisableAllocationGuard g; ((void)g);
+ try {
+ any const a2(std::move(a));
+ assertEmpty(a);
+ assertContains<throws_on_move>(a2, 42);
+ } catch (...) {
+ assert(false);
+ }
+ assert(throws_on_move::count == 1);
+ assertEmpty(a);
+ }
+ assert(throws_on_move::count == 0);
+#endif
+}
+
+void test_move_empty() {
+ DisableAllocationGuard g; ((void)g); // no allocations should be performed.
+
+ any a1;
+ any a2(std::move(a1));
+
+ assertEmpty(a1);
+ assertEmpty(a2);
+}
+
+template <class Type>
+void test_move() {
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a((Type(42)));
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 1);
+
+ // Moving should not perform allocations since it must be noexcept.
+ DisableAllocationGuard g; ((void)g);
+
+ any a2(std::move(a));
+
+ assert(Type::moved == 1 || Type::moved == 2); // zero or more move operations can be performed.
+ assert(Type::copied == 0); // no copies can be performed.
+ assert(Type::count == 1 + a.has_value());
+ assertContains<Type>(a2, 42);
+ LIBCPP_ASSERT(!a.has_value()); // Moves are always destructive.
+ if (a.has_value())
+ assertContains<Type>(a, 0);
+ }
+ assert(Type::count == 0);
+}
+
+int main()
+{
+ // noexcept test
+ {
+ static_assert(
+ std::is_nothrow_move_constructible<any>::value
+ , "any must be nothrow move constructible"
+ );
+ }
+ test_move<small>();
+ test_move<large>();
+ test_move_empty();
+ test_move_does_not_throw();
+}
diff --git a/test/std/utilities/any/any.class/any.cons/value.pass.cpp b/test/std/utilities/any/any.class/any.cons/value.pass.cpp
new file mode 100644
index 000000000000..a164fbeb52fe
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.cons/value.pass.cpp
@@ -0,0 +1,154 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class Value> any(Value &&)
+
+// Test construction from a value.
+// Concerns:
+// ---------
+// 1. The value is properly move/copied depending on the value category.
+// 2. Both small and large values are properly handled.
+
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::any;
+using std::any_cast;
+
+template <class Type>
+void test_copy_value_throws()
+{
+#if !defined(TEST_HAS_NO_EXCEPTIONS)
+ assert(Type::count == 0);
+ {
+ Type const t(42);
+ assert(Type::count == 1);
+ try {
+ any const a2(t);
+ assert(false);
+ } catch (my_any_exception const &) {
+ // do nothing
+ } catch (...) {
+ assert(false);
+ }
+ assert(Type::count == 1);
+ assert(t.value == 42);
+ }
+ assert(Type::count == 0);
+#endif
+}
+
+void test_move_value_throws()
+{
+#if !defined(TEST_HAS_NO_EXCEPTIONS)
+ assert(throws_on_move::count == 0);
+ {
+ throws_on_move v;
+ assert(throws_on_move::count == 1);
+ try {
+ any const a(std::move(v));
+ assert(false);
+ } catch (my_any_exception const &) {
+ // do nothing
+ } catch (...) {
+ assert(false);
+ }
+ assert(throws_on_move::count == 1);
+ }
+ assert(throws_on_move::count == 0);
+#endif
+}
+
+template <class Type>
+void test_copy_move_value() {
+ // constructing from a small type should perform no allocations.
+ DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ Type t(42);
+ assert(Type::count == 1);
+
+ any a(t);
+
+ assert(Type::count == 2);
+ assert(Type::copied == 1);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 42);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ Type t(42);
+ assert(Type::count == 1);
+
+ any a(std::move(t));
+
+ assert(Type::count == 2);
+ assert(Type::copied == 0);
+ assert(Type::moved == 1);
+ assertContains<Type>(a, 42);
+ }
+}
+
+// Test that any(ValueType&&) is *never* selected for a std::in_place_type_t specialization.
+void test_sfinae_constraints() {
+ using BadTag = std::in_place_type_t<int>;
+ using OKTag = std::in_place_t;
+ // Test that the tag type is properly handled in SFINAE
+ BadTag t = std::in_place_type<int>;
+ OKTag ot = std::in_place;
+ {
+ std::any a(t);
+ assertContains<int>(a, 0);
+ }
+ {
+ std::any a(std::move(t));
+ assertContains<int>(a, 0);
+ }
+ {
+ std::any a(ot);
+ assert(containsType<OKTag>(a));
+ }
+ {
+ struct Dummy { Dummy() = delete; };
+ using T = std::in_place_type_t<Dummy>;
+ static_assert(!std::is_constructible<std::any, T>::value, "");
+ }
+ {
+ // Test that the ValueType&& constructor SFINAE's away when the
+ // argument is non-copyable
+ struct NoCopy {
+ NoCopy() = default;
+ NoCopy(NoCopy const&) = delete;
+ NoCopy(int) {}
+ };
+ static_assert(!std::is_constructible<std::any, NoCopy>::value, "");
+ static_assert(!std::is_constructible<std::any, NoCopy&>::value, "");
+ static_assert(!std::is_convertible<NoCopy, std::any>::value, "");
+ }
+}
+
+int main() {
+ test_copy_move_value<small>();
+ test_copy_move_value<large>();
+ test_copy_value_throws<small_throws_on_copy>();
+ test_copy_value_throws<large_throws_on_copy>();
+ test_move_value_throws();
+ test_sfinae_constraints();
+} \ No newline at end of file
diff --git a/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp b/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
new file mode 100644
index 000000000000..65d94fd1e0a4
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
@@ -0,0 +1,262 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class T, class ...Args> emplace(Args&&...);
+// template <class T, class U, class ...Args>
+// void emplace(initializer_list<U>, Args&&...);
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::any;
+using std::any_cast;
+
+struct Tracked {
+ static int count;
+ Tracked() {++count;}
+ ~Tracked() { --count; }
+};
+int Tracked::count = 0;
+
+template <class Type>
+void test_emplace_type() {
+ // constructing from a small type should perform no allocations.
+ DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a(std::in_place_type<Tracked>);
+ assert(Tracked::count == 1);
+
+ a.emplace<Type>();
+
+ assert(Tracked::count == 0);
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 0);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a(std::in_place_type<Tracked>);
+ assert(Tracked::count == 1);
+
+ a.emplace<Type>(101);
+
+ assert(Tracked::count == 0);
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 101);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a(std::in_place_type<Tracked>);
+ assert(Tracked::count == 1);
+
+ a.emplace<Type>(-1, 42, -1);
+
+ assert(Tracked::count == 0);
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 42);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+}
+
+template <class Type>
+void test_emplace_type_tracked() {
+ // constructing from a small type should perform no allocations.
+ DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
+ {
+ any a(std::in_place_type<Tracked>);
+ assert(Tracked::count == 1);
+ a.emplace<Type>();
+ assert(Tracked::count == 0);
+ assertArgsMatch<Type>(a);
+ }
+ {
+ any a(std::in_place_type<Tracked>);
+ assert(Tracked::count == 1);
+ a.emplace<Type>(-1, 42, -1);
+ assert(Tracked::count == 0);
+ assertArgsMatch<Type, int, int, int>(a);
+ }
+ // initializer_list constructor tests
+ {
+ any a(std::in_place_type<Tracked>);
+ assert(Tracked::count == 1);
+ a.emplace<Type>({-1, 42, -1});
+ assert(Tracked::count == 0);
+ assertArgsMatch<Type, std::initializer_list<int>>(a);
+ }
+ {
+ int x = 42;
+ any a(std::in_place_type<Tracked>);
+ assert(Tracked::count == 1);
+ a.emplace<Type>({-1, 42, -1}, x);
+ assert(Tracked::count == 0);
+ assertArgsMatch<Type, std::initializer_list<int>, int&>(a);
+ }
+}
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+
+struct SmallThrows {
+ SmallThrows(int) { throw 42; }
+ SmallThrows(std::initializer_list<int>, int) { throw 42; }
+};
+static_assert(IsSmallObject<SmallThrows>::value, "");
+
+struct LargeThrows {
+ LargeThrows(int) { throw 42; }
+ LargeThrows(std::initializer_list<int>, int) { throw 42; }
+ int data[sizeof(std::any)];
+};
+static_assert(!IsSmallObject<LargeThrows>::value, "");
+
+template <class Type>
+void test_emplace_throws()
+{
+ // any stores small type
+ {
+ std::any a(small{42});
+ assert(small::count == 1);
+ try {
+ a.emplace<Type>(101);
+ assert(false);
+ } catch (int const&) {
+ }
+ assert(small::count == 0);
+ }
+ {
+ std::any a(small{42});
+ assert(small::count == 1);
+ try {
+ a.emplace<Type>({1, 2, 3}, 101);
+ assert(false);
+ } catch (int const&) {
+ }
+ assert(small::count == 0);
+ }
+ // any stores large type
+ {
+ std::any a(large{42});
+ assert(large::count == 1);
+ try {
+ a.emplace<Type>(101);
+ assert(false);
+ } catch (int const&) {
+ }
+ assert(large::count == 0);
+ }
+ {
+ std::any a(large{42});
+ assert(large::count == 1);
+ try {
+ a.emplace<Type>({1, 2, 3}, 101);
+ assert(false);
+ } catch (int const&) {
+ }
+ assert(large::count == 0);
+ }
+}
+
+#endif
+
+template <class T, class ...Args>
+constexpr auto has_emplace(int)
+ -> decltype(std::any{}.emplace<T>(std::declval<Args>()...), true) { return true; }
+
+template <class ...Args>
+constexpr bool has_emplace(long) { return false; }
+
+template <class ...Args>
+constexpr bool has_emplace() { return has_emplace<Args...>(0); }
+
+
+template <class T, class IT, class ...Args>
+constexpr auto has_emplace_init_list(int)
+ -> decltype(std::any{}.emplace<T>(
+ {std::declval<IT>(), std::declval<IT>(), std::declval<IT>()},
+ std::declval<Args>()...), true) { return true; }
+
+template <class ...Args>
+constexpr bool has_emplace_init_list(long) { return false; }
+
+template <class ...Args>
+constexpr bool has_emplace_init_list() { return has_emplace_init_list<Args...>(0); }
+
+
+void test_emplace_sfinae_constraints() {
+ {
+ static_assert(has_emplace<int>(), "");
+ static_assert(has_emplace<int, int>(), "");
+ static_assert(!has_emplace<int, int, int>(), "not constructible");
+ static_assert(!has_emplace_init_list<int, int>(), "not constructible from il");
+ }
+ {
+ static_assert(has_emplace<small>(), "");
+ static_assert(has_emplace<large>(), "");
+ static_assert(!has_emplace<small, void*>(), "");
+ static_assert(!has_emplace<large, void*>(), "");
+
+ static_assert(has_emplace_init_list<small, int>(), "");
+ static_assert(has_emplace_init_list<large, int>(), "");
+ static_assert(!has_emplace_init_list<small, void*>(), "");
+ static_assert(!has_emplace_init_list<large, void*>(), "");
+ }
+ {
+ // Test that the emplace SFINAE's away when the
+ // argument is non-copyable
+ struct NoCopy {
+ NoCopy() = default;
+ NoCopy(NoCopy const&) = delete;
+ NoCopy(int) {}
+ NoCopy(std::initializer_list<int>, int, int) {}
+ };
+ static_assert(!has_emplace<NoCopy>(), "");
+ static_assert(!has_emplace<NoCopy, int>(), "");
+ static_assert(!has_emplace_init_list<NoCopy, int, int, int>(), "");
+ static_assert(!has_emplace<NoCopy&>(), "");
+ static_assert(!has_emplace<NoCopy&, int>(), "");
+ static_assert(!has_emplace_init_list<NoCopy&, int, int, int>(), "");
+ static_assert(!has_emplace<NoCopy&&>(), "");
+ static_assert(!has_emplace<NoCopy&&, int>(), "");
+ static_assert(!has_emplace_init_list<NoCopy&&, int, int, int>(), "");
+
+ }
+}
+
+int main() {
+ test_emplace_type<small>();
+ test_emplace_type<large>();
+ test_emplace_type<small_throws_on_copy>();
+ test_emplace_type<large_throws_on_copy>();
+ test_emplace_type<throws_on_move>();
+ test_emplace_type_tracked<small_tracked_t>();
+ test_emplace_type_tracked<large_tracked_t>();
+ test_emplace_sfinae_constraints();
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ test_emplace_throws<SmallThrows>();
+ test_emplace_throws<LargeThrows>();
+#endif
+}
diff --git a/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp b/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp
new file mode 100644
index 000000000000..45bc70f7a795
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// any::reset() noexcept
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+
+int main()
+{
+ using std::any;
+ using std::any_cast;
+ // empty
+ {
+ any a;
+
+ // noexcept check
+ static_assert(
+ noexcept(a.reset())
+ , "any.reset() must be noexcept"
+ );
+
+ assertEmpty(a);
+
+ a.reset();
+
+ assertEmpty(a);
+ }
+ // small object
+ {
+ any a((small(1)));
+ assert(small::count == 1);
+ assertContains<small>(a, 1);
+
+ a.reset();
+
+ assertEmpty<small>(a);
+ assert(small::count == 0);
+ }
+ // large object
+ {
+ any a(large(1));
+ assert(large::count == 1);
+ assertContains<large>(a, 1);
+
+ a.reset();
+
+ assertEmpty<large>(a);
+ assert(large::count == 0);
+ }
+}
diff --git a/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp b/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp
new file mode 100644
index 000000000000..6fc100943d0f
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp
@@ -0,0 +1,133 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// any::swap(any &) noexcept
+
+// Test swap(large, small) and swap(small, large)
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+
+using std::any;
+using std::any_cast;
+
+template <class LHS, class RHS>
+void test_swap() {
+ assert(LHS::count == 0);
+ assert(RHS::count == 0);
+ {
+ any a1((LHS(1)));
+ any a2(RHS{2});
+ assert(LHS::count == 1);
+ assert(RHS::count == 1);
+
+ a1.swap(a2);
+
+ assert(LHS::count == 1);
+ assert(RHS::count == 1);
+
+ assertContains<RHS>(a1, 2);
+ assertContains<LHS>(a2, 1);
+ }
+ assert(LHS::count == 0);
+ assert(RHS::count == 0);
+ assert(LHS::copied == 0);
+ assert(RHS::copied == 0);
+}
+
+template <class Tp>
+void test_swap_empty() {
+ assert(Tp::count == 0);
+ {
+ any a1((Tp(1)));
+ any a2;
+ assert(Tp::count == 1);
+
+ a1.swap(a2);
+
+ assert(Tp::count == 1);
+
+ assertContains<Tp>(a2, 1);
+ assertEmpty(a1);
+ }
+ assert(Tp::count == 0);
+ {
+ any a1((Tp(1)));
+ any a2;
+ assert(Tp::count == 1);
+
+ a2.swap(a1);
+
+ assert(Tp::count == 1);
+
+ assertContains<Tp>(a2, 1);
+ assertEmpty(a1);
+ }
+ assert(Tp::count == 0);
+ assert(Tp::copied == 0);
+}
+
+void test_noexcept()
+{
+ any a1;
+ any a2;
+ static_assert(
+ noexcept(a1.swap(a2))
+ , "any::swap(any&) must be noexcept"
+ );
+}
+
+void test_self_swap() {
+ {
+ // empty
+ any a;
+ a.swap(a);
+ assertEmpty(a);
+ }
+ { // small
+ using T = small;
+ any a{T{42}};
+ T::reset();
+ a.swap(a);
+ assertContains<T>(a, 42);
+ assert(T::count == 1);
+ assert(T::copied == 0);
+ LIBCPP_ASSERT(T::moved == 0);
+ }
+ assert(small::count == 0);
+ { // large
+ using T = large;
+ any a{T{42}};
+ T::reset();
+ a.swap(a);
+ assertContains<T>(a, 42);
+ assert(T::count == 1);
+ assert(T::copied == 0);
+ LIBCPP_ASSERT(T::moved == 0);
+ }
+ assert(large::count == 0);
+}
+
+int main()
+{
+ test_noexcept();
+ test_swap_empty<small>();
+ test_swap_empty<large>();
+ test_swap<small1, small2>();
+ test_swap<large1, large2>();
+ test_swap<small, large>();
+ test_swap<large, small>();
+ test_self_swap();
+}
diff --git a/test/std/utilities/any/any.class/any.observers/has_value.pass.cpp b/test/std/utilities/any/any.class/any.observers/has_value.pass.cpp
new file mode 100644
index 000000000000..072ac06776c1
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.observers/has_value.pass.cpp
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// any::has_value() noexcept
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+
+int main()
+{
+ using std::any;
+ // noexcept test
+ {
+ any a;
+ static_assert(noexcept(a.has_value()), "any::has_value() must be noexcept");
+ }
+ // empty
+ {
+ any a;
+ assert(!a.has_value());
+
+ a.reset();
+ assert(!a.has_value());
+
+ a = 42;
+ assert(a.has_value());
+ }
+ // small object
+ {
+ small const s(1);
+ any a(s);
+ assert(a.has_value());
+
+ a.reset();
+ assert(!a.has_value());
+
+ a = s;
+ assert(a.has_value());
+ }
+ // large object
+ {
+ large const l(1);
+ any a(l);
+ assert(a.has_value());
+
+ a.reset();
+ assert(!a.has_value());
+
+ a = l;
+ assert(a.has_value());
+ }
+}
diff --git a/test/std/utilities/any/any.class/any.observers/type.pass.cpp b/test/std/utilities/any/any.class/any.observers/type.pass.cpp
new file mode 100644
index 000000000000..984c4137db09
--- /dev/null
+++ b/test/std/utilities/any/any.class/any.observers/type.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// XFAIL: libcpp-no-rtti
+
+// <any>
+
+// any::type() noexcept
+
+#include <any>
+#include <cassert>
+#include "any_helpers.h"
+
+int main()
+{
+ using std::any;
+ {
+ any const a;
+ assert(a.type() == typeid(void));
+ static_assert(noexcept(a.type()), "any::type() must be noexcept");
+ }
+ {
+ small const s(1);
+ any const a(s);
+ assert(a.type() == typeid(small));
+
+ }
+ {
+ large const l(1);
+ any const a(l);
+ assert(a.type() == typeid(large));
+ }
+}
diff --git a/test/std/utilities/any/any.class/not_literal_type.pass.cpp b/test/std/utilities/any/any.class/not_literal_type.pass.cpp
new file mode 100644
index 000000000000..91ef5c970a22
--- /dev/null
+++ b/test/std/utilities/any/any.class/not_literal_type.pass.cpp
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// [Note any is a not a literal type --end note]
+
+#include <any>
+#include <type_traits>
+
+int main () {
+ static_assert(!std::is_literal_type<std::any>::value, "");
+}
diff --git a/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
new file mode 100644
index 000000000000..1a5a85482b8f
--- /dev/null
+++ b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
@@ -0,0 +1,171 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class ValueType>
+// ValueType const* any_cast(any const *) noexcept;
+//
+// template <class ValueType>
+// ValueType * any_cast(any *) noexcept;
+
+#include <any>
+#include <type_traits>
+#include <cassert>
+
+#include "any_helpers.h"
+
+using std::any;
+using std::any_cast;
+
+// Test that the operators are properly noexcept.
+void test_cast_is_noexcept() {
+ any a;
+ static_assert(noexcept(any_cast<int>(&a)), "");
+
+ any const& ca = a;
+ static_assert(noexcept(any_cast<int>(&ca)), "");
+}
+
+// Test that the return type of any_cast is correct.
+void test_cast_return_type() {
+ any a;
+ static_assert(std::is_same<decltype(any_cast<int>(&a)), int*>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int const>(&a)), int const*>::value, "");
+
+ any const& ca = a;
+ static_assert(std::is_same<decltype(any_cast<int>(&ca)), int const*>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int const>(&ca)), int const*>::value, "");
+}
+
+// Test that any_cast handles null pointers.
+void test_cast_nullptr() {
+ any* a = nullptr;
+ assert(nullptr == any_cast<int>(a));
+ assert(nullptr == any_cast<int const>(a));
+
+ any const* ca = nullptr;
+ assert(nullptr == any_cast<int>(ca));
+ assert(nullptr == any_cast<int const>(ca));
+}
+
+// Test casting an empty object.
+void test_cast_empty() {
+ {
+ any a;
+ assert(nullptr == any_cast<int>(&a));
+ assert(nullptr == any_cast<int const>(&a));
+
+ any const& ca = a;
+ assert(nullptr == any_cast<int>(&ca));
+ assert(nullptr == any_cast<int const>(&ca));
+ }
+ // Create as non-empty, then make empty and run test.
+ {
+ any a(42);
+ a.reset();
+ assert(nullptr == any_cast<int>(&a));
+ assert(nullptr == any_cast<int const>(&a));
+
+ any const& ca = a;
+ assert(nullptr == any_cast<int>(&ca));
+ assert(nullptr == any_cast<int const>(&ca));
+ }
+}
+
+template <class Type>
+void test_cast() {
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a((Type(42)));
+ any const& ca = a;
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 1);
+
+ // Try a cast to a bad type.
+ // NOTE: Type cannot be an int.
+ assert(any_cast<int>(&a) == nullptr);
+ assert(any_cast<int const>(&a) == nullptr);
+ assert(any_cast<int const volatile>(&a) == nullptr);
+
+ // Try a cast to the right type, but as a pointer.
+ assert(any_cast<Type*>(&a) == nullptr);
+ assert(any_cast<Type const*>(&a) == nullptr);
+
+ // Check getting a unqualified type from a non-const any.
+ Type* v = any_cast<Type>(&a);
+ assert(v != nullptr);
+ assert(v->value == 42);
+
+ // change the stored value and later check for the new value.
+ v->value = 999;
+
+ // Check getting a const qualified type from a non-const any.
+ Type const* cv = any_cast<Type const>(&a);
+ assert(cv != nullptr);
+ assert(cv == v);
+ assert(cv->value == 999);
+
+ // Check getting a unqualified type from a const any.
+ cv = any_cast<Type>(&ca);
+ assert(cv != nullptr);
+ assert(cv == v);
+ assert(cv->value == 999);
+
+ // Check getting a const-qualified type from a const any.
+ cv = any_cast<Type const>(&ca);
+ assert(cv != nullptr);
+ assert(cv == v);
+ assert(cv->value == 999);
+
+ // Check that no more objects were created, copied or moved.
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 1);
+ }
+ assert(Type::count == 0);
+}
+
+void test_cast_non_copyable_type()
+{
+ // Even though 'any' never stores non-copyable types
+ // we still need to support any_cast<NoCopy>(ptr)
+ struct NoCopy { NoCopy(NoCopy const&) = delete; };
+ std::any a(42);
+ std::any const& ca = a;
+ assert(std::any_cast<NoCopy>(&a) == nullptr);
+ assert(std::any_cast<NoCopy>(&ca) == nullptr);
+}
+
+void test_fn() {}
+
+void test_cast_function_pointer() {
+ using T = void(*)();
+ std::any a(test_fn);
+ // An any can never store a function type, but we should at least be able
+ // to ask.
+ assert(std::any_cast<void()>(&a) == nullptr);
+ T fn_ptr = std::any_cast<T>(a);
+ assert(fn_ptr == test_fn);
+}
+
+int main() {
+ test_cast_is_noexcept();
+ test_cast_return_type();
+ test_cast_nullptr();
+ test_cast_empty();
+ test_cast<small>();
+ test_cast<large>();
+ test_cast_non_copyable_type();
+ test_cast_function_pointer();
+}
diff --git a/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
new file mode 100644
index 000000000000..af081ecceefd
--- /dev/null
+++ b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
@@ -0,0 +1,313 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class ValueType>
+// ValueType const any_cast(any const&);
+//
+// template <class ValueType>
+// ValueType any_cast(any &);
+//
+// template <class ValueType>
+// ValueType any_cast(any &&);
+
+#include <any>
+#include <type_traits>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::any;
+using std::any_cast;
+using std::bad_any_cast;
+
+
+// Test that the operators are NOT marked noexcept.
+void test_cast_is_not_noexcept() {
+ any a;
+ static_assert(!noexcept(any_cast<int>(static_cast<any&>(a))), "");
+ static_assert(!noexcept(any_cast<int>(static_cast<any const&>(a))), "");
+ static_assert(!noexcept(any_cast<int>(static_cast<any &&>(a))), "");
+}
+
+// Test that the return type of any_cast is correct.
+void test_cast_return_type() {
+ any a;
+ static_assert(std::is_same<decltype(any_cast<int>(a)), int>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int const>(a)), int>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int&>(a)), int&>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int const&>(a)), int const&>::value, "");
+
+ static_assert(std::is_same<decltype(any_cast<int&&>(a)), int&&>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int const&&>(a)), int const&&>::value, "");
+
+ static_assert(std::is_same<decltype(any_cast<int>(std::move(a))), int>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int const>(std::move(a))), int>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int&>(std::move(a))), int&>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int const&>(std::move(a))), int const&>::value, "");
+
+ static_assert(std::is_same<decltype(any_cast<int&&>(std::move(a))), int&&>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int const&&>(std::move(a))), int const&&>::value, "");
+
+ any const& ca = a;
+ static_assert(std::is_same<decltype(any_cast<int>(ca)), int>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int const>(ca)), int>::value, "");
+ static_assert(std::is_same<decltype(any_cast<int const&>(ca)), int const&>::value, "");
+
+ static_assert(std::is_same<decltype(any_cast<int const&&>(ca)), int const&&>::value, "");
+}
+
+template <class Type, class ConstT = Type>
+void checkThrows(any& a)
+{
+#if !defined(TEST_HAS_NO_EXCEPTIONS)
+ try {
+ any_cast<Type>(a);
+ assert(false);
+ } catch (bad_any_cast const &) {
+ // do nothing
+ } catch (...) {
+ assert(false);
+ }
+
+ try {
+ any_cast<ConstT>(static_cast<any const&>(a));
+ assert(false);
+ } catch (bad_any_cast const &) {
+ // do nothing
+ } catch (...) {
+ assert(false);
+ }
+
+ try {
+ using RefType = typename std::conditional<
+ std::is_lvalue_reference<Type>::value,
+ typename std::remove_reference<Type>::type&&,
+ Type
+ >::type;
+ any_cast<RefType>(static_cast<any&&>(a));
+ assert(false);
+ } catch (bad_any_cast const &) {
+ // do nothing
+ } catch (...) {
+ assert(false);
+ }
+#else
+ ((void)a);
+#endif
+}
+
+void test_cast_empty() {
+ // None of these operations should allocate.
+ DisableAllocationGuard g; ((void)g);
+ any a;
+ checkThrows<int>(a);
+}
+
+template <class Type>
+void test_cast_to_reference() {
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a((Type(42)));
+ any const& ca = a;
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 1);
+
+ // Try a cast to a bad type.
+ // NOTE: Type cannot be an int.
+ checkThrows<int>(a);
+ checkThrows<int&, int const&>(a);
+ checkThrows<Type*, Type const*>(a);
+ checkThrows<Type const*>(a);
+
+ // Check getting a type by reference from a non-const lvalue any.
+ {
+ Type& v = any_cast<Type&>(a);
+ assert(v.value == 42);
+
+ Type const &cv = any_cast<Type const&>(a);
+ assert(&cv == &v);
+ }
+ // Check getting a type by reference from a const lvalue any.
+ {
+ Type const& v = any_cast<Type const&>(ca);
+ assert(v.value == 42);
+
+ Type const &cv = any_cast<Type const&>(ca);
+ assert(&cv == &v);
+ }
+ // Check getting a type by reference from a const rvalue any.
+ {
+ Type const& v = any_cast<Type const&>(std::move(ca));
+ assert(v.value == 42);
+
+ Type const &cv = any_cast<Type const&>(std::move(ca));
+ assert(&cv == &v);
+ }
+ // Check getting a type by reference from a const rvalue any.
+ {
+ Type&& v = any_cast<Type&&>(std::move(a));
+ assert(v.value == 42);
+ assert(any_cast<Type&>(a).value == 42);
+
+ Type&& cv = any_cast<Type&&>(std::move(a));
+ assert(&cv == &v);
+ assert(any_cast<Type&>(a).value == 42);
+ }
+ // Check getting a type by reference from a const rvalue any.
+ {
+ Type const&& v = any_cast<Type const&&>(std::move(a));
+ assert(v.value == 42);
+ assert(any_cast<Type&>(a).value == 42);
+
+ Type const&& cv = any_cast<Type const&&>(std::move(a));
+ assert(&cv == &v);
+ assert(any_cast<Type&>(a).value == 42);
+ }
+ // Check that the original object hasn't been changed.
+ assertContains<Type>(a, 42);
+
+ // Check that no objects have been created/copied/moved.
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 1);
+ }
+ assert(Type::count == 0);
+}
+
+template <class Type>
+void test_cast_to_value() {
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a((Type(42)));
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 1);
+
+ // Try a cast to a bad type.
+ // NOTE: Type cannot be an int.
+ checkThrows<int>(a);
+ checkThrows<int&, int const&>(a);
+ checkThrows<Type*, Type const*>(a);
+ checkThrows<Type const*>(a);
+
+ Type::reset(); // NOTE: reset does not modify Type::count
+ // Check getting Type by value from a non-const lvalue any.
+ // This should cause the non-const copy constructor to be called.
+ {
+ Type t = any_cast<Type>(a);
+
+ assert(Type::count == 2);
+ assert(Type::copied == 1);
+ assert(Type::const_copied == 0);
+ assert(Type::non_const_copied == 1);
+ assert(Type::moved == 0);
+ assert(t.value == 42);
+ }
+ assert(Type::count == 1);
+ Type::reset();
+ // Check getting const Type by value from a non-const lvalue any.
+ // This should cause the const copy constructor to be called.
+ {
+ Type t = any_cast<Type const>(a);
+
+ assert(Type::count == 2);
+ assert(Type::copied == 1);
+ assert(Type::const_copied == 0);
+ assert(Type::non_const_copied == 1);
+ assert(Type::moved == 0);
+ assert(t.value == 42);
+ }
+ assert(Type::count == 1);
+ Type::reset();
+ // Check getting Type by value from a non-const lvalue any.
+ // This should cause the const copy constructor to be called.
+ {
+ Type t = any_cast<Type>(static_cast<any const&>(a));
+
+ assert(Type::count == 2);
+ assert(Type::copied == 1);
+ assert(Type::const_copied == 1);
+ assert(Type::non_const_copied == 0);
+ assert(Type::moved == 0);
+ assert(t.value == 42);
+ }
+ assert(Type::count == 1);
+ Type::reset();
+ // Check getting Type by value from a non-const rvalue any.
+ // This should cause the non-const copy constructor to be called.
+ {
+ Type t = any_cast<Type>(static_cast<any &&>(a));
+
+ assert(Type::count == 2);
+ assert(Type::moved == 1);
+ assert(Type::copied == 0);
+ assert(Type::const_copied == 0);
+ assert(Type::non_const_copied == 0);
+ assert(t.value == 42);
+ assert(any_cast<Type&>(a).value == 0);
+ any_cast<Type&>(a).value = 42; // reset the value
+ }
+ assert(Type::count == 1);
+ Type::reset();
+ // Check getting const Type by value from a non-const rvalue any.
+ // This should cause the const copy constructor to be called.
+ {
+ Type t = any_cast<Type const>(static_cast<any &&>(a));
+
+ assert(Type::count == 2);
+ assert(Type::copied == 0);
+ assert(Type::const_copied == 0);
+ assert(Type::non_const_copied == 0);
+ assert(Type::moved == 1);
+ assert(t.value == 42);
+ assert(any_cast<Type&>(a).value == 0);
+ any_cast<Type&>(a).value = 42; // reset the value
+ }
+ assert(Type::count == 1);
+ Type::reset();
+ // Check getting Type by value from a const rvalue any.
+ // This should cause the const copy constructor to be called.
+ {
+ Type t = any_cast<Type>(static_cast<any const&&>(a));
+
+ assert(Type::count == 2);
+ assert(Type::copied == 1);
+ assert(Type::const_copied == 1);
+ assert(Type::non_const_copied == 0);
+ assert(Type::moved == 0);
+ assert(t.value == 42);
+ assert(any_cast<Type&>(a).value == 42);
+ }
+ // Ensure we still only have 1 Type object alive.
+ assert(Type::count == 1);
+
+ // Check that the original object hasn't been changed.
+ assertContains<Type>(a, 42);
+ }
+ assert(Type::count == 0);
+}
+
+int main() {
+ test_cast_is_not_noexcept();
+ test_cast_return_type();
+ test_cast_empty();
+ test_cast_to_reference<small>();
+ test_cast_to_reference<large>();
+ test_cast_to_value<small>();
+ test_cast_to_value<large>();
+}
diff --git a/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp
new file mode 100644
index 000000000000..07578a28e82f
--- /dev/null
+++ b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class ValueType>
+// ValueType any_cast(any &&);
+
+// Try and use the rvalue any_cast to cast to an lvalue reference
+
+#include <any>
+
+struct TestType {};
+using std::any;
+using std::any_cast;
+
+void test_const_lvalue_cast_request_non_const_lvalue()
+{
+ const any a;
+ // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}}
+ // expected-error@any:* {{binding value of type 'const TestType' to reference to type 'TestType' drops 'const' qualifier}}
+ any_cast<TestType &>(a); // expected-note {{requested here}}
+
+ const any a2(42);
+ // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}}
+ // expected-error@any:* {{binding value of type 'const int' to reference to type 'int' drops 'const' qualifier}}
+ any_cast<int&>(a2); // expected-note {{requested here}}
+}
+
+void test_lvalue_any_cast_request_rvalue()
+{
+ any a;
+ // expected-error@any:* {{static_assert failed "ValueType is required to be an lvalue reference or a CopyConstructible type"}}
+ any_cast<TestType &&>(a); // expected-note {{requested here}}
+
+ any a2(42);
+ // expected-error@any:* {{static_assert failed "ValueType is required to be an lvalue reference or a CopyConstructible type"}}
+ any_cast<int&&>(a2); // expected-note {{requested here}}
+}
+
+void test_rvalue_any_cast_request_lvalue()
+{
+ any a;
+ // expected-error@any:* {{static_assert failed "ValueType is required to be an rvalue reference or a CopyConstructible type"}}
+ // expected-error@any:* {{non-const lvalue reference to type 'TestType' cannot bind to a temporary}}
+ any_cast<TestType &>(std::move(a)); // expected-note {{requested here}}
+
+ // expected-error@any:* {{static_assert failed "ValueType is required to be an rvalue reference or a CopyConstructible type"}}
+ // expected-error@any:* {{non-const lvalue reference to type 'int' cannot bind to a temporary}}
+ any_cast<int&>(42);
+}
+
+int main()
+{
+ test_const_lvalue_cast_request_non_const_lvalue();
+ test_lvalue_any_cast_request_rvalue();
+ test_rvalue_any_cast_request_lvalue();
+}
diff --git a/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp b/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp
new file mode 100644
index 000000000000..3f6955a8cbce
--- /dev/null
+++ b/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class ValueType>
+// ValueType any_cast(any const &);
+
+// Try and cast away const.
+
+#include <any>
+
+struct TestType {};
+struct TestType2 {};
+
+int main()
+{
+ using std::any;
+ using std::any_cast;
+
+ any a;
+
+ // expected-error@any:* {{binding value of type 'const TestType' to reference to type 'TestType' drops 'const' qualifier}}
+ // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}}
+ any_cast<TestType &>(static_cast<any const&>(a)); // expected-note {{requested here}}
+
+ // expected-error@any:* {{cannot cast from lvalue of type 'const TestType' to rvalue reference type 'TestType &&'; types are not compatible}}
+ // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}}
+ any_cast<TestType &&>(static_cast<any const&>(a)); // expected-note {{requested here}}
+
+ // expected-error@any:* {{binding value of type 'const TestType2' to reference to type 'TestType2' drops 'const' qualifier}}
+ // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}}
+ any_cast<TestType2 &>(static_cast<any const&&>(a)); // expected-note {{requested here}}
+
+ // expected-error@any:* {{cannot cast from lvalue of type 'const TestType2' to rvalue reference type 'TestType2 &&'; types are not compatible}}
+ // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}}
+ any_cast<TestType2 &&>(static_cast<any const&&>(a)); // expected-note {{requested here}}
+}
diff --git a/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp b/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
new file mode 100644
index 000000000000..ed4b96d644d2
--- /dev/null
+++ b/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class ValueType>
+// ValueType const any_cast(any const&);
+//
+// template <class ValueType>
+// ValueType any_cast(any &);
+//
+// template <class ValueType>
+// ValueType any_cast(any &&);
+
+// Test instantiating the any_cast with a non-copyable type.
+
+#include <any>
+
+using std::any;
+using std::any_cast;
+
+struct no_copy
+{
+ no_copy() {}
+ no_copy(no_copy &&) {}
+ no_copy(no_copy const &) = delete;
+};
+
+struct no_move {
+ no_move() {}
+ no_move(no_move&&) = delete;
+ no_move(no_move const&) {}
+};
+
+int main() {
+ any a;
+ // expected-error@any:* {{static_assert failed "ValueType is required to be an lvalue reference or a CopyConstructible type"}}
+ // expected-error@any:* {{static_cast from 'no_copy' to 'no_copy' uses deleted function}}
+ any_cast<no_copy>(static_cast<any&>(a)); // expected-note {{requested here}}
+
+ // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}}
+ // expected-error@any:* {{static_cast from 'const no_copy' to 'no_copy' uses deleted function}}
+ any_cast<no_copy>(static_cast<any const&>(a)); // expected-note {{requested here}}
+
+ any_cast<no_copy>(static_cast<any &&>(a)); // OK
+
+ // expected-error@any:* {{static_assert failed "ValueType is required to be an rvalue reference or a CopyConstructible type"}}
+ // expected-error@any:* {{static_cast from 'typename remove_reference<no_move &>::type' (aka 'no_move') to 'no_move' uses deleted function}}
+ any_cast<no_move>(static_cast<any &&>(a));
+}
diff --git a/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp b/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
new file mode 100644
index 000000000000..99cc029971a8
--- /dev/null
+++ b/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class ValueType>
+// ValueType const* any_cast(any const *) noexcept;
+//
+// template <class ValueType>
+// ValueType * any_cast(any *) noexcept;
+
+#include <any>
+
+using std::any;
+using std::any_cast;
+
+int main()
+{
+ any a(1);
+ any_cast<int &>(&a); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int &&>(&a); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const &>(&a); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const&&>(&a); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any const& a2 = a;
+ any_cast<int &>(&a2); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int &&>(&a2); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const &>(&a2); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const &&>(&a2); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+}
diff --git a/test/std/utilities/any/any.nonmembers/make_any.pass.cpp b/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
new file mode 100644
index 000000000000..59c06be6aad3
--- /dev/null
+++ b/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
@@ -0,0 +1,140 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// template <class T, class ...Args> any make_any(Args&&...);
+// template <class T, class U, class ...Args>
+// any make_any(initializer_list<U>, Args&&...);
+
+#include <any>
+#include <cassert>
+
+#include "any_helpers.h"
+#include "count_new.hpp"
+#include "test_macros.h"
+
+using std::any;
+using std::any_cast;
+
+
+template <class Type>
+void test_make_any_type() {
+ // constructing from a small type should perform no allocations.
+ DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a = std::make_any<Type>();
+
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 0);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a = std::make_any<Type>(101);
+
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 101);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+ {
+ any a = std::make_any<Type>(-1, 42, -1);
+
+ assert(Type::count == 1);
+ assert(Type::copied == 0);
+ assert(Type::moved == 0);
+ assertContains<Type>(a, 42);
+ }
+ assert(Type::count == 0);
+ Type::reset();
+}
+
+template <class Type>
+void test_make_any_type_tracked() {
+ // constructing from a small type should perform no allocations.
+ DisableAllocationGuard g(isSmallType<Type>()); ((void)g);
+ {
+ any a = std::make_any<Type>();
+ assertArgsMatch<Type>(a);
+ }
+ {
+ any a = std::make_any<Type>(-1, 42, -1);
+ assertArgsMatch<Type, int, int, int>(a);
+ }
+ // initializer_list constructor tests
+ {
+ any a = std::make_any<Type>({-1, 42, -1});
+ assertArgsMatch<Type, std::initializer_list<int>>(a);
+ }
+ {
+ int x = 42;
+ any a = std::make_any<Type>({-1, 42, -1}, x);
+ assertArgsMatch<Type, std::initializer_list<int>, int&>(a);
+ }
+}
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+
+struct SmallThrows {
+ SmallThrows(int) { throw 42; }
+ SmallThrows(std::initializer_list<int>, int) { throw 42; }
+};
+static_assert(IsSmallObject<SmallThrows>::value, "");
+
+struct LargeThrows {
+ LargeThrows(int) { throw 42; }
+ LargeThrows(std::initializer_list<int>, int) { throw 42; }
+ int data[sizeof(std::any)];
+};
+static_assert(!IsSmallObject<LargeThrows>::value, "");
+
+template <class Type>
+void test_make_any_throws()
+{
+ {
+ try {
+ std::make_any<Type>(101);
+ assert(false);
+ } catch (int const&) {
+ }
+ }
+ {
+ try {
+ std::make_any<Type>({1, 2, 3}, 101);
+ assert(false);
+ } catch (int const&) {
+ }
+ }
+}
+
+#endif
+
+int main() {
+ test_make_any_type<small>();
+ test_make_any_type<large>();
+ test_make_any_type<small_throws_on_copy>();
+ test_make_any_type<large_throws_on_copy>();
+ test_make_any_type<throws_on_move>();
+ test_make_any_type_tracked<small_tracked_t>();
+ test_make_any_type_tracked<large_tracked_t>();
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ test_make_any_throws<SmallThrows>();
+ test_make_any_throws<LargeThrows>();
+
+#endif
+}
diff --git a/test/std/utilities/any/any.nonmembers/swap.pass.cpp b/test/std/utilities/any/any.nonmembers/swap.pass.cpp
new file mode 100644
index 000000000000..1b3785bb1c66
--- /dev/null
+++ b/test/std/utilities/any/any.nonmembers/swap.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <any>
+
+// void swap(any &, any &) noexcept
+
+// swap(...) just wraps any::swap(...). That function is tested elsewhere.
+
+#include <any>
+#include <cassert>
+
+using std::any;
+using std::any_cast;
+
+int main()
+{
+
+ { // test noexcept
+ any a;
+ static_assert(noexcept(swap(a, a)), "swap(any&, any&) must be noexcept");
+ }
+ {
+ any a1(1);
+ any a2(2);
+
+ swap(a1, a2);
+
+ assert(any_cast<int>(a1) == 2);
+ assert(any_cast<int>(a2) == 1);
+ }
+}
diff --git a/test/std/utilities/function.objects/arithmetic.operations/divides.pass.cpp b/test/std/utilities/function.objects/arithmetic.operations/divides.pass.cpp
index 490dc16b60e2..7419b70e0b8f 100644
--- a/test/std/utilities/function.objects/arithmetic.operations/divides.pass.cpp
+++ b/test/std/utilities/function.objects/arithmetic.operations/divides.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::divides<int> F;
@@ -23,7 +25,7 @@ int main()
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
static_assert((std::is_same<int, F::result_type>::value), "" );
assert(f(36, 4) == 9);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::divides<> F2;
const F2 f2 = F2();
assert(f2(36, 4) == 9);
@@ -33,7 +35,7 @@ int main()
constexpr int foo = std::divides<int> () (3, 2);
static_assert ( foo == 1, "" );
- constexpr int bar = std::divides<> () (3.0, 2);
- static_assert ( bar == 1, "" );
+ constexpr double bar = std::divides<> () (3.0, 2);
+ static_assert ( bar == 1.5, "" ); // exact in binary
#endif
}
diff --git a/test/std/utilities/function.objects/arithmetic.operations/minus.pass.cpp b/test/std/utilities/function.objects/arithmetic.operations/minus.pass.cpp
index 9bda541f896a..25df69d60e96 100644
--- a/test/std/utilities/function.objects/arithmetic.operations/minus.pass.cpp
+++ b/test/std/utilities/function.objects/arithmetic.operations/minus.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::minus<int> F;
@@ -23,7 +25,7 @@ int main()
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
static_assert((std::is_same<int, F::result_type>::value), "" );
assert(f(3, 2) == 1);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::minus<> F2;
const F2 f2 = F2();
assert(f2(3,2) == 1);
@@ -33,7 +35,7 @@ int main()
constexpr int foo = std::minus<int> () (3, 2);
static_assert ( foo == 1, "" );
- constexpr int bar = std::minus<> () (3.0, 2);
- static_assert ( bar == 1, "" );
+ constexpr double bar = std::minus<> () (3.0, 2);
+ static_assert ( bar == 1.0, "" );
#endif
}
diff --git a/test/std/utilities/function.objects/arithmetic.operations/modulus.pass.cpp b/test/std/utilities/function.objects/arithmetic.operations/modulus.pass.cpp
index ca5bba6d5b8e..6f39792e925f 100644
--- a/test/std/utilities/function.objects/arithmetic.operations/modulus.pass.cpp
+++ b/test/std/utilities/function.objects/arithmetic.operations/modulus.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::modulus<int> F;
@@ -23,7 +25,7 @@ int main()
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
static_assert((std::is_same<int, F::result_type>::value), "" );
assert(f(36, 8) == 4);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::modulus<> F2;
const F2 f2 = F2();
assert(f2(36, 8) == 4);
diff --git a/test/std/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp b/test/std/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp
index f132c8d4bd9b..2b354826960e 100644
--- a/test/std/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp
+++ b/test/std/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::multiplies<int> F;
@@ -23,7 +25,7 @@ int main()
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
static_assert((std::is_same<int, F::result_type>::value), "" );
assert(f(3, 2) == 6);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::multiplies<> F2;
const F2 f2 = F2();
assert(f2(3,2) == 6);
@@ -33,7 +35,7 @@ int main()
constexpr int foo = std::multiplies<int> () (3, 2);
static_assert ( foo == 6, "" );
- constexpr int bar = std::multiplies<> () (3.0, 2);
- static_assert ( bar == 6, "" );
+ constexpr double bar = std::multiplies<> () (3.0, 2);
+ static_assert ( bar == 6.0, "" );
#endif
}
diff --git a/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp b/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp
index 0adac659123b..198894023cd7 100644
--- a/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp
+++ b/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::negate<int> F;
@@ -22,7 +24,7 @@ int main()
static_assert((std::is_same<F::argument_type, int>::value), "" );
static_assert((std::is_same<F::result_type, int>::value), "" );
assert(f(36) == -36);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::negate<> F2;
const F2 f2 = F2();
assert(f2(36) == -36);
@@ -32,7 +34,7 @@ int main()
constexpr int foo = std::negate<int> () (3);
static_assert ( foo == -3, "" );
- constexpr int bar = std::negate<> () (3.0);
- static_assert ( bar == -3, "" );
+ constexpr double bar = std::negate<> () (3.0);
+ static_assert ( bar == -3.0, "" );
#endif
}
diff --git a/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp b/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp
index ce544c78b676..b56d3ef2b346 100644
--- a/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp
+++ b/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::plus<int> F;
@@ -23,7 +25,7 @@ int main()
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
static_assert((std::is_same<int, F::result_type>::value), "" );
assert(f(3, 2) == 5);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::plus<> F2;
const F2 f2 = F2();
assert(f2(3,2) == 5);
@@ -33,7 +35,7 @@ int main()
constexpr int foo = std::plus<int> () (3, 2);
static_assert ( foo == 5, "" );
- constexpr int bar = std::plus<> () (3.0, 2);
- static_assert ( bar == 5, "" );
+ constexpr double bar = std::plus<> () (3.0, 2);
+ static_assert ( bar == 5.0, "" );
#endif
}
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/bind_return_type.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/bind_return_type.pass.cpp
index 63d3c9b0de92..a543fffedbb5 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/bind_return_type.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/bind_return_type.pass.cpp
@@ -24,6 +24,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int dummy = 42;
int return_value(int) { return dummy; }
@@ -81,10 +83,10 @@ void do_test(Fn* func) {
// Check that the call operator SFINAE's away when too few arguments
// are provided but is well-formed otherwise.
{
- static_assert(!CheckCall<Bind>(), "");
+ LIBCPP_STATIC_ASSERT(!CheckCall<Bind>(), "");
static_assert(CheckCall<Bind, int>(), "");
static_assert(CheckCall<Bind, int, int>(), "");
- static_assert(!CheckCall<BindR>(), "");
+ LIBCPP_STATIC_ASSERT(!CheckCall<BindR>(), "");
static_assert(CheckCall<BindR, int>(), "");
static_assert(CheckCall<BindR, int, int>(), "");
}
@@ -108,7 +110,7 @@ void do_test_r(Fn* func) {
// Check that the call operator SFINAE's away when too few arguments
// are provided but is well-formed otherwise.
{
- static_assert(!CheckCall<Bind>(), "");
+ LIBCPP_STATIC_ASSERT(!CheckCall<Bind>(), "");
static_assert(CheckCall<Bind, int>(), "");
static_assert(CheckCall<Bind, int, int>(), "");
}
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp
index a0c686de77ba..180433109f26 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp
@@ -29,7 +29,7 @@ struct DummyUnaryFunction
struct BadUnaryFunction
{
template <typename S>
- constexpr int operator()(S const & s) const
+ constexpr int operator()(S const &) const
{
// Trigger a compile error if this function is instantiated.
// The constexpr is needed so that it is instantiated while checking
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp
index f61d93aefd89..0d4244b4d860 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp
@@ -28,7 +28,7 @@ struct power
T
operator()(T a, T b)
{
- return std::pow(a, b);
+ return static_cast<T>(std::pow(a, b));
}
};
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp
index 83fa452fecb3..5d833e28830b 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp
@@ -14,12 +14,16 @@
// template<class T> struct is_bind_expression
#include <functional>
+#include "test_macros.h"
template <bool Expected, class T>
void
test(const T&)
{
static_assert(std::is_bind_expression<T>::value == Expected, "");
+#if TEST_STD_VER > 14
+ static_assert(std::is_bind_expression_v<T> == Expected, "");
+#endif
}
struct C {};
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp
index 6a52bd1848e9..1d7c649dfc0e 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp
@@ -12,12 +12,16 @@
// struct is_placeholder
#include <functional>
+#include "test_macros.h"
template <int Expected, class T>
void
test(const T&)
{
static_assert(std::is_placeholder<T>::value == Expected, "");
+#if TEST_STD_VER > 14
+ static_assert(std::is_placeholder_v<T> == Expected, "");
+#endif
}
struct C {};
diff --git a/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp b/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
index 68986ac1aeb3..59709d0ed5b2 100644
--- a/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
+++ b/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
@@ -56,8 +56,34 @@ constexpr decltype(std::placeholders::_9) cp9 = std::placeholders::_9;
constexpr decltype(std::placeholders::_10) cp10 = std::placeholders::_10;
#endif // TEST_STD_VER >= 11
+void use_placeholders_to_prevent_unused_warning() {
+#if TEST_STD_VER >= 11
+ ((void)cp1);
+ ((void)cp2);
+ ((void)cp3);
+ ((void)cp4);
+ ((void)cp5);
+ ((void)cp6);
+ ((void)cp7);
+ ((void)cp8);
+ ((void)cp9);
+ ((void)cp10);
+ ((void)default1);
+ ((void)default2);
+ ((void)default3);
+ ((void)default4);
+ ((void)default5);
+ ((void)default6);
+ ((void)default7);
+ ((void)default8);
+ ((void)default9);
+ ((void)default10);
+#endif
+}
+
int main()
{
+ use_placeholders_to_prevent_unused_warning();
test(std::placeholders::_1);
test(std::placeholders::_2);
test(std::placeholders::_3);
diff --git a/test/std/utilities/function.objects/bitwise.operations/bit_and.pass.cpp b/test/std/utilities/function.objects/bitwise.operations/bit_and.pass.cpp
index c0135fad1982..12d968f42c0a 100644
--- a/test/std/utilities/function.objects/bitwise.operations/bit_and.pass.cpp
+++ b/test/std/utilities/function.objects/bitwise.operations/bit_and.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::bit_and<int> F;
@@ -27,7 +29,7 @@ int main()
assert(f(0x58D3, 0xEA95) == 0x4891);
assert(f(0x58D3, 0) == 0);
assert(f(0xFFFF, 0x58D3) == 0x58D3);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::bit_and<> F2;
const F2 f2 = F2();
assert(f2(0xEA95, 0xEA95) == 0xEA95);
diff --git a/test/std/utilities/function.objects/bitwise.operations/bit_or.pass.cpp b/test/std/utilities/function.objects/bitwise.operations/bit_or.pass.cpp
index cb33df3d84b7..90dd9bc098bb 100644
--- a/test/std/utilities/function.objects/bitwise.operations/bit_or.pass.cpp
+++ b/test/std/utilities/function.objects/bitwise.operations/bit_or.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::bit_or<int> F;
@@ -27,7 +29,7 @@ int main()
assert(f(0x58D3, 0xEA95) == 0xFAD7);
assert(f(0x58D3, 0) == 0x58D3);
assert(f(0xFFFF, 0x58D3) == 0xFFFF);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::bit_or<> F2;
const F2 f2 = F2();
assert(f2(0xEA95, 0xEA95) == 0xEA95);
diff --git a/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp b/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
index bbf2ce5baf1b..a5cbd17a0d0e 100644
--- a/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
+++ b/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -29,7 +31,7 @@ int main()
assert(f(0x58D3, 0) == 0x58D3);
assert(f(0xFFFF, 0x58D3) == 0xA72C);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::bit_xor<> F2;
const F2 f = F2();
diff --git a/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp b/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp
index 66d783a6e357..b23d4e8bb478 100644
--- a/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp
+++ b/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp
@@ -19,13 +19,13 @@ void do_pointer_comparison_test() {
#endif
std::vector<std::shared_ptr<T> > pointers;
const std::size_t test_size = 100;
- for (int i=0; i < test_size; ++i)
+ for (size_t i=0; i < test_size; ++i)
pointers.push_back(std::shared_ptr<T>(new T()));
Compare comp;
UIntCompare ucomp;
VoidCompare vcomp;
- for (int i=0; i < test_size; ++i) {
- for (int j=0; j < test_size; ++j) {
+ for (size_t i=0; i < test_size; ++i) {
+ for (size_t j=0; j < test_size; ++j) {
T* lhs = pointers[i].get();
T* rhs = pointers[j].get();
std::uintptr_t lhs_uint = reinterpret_cast<std::uintptr_t>(lhs);
diff --git a/test/std/utilities/function.objects/func.invoke/invoke_feature_test_macro.pass.cpp b/test/std/utilities/function.objects/func.invoke/invoke_feature_test_macro.pass.cpp
new file mode 100644
index 000000000000..aaac98474fcb
--- /dev/null
+++ b/test/std/utilities/function.objects/func.invoke/invoke_feature_test_macro.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <class F, class ...Args>
+// result_of_t<F&&(Args&&...)> invoke(F&&, Args&&...);
+
+#include <functional>
+#include <cassert>
+
+#include "test_macros.h"
+
+#if TEST_STD_VER <= 14
+# ifdef __cpp_lib_invoke
+# error Feature test macro should be defined
+# endif
+#else
+# ifndef __cpp_lib_invoke
+# error Feature test macro not defined
+# endif
+# if __cpp_lib_invoke != 201411
+# error __cpp_lib_invoke has the wrong value
+# endif
+#endif
+
+int foo(int) { return 42; }
+
+int main() {
+#if defined(__cpp_lib_invoke)
+ assert(std::invoke(foo, 101) == 42);
+#endif
+} \ No newline at end of file
diff --git a/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp b/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
index c12fa7920974..47a3e1cc5969 100644
--- a/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
+++ b/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
@@ -138,26 +138,26 @@ inline constexpr CallType operator|(CallType LHS, CallType RHS) {
struct ForwardingCallObject {
template <class ...Args>
- bool operator()(Args&&... args) & {
+ bool operator()(Args&&...) & {
set_call<Args&&...>(CT_NonConst | CT_LValue);
return true;
}
template <class ...Args>
- bool operator()(Args&&... args) const & {
+ bool operator()(Args&&...) const & {
set_call<Args&&...>(CT_Const | CT_LValue);
return true;
}
// Don't allow the call operator to be invoked as an rvalue.
template <class ...Args>
- bool operator()(Args&&... args) && {
+ bool operator()(Args&&...) && {
set_call<Args&&...>(CT_NonConst | CT_RValue);
return true;
}
template <class ...Args>
- bool operator()(Args&&... args) const && {
+ bool operator()(Args&&...) const && {
set_call<Args&&...>(CT_Const | CT_RValue);
return true;
}
@@ -526,7 +526,6 @@ void call_operator_forwarding_test()
assert(Fn::check_call<int&&>(CT_Const | CT_RValue));
}
{ // test multi arg
- int x = 42;
const double y = 3.14;
std::string s = "abc";
obj(42, std::move(y), s, std::string{"foo"});
@@ -554,7 +553,10 @@ void call_operator_noexcept_test()
using T = NoExceptCallable<bool>;
T value(true);
auto ret = std::not_fn(value);
- static_assert(noexcept(!_VSTD::__invoke(value)), "");
+ LIBCPP_STATIC_ASSERT(noexcept(!_VSTD::__invoke(value)), "");
+#if TEST_STD_VER > 14
+ static_assert(noexcept(!std::invoke(value)), "");
+#endif
static_assert(noexcept(ret()), "call should be noexcept");
auto const& cret = ret;
static_assert(noexcept(cret()), "call should be noexcept");
@@ -577,6 +579,19 @@ void call_operator_noexcept_test()
}
}
+void test_lwg2767() {
+ // See http://wg21.link/LWG2767
+ struct Abstract { virtual void f() const = 0; };
+ struct Derived : public Abstract { void f() const {} };
+ struct F { bool operator()(Abstract&&) { return false; } };
+ {
+ Derived d;
+ Abstract &a = d;
+ bool b = std::not_fn(F{})(std::move(a));
+ assert(b);
+ }
+}
+
int main()
{
constructor_tests();
@@ -586,4 +601,5 @@ int main()
call_operator_sfinae_test(); // somewhat of an extension
call_operator_forwarding_test();
call_operator_noexcept_test();
+ test_lwg2767();
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.fail.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.fail.cpp
new file mode 100644
index 000000000000..e156fa966ac5
--- /dev/null
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+// XFAIL: c++11, c++14
+
+// <functional>
+
+#include <functional>
+#include <type_traits>
+
+#include "test_macros.h"
+
+struct S : public std::function<void()> { using function::function; };
+
+int main() {
+ S f1( [](){} );
+ S f2(std::allocator_arg, std::allocator<int>{}, f1);
+}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
new file mode 100644
index 000000000000..5bdf9e98e897
--- /dev/null
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+// REQUIRES-ANY: c++11, c++14
+
+// <functional>
+
+// See https://llvm.org/bugs/show_bug.cgi?id=20002
+
+#include <functional>
+#include <type_traits>
+
+#include "test_macros.h"
+
+using Fn = std::function<void()>;
+struct S : public std::function<void()> { using function::function; };
+
+int main() {
+ S s( [](){} );
+ S f1( s );
+ S f2(std::allocator_arg, std::allocator<int>{}, s);
+}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp
index 58192c928d58..1a9206e0e7f3 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp
@@ -12,13 +12,14 @@
// class function<R(ArgTypes...)>
// template <MoveConstructible R, MoveConstructible ... ArgTypes>
-// void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&);
+// void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&) noexcept;
#include <functional>
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
class A
@@ -63,6 +64,9 @@ int main()
{
std::function<int(int)> f1 = A(1);
std::function<int(int)> f2 = A(2);
+#if TEST_STD_VER >= 11
+ static_assert(noexcept(swap(f1, f2)), "" );
+#endif
assert(A::count == 2);
assert(globalMemCounter.checkOutstandingNewEq(2));
assert(f1.target<A>()->id() == 1);
@@ -78,6 +82,9 @@ int main()
{
std::function<int(int)> f1 = A(1);
std::function<int(int)> f2 = g;
+#if TEST_STD_VER >= 11
+ static_assert(noexcept(swap(f1, f2)), "" );
+#endif
assert(A::count == 1);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(f1.target<A>()->id() == 1);
@@ -93,6 +100,9 @@ int main()
{
std::function<int(int)> f1 = g;
std::function<int(int)> f2 = A(1);
+#if TEST_STD_VER >= 11
+ static_assert(noexcept(swap(f1, f2)), "" );
+#endif
assert(A::count == 1);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(*f1.target<int(*)(int)>() == g);
@@ -108,6 +118,9 @@ int main()
{
std::function<int(int)> f1 = g;
std::function<int(int)> f2 = h;
+#if TEST_STD_VER >= 11
+ static_assert(noexcept(swap(f1, f2)), "" );
+#endif
assert(A::count == 0);
assert(globalMemCounter.checkOutstandingNewEq(0));
assert(*f1.target<int(*)(int)>() == g);
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp
index 82a6f6c5215e..fd296a7367b8 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp
@@ -16,6 +16,7 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
class A
@@ -49,6 +50,17 @@ int A::count = 0;
int g(int) {return 0;}
+#if TEST_STD_VER >= 11
+struct RValueCallable {
+ template <class ...Args>
+ void operator()(Args&&...) && {}
+};
+struct LValueCallable {
+ template <class ...Args>
+ void operator()(Args&&...) & {}
+};
+#endif
+
int main()
{
assert(globalMemCounter.checkOutstandingNewEq(0));
@@ -91,4 +103,13 @@ int main()
std::function <void()> f(static_cast<void (*)()>(0));
assert(!f);
}
+#if TEST_STD_VER >= 11
+ {
+ using Fn = std::function<void(int, int, int)>;
+ static_assert(std::is_constructible<Fn, LValueCallable&>::value, "");
+ static_assert(std::is_constructible<Fn, LValueCallable>::value, "");
+ static_assert(!std::is_constructible<Fn, RValueCallable&>::value, "");
+ static_assert(!std::is_constructible<Fn, RValueCallable>::value, "");
+ }
+#endif
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
index 11716e7946b0..e927ad42c06b 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
@@ -19,6 +19,7 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
class A
@@ -52,6 +53,17 @@ int A::count = 0;
int g(int) {return 0;}
+#if TEST_STD_VER >= 11
+struct RValueCallable {
+ template <class ...Args>
+ void operator()(Args&&...) && {}
+};
+struct LValueCallable {
+ template <class ...Args>
+ void operator()(Args&&...) & {}
+};
+#endif
+
int main()
{
assert(globalMemCounter.checkOutstandingNewEq(0));
@@ -95,4 +107,13 @@ int main()
assert(f.target<int(*)(int)>() != 0);
f(1);
}
+#if TEST_STD_VER >= 11
+ {
+ using Fn = std::function<void(int, int, int)>;
+ static_assert(std::is_assignable<Fn&, LValueCallable&>::value, "");
+ static_assert(std::is_assignable<Fn&, LValueCallable>::value, "");
+ static_assert(!std::is_assignable<Fn&, RValueCallable&>::value, "");
+ static_assert(!std::is_assignable<Fn&, RValueCallable>::value, "");
+ }
+#endif
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.fail.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.fail.cpp
new file mode 100644
index 000000000000..f455f0311847
--- /dev/null
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+// XFAIL: c++98, c++03, c++11, c++14
+
+// class function<R(ArgTypes...)>
+
+// template<class A> function(allocator_arg_t, const A&);
+
+#include <functional>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+ std::function<int(int)> f(std::allocator_arg, std::allocator<int>());
+}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp
index f97e34d3f2cb..392dfc1993bc 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp
@@ -8,10 +8,13 @@
//===----------------------------------------------------------------------===//
// <functional>
+// REQUIRES-ANY: c++98, c++03, c++11, c++14
// class function<R(ArgTypes...)>
// template<class A> function(allocator_arg_t, const A&);
+//
+// This signature was removed in C++17
#include <functional>
#include <cassert>
diff --git a/test/libcxx/containers/sequences/list/db_iterators_8.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.fail.cpp
index 08c10d34a01e..24f7fceb877b 100644
--- a/test/libcxx/containers/sequences/list/db_iterators_8.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.fail.cpp
@@ -7,25 +7,23 @@
//
//===----------------------------------------------------------------------===//
-// <list>
+// <functional>
+// XFAIL: c++98, c++03, c++11, c++14
-// Dereference non-dereferenceable iterator.
+// class function<R(ArgTypes...)>
-#define _LIBCPP_DEBUG 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+// template<class F, class A> function(allocator_arg_t, const A&, F);
+//
+// This signature was removed in C++17
-#include <list>
+#include <functional>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+
+#include "test_macros.h"
+
+void foo(int) {}
int main()
{
- typedef int T;
- typedef std::list<T> C;
- C c(1);
- C::iterator i = c.end();
- T j = *i;
- assert(false);
+ std::function<void(int)> f(std::allocator_arg, std::allocator<int>(), foo);
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
index 352ecfc602be..8d454723320c 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// <functional>
+// REQUIRES-ANY: c++98, c++03, c++11, c++14
// class function<R(ArgTypes...)>
@@ -16,11 +17,24 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "test_allocator.h"
#include "count_new.hpp"
#include "../function_types.h"
+
+#if TEST_STD_VER >= 11
+struct RValueCallable {
+ template <class ...Args>
+ void operator()(Args&&...) && {}
+};
+struct LValueCallable {
+ template <class ...Args>
+ void operator()(Args&&...) & {}
+};
+#endif
+
class DummyClass {};
template <class FuncType, class AllocType>
@@ -103,4 +117,14 @@ int main()
non_default_test_allocator<DummyClass> non_default_alloc(42);
test_for_alloc(non_default_alloc);
}
+#if TEST_STD_VER >= 11
+ {
+ using Fn = std::function<void(int, int, int)>;
+ static_assert(std::is_constructible<Fn, std::allocator_arg_t, std::allocator<int>, LValueCallable&>::value, "");
+ static_assert(std::is_constructible<Fn, std::allocator_arg_t, std::allocator<int>, LValueCallable>::value, "");
+ static_assert(!std::is_constructible<Fn, std::allocator_arg_t, std::allocator<int>, RValueCallable&>::value, "");
+ static_assert(!std::is_constructible<Fn, std::allocator_arg_t, std::allocator<int>, RValueCallable>::value, "");
+ }
+#endif
+
}
diff --git a/test/libcxx/containers/sequences/list/db_back.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.fail.cpp
index 96dfd2d8d2ec..9967457ff821 100644
--- a/test/libcxx/containers/sequences/list/db_back.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.fail.cpp
@@ -7,26 +7,24 @@
//
//===----------------------------------------------------------------------===//
-// <list>
+// <functional>
+// XFAIL: c++98, c++03, c++11, c++14
-// Call back() on empty container.
+// class function<R(ArgTypes...)>
+
+// template<class A> function(allocator_arg_t, const A&, const function&);
+//
+// This signature was removed in C++17
-#define _LIBCPP_DEBUG 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-#include <list>
+#include <functional>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+
+#include "test_macros.h"
int main()
{
- typedef int T;
- typedef std::list<T> C;
- C c(1);
- assert(c.back() == 0);
- c.clear();
- assert(c.back() == 0);
- assert(false);
+ typedef std::function<void(int)> F;
+ F f1;
+ F f2(std::allocator_arg, std::allocator<int>(), f1);
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
index 371eb98de1a9..718aa49341d2 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// <functional>
+// REQUIRES-ANY: c++98, c++03, c++11, c++14
// class function<R(ArgTypes...)>
diff --git a/test/libcxx/containers/sequences/list/db_cback.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.fail.cpp
index 1e25307c4602..cc4ecce75138 100644
--- a/test/libcxx/containers/sequences/list/db_cback.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.fail.cpp
@@ -7,24 +7,21 @@
//
//===----------------------------------------------------------------------===//
-// <list>
+// <functional>
+// XFAIL: c++98, c++03, c++11, c++14
-// Call back() on empty const container.
+// class function<R(ArgTypes...)>
-#define _LIBCPP_DEBUG 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+// template<class A> function(allocator_arg_t, const A&, nullptr_t);
+//
+// This signature was removed in C++17
-#include <list>
+#include <functional>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+
+#include "min_allocator.h"
int main()
{
- typedef int T;
- typedef std::list<T> C;
- const C c;
- assert(c.back() == 0);
- assert(false);
+ std::function<int(int)> f(std::allocator_arg, std::allocator<int>(), nullptr);
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp
index 2350f92f0f89..354ad955f207 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp
@@ -8,10 +8,13 @@
//===----------------------------------------------------------------------===//
// <functional>
+// REQUIRES-ANY: c++98, c++03, c++11, c++14
// class function<R(ArgTypes...)>
// template<class A> function(allocator_arg_t, const A&, nullptr_t);
+//
+// This signature was removed in C++17
#include <functional>
#include <cassert>
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.fail.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.fail.cpp
new file mode 100644
index 000000000000..cb9fb9afad2b
--- /dev/null
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.fail.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+// XFAIL: c++98, c++03, c++11, c++14
+
+// class function<R(ArgTypes...)>
+
+// template<class A> function(allocator_arg_t, const A&, function&&);
+//
+// This signature was removed in C++17
+
+#include <functional>
+#include <memory>
+#include <cassert>
+
+#include "test_macros.h"
+
+class A
+{
+ int data_[10];
+public:
+ static int count;
+
+ A()
+ {
+ ++count;
+ for (int i = 0; i < 10; ++i)
+ data_[i] = i;
+ }
+
+ A(const A&) {++count;}
+
+ ~A() {--count;}
+
+ int operator()(int i) const
+ {
+ for (int j = 0; j < 10; ++j)
+ i += data_[j];
+ return i;
+ }
+};
+
+int A::count = 0;
+
+int g(int) { return 0; }
+
+int main()
+{
+ {
+ std::function<int(int)> f = A();
+ std::function<int(int)> f2(std::allocator_arg, std::allocator<A>(), std::move(f));
+ }
+}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp
index 403d646f4216..e328481b274d 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp
@@ -8,12 +8,15 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
+// REQUIRES-ANY: c++11, c++14
// <functional>
// class function<R(ArgTypes...)>
// template<class A> function(allocator_arg_t, const A&, function&&);
+//
+// This signature was removed in C++17
#include <functional>
#include <memory>
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
index c91eaa2d5674..9b83ddecb974 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
@@ -16,94 +16,123 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
-class A
-{
- int data_[10];
+class A {
+ int data_[10];
+
public:
- static int count;
+ static int count;
- A()
- {
- ++count;
- for (int i = 0; i < 10; ++i)
- data_[i] = i;
- }
+ A() {
+ ++count;
+ for (int i = 0; i < 10; ++i)
+ data_[i] = i;
+ }
- A(const A&) {++count;}
+ A(const A &) { ++count; }
- ~A() {--count;}
+ ~A() { --count; }
- int operator()(int i) const
- {
- for (int j = 0; j < 10; ++j)
- i += data_[j];
- return i;
- }
+ int operator()(int i) const {
+ for (int j = 0; j < 10; ++j)
+ i += data_[j];
+ return i;
+ }
};
int A::count = 0;
-int g(int) {return 0;}
+int g0() { return 0; }
+int g(int) { return 0; }
+int g2(int, int) { return 2; }
+int g3(int, int, int) { return 3; }
-int main()
-{
- assert(globalMemCounter.checkOutstandingNewEq(0));
- {
+int main() {
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
std::function<int(int)> f = A();
assert(A::count == 1);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(f.target<A>());
- assert(f.target<int(*)(int)>() == 0);
+ assert(f.target<int (*)(int)>() == 0);
std::function<int(int)> f2;
f2 = f;
assert(A::count == 2);
assert(globalMemCounter.checkOutstandingNewEq(2));
assert(f2.target<A>());
- assert(f2.target<int(*)(int)>() == 0);
- }
- assert(A::count == 0);
- assert(globalMemCounter.checkOutstandingNewEq(0));
- {
+ assert(f2.target<int (*)(int)>() == 0);
+ }
+ assert(A::count == 0);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
std::function<int(int)> f = g;
assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(f.target<int(*)(int)>());
+ assert(f.target<int (*)(int)>());
assert(f.target<A>() == 0);
std::function<int(int)> f2;
f2 = f;
assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(f2.target<int(*)(int)>());
+ assert(f2.target<int (*)(int)>());
assert(f2.target<A>() == 0);
- }
- assert(globalMemCounter.checkOutstandingNewEq(0));
- {
+ }
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
std::function<int(int)> f;
assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(f.target<int(*)(int)>() == 0);
+ assert(f.target<int (*)(int)>() == 0);
assert(f.target<A>() == 0);
std::function<int(int)> f2;
f2 = f;
assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(f2.target<int(*)(int)>() == 0);
+ assert(f2.target<int (*)(int)>() == 0);
assert(f2.target<A>() == 0);
- }
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- assert(globalMemCounter.checkOutstandingNewEq(0));
- {
+ }
+ {
+ typedef std::function<int()> Func;
+ Func f = g0;
+ Func& fr = (f = f);
+ assert(&fr == &f);
+ assert(*f.target<int(*)()>() == g0);
+ }
+ {
+ typedef std::function<int(int)> Func;
+ Func f = g;
+ Func& fr = (f = f);
+ assert(&fr == &f);
+ assert(*f.target<int(*)(int)>() == g);
+ }
+ {
+ typedef std::function<int(int, int)> Func;
+ Func f = g2;
+ Func& fr = (f = f);
+ assert(&fr == &f);
+ assert(*f.target<int(*)(int, int)>() == g2);
+ }
+ {
+ typedef std::function<int(int, int, int)> Func;
+ Func f = g3;
+ Func& fr = (f = f);
+ assert(&fr == &f);
+ assert(*f.target<int(*)(int, int, int)>() == g3);
+ }
+#if TEST_STD_VER >= 11
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
std::function<int(int)> f = A();
assert(A::count == 1);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(f.target<A>());
- assert(f.target<int(*)(int)>() == 0);
+ assert(f.target<int (*)(int)>() == 0);
std::function<int(int)> f2;
f2 = std::move(f);
assert(A::count == 1);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(f2.target<A>());
- assert(f2.target<int(*)(int)>() == 0);
+ assert(f2.target<int (*)(int)>() == 0);
assert(f.target<A>() == 0);
- assert(f.target<int(*)(int)>() == 0);
- }
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ assert(f.target<int (*)(int)>() == 0);
+ }
+#endif
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
index 387b371a9331..9d5681a3db76 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
@@ -132,7 +132,7 @@ int main()
assert(A::count == 1);
assert(f2.target<A>() == nullptr);
assert(f2.target<Ref>());
- assert(f.target<Ref>()); // f is unchanged because the target is small
+ LIBCPP_ASSERT(f.target<Ref>()); // f is unchanged because the target is small
}
{
// Test that moving a function constructed from a function pointer
@@ -146,7 +146,7 @@ int main()
std::function<int(int)> f2(std::move(f));
assert(f2.target<A>() == nullptr);
assert(f2.target<Ptr>());
- assert(f.target<Ptr>()); // f is unchanged because the target is small
+ LIBCPP_ASSERT(f.target<Ptr>()); // f is unchanged because the target is small
}
#endif // TEST_STD_VER >= 11
}
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp
index f94e689b2a6b..214c3f7c5d83 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp
@@ -18,46 +18,49 @@
#include "count_new.hpp"
-class A
-{
- int data_[10];
+class A {
+ int data_[10];
+
public:
- static int count;
+ static int count;
- explicit A(int j)
- {
- ++count;
- data_[0] = j;
- }
+ explicit A(int j) {
+ ++count;
+ data_[0] = j;
+ }
- A(const A& a)
- {
- ++count;
- for (int i = 0; i < 10; ++i)
- data_[i] = a.data_[i];
- }
+ A(const A &a) {
+ ++count;
+ for (int i = 0; i < 10; ++i)
+ data_[i] = a.data_[i];
+ }
- ~A() {--count;}
+ ~A() { --count; }
- int operator()(int i) const
- {
- for (int j = 0; j < 10; ++j)
- i += data_[j];
- return i;
- }
+ int operator()(int i) const {
+ for (int j = 0; j < 10; ++j)
+ i += data_[j];
+ return i;
+ }
+
+ int operator()() const { return -1; }
+ int operator()(int, int) const { return -2; }
+ int operator()(int, int, int) const { return -3; }
- int id() const {return data_[0];}
+ int id() const { return data_[0]; }
};
int A::count = 0;
-int g(int) {return 0;}
-int h(int) {return 1;}
+int g0() { return 0; }
+int g(int) { return 0; }
+int h(int) { return 1; }
+int g2(int, int) { return 2; }
+int g3(int, int, int) { return 3; }
-int main()
-{
- assert(globalMemCounter.checkOutstandingNewEq(0));
- {
+int main() {
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
std::function<int(int)> f1 = A(1);
std::function<int(int)> f2 = A(2);
assert(A::count == 2);
@@ -69,52 +72,122 @@ int main()
assert(globalMemCounter.checkOutstandingNewEq(2));
assert(f1.target<A>()->id() == 2);
assert(f2.target<A>()->id() == 1);
- }
- assert(A::count == 0);
- assert(globalMemCounter.checkOutstandingNewEq(0));
- {
+ }
+ assert(A::count == 0);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
std::function<int(int)> f1 = A(1);
std::function<int(int)> f2 = g;
assert(A::count == 1);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(f1.target<A>()->id() == 1);
- assert(*f2.target<int(*)(int)>() == g);
+ assert(*f2.target<int (*)(int)>() == g);
f1.swap(f2);
assert(A::count == 1);
assert(globalMemCounter.checkOutstandingNewEq(1));
- assert(*f1.target<int(*)(int)>() == g);
+ assert(*f1.target<int (*)(int)>() == g);
assert(f2.target<A>()->id() == 1);
- }
- assert(A::count == 0);
- assert(globalMemCounter.checkOutstandingNewEq(0));
- {
+ }
+ assert(A::count == 0);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
std::function<int(int)> f1 = g;
std::function<int(int)> f2 = A(1);
assert(A::count == 1);
assert(globalMemCounter.checkOutstandingNewEq(1));
- assert(*f1.target<int(*)(int)>() == g);
+ assert(*f1.target<int (*)(int)>() == g);
assert(f2.target<A>()->id() == 1);
f1.swap(f2);
assert(A::count == 1);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(f1.target<A>()->id() == 1);
- assert(*f2.target<int(*)(int)>() == g);
- }
- assert(A::count == 0);
- assert(globalMemCounter.checkOutstandingNewEq(0));
- {
+ assert(*f2.target<int (*)(int)>() == g);
+ }
+ assert(A::count == 0);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
std::function<int(int)> f1 = g;
std::function<int(int)> f2 = h;
assert(A::count == 0);
assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(*f1.target<int(*)(int)>() == g);
- assert(*f2.target<int(*)(int)>() == h);
+ assert(*f1.target<int (*)(int)>() == g);
+ assert(*f2.target<int (*)(int)>() == h);
f1.swap(f2);
assert(A::count == 0);
assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(*f1.target<int(*)(int)>() == h);
- assert(*f2.target<int(*)(int)>() == g);
+ assert(*f1.target<int (*)(int)>() == h);
+ assert(*f2.target<int (*)(int)>() == g);
+ }
+ assert(A::count == 0);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
+ std::function<int(int)> f1 = A(1);
+ assert(A::count == 1);
+ {
+ DisableAllocationGuard guard;
+ ((void)guard);
+ f1.swap(f1);
}
- assert(A::count == 0);
- assert(globalMemCounter.checkOutstandingNewEq(0));
+ assert(A::count == 1);
+ assert(f1.target<A>()->id() == 1);
+ }
+ assert(A::count == 0);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
+ std::function<int()> f1 = g0;
+ DisableAllocationGuard guard;
+ ((void)guard);
+ f1.swap(f1);
+ assert(*f1.target<int (*)()>() == g0);
+ }
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
+ std::function<int(int, int)> f1 = g2;
+ DisableAllocationGuard guard;
+ ((void)guard);
+ f1.swap(f1);
+ assert(*f1.target<int (*)(int, int)>() == g2);
+ }
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
+ std::function<int(int, int, int)> f1 = g3;
+ DisableAllocationGuard guard;
+ ((void)guard);
+ f1.swap(f1);
+ assert(*f1.target<int (*)(int, int, int)>() == g3);
+ }
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ {
+ std::function<int()> f1 = A(1);
+ assert(A::count == 1);
+ DisableAllocationGuard guard;
+ ((void)guard);
+ f1.swap(f1);
+ assert(A::count == 1);
+ assert(f1.target<A>()->id() == 1);
+ }
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ assert(A::count == 0);
+ {
+ std::function<int(int, int)> f1 = A(2);
+ assert(A::count == 1);
+ DisableAllocationGuard guard;
+ ((void)guard);
+ f1.swap(f1);
+ assert(A::count == 1);
+ assert(f1.target<A>()->id() == 2);
+ }
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ assert(A::count == 0);
+ {
+ std::function<int(int, int, int)> f1 = A(3);
+ assert(A::count == 1);
+ DisableAllocationGuard guard;
+ ((void)guard);
+ f1.swap(f1);
+ assert(A::count == 1);
+ assert(f1.target<A>()->id() == 3);
+ }
+ assert(globalMemCounter.checkOutstandingNewEq(0));
+ assert(A::count == 0);
}
diff --git a/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp b/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp
index 72f9dc20144d..ac94fa5362e8 100644
--- a/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp
+++ b/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::logical_and<int> F;
@@ -26,7 +28,7 @@ int main()
assert(!f(36, 0));
assert(!f(0, 36));
assert(!f(0, 0));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::logical_and<> F2;
const F2 f2 = F2();
assert( f2(36, 36));
diff --git a/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp b/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp
index 8484625a727c..4f783dd0f23a 100644
--- a/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp
+++ b/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::logical_not<int> F;
@@ -23,7 +25,7 @@ int main()
static_assert((std::is_same<F::result_type, bool>::value), "" );
assert(!f(36));
assert(f(0));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::logical_not<> F2;
const F2 f2 = F2();
assert(!f2(36));
diff --git a/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp b/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp
index 7280504403f4..3c450a05de19 100644
--- a/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp
+++ b/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp
@@ -15,6 +15,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::logical_or<int> F;
@@ -26,7 +28,7 @@ int main()
assert(f(36, 0));
assert(f(0, 36));
assert(!f(0, 0));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::logical_or<> F2;
const F2 f2 = F2();
assert( f2(36, 36));
diff --git a/test/std/utilities/function.objects/refwrap/type_properties.pass.cpp b/test/std/utilities/function.objects/refwrap/type_properties.pass.cpp
index 3c00bd20ac64..261a306ca156 100644
--- a/test/std/utilities/function.objects/refwrap/type_properties.pass.cpp
+++ b/test/std/utilities/function.objects/refwrap/type_properties.pass.cpp
@@ -21,7 +21,9 @@
#include <type_traits>
#include <string>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#include "test_macros.h"
+
+#if TEST_STD_VER >= 11
class MoveOnly
{
MoveOnly(const MoveOnly&);
@@ -55,7 +57,7 @@ int main()
test<int>();
test<double>();
test<std::string>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test<MoveOnly>();
#endif
}
diff --git a/test/std/utilities/function.objects/unord.hash/enum.pass.cpp b/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
index 8aa2c1df8935..af367789a105 100644
--- a/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
+++ b/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11
+
// <functional>
// make sure that we can hash enumeration values
@@ -14,8 +16,6 @@
#include "test_macros.h"
-#if TEST_STD_VER >= 14
-
#include <functional>
#include <cassert>
#include <type_traits>
@@ -59,6 +59,3 @@ int main()
test<Fruits>();
}
-#else
-int main () {}
-#endif
diff --git a/test/std/utilities/function.objects/unord.hash/integral.pass.cpp b/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
index 8954f4f3664b..2f3f9bee4bc3 100644
--- a/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
+++ b/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
@@ -35,11 +35,11 @@ test()
for (int i = 0; i <= 5; ++i)
{
- T t(i);
+ T t(static_cast<T>(i));
if (sizeof(T) <= sizeof(std::size_t))
{
const std::size_t result = h(t);
- LIBCPP_ASSERT(result == t);
+ LIBCPP_ASSERT(result == static_cast<size_t>(t));
((void)result); // Prevent unused warning
}
}
diff --git a/test/std/utilities/function.objects/unord.hash/non_enum.pass.cpp b/test/std/utilities/function.objects/unord.hash/non_enum.pass.cpp
new file mode 100644
index 000000000000..ed173f280d05
--- /dev/null
+++ b/test/std/utilities/function.objects/unord.hash/non_enum.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11
+
+// <functional>
+
+// Hashing a struct w/o a defined hash should *not* fail, but it should
+// create a type that is not constructible and not callable.
+// See also: http://cplusplus.github.io/LWG/lwg-active.html#2543
+
+#include <functional>
+#include <cassert>
+#include <type_traits>
+
+#include "test_macros.h"
+
+struct X {};
+
+int main()
+{
+ using H = std::hash<X>;
+ static_assert(!std::is_default_constructible<H>::value, "");
+ static_assert(!std::is_copy_constructible<H>::value, "");
+ static_assert(!std::is_move_constructible<H>::value, "");
+ static_assert(!std::is_copy_assignable<H>::value, "");
+ static_assert(!std::is_move_assignable<H>::value, "");
+#if TEST_STD_VER > 14
+ static_assert(!std::is_callable<H(X&)>::value, "");
+ static_assert(!std::is_callable<H(X const&)>::value, "");
+#endif
+}
diff --git a/test/std/utilities/intseq/intseq.intseq/integer_seq.fail.cpp b/test/std/utilities/intseq/intseq.intseq/integer_seq.fail.cpp
index b689160babaa..ed899e7ca268 100644
--- a/test/std/utilities/intseq/intseq.intseq/integer_seq.fail.cpp
+++ b/test/std/utilities/intseq/intseq.intseq/integer_seq.fail.cpp
@@ -22,9 +22,11 @@
#include <utility>
+#include "test_macros.h"
+
int main()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
// Should fail to compile, since float is not an integral type
using floatmix = std::integer_sequence<float>;
@@ -34,5 +36,5 @@ int main()
X
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
}
diff --git a/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp b/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp
index af4a3c4dfe7f..192626935f00 100644
--- a/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp
+++ b/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp
@@ -14,6 +14,9 @@
// UNSUPPORTED: c++98, c++03, c++11
+// This test hangs during recursive template instantiation with libstdc++
+// UNSUPPORTED: libstdc++
+
#include <utility>
#include <type_traits>
#include <cassert>
diff --git a/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.fail.cpp b/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.fail.cpp
index b6431b56d5f0..c3efe72fe7db 100644
--- a/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.fail.cpp
+++ b/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.fail.cpp
@@ -14,5 +14,8 @@
// UNSUPPORTED: c++98, c++03, c++11
+// This test hangs during recursive template instantiation with libstdc++
+// UNSUPPORTED: libstdc++
+
#define _LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE
#include "make_integer_seq.fail.cpp"
diff --git a/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp b/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp
index 490fdf5d332b..ab8179c5ab4d 100644
--- a/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp
+++ b/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp
@@ -17,6 +17,7 @@
// };
#include <memory>
+#include <cstdint>
#include <cassert>
template <class T>
@@ -27,12 +28,12 @@ struct A
value_type* allocate(std::size_t n)
{
assert(n == 10);
- return (value_type*)0xDEADBEEF;
+ return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xDEADBEEF));
}
};
int main()
{
A<int> a;
- assert(std::allocator_traits<A<int> >::allocate(a, 10) == (int*)0xDEADBEEF);
+ assert(std::allocator_traits<A<int> >::allocate(a, 10) == reinterpret_cast<int*>(static_cast<std::uintptr_t>(0xDEADBEEF)));
}
diff --git a/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp b/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp
index 079db3526ac7..808284261f7d 100644
--- a/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp
+++ b/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp
@@ -17,8 +17,11 @@
// };
#include <memory>
+#include <cstdint>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
struct A
{
@@ -27,7 +30,7 @@ struct A
value_type* allocate(std::size_t n)
{
assert(n == 10);
- return (value_type*)0xDEADBEEF;
+ return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xDEADBEEF));
}
};
@@ -39,22 +42,22 @@ struct B
value_type* allocate(std::size_t n)
{
assert(n == 12);
- return (value_type*)0xEEADBEEF;
+ return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xEEADBEEF));
}
value_type* allocate(std::size_t n, const void* p)
{
assert(n == 11);
assert(p == 0);
- return (value_type*)0xFEADBEEF;
+ return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xFEADBEEF));
}
};
int main()
{
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
A<int> a;
- assert(std::allocator_traits<A<int> >::allocate(a, 10, nullptr) == (int*)0xDEADBEEF);
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+ assert(std::allocator_traits<A<int> >::allocate(a, 10, nullptr) == reinterpret_cast<int*>(static_cast<std::uintptr_t>(0xDEADBEEF)));
+#endif
B<int> b;
- assert(std::allocator_traits<B<int> >::allocate(b, 11, nullptr) == (int*)0xFEADBEEF);
+ assert(std::allocator_traits<B<int> >::allocate(b, 11, nullptr) == reinterpret_cast<int*>(static_cast<std::uintptr_t>(0xFEADBEEF)));
}
diff --git a/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp b/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp
index 634019758e70..46075f62c6c1 100644
--- a/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp
+++ b/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp
@@ -22,6 +22,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
struct A
{
@@ -36,14 +38,14 @@ struct B
{
typedef T value_type;
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#if TEST_STD_VER >= 11
template <class U, class ...Args>
void construct(U* p, Args&& ...args)
{
++b_construct;
::new ((void*)p) U(std::forward<Args>(args)...);
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif
};
struct A0
@@ -105,7 +107,7 @@ int main()
std::allocator_traits<A<int> >::construct(a, (A2*)&a2, 'd', 5);
assert(A2::count == 1);
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#if TEST_STD_VER >= 11
{
A0::count = 0;
b_construct = 0;
@@ -139,5 +141,5 @@ int main()
assert(A2::count == 1);
assert(b_construct == 1);
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif
}
diff --git a/test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp b/test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp
index b137dc6d36c3..8176d8b3767a 100644
--- a/test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp
+++ b/test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp
@@ -17,6 +17,7 @@
// };
#include <memory>
+#include <cstdint>
#include <cassert>
int called = 0;
@@ -28,7 +29,7 @@ struct A
void deallocate(value_type* p, std::size_t n)
{
- assert(p == (value_type*)0xDEADBEEF);
+ assert(p == reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xDEADBEEF)));
assert(n == 10);
++called;
}
@@ -37,6 +38,6 @@ struct A
int main()
{
A<int> a;
- std::allocator_traits<A<int> >::deallocate(a, (int*)0xDEADBEEF, 10);
+ std::allocator_traits<A<int> >::deallocate(a, reinterpret_cast<int*>(static_cast<std::uintptr_t>(0xDEADBEEF)), 10);
assert(called == 1);
}
diff --git a/test/std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp b/test/std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp
index 54726c929efe..2ee64b8b4a07 100644
--- a/test/std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp
+++ b/test/std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp
@@ -22,6 +22,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
struct A
{
@@ -63,7 +65,7 @@ int main()
std::allocator_traits<A<int> >::destroy(a, (A0*)&a0);
assert(A0::count == 1);
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
A0::count = 0;
b_destroy = 0;
@@ -76,5 +78,5 @@ int main()
assert(A0::count == 1);
assert(b_destroy == 1);
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif
}
diff --git a/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp b/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
index bbc6b470174d..d2c9a9826e14 100644
--- a/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
+++ b/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
@@ -43,7 +43,15 @@ struct B
int main()
{
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+ {
+ B<int> b;
+ assert(std::allocator_traits<B<int> >::max_size(b) == 100);
+ }
+ {
+ const B<int> b = {};
+ assert(std::allocator_traits<B<int> >::max_size(b) == 100);
+ }
+#if TEST_STD_VER >= 11
{
A<int> a;
assert(std::allocator_traits<A<int> >::max_size(a) ==
@@ -54,16 +62,6 @@ int main()
assert(std::allocator_traits<A<int> >::max_size(a) ==
std::numeric_limits<std::size_t>::max() / sizeof(int));
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
- {
- B<int> b;
- assert(std::allocator_traits<B<int> >::max_size(b) == 100);
- }
- {
- const B<int> b = {};
- assert(std::allocator_traits<B<int> >::max_size(b) == 100);
- }
-#if TEST_STD_VER >= 11
{
std::allocator<int> a;
static_assert(noexcept(std::allocator_traits<std::allocator<int>>::max_size(a)) == true, "");
diff --git a/test/std/utilities/memory/allocator.traits/allocator.traits.members/select_on_container_copy_construction.pass.cpp b/test/std/utilities/memory/allocator.traits/allocator.traits.members/select_on_container_copy_construction.pass.cpp
index 29fe2be126f3..2e9703037894 100644
--- a/test/std/utilities/memory/allocator.traits/allocator.traits.members/select_on_container_copy_construction.pass.cpp
+++ b/test/std/utilities/memory/allocator.traits/allocator.traits.members/select_on_container_copy_construction.pass.cpp
@@ -22,6 +22,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
struct A
{
@@ -55,7 +57,7 @@ int main()
const A<int> a(0);
assert(std::allocator_traits<A<int> >::select_on_container_copy_construction(a).id == 0);
}
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER >= 11
{
B<int> b;
assert(std::allocator_traits<B<int> >::select_on_container_copy_construction(b).id == 100);
@@ -64,5 +66,5 @@ int main()
const B<int> b(0);
assert(std::allocator_traits<B<int> >::select_on_container_copy_construction(b).id == 100);
}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif
}
diff --git a/test/std/utilities/memory/allocator.traits/rebind_traits.pass.cpp b/test/std/utilities/memory/allocator.traits/rebind_traits.pass.cpp
index 87da9a0a85da..af4f5bc3fb46 100644
--- a/test/std/utilities/memory/allocator.traits/rebind_traits.pass.cpp
+++ b/test/std/utilities/memory/allocator.traits/rebind_traits.pass.cpp
@@ -19,6 +19,8 @@
#include <memory>
#include <type_traits>
+#include "test_macros.h"
+
template <class T>
struct ReboundA {};
@@ -63,17 +65,17 @@ struct E
int main()
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#if TEST_STD_VER >= 11
static_assert((std::is_same<std::allocator_traits<A<char> >::rebind_traits<double>, std::allocator_traits<ReboundA<double> > >::value), "");
static_assert((std::is_same<std::allocator_traits<B<int, char> >::rebind_traits<double>, std::allocator_traits<ReboundB<double, char> > >::value), "");
static_assert((std::is_same<std::allocator_traits<C<char> >::rebind_traits<double>, std::allocator_traits<C<double> > >::value), "");
static_assert((std::is_same<std::allocator_traits<D<int, char> >::rebind_traits<double>, std::allocator_traits<D<double, char> > >::value), "");
static_assert((std::is_same<std::allocator_traits<E<char> >::rebind_traits<double>, std::allocator_traits<E<double> > >::value), "");
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else
static_assert((std::is_same<std::allocator_traits<A<char> >::rebind_traits<double>::other, std::allocator_traits<ReboundA<double> > >::value), "");
static_assert((std::is_same<std::allocator_traits<B<int, char> >::rebind_traits<double>::other, std::allocator_traits<ReboundB<double, char> > >::value), "");
static_assert((std::is_same<std::allocator_traits<C<char> >::rebind_traits<double>::other, std::allocator_traits<C<double> > >::value), "");
static_assert((std::is_same<std::allocator_traits<D<int, char> >::rebind_traits<double>::other, std::allocator_traits<D<double, char> > >::value), "");
static_assert((std::is_same<std::allocator_traits<E<char> >::rebind_traits<double>::other, std::allocator_traits<E<double> > >::value), "");
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif
}
diff --git a/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp b/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp
index bd32bc34e7a0..2831399c3047 100644
--- a/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp
+++ b/test/std/utilities/memory/allocator.uses/allocator.uses.trait/uses_allocator.pass.cpp
@@ -38,16 +38,38 @@ private:
typedef int allocator_type;
};
+template <bool Expected, class T, class A>
+void
+test()
+{
+ static_assert((std::uses_allocator<T, A>::value == Expected), "");
+#if TEST_STD_VER > 14
+ static_assert((std::uses_allocator_v<T, A> == Expected), "");
+#endif
+}
+
int main()
{
- static_assert((!std::uses_allocator<int, std::allocator<int> >::value), "");
- static_assert(( std::uses_allocator<std::vector<int>, std::allocator<int> >::value), "");
- static_assert((!std::uses_allocator<A, std::allocator<int> >::value), "");
- static_assert((!std::uses_allocator<B, std::allocator<int> >::value), "");
- static_assert(( std::uses_allocator<B, double>::value), "");
- static_assert((!std::uses_allocator<C, decltype(C::allocator_type)>::value), "");
- static_assert((!std::uses_allocator<D, decltype(D::allocator_type)>::value), "");
+ test<false, int, std::allocator<int> >();
+ test<true, std::vector<int>, std::allocator<int> >();
+ test<false, A, std::allocator<int> >();
+ test<false, B, std::allocator<int> >();
+ test<true, B, double>();
+ test<false, C, decltype(C::allocator_type)>();
+ test<false, D, decltype(D::allocator_type)>();
#if TEST_STD_VER >= 11
- static_assert((!std::uses_allocator<E, int>::value), "");
+ test<false, E, int>();
#endif
+
+
+// static_assert((!std::uses_allocator<int, std::allocator<int> >::value), "");
+// static_assert(( std::uses_allocator<std::vector<int>, std::allocator<int> >::value), "");
+// static_assert((!std::uses_allocator<A, std::allocator<int> >::value), "");
+// static_assert((!std::uses_allocator<B, std::allocator<int> >::value), "");
+// static_assert(( std::uses_allocator<B, double>::value), "");
+// static_assert((!std::uses_allocator<C, decltype(C::allocator_type)>::value), "");
+// static_assert((!std::uses_allocator<D, decltype(D::allocator_type)>::value), "");
+// #if TEST_STD_VER >= 11
+// static_assert((!std::uses_allocator<E, int>::value), "");
+// #endif
}
diff --git a/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
index dc0bdd047c61..768d41878437 100644
--- a/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
+++ b/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <memory>
// allocator:
@@ -16,6 +16,8 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
template <typename T>
void test_max(size_t count)
{
@@ -27,23 +29,19 @@ void test_max(size_t count)
}
}
-int main()
+template <typename T>
+void test()
{
- { // Bug 26812 -- allocating too large
- typedef double T;
- std::allocator<T> a;
- test_max<T> (a.max_size() + 1); // just barely too large
- test_max<T> (a.max_size() * 2); // significantly too large
- test_max<T> (((size_t) -1) / sizeof(T) + 1); // multiply will overflow
- test_max<T> ((size_t) -1); // way too large
- }
+ // Bug 26812 -- allocating too large
+ std::allocator<T> a;
+ test_max<T> (a.max_size() + 1); // just barely too large
+ test_max<T> (a.max_size() * 2); // significantly too large
+ test_max<T> (((size_t) -1) / sizeof(T) + 1); // multiply will overflow
+ test_max<T> ((size_t) -1); // way too large
+}
- {
- typedef const double T;
- std::allocator<T> a;
- test_max<T> (a.max_size() + 1); // just barely too large
- test_max<T> (a.max_size() * 2); // significantly too large
- test_max<T> (((size_t) -1) / sizeof(T) + 1); // multiply will overflow
- test_max<T> ((size_t) -1); // way too large
- }
+int main()
+{
+ test<double>();
+ LIBCPP_ONLY(test<const double>());
}
diff --git a/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp b/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
index cba32103dcd4..7f25e57765d4 100644
--- a/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
+++ b/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
@@ -32,6 +32,8 @@
#include <type_traits>
#include <cstddef>
+#include "test_macros.h"
+
int main()
{
static_assert((std::is_same<std::allocator<char>::size_type, std::size_t>::value), "");
@@ -45,7 +47,7 @@ int main()
std::allocator<int> >::value), "");
static_assert((std::is_same<std::allocator< char>::is_always_equal, std::true_type>::value), "");
- static_assert((std::is_same<std::allocator<const char>::is_always_equal, std::true_type>::value), "");
+ LIBCPP_STATIC_ASSERT((std::is_same<std::allocator<const char>::is_always_equal, std::true_type>::value), "");
std::allocator<char> a;
std::allocator<char> a2 = a;
diff --git a/test/std/utilities/memory/pointer.traits/rebind.pass.cpp b/test/std/utilities/memory/pointer.traits/rebind.pass.cpp
index 8716c05f3335..4caf4f650297 100644
--- a/test/std/utilities/memory/pointer.traits/rebind.pass.cpp
+++ b/test/std/utilities/memory/pointer.traits/rebind.pass.cpp
@@ -19,9 +19,11 @@
#include <memory>
#include <type_traits>
+#include "test_macros.h"
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#if TEST_STD_VER >= 11
static_assert((std::is_same<std::pointer_traits<int*>::rebind<double>, double*>::value), "");
#else
static_assert((std::is_same<std::pointer_traits<int*>::rebind<double>::other, double*>::value), "");
diff --git a/test/std/utilities/memory/specialized.algorithms/specialized.addressof/addressof.temp.fail.cpp b/test/std/utilities/memory/specialized.algorithms/specialized.addressof/addressof.temp.fail.cpp
new file mode 100644
index 000000000000..81f49eaac39b
--- /dev/null
+++ b/test/std/utilities/memory/specialized.algorithms/specialized.addressof/addressof.temp.fail.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// template <ObjectType T> T* addressof(T&& r) = delete;
+
+#include <memory>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main()
+{
+#if TEST_STD_VER > 14
+ const int *p = std::addressof<const int>(0);
+#else
+#error
+#endif
+}
diff --git a/test/std/utilities/memory/specialized.algorithms/specialized.addressof/constexpr_addressof.pass.cpp b/test/std/utilities/memory/specialized.algorithms/specialized.addressof/constexpr_addressof.pass.cpp
index a371f8eda1a8..41f06c519609 100644
--- a/test/std/utilities/memory/specialized.algorithms/specialized.addressof/constexpr_addressof.pass.cpp
+++ b/test/std/utilities/memory/specialized.algorithms/specialized.addressof/constexpr_addressof.pass.cpp
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
-// XFAIL: gcc
+// XFAIL: gcc-4, gcc-5, gcc-6
// <memory>
diff --git a/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy.pass.cpp b/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy.pass.cpp
new file mode 100644
index 000000000000..2ad9d04e59b7
--- /dev/null
+++ b/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <memory>
+
+// template <class ForwardIt>
+// void destroy(ForwardIt, ForwardIt);
+
+#include <memory>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+
+struct Counted {
+ static int count;
+ static void reset() { count = 0; }
+ Counted() { ++count; }
+ Counted(Counted const&) { ++count; }
+ ~Counted() { --count; }
+ friend void operator&(Counted) = delete;
+};
+int Counted::count = 0;
+
+int main()
+{
+ using It = forward_iterator<Counted*>;
+ const int N = 5;
+ alignas(Counted) char pool[sizeof(Counted)*N] = {};
+ Counted* p = (Counted*)pool;
+ std::uninitialized_fill(p, p+N, Counted());
+ assert(Counted::count == 5);
+ std::destroy(p, p+1);
+ p += 1;
+ assert(Counted::count == 4);
+ std::destroy(It(p), It(p + 4));
+ assert(Counted::count == 0);
+}
diff --git a/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_at.pass.cpp b/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_at.pass.cpp
new file mode 100644
index 000000000000..4e67b1eceb57
--- /dev/null
+++ b/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_at.pass.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <memory>
+
+// template <class _Tp>
+// void destroy_at(_Tp*);
+
+#include <memory>
+#include <cstdlib>
+#include <cassert>
+
+struct Counted {
+ static int count;
+ static void reset() { count = 0; }
+ Counted() { ++count; }
+ Counted(Counted const&) { ++count; }
+ ~Counted() { --count; }
+ friend void operator&(Counted) = delete;
+};
+int Counted::count = 0;
+
+struct VCounted {
+ static int count;
+ static void reset() { count = 0; }
+ VCounted() { ++count; }
+ VCounted(VCounted const&) { ++count; }
+ virtual ~VCounted() { --count; }
+ friend void operator&(VCounted) = delete;
+};
+int VCounted::count = 0;
+
+struct DCounted : VCounted {
+ friend void operator&(DCounted) = delete;
+};
+
+int main()
+{
+ {
+ void* mem1 = std::malloc(sizeof(Counted));
+ void* mem2 = std::malloc(sizeof(Counted));
+ assert(mem1 && mem2);
+ assert(Counted::count == 0);
+ Counted* ptr1 = ::new(mem1) Counted();
+ Counted* ptr2 = ::new(mem2) Counted();
+ assert(Counted::count == 2);
+ std::destroy_at(ptr1);
+ assert(Counted::count == 1);
+ std::destroy_at(ptr2);
+ assert(Counted::count == 0);
+ std::free(mem1);
+ std::free(mem2);
+ }
+ {
+ void* mem1 = std::malloc(sizeof(DCounted));
+ void* mem2 = std::malloc(sizeof(DCounted));
+ assert(mem1 && mem2);
+ assert(DCounted::count == 0);
+ DCounted* ptr1 = ::new(mem1) DCounted();
+ DCounted* ptr2 = ::new(mem2) DCounted();
+ assert(DCounted::count == 2);
+ assert(VCounted::count == 2);
+ std::destroy_at(ptr1);
+ assert(VCounted::count == 1);
+ std::destroy_at(ptr2);
+ assert(VCounted::count == 0);
+ std::free(mem1);
+ std::free(mem2);
+ }
+}
diff --git a/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_n.pass.cpp b/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_n.pass.cpp
new file mode 100644
index 000000000000..d1eaca558a73
--- /dev/null
+++ b/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_n.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <memory>
+
+// template <class ForwardIt, class Size>
+// ForwardIt destroy_n(ForwardIt, Size s);
+
+#include <memory>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+
+struct Counted {
+ static int count;
+ static void reset() { count = 0; }
+ Counted() { ++count; }
+ Counted(Counted const&) { ++count; }
+ ~Counted() { --count; }
+ friend void operator&(Counted) = delete;
+};
+int Counted::count = 0;
+
+int main()
+{
+ using It = forward_iterator<Counted*>;
+ const int N = 5;
+ alignas(Counted) char pool[sizeof(Counted)*N] = {};
+ Counted* p = (Counted*)pool;
+ std::uninitialized_fill(p, p+N, Counted());
+ assert(Counted::count == 5);
+ Counted* np = std::destroy_n(p, 1);
+ assert(np == p+1);
+ assert(Counted::count == 4);
+ p += 1;
+ It it = std::destroy_n(It(p), 4);
+ assert(it == It(p+4));
+ assert(Counted::count == 0);
+}
diff --git a/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/uninitialized_default_construct.pass.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/uninitialized_default_construct.pass.cpp
new file mode 100644
index 000000000000..533d516707e1
--- /dev/null
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/uninitialized_default_construct.pass.cpp
@@ -0,0 +1,112 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <memory>
+
+// template <class ForwardIt>
+// void uninitialized_default_construct(ForwardIt, ForwardIt);
+
+#include <memory>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+
+struct Counted {
+ static int count;
+ static int constructed;
+ static void reset() { count = constructed = 0; }
+ explicit Counted() { ++count; ++constructed; }
+ Counted(Counted const&) { assert(false); }
+ ~Counted() { --count; }
+ friend void operator&(Counted) = delete;
+};
+int Counted::count = 0;
+int Counted::constructed = 0;
+
+
+struct ThrowsCounted {
+ static int count;
+ static int constructed;
+ static int throw_after;
+ static void reset() { throw_after = count = constructed = 0; }
+ explicit ThrowsCounted() {
+ ++constructed;
+ if (throw_after > 0 && --throw_after == 0) {
+ TEST_THROW(1);
+ }
+ ++count;
+ }
+ ThrowsCounted(ThrowsCounted const&) { assert(false); }
+ ~ThrowsCounted() { assert(count > 0); --count; }
+ friend void operator&(ThrowsCounted) = delete;
+};
+int ThrowsCounted::count = 0;
+int ThrowsCounted::constructed = 0;
+int ThrowsCounted::throw_after = 0;
+
+
+void test_ctor_throws()
+{
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using It = forward_iterator<ThrowsCounted*>;
+ const int N = 5;
+ alignas(ThrowsCounted) char pool[sizeof(ThrowsCounted)*N] = {};
+ ThrowsCounted* p = (ThrowsCounted*)pool;
+ try {
+ ThrowsCounted::throw_after = 4;
+ std::uninitialized_default_construct(It(p), It(p+N));
+ assert(false);
+ } catch (...) {}
+ assert(ThrowsCounted::count == 0);
+ assert(ThrowsCounted::constructed == 4); // forth construction throws
+#endif
+}
+
+void test_counted()
+{
+ using It = forward_iterator<Counted*>;
+ const int N = 5;
+ alignas(Counted) char pool[sizeof(Counted)*N] = {};
+ Counted* p = (Counted*)pool;
+ std::uninitialized_default_construct(It(p), It(p+1));
+ assert(Counted::count == 1);
+ assert(Counted::constructed = 1);
+ std::uninitialized_default_construct(It(p+1), It(p+N));
+ assert(Counted::count == 5);
+ assert(Counted::constructed == 5);
+ std::destroy(p, p+N);
+ assert(Counted::count == 0);
+}
+
+void test_value_initialized()
+{
+ using It = forward_iterator<int*>;
+ const int N = 5;
+ int pool[N] = {-1, -1, -1, -1, -1};
+ int* p = pool;
+ std::uninitialized_default_construct(It(p), It(p+1));
+ assert(pool[0] == -1);
+ assert(pool[1] == -1);
+ std::uninitialized_default_construct(It(p+1), It(p+N));
+ assert(pool[1] == -1);
+ assert(pool[2] == -1);
+ assert(pool[3] == -1);
+ assert(pool[4] == -1);
+}
+
+int main()
+{
+ test_counted();
+ test_value_initialized();
+ test_ctor_throws();
+}
diff --git a/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/uninitialized_default_construct_n.pass.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/uninitialized_default_construct_n.pass.cpp
new file mode 100644
index 000000000000..f22a74f1f832
--- /dev/null
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/uninitialized_default_construct_n.pass.cpp
@@ -0,0 +1,116 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <memory>
+
+// template <class ForwardIt>
+// void uninitialized_default_construct(ForwardIt, ForwardIt);
+
+#include <memory>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+
+struct Counted {
+ static int count;
+ static int constructed;
+ static void reset() { count = constructed = 0; }
+ explicit Counted() { ++count; ++constructed; }
+ Counted(Counted const&) { assert(false); }
+ ~Counted() { assert(count > 0); --count; }
+ friend void operator&(Counted) = delete;
+};
+int Counted::count = 0;
+int Counted::constructed = 0;
+
+
+struct ThrowsCounted {
+ static int count;
+ static int constructed;
+ static int throw_after;
+ static void reset() { throw_after = count = constructed = 0; }
+ explicit ThrowsCounted() {
+ ++constructed;
+ if (throw_after > 0 && --throw_after == 0) {
+ TEST_THROW(1);
+ }
+ ++count;
+ }
+ ThrowsCounted(ThrowsCounted const&) { assert(false); }
+ ~ThrowsCounted() { assert(count > 0); --count; }
+ friend void operator&(ThrowsCounted) = delete;
+};
+int ThrowsCounted::count = 0;
+int ThrowsCounted::constructed = 0;
+int ThrowsCounted::throw_after = 0;
+
+void test_ctor_throws()
+{
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using It = forward_iterator<ThrowsCounted*>;
+ const int N = 5;
+ alignas(ThrowsCounted) char pool[sizeof(ThrowsCounted)*N] = {};
+ ThrowsCounted* p = (ThrowsCounted*)pool;
+ try {
+ ThrowsCounted::throw_after = 4;
+ std::uninitialized_default_construct_n(It(p), N);
+ assert(false);
+ } catch (...) {}
+ assert(ThrowsCounted::count == 0);
+ assert(ThrowsCounted::constructed == 4); // forth construction throws
+#endif
+}
+
+void test_counted()
+{
+ using It = forward_iterator<Counted*>;
+ const int N = 5;
+ alignas(Counted) char pool[sizeof(Counted)*N] = {};
+ Counted* p = (Counted*)pool;
+ It e = std::uninitialized_default_construct_n(It(p), 1);
+ assert(e == It(p+1));
+ assert(Counted::count == 1);
+ assert(Counted::constructed = 1);
+ e = std::uninitialized_default_construct_n(It(p+1), 4);
+ assert(e == It(p+N));
+ assert(Counted::count == 5);
+ assert(Counted::constructed == 5);
+ std::destroy(p, p+N);
+ assert(Counted::count == 0);
+}
+
+void test_value_initialized()
+{
+ using It = forward_iterator<int*>;
+ const int N = 5;
+ int pool[N] = {-1, -1, -1, -1, -1};
+ int* p = pool;
+ auto e = std::uninitialized_default_construct_n(It(p), 1);
+ assert(e == It(p+1));
+ assert(pool[0] == -1);
+ assert(pool[1] == -1);
+ e = std::uninitialized_default_construct_n(It(p+1), 4);
+ assert(e == It(p+N));
+ assert(pool[1] == -1);
+ assert(pool[2] == -1);
+ assert(pool[3] == -1);
+ assert(pool[4] == -1);
+}
+
+
+int main()
+{
+ test_counted();
+ test_value_initialized();
+ test_ctor_throws();
+}
diff --git a/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct.pass.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct.pass.cpp
new file mode 100644
index 000000000000..c2d860694a75
--- /dev/null
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct.pass.cpp
@@ -0,0 +1,111 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <memory>
+
+// template <class ForwardIt>
+// void uninitialized_value_construct(ForwardIt, ForwardIt);
+
+#include <memory>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+
+struct Counted {
+ static int count;
+ static int constructed;
+ static void reset() { count = constructed = 0; }
+ explicit Counted() { ++count; ++constructed; }
+ Counted(Counted const&) { assert(false); }
+ ~Counted() { assert(count > 0); --count; }
+ friend void operator&(Counted) = delete;
+};
+int Counted::count = 0;
+int Counted::constructed = 0;
+
+
+struct ThrowsCounted {
+ static int count;
+ static int constructed;
+ static int throw_after;
+ static void reset() { throw_after = count = constructed = 0; }
+ explicit ThrowsCounted() {
+ ++constructed;
+ if (throw_after > 0 && --throw_after == 0) {
+ TEST_THROW(1);
+ }
+ ++count;
+ }
+ ThrowsCounted(ThrowsCounted const&) { assert(false); }
+ ~ThrowsCounted() { assert(count > 0); --count; }
+ friend void operator&(ThrowsCounted) = delete;
+};
+int ThrowsCounted::count = 0;
+int ThrowsCounted::constructed = 0;
+int ThrowsCounted::throw_after = 0;
+
+void test_ctor_throws()
+{
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using It = forward_iterator<ThrowsCounted*>;
+ const int N = 5;
+ alignas(ThrowsCounted) char pool[sizeof(ThrowsCounted)*N] = {};
+ ThrowsCounted* p = (ThrowsCounted*)pool;
+ try {
+ ThrowsCounted::throw_after = 4;
+ std::uninitialized_value_construct(It(p), It(p+N));
+ assert(false);
+ } catch (...) {}
+ assert(ThrowsCounted::count == 0);
+ assert(ThrowsCounted::constructed == 4); // forth construction throws
+#endif
+}
+
+void test_counted()
+{
+ using It = forward_iterator<Counted*>;
+ const int N = 5;
+ alignas(Counted) char pool[sizeof(Counted)*N] = {};
+ Counted* p = (Counted*)pool;
+ std::uninitialized_value_construct(It(p), It(p+1));
+ assert(Counted::count == 1);
+ assert(Counted::constructed = 1);
+ std::uninitialized_value_construct(It(p+1), It(p+N));
+ assert(Counted::count == 5);
+ assert(Counted::constructed == 5);
+ std::destroy(p, p+N);
+ assert(Counted::count == 0);
+}
+
+void test_value_initialized()
+{
+ using It = forward_iterator<int*>;
+ const int N = 5;
+ int pool[N] = {-1, -1, -1, -1, -1};
+ int* p = pool;
+ std::uninitialized_value_construct(It(p), It(p+1));
+ assert(pool[0] == 0);
+ assert(pool[1] == -1);
+ std::uninitialized_value_construct(It(p+1), It(p+N));
+ assert(pool[1] == 0);
+ assert(pool[2] == 0);
+ assert(pool[3] == 0);
+ assert(pool[4] == 0);
+}
+
+int main()
+{
+ test_counted();
+ test_value_initialized();
+ test_ctor_throws();
+}
diff --git a/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct_n.pass.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct_n.pass.cpp
new file mode 100644
index 000000000000..323d00f7c9c4
--- /dev/null
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct_n.pass.cpp
@@ -0,0 +1,115 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <memory>
+
+// template <class ForwardIt>
+// void uninitialized_value_construct(ForwardIt, ForwardIt);
+
+#include <memory>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+
+struct Counted {
+ static int count;
+ static int constructed;
+ static void reset() { count = constructed = 0; }
+ explicit Counted() { ++count; ++constructed; }
+ Counted(Counted const&) { assert(false); }
+ ~Counted() { --count; }
+ friend void operator&(Counted) = delete;
+};
+int Counted::count = 0;
+int Counted::constructed = 0;
+
+struct ThrowsCounted {
+ static int count;
+ static int constructed;
+ static int throw_after;
+ static void reset() { throw_after = count = constructed = 0; }
+ explicit ThrowsCounted() {
+ ++constructed;
+ if (throw_after > 0 && --throw_after == 0) {
+ TEST_THROW(1);
+ }
+ ++count;
+ }
+ ThrowsCounted(ThrowsCounted const&) { assert(false); }
+ ~ThrowsCounted() { --count; }
+ friend void operator&(ThrowsCounted) = delete;
+};
+int ThrowsCounted::count = 0;
+int ThrowsCounted::constructed = 0;
+int ThrowsCounted::throw_after = 0;
+
+void test_ctor_throws()
+{
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using It = forward_iterator<ThrowsCounted*>;
+ const int N = 5;
+ alignas(ThrowsCounted) char pool[sizeof(ThrowsCounted)*N] = {};
+ ThrowsCounted* p = (ThrowsCounted*)pool;
+ try {
+ ThrowsCounted::throw_after = 4;
+ std::uninitialized_value_construct_n(It(p), N);
+ assert(false);
+ } catch (...) {}
+ assert(ThrowsCounted::count == 3);
+ assert(ThrowsCounted::constructed == 4); // forth construction throws
+ std::destroy(p, p+3);
+ assert(ThrowsCounted::count == 0);
+#endif
+}
+
+void test_counted()
+{
+ using It = forward_iterator<Counted*>;
+ const int N = 5;
+ alignas(Counted) char pool[sizeof(Counted)*N] = {};
+ Counted* p = (Counted*)pool;
+ It e = std::uninitialized_value_construct_n(It(p), 1);
+ assert(e == It(p+1));
+ assert(Counted::count == 1);
+ assert(Counted::constructed = 1);
+ e = std::uninitialized_value_construct_n(It(p+1), 4);
+ assert(e == It(p+N));
+ assert(Counted::count == 5);
+ assert(Counted::constructed == 5);
+ std::destroy(p, p+N);
+ assert(Counted::count == 0);
+}
+
+void test_value_initialized()
+{
+ using It = forward_iterator<int*>;
+ const int N = 5;
+ int pool[N] = {-1, -1, -1, -1, -1};
+ int* p = pool;
+ It e = std::uninitialized_value_construct_n(It(p), 1);
+ assert(e == It(p+1));
+ assert(pool[0] == 0);
+ assert(pool[1] == -1);
+ e = std::uninitialized_value_construct_n(It(p+1), 4);
+ assert(e == It(p+N));
+ assert(pool[1] == 0);
+ assert(pool[2] == 0);
+ assert(pool[3] == 0);
+ assert(pool[4] == 0);
+}
+
+int main()
+{
+ test_counted();
+ test_value_initialized();
+} \ No newline at end of file
diff --git a/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp
index 1debd6d75ff0..1829dff354d3 100644
--- a/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <memory>
// template <class InputIterator, class ForwardIterator>
@@ -18,13 +17,21 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
struct B
{
static int count_;
static int population_;
int data_;
explicit B() : data_(1) { ++population_; }
- B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; }
+ B(const B &b) {
+ ++count_;
+ if (count_ == 3)
+ TEST_THROW(1);
+ data_ = b.data_;
+ ++population_;
+ }
~B() {data_ = 0; --population_; }
};
@@ -49,6 +56,7 @@ int main()
B* bp = (B*)pool;
B b[N];
assert(B::population_ == N);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
std::uninitialized_copy(b, b+N, bp);
@@ -58,6 +66,7 @@ int main()
{
assert(B::population_ == N);
}
+#endif
B::count_ = 0;
std::uninitialized_copy(b, b+2, bp);
for (int i = 0; i < 2; ++i)
diff --git a/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp
index 83aa19471ada..af20cd220291 100644
--- a/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <memory>
// template <class InputIterator, class Size, class ForwardIterator>
@@ -18,13 +17,21 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
struct B
{
static int count_;
static int population_;
int data_;
explicit B() : data_(1) { ++population_; }
- B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; }
+ B(const B &b) {
+ ++count_;
+ if (count_ == 3)
+ TEST_THROW(1);
+ data_ = b.data_;
+ ++population_;
+ }
~B() {data_ = 0; --population_; }
};
@@ -49,6 +56,7 @@ int main()
B* bp = (B*)pool;
B b[N];
assert(B::population_ == N);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
std::uninitialized_copy_n(b, 5, bp);
@@ -58,6 +66,7 @@ int main()
{
assert(B::population_ == N);
}
+#endif
B::count_ = 0;
std::uninitialized_copy_n(b, 2, bp);
for (int i = 0; i < 2; ++i)
diff --git a/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp
index 5f90a3792064..862e5be8e363 100644
--- a/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <memory>
// template <class ForwardIterator, class Size, class T>
@@ -17,13 +16,21 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
struct B
{
static int count_;
static int population_;
int data_;
explicit B() : data_(1) { ++population_; }
- B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; }
+ B(const B &b) {
+ ++count_;
+ if (count_ == 3)
+ TEST_THROW(1);
+ data_ = b.data_;
+ ++population_;
+ }
~B() {data_ = 0; --population_; }
};
@@ -47,6 +54,7 @@ int main()
char pool[sizeof(B)*N] = {0};
B* bp = (B*)pool;
assert(B::population_ == 0);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
std::uninitialized_fill_n(bp, 5, B());
@@ -56,6 +64,7 @@ int main()
{
assert(B::population_ == 0);
}
+#endif
B::count_ = 0;
B* r = std::uninitialized_fill_n(bp, 2, B());
assert(r == bp + 2);
diff --git a/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp
index 3816a2528688..57438e9cb0d5 100644
--- a/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <memory>
// template <class ForwardIterator, class T>
@@ -18,13 +17,21 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
struct B
{
static int count_;
static int population_;
int data_;
explicit B() : data_(1) { ++population_; }
- B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; }
+ B(const B &b) {
+ ++count_;
+ if (count_ == 3)
+ TEST_THROW(1);
+ data_ = b.data_;
+ ++population_;
+ }
~B() {data_ = 0; --population_; }
};
@@ -48,6 +55,7 @@ int main()
char pool[sizeof(B)*N] = {0};
B* bp = (B*)pool;
assert(B::population_ == 0);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
std::uninitialized_fill(bp, bp+N, B());
@@ -57,6 +65,7 @@ int main()
{
assert(B::population_ == 0);
}
+#endif
B::count_ = 0;
std::uninitialized_fill(bp, bp+2, B());
for (int i = 0; i < 2; ++i)
diff --git a/test/std/utilities/memory/specialized.algorithms/uninitialized.move/uninitialized_move.pass.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized.move/uninitialized_move.pass.cpp
new file mode 100644
index 000000000000..d7a9542b4c27
--- /dev/null
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized.move/uninitialized_move.pass.cpp
@@ -0,0 +1,114 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <memory>
+
+// template <class InputIt, class ForwardIt>
+// ForwardIt uninitialized_move(InputIt, InputIt, ForwardIt);
+
+#include <memory>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+
+struct Counted {
+ static int count;
+ static int constructed;
+ static void reset() { count = constructed = 0; }
+ explicit Counted(int&& x) : value(x) { x = 0; ++count; ++constructed; }
+ Counted(Counted const&) { assert(false); }
+ ~Counted() { assert(count > 0); --count; }
+ friend void operator&(Counted) = delete;
+ int value;
+};
+int Counted::count = 0;
+int Counted::constructed = 0;
+
+struct ThrowsCounted {
+ static int count;
+ static int constructed;
+ static int throw_after;
+ static void reset() { throw_after = count = constructed = 0; }
+ explicit ThrowsCounted(int&& x) {
+ ++constructed;
+ if (throw_after > 0 && --throw_after == 0) {
+ TEST_THROW(1);
+ }
+ ++count;
+ x = 0;
+ }
+ ThrowsCounted(ThrowsCounted const&) { assert(false); }
+ ~ThrowsCounted() { assert(count > 0); --count; }
+ friend void operator&(ThrowsCounted) = delete;
+};
+int ThrowsCounted::count = 0;
+int ThrowsCounted::constructed = 0;
+int ThrowsCounted::throw_after = 0;
+
+void test_ctor_throws()
+{
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using It = forward_iterator<ThrowsCounted*>;
+ const int N = 5;
+ int values[N] = {1, 2, 3, 4, 5};
+ alignas(ThrowsCounted) char pool[sizeof(ThrowsCounted)*N] = {};
+ ThrowsCounted* p = (ThrowsCounted*)pool;
+ try {
+ ThrowsCounted::throw_after = 4;
+ std::uninitialized_move(values, values + N, It(p));
+ assert(false);
+ } catch (...) {}
+ assert(ThrowsCounted::count == 0);
+ assert(ThrowsCounted::constructed == 4); // forth construction throws
+ assert(values[0] == 0);
+ assert(values[1] == 0);
+ assert(values[2] == 0);
+ assert(values[3] == 4);
+ assert(values[4] == 5);
+#endif
+}
+
+void test_counted()
+{
+ using It = input_iterator<int*>;
+ using FIt = forward_iterator<Counted*>;
+ const int N = 5;
+ int values[N] = {1, 2, 3, 4, 5};
+ alignas(Counted) char pool[sizeof(Counted)*N] = {};
+ Counted* p = (Counted*)pool;
+ auto ret = std::uninitialized_move(It(values), It(values + 1), FIt(p));
+ assert(ret == FIt(p +1));
+ assert(Counted::constructed = 1);
+ assert(Counted::count == 1);
+ assert(p[0].value == 1);
+ assert(values[0] == 0);
+ ret = std::uninitialized_move(It(values+1), It(values+N), FIt(p+1));
+ assert(ret == FIt(p + N));
+ assert(Counted::count == 5);
+ assert(Counted::constructed == 5);
+ assert(p[1].value == 2);
+ assert(p[2].value == 3);
+ assert(p[3].value == 4);
+ assert(p[4].value == 5);
+ assert(values[1] == 0);
+ assert(values[2] == 0);
+ assert(values[3] == 0);
+ assert(values[4] == 0);
+ std::destroy(p, p+N);
+ assert(Counted::count == 0);
+}
+
+int main() {
+ test_counted();
+ test_ctor_throws();
+} \ No newline at end of file
diff --git a/test/std/utilities/memory/specialized.algorithms/uninitialized.move/uninitialized_move_n.pass.cpp b/test/std/utilities/memory/specialized.algorithms/uninitialized.move/uninitialized_move_n.pass.cpp
new file mode 100644
index 000000000000..f27e5726135f
--- /dev/null
+++ b/test/std/utilities/memory/specialized.algorithms/uninitialized.move/uninitialized_move_n.pass.cpp
@@ -0,0 +1,117 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <memory>
+
+// template <class InputIt, class Size, class ForwardIt>
+// pair<InputIt, ForwardIt> uninitialized_move_n(InputIt, Size, ForwardIt);
+
+#include <memory>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+
+struct Counted {
+ static int count;
+ static int constructed;
+ static void reset() { count = constructed = 0; }
+ explicit Counted(int&& x) : value(x) { x = 0; ++count; ++constructed; }
+ Counted(Counted const&) { assert(false); }
+ ~Counted() { assert(count > 0); --count; }
+ friend void operator&(Counted) = delete;
+ int value;
+};
+int Counted::count = 0;
+int Counted::constructed = 0;
+
+struct ThrowsCounted {
+ static int count;
+ static int constructed;
+ static int throw_after;
+ static void reset() { throw_after = count = constructed = 0; }
+ explicit ThrowsCounted(int&& x) {
+ ++constructed;
+ if (throw_after > 0 && --throw_after == 0) {
+ TEST_THROW(1);
+ }
+ ++count;
+ x = 0;
+ }
+ ThrowsCounted(ThrowsCounted const&) { assert(false); }
+ ~ThrowsCounted() { assert(count > 0); --count; }
+ friend void operator&(ThrowsCounted) = delete;
+};
+int ThrowsCounted::count = 0;
+int ThrowsCounted::constructed = 0;
+int ThrowsCounted::throw_after = 0;
+
+void test_ctor_throws()
+{
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using It = forward_iterator<ThrowsCounted*>;
+ const int N = 5;
+ int values[N] = {1, 2, 3, 4, 5};
+ alignas(ThrowsCounted) char pool[sizeof(ThrowsCounted)*N] = {};
+ ThrowsCounted* p = (ThrowsCounted*)pool;
+ try {
+ ThrowsCounted::throw_after = 4;
+ std::uninitialized_move_n(values, N, It(p));
+ assert(false);
+ } catch (...) {}
+ assert(ThrowsCounted::count == 0);
+ assert(ThrowsCounted::constructed == 4); // forth construction throws
+ assert(values[0] == 0);
+ assert(values[1] == 0);
+ assert(values[2] == 0);
+ assert(values[3] == 4);
+ assert(values[4] == 5);
+#endif
+}
+
+void test_counted()
+{
+ using It = input_iterator<int*>;
+ using FIt = forward_iterator<Counted*>;
+ const int N = 5;
+ int values[N] = {1, 2, 3, 4, 5};
+ alignas(Counted) char pool[sizeof(Counted)*N] = {};
+ Counted* p = (Counted*)pool;
+ auto ret = std::uninitialized_move_n(It(values), 1, FIt(p));
+ assert(ret.first == It(values +1));
+ assert(ret.second == FIt(p +1));
+ assert(Counted::constructed = 1);
+ assert(Counted::count == 1);
+ assert(p[0].value == 1);
+ assert(values[0] == 0);
+ ret = std::uninitialized_move_n(It(values+1), N-1, FIt(p+1));
+ assert(ret.first == It(values+N));
+ assert(ret.second == FIt(p + N));
+ assert(Counted::count == 5);
+ assert(Counted::constructed == 5);
+ assert(p[1].value == 2);
+ assert(p[2].value == 3);
+ assert(p[3].value == 4);
+ assert(p[4].value == 5);
+ assert(values[1] == 0);
+ assert(values[2] == 0);
+ assert(values[3] == 0);
+ assert(values[4] == 0);
+ std::destroy(p, p+N);
+ assert(Counted::count == 0);
+}
+
+int main()
+{
+ test_counted();
+ test_ctor_throws();
+} \ No newline at end of file
diff --git a/test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp b/test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp
index 914802423ce7..3df8dd0eded0 100644
--- a/test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp
+++ b/test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp
@@ -13,6 +13,7 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
#include <MoveOnly.h>
int A_constructed = 0;
@@ -46,7 +47,7 @@ int main()
assert(A_constructed == i+1);
}
}
-#if _LIBCPP_STD_VER >= 14
+#if TEST_STD_VER >= 14
{
typedef MoveOnly S;
typedef std::aligned_storage<3*sizeof(S), std::alignment_of<S>::value>::type
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp
index a611b1a12f05..2949d6310c59 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp
@@ -24,4 +24,5 @@ int main()
{
std::default_delete<int[]> d1;
std::default_delete<const int[]> d2 = d1;
+ ((void)d2);
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp
index 6d752b9951a5..50389978e8ab 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp
@@ -16,6 +16,8 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
class Deleter
{
int state_;
@@ -36,9 +38,18 @@ int main()
Deleter d;
assert(d.state() == 0);
{
+ std::unique_ptr<int[], Deleter&> p(nullptr, d);
+ assert(p.get() == 0);
+ assert(&p.get_deleter() == &d);
+ }
+#if defined(_LIBCPP_VERSION)
+ {
+ // The standard only requires the constructor accept nullptr, but libc++
+ // also supports the literal 0.
std::unique_ptr<int[], Deleter&> p(0, d);
assert(p.get() == 0);
assert(&p.get_deleter() == &d);
}
+#endif
assert(d.state() == 0);
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp
index 5720d3bd288f..89b6fa248845 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp
@@ -38,7 +38,7 @@ source1()
return std::unique_ptr<A[]>(new A[3]);
}
-void sink1(std::unique_ptr<A[]> p)
+void sink1(std::unique_ptr<A[]>)
{
}
@@ -48,7 +48,7 @@ source2()
return std::unique_ptr<A[], Deleter<A[]> >(new A[3]);
}
-void sink2(std::unique_ptr<A[], Deleter<A[]> > p)
+void sink2(std::unique_ptr<A[], Deleter<A[]> >)
{
}
@@ -59,7 +59,7 @@ source3()
return std::unique_ptr<A[], NCDeleter<A[]>&>(new A[3], d);
}
-void sink3(std::unique_ptr<A[], NCDeleter<A[]>&> p)
+void sink3(std::unique_ptr<A[], NCDeleter<A[]>&>)
{
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp
index 2b0b5f0d945d..3de556563f97 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp
@@ -42,7 +42,9 @@ int main()
assert(A::count == 0);
{ // LWG#2520 says that nullptr is a valid input as well as null
+#ifdef _LIBCPP_VERSION
std::unique_ptr<A[], Deleter<A[]> > s1(NULL, Deleter<A[]>());
+#endif
std::unique_ptr<A[], Deleter<A[]> > s2(nullptr, Deleter<A[]>());
}
assert(A::count == 0);
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp
index e14bba0763c5..016eadcb2460 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// unique_ptr
@@ -46,17 +48,10 @@ template <class T>
class Deleter
{
int state_;
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Deleter(const Deleter&);
Deleter& operator=(const Deleter&);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- Deleter(Deleter&);
- Deleter& operator=(Deleter&);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
public:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;}
Deleter& operator=(Deleter&& r)
{
@@ -64,20 +59,9 @@ public:
r.state_ = 0;
return *this;
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- operator std::__rv<Deleter>() {return std::__rv<Deleter>(*this);}
- Deleter(std::__rv<Deleter> r) : state_(r->state_) {r->state_ = 0;}
- Deleter& operator=(std::__rv<Deleter> r)
- {
- state_ = r->state_;
- r->state_ = 0;
- return *this;
- }
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Deleter() : state_(5) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class U>
Deleter(Deleter<U>&& d,
typename std::enable_if<!std::is_same<U, T>::value>::type* = 0)
@@ -87,12 +71,7 @@ private:
template <class U>
Deleter(const Deleter<U>& d,
typename std::enable_if<!std::is_same<U, T>::value>::type* = 0);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class U>
- Deleter(Deleter<U> d,
- typename std::enable_if<!std::is_same<U, T>::value>::type* = 0)
- : state_(d.state()) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
public:
int state() const {return state_;}
void set_state(int i) {state_ = i;}
@@ -102,17 +81,6 @@ public:
int main()
{
- {
- const std::unique_ptr<B, Deleter<B> > s(new B);
- A* p = s.get();
- std::unique_ptr<A, Deleter<A> > s2(s);
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(B::count == 1);
- assert(s2.get_deleter().state() == 5);
- assert(s.get_deleter().state() == 0);
- }
- assert(A::count == 0);
- assert(B::count == 0);
+ const std::unique_ptr<B, Deleter<B> > s;
+ std::unique_ptr<A, Deleter<A> > s2(s); // expected-error {{no matching constructor}}
}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp
index bcf94a978144..1b8bb736df20 100644
--- a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// unique_ptr
@@ -47,16 +49,9 @@ class Deleter
{
int state_;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Deleter(const Deleter&);
Deleter& operator=(const Deleter&);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- Deleter(Deleter&);
- Deleter& operator=(Deleter&);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
public:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;}
Deleter& operator=(Deleter&& r)
{
@@ -64,20 +59,9 @@ public:
r.state_ = 0;
return *this;
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- operator std::__rv<Deleter>() {return std::__rv<Deleter>(*this);}
- Deleter(std::__rv<Deleter> r) : state_(r->state_) {r->state_ = 0;}
- Deleter& operator=(std::__rv<Deleter> r)
- {
- state_ = r->state_;
- r->state_ = 0;
- return *this;
- }
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Deleter() : state_(5) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class U>
Deleter(Deleter<U>&& d,
typename std::enable_if<!std::is_same<U, T>::value>::type* = 0)
@@ -87,12 +71,7 @@ private:
template <class U>
Deleter(const Deleter<U>& d,
typename std::enable_if<!std::is_same<U, T>::value>::type* = 0);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class U>
- Deleter(Deleter<U> d,
- typename std::enable_if<!std::is_same<U, T>::value>::type* = 0)
- : state_(d.state()) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
public:
int state() const {return state_;}
void set_state(int i) {state_ = i;}
@@ -102,17 +81,6 @@ public:
int main()
{
- {
- const std::unique_ptr<B, Deleter<B> > s(new B);
- A* p = s.get();
- std::unique_ptr<A, Deleter<A> > s2 = s;
- assert(s2.get() == p);
- assert(s.get() == 0);
- assert(A::count == 1);
- assert(B::count == 1);
- assert(s2.get_deleter().state() == 5);
- assert(s.get_deleter().state() == 0);
- }
- assert(A::count == 0);
- assert(B::count == 0);
+ const std::unique_ptr<B, Deleter<B> > s;
+ std::unique_ptr<A, Deleter<A> > s2 = s; // expected-error {{no viable conversion}}
}
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp
index 93956bcae663..20275de603e2 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_Y_rv.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// shared_ptr
@@ -42,7 +44,6 @@ int A::count = 0;
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::shared_ptr<A> pA(new A);
A* ptrA = pA.get();
@@ -119,5 +120,4 @@ int main()
}
assert(B::count == 0);
assert(A::count == 0);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp
index 4194890dda2d..4a85633a89ad 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr_rv.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// shared_ptr
@@ -42,7 +44,6 @@ int A::count = 0;
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::shared_ptr<A> pA(new A);
A* ptrA = pA.get();
@@ -119,5 +120,4 @@ int main()
}
assert(B::count == 0);
assert(A::count == 0);
-#endif // _LIBCXX_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator_throw.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator_throw.pass.cpp
index 41aeb04a5feb..2e6441d66316 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator_throw.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_allocator_throw.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <memory>
// template<class D, class A> shared_ptr(nullptr_t, D d, A a);
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp
index 85fc5e930544..009b4cfc00f9 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// UNSUPPORTED: sanitizer-new-delete
// <memory>
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp
index c72847791778..388599bd7015 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator_throw.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// <memory>
// template<class Y, class D, class A> shared_ptr(Y* p, D d, A a);
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp
index 70af2964113d..7b40d6df2164 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// UNSUPPORTED: sanitizer-new-delete
// <memory>
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp
index 2fa975eca833..182d5f4a4937 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
// UNSUPPORTED: sanitizer-new-delete
// <memory>
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp
index f041d9451a6d..ea0720404b48 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// shared_ptr
@@ -17,6 +19,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
struct B
{
static int count;
@@ -66,24 +70,24 @@ int main()
std::shared_ptr<B> pB(std::move(pA));
assert(B::count == 1);
assert(A::count == 1);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
assert(pB.use_count() == 1);
assert(pA.use_count() == 0);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else
assert(pB.use_count() == 2);
assert(pA.use_count() == 2);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
assert(p == pB.get());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
assert(pA.use_count() == 0);
assert(B::count == 0);
assert(A::count == 0);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else
assert(pA.use_count() == 1);
assert(B::count == 1);
assert(A::count == 1);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
assert(B::count == 0);
assert(A::count == 0);
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp
index b89178e201cf..257d3ce19be3 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_rv.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <memory>
// shared_ptr
@@ -16,6 +18,8 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
struct A
{
static int count;
@@ -37,22 +41,22 @@ int main()
A* p = pA.get();
std::shared_ptr<A> pA2(std::move(pA));
assert(A::count == 1);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
assert(pA.use_count() == 0);
assert(pA2.use_count() == 1);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else
assert(pA.use_count() == 2);
assert(pA2.use_count() == 2);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
assert(pA2.get() == p);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
assert(pA.use_count() == 0);
assert(A::count == 0);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else
assert(pA.use_count() == 1);
assert(A::count == 1);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
assert(A::count == 0);
{
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
index 5c424f5c7428..877577c9ce58 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: sanitizer-new-delete
// <memory>
@@ -63,6 +62,7 @@ int main()
assert(p.get() == raw_ptr);
assert(ptr.get() == 0);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
assert(A::count == 0);
{
std::unique_ptr<A> ptr(new A);
@@ -86,6 +86,7 @@ int main()
#endif
}
}
+#endif
assert(A::count == 0);
{ // LWG 2399
fn(std::unique_ptr<int>(new int));
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
index 35a7d077b424..830aa5bbca4c 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <memory>
// shared_ptr
@@ -17,6 +16,8 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
struct B
{
static int count;
@@ -42,6 +43,7 @@ int A::count = 0;
int main()
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::weak_ptr<A> wp;
try
@@ -54,6 +56,7 @@ int main()
}
assert(A::count == 0);
}
+#endif
{
std::shared_ptr<A> sp0(new A);
std::weak_ptr<A> wp(sp0);
@@ -63,6 +66,7 @@ int main()
assert(A::count == 1);
}
assert(A::count == 0);
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::shared_ptr<A> sp0(new A);
std::weak_ptr<A> wp(sp0);
@@ -77,4 +81,5 @@ int main()
}
}
assert(A::count == 0);
+#endif
}
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp
index 8cb972b0c1a1..8d782716b94f 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp
@@ -16,6 +16,7 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
struct A
@@ -65,7 +66,7 @@ int main()
assert(p2.get());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
nc = globalMemCounter.outstanding_new;
{
char c = 'e';
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp
index 75bf3df90aa3..90f958e26852 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp
@@ -18,6 +18,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
struct B
{
static int count;
@@ -55,7 +57,7 @@ int C::count = 0;
template <class T>
std::weak_ptr<T> source (std::shared_ptr<T> p) { return std::weak_ptr<T>(p); }
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
template <class T>
void sink (std::weak_ptr<T> &&) {}
#endif
@@ -100,7 +102,7 @@ int main()
assert(B::count == 0);
assert(A::count == 0);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::shared_ptr<A> ps(new A);
std::weak_ptr<A> pA = source(ps);
diff --git a/test/std/utilities/meta/meta.help/integral_constant.pass.cpp b/test/std/utilities/meta/meta.help/integral_constant.pass.cpp
index 335305a28236..51a837e4e032 100644
--- a/test/std/utilities/meta/meta.help/integral_constant.pass.cpp
+++ b/test/std/utilities/meta/meta.help/integral_constant.pass.cpp
@@ -14,6 +14,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::integral_constant<int, 5> _5;
@@ -26,7 +28,7 @@ int main()
assert(_5() == 5);
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert ( _5{}() == 5, "" );
static_assert ( std::true_type{}(), "" );
#endif
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp
index 28bbedee1749..f7902a2be775 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp
@@ -13,13 +13,15 @@
#include <type_traits>
+#include "test_macros.h"
+
enum Enum {zero, one_};
template <class T, class U>
void test_remove_all_extents()
{
static_assert((std::is_same<typename std::remove_all_extents<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::remove_all_extents_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp
index c688c26b9a5b..aa175d9ebc8c 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp
@@ -13,13 +13,15 @@
#include <type_traits>
+#include "test_macros.h"
+
enum Enum {zero, one_};
template <class T, class U>
void test_remove_extent()
{
static_assert((std::is_same<typename std::remove_extent<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::remove_extent_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp
index 19b1fb4d01b3..ef1aa8acbc68 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp
@@ -13,11 +13,13 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_add_const_imp()
{
static_assert((std::is_same<typename std::add_const<T>::type, const U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::add_const_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp
index 4905e518e12a..c0c2483e4c40 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp
@@ -13,11 +13,13 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_add_cv_imp()
{
static_assert((std::is_same<typename std::add_cv<T>::type, const volatile U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::add_cv_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp
index 7a12c44a2c6e..f29fb06cd807 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp
@@ -13,11 +13,13 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_add_volatile_imp()
{
static_assert((std::is_same<typename std::add_volatile<T>::type, volatile U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::add_volatile_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp
index cd2faf786d80..426d22d29f67 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp
@@ -13,11 +13,13 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_remove_const_imp()
{
static_assert((std::is_same<typename std::remove_const<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::remove_const_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp
index 3f6405c8280c..a6ce05756ef6 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp
@@ -13,11 +13,13 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_remove_cv_imp()
{
static_assert((std::is_same<typename std::remove_cv<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::remove_cv_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp
index 6258a9039b40..90b8d4bcbea2 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp
@@ -13,11 +13,13 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_remove_volatile_imp()
{
static_assert((std::is_same<typename std::remove_volatile<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::remove_volatile_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
index ae849ca54558..43f23f5ccc80 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
@@ -13,12 +13,14 @@
#include <type_traits>
+#include "test_macros.h"
+
int main()
{
#ifndef _LIBCPP_HAS_NO_VARIADICS
{
typedef std::aligned_union<10, char >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, char>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 1, "");
@@ -26,7 +28,7 @@ int main()
}
{
typedef std::aligned_union<10, short >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, short>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 2, "");
@@ -34,7 +36,7 @@ int main()
}
{
typedef std::aligned_union<10, int >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, int>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
@@ -42,7 +44,7 @@ int main()
}
{
typedef std::aligned_union<10, double >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, double>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 8, "");
@@ -50,7 +52,7 @@ int main()
}
{
typedef std::aligned_union<10, short, char >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, short, char>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 2, "");
@@ -58,7 +60,7 @@ int main()
}
{
typedef std::aligned_union<10, char, short >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, char, short>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 2, "");
@@ -66,7 +68,7 @@ int main()
}
{
typedef std::aligned_union<2, int, char, short >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<2, int, char, short>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
@@ -74,7 +76,7 @@ int main()
}
{
typedef std::aligned_union<2, char, int, short >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<2, char, int, short >, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
@@ -82,7 +84,7 @@ int main()
}
{
typedef std::aligned_union<2, char, short, int >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<2, char, short, int >, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
index e8611253c5d4..61523e4872d4 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
@@ -12,6 +12,7 @@
// common_type
#include <type_traits>
+#include <memory>
#include "test_macros.h"
@@ -30,15 +31,198 @@ namespace std
{
typedef S<T> type;
};
+
+ template <class T>
+ struct common_type< ::S<T>, T> {
+ typedef S<T> type;
+ };
+
+ template <> struct common_type< ::S<long>, long> {};
+ template <> struct common_type<long, ::S<long> > {};
}
#if TEST_STD_VER >= 11
-template <class T, class U, class = void>
-struct no_common_type : std::true_type {};
+template <class Tp>
+struct always_bool_imp { using type = bool; };
+template <class Tp> using always_bool = typename always_bool_imp<Tp>::type;
+
+template <class ...Args>
+constexpr auto no_common_type_imp(int)
+ -> always_bool<typename std::common_type<Args...>::type>
+ { return false; }
+
+template <class ...Args>
+constexpr bool no_common_type_imp(long) { return true; }
+
+template <class ...Args>
+using no_common_type = std::integral_constant<bool, no_common_type_imp<Args...>(0)>;
+
+template <class Tp>
+using Decay = typename std::decay<Tp>::type;
+
+template <class ...Args>
+using CommonType = typename std::common_type<Args...>::type;
+
+template <class T1, class T2>
+struct TernaryOpImp {
+ static_assert(std::is_same<Decay<T1>, T1>::value, "must be same");
+ static_assert(std::is_same<Decay<T2>, T2>::value, "must be same");
+ using type = typename std::decay<
+ decltype(false ? std::declval<T1>() : std::declval<T2>())
+ >::type;
+};
+
+template <class T1, class T2>
+using TernaryOp = typename TernaryOpImp<T1, T2>::type;
+
+// -- If sizeof...(T) is zero, there shall be no member type.
+void test_bullet_one() {
+ static_assert(no_common_type<>::value, "");
+}
+
+// If sizeof...(T) is one, let T0 denote the sole type constituting the pack T.
+// The member typedef-name type shall denote the same type as decay_t<T0>.
+void test_bullet_two() {
+ static_assert(std::is_same<CommonType<void>, void>::value, "");
+ static_assert(std::is_same<CommonType<int>, int>::value, "");
+ static_assert(std::is_same<CommonType<int const>, int>::value, "");
+ static_assert(std::is_same<CommonType<int volatile[]>, int volatile*>::value, "");
+ static_assert(std::is_same<CommonType<void(&)()>, void(*)()>::value, "");
+}
+
+template <class T, class U, class Expect>
+void test_bullet_three_one_imp() {
+ using DT = Decay<T>;
+ using DU = Decay<U>;
+ static_assert(!std::is_same<T, DT>::value || !std::is_same<U, DU>::value, "");
+ static_assert(std::is_same<CommonType<T, U>, Expect>::value, "");
+ static_assert(std::is_same<CommonType<U, T>, Expect>::value, "");
+ static_assert(std::is_same<CommonType<T, U>, CommonType<DT, DU>>::value, "");
+}
+
+// (3.3)
+// -- If sizeof...(T) is two, let the first and second types constituting T be
+// denoted by T1 and T2, respectively, and let D1 and D2 denote the same types
+// as decay_t<T1> and decay_t<T2>, respectively.
+// (3.3.1)
+// -- If is_same_v<T1, D1> is false or is_same_v<T2, D2> is false, let C
+// denote the same type, if any, as common_type_t<D1, D2>.
+void test_bullet_three_one() {
+ // Test that the user provided specialization of common_type is used after
+ // decaying T1.
+ {
+ using T1 = S<int> const;
+ using T2 = int;
+ test_bullet_three_one_imp<T1, T2, S<int> >();
+ }
+ // Test a user provided specialization that does not provide a typedef.
+ {
+ using T1 = ::S<long> const;
+ using T2 = long;
+ static_assert(no_common_type<T1, T2>::value, "");
+ static_assert(no_common_type<T2, T1>::value, "");
+ }
+ // Test that the ternary operator is not applied when the types are the
+ // same.
+ {
+ using T1 = const void;
+ using Expect = void;
+ static_assert(std::is_same<CommonType<T1, T1>, Expect>::value, "");
+ static_assert(std::is_same<CommonType<T1, T1>, CommonType<T1>>::value, "");
+ }
+ {
+ using T1 = int const[];
+ using Expect = int const*;
+ static_assert(std::is_same<CommonType<T1, T1>, Expect>::value, "");
+ static_assert(std::is_same<CommonType<T1, T1>, CommonType<T1>>::value, "");
+ }
+}
-template <class T, class U>
-struct no_common_type<T, U, typename std::conditional<false,
- typename std::common_type<T, U>::type, void>::type> : std::false_type {};
+// (3.3)
+// -- If sizeof...(T) is two, let the first and second types constituting T be
+// denoted by T1 and T2, respectively, and let D1 and D2 denote the same types
+// as decay_t<T1> and decay_t<T2>, respectively.
+// (3.3.1)
+// -- If [...]
+// (3.3.2)
+// -- Otherwise, let C denote the same type, if any, as
+// decay_t<decltype(false ? declval<D1>() : declval<D2>())>
+void test_bullet_three_two() {
+ {
+ using T1 = int const*;
+ using T2 = int*;
+ using Expect = TernaryOp<T1, T2>;
+ static_assert(std::is_same<CommonType<T1, T2>, Expect>::value, "");
+ static_assert(std::is_same<CommonType<T2, T1>, Expect>::value, "");
+ }
+ // Test that there is no ::type member when the ternary op is ill-formed
+ {
+ using T1 = int;
+ using T2 = void;
+ static_assert(no_common_type<T1, T2>::value, "");
+ static_assert(no_common_type<T2, T1>::value, "");
+ }
+ {
+ using T1 = int;
+ using T2 = X<int>;
+ static_assert(no_common_type<T1, T2>::value, "");
+ static_assert(no_common_type<T2, T1>::value, "");
+ }
+ // Test that the ternary operator is not applied when the types are the
+ // same.
+ {
+ using T1 = void;
+ using Expect = void;
+ static_assert(std::is_same<CommonType<T1, T1>, Expect>::value, "");
+ static_assert(std::is_same<CommonType<T1, T1>, CommonType<T1>>::value, "");
+ }
+}
+
+// (3.4)
+// -- If sizeof...(T) is greater than two, let T1, T2, and R, respectively,
+// denote the first, second, and (pack of) remaining types constituting T.
+// Let C denote the same type, if any, as common_type_t<T1, T2>. If there is
+// such a type C, the member typedef-name type shall denote the
+// same type, if any, as common_type_t<C, R...>. Otherwise, there shall be
+// no member type.
+void test_bullet_four() {
+ { // test that there is no ::type member
+ static_assert(no_common_type<int, E>::value, "");
+ static_assert(no_common_type<int, int, E>::value, "");
+ static_assert(no_common_type<int, int, E, int>::value, "");
+ static_assert(no_common_type<int, int, int, E>::value, "");
+ }
+}
+
+
+// The example code specified in Note B for common_type
+namespace note_b_example {
+
+using PF1 = bool (&)();
+using PF2 = short (*)(long);
+
+struct S {
+ operator PF2() const;
+ double operator()(char, int&);
+ void fn(long) const;
+ char data;
+};
+
+using PMF = void (S::*)(long) const;
+using PMD = char S::*;
+
+using std::is_same;
+using std::result_of;
+using std::unique_ptr;
+
+static_assert(is_same<typename result_of<S(int)>::type, short>::value, "Error!");
+static_assert(is_same<typename result_of<S&(unsigned char, int&)>::type, double>::value, "Error!");
+static_assert(is_same<typename result_of<PF1()>::type, bool>::value, "Error!");
+static_assert(is_same<typename result_of<PMF(unique_ptr<S>, int)>::type, void>::value, "Error!");
+static_assert(is_same<typename result_of<PMD(S)>::type, char&&>::value, "Error!");
+static_assert(is_same<typename result_of<PMD(const S*)>::type, const char&>::value, "Error!");
+
+} // namespace note_b_example
#endif // TEST_STD_VER >= 11
int main()
@@ -89,14 +273,15 @@ int main()
static_assert((std::is_same<std::common_type<volatile void, void>::type, void>::value), "");
static_assert((std::is_same<std::common_type<const void, const void>::type, void>::value), "");
-#if TEST_STD_VER >= 11
- static_assert((no_common_type<void, int>::value), "");
- static_assert((no_common_type<int, void>::value), "");
- static_assert((no_common_type<int, E>::value), "");
- static_assert((no_common_type<int, X<int> >::value), "");
-#endif // TEST_STD_VER >= 11
-
static_assert((std::is_same<std::common_type<int, S<int> >::type, S<int> >::value), "");
static_assert((std::is_same<std::common_type<int, S<int>, S<int> >::type, S<int> >::value), "");
static_assert((std::is_same<std::common_type<int, int, S<int> >::type, S<int> >::value), "");
+
+#if TEST_STD_VER >= 11
+ test_bullet_one();
+ test_bullet_two();
+ test_bullet_three_one();
+ test_bullet_three_two();
+ test_bullet_four();
+#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp
index ac11e3a4ce86..7de0a0737905 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp
@@ -13,11 +13,13 @@
#include <type_traits>
+#include "test_macros.h"
+
int main()
{
static_assert((std::is_same<std::conditional<true, char, int>::type, char>::value), "");
static_assert((std::is_same<std::conditional<false, char, int>::type, int>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::conditional_t<true, char, int>, char>::value), "");
static_assert((std::is_same<std::conditional_t<false, char, int>, int>::value), "");
#endif
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp
index bd8ae0e297bc..bcd839849453 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp
@@ -13,11 +13,13 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_decay()
{
static_assert((std::is_same<typename std::decay<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::decay_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp
index eb72b0f393b3..a9b1e1be1274 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp
@@ -13,11 +13,13 @@
#include <type_traits>
+#include "test_macros.h"
+
int main()
{
static_assert((std::is_same<std::enable_if<true>::type, void>::value), "");
static_assert((std::is_same<std::enable_if<true, int>::type, int>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::enable_if_t<true>, void>::value), "");
static_assert((std::is_same<std::enable_if_t<true, int>, int>::value), "");
#endif
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
index 1d7b23c19222..410e47e03bcc 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
@@ -21,14 +21,19 @@ enum F { W = UINT_MAX };
int main()
{
+#if !defined(_WIN32) || defined(__MINGW32__)
+ typedef unsigned ExpectUnsigned;
+#else
+ typedef int ExpectUnsigned; // MSVC's ABI doesn't follow the Standard
+#endif
static_assert((std::is_same<std::underlying_type<E>::type, int>::value),
"E has the wrong underlying type");
- static_assert((std::is_same<std::underlying_type<F>::type, unsigned>::value),
+ static_assert((std::is_same<std::underlying_type<F>::type, ExpectUnsigned>::value),
"F has the wrong underlying type");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::underlying_type_t<E>, int>::value), "");
- static_assert((std::is_same<std::underlying_type_t<F>, unsigned>::value), "");
+ static_assert((std::is_same<std::underlying_type_t<F>, ExpectUnsigned>::value), "");
#endif
#if TEST_STD_VER >= 11
@@ -36,7 +41,7 @@ int main()
static_assert((std::is_same<std::underlying_type<G>::type, char>::value),
"G has the wrong underlying type");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::underlying_type_t<G>, char>::value), "");
#endif
#endif // TEST_STD_VER >= 11
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp
index fc147c37b1ac..373bad7d6e3c 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// type_traits
// add_rvalue_reference
@@ -16,8 +18,6 @@
#include <type_traits>
#include "test_macros.h"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class T, class U>
void test_add_rvalue_reference()
{
@@ -44,13 +44,11 @@ void test_function1()
static_assert((std::is_same<std::add_rvalue_reference_t<F>, F>::value), "");
#endif
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
struct Foo {};
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
test_add_rvalue_reference<void, void>();
test_add_rvalue_reference<int, int&&>();
test_add_rvalue_reference<int[3], int(&&)[3]>();
@@ -63,22 +61,17 @@ int main()
// LWG 2101 specifically talks about add_rvalue_reference and functions.
// The term of art is "a referenceable type", which a cv- or ref-qualified function is not.
test_function0<void()>();
-#if TEST_STD_VER >= 11
test_function1<void() const>();
test_function1<void() &>();
test_function1<void() &&>();
test_function1<void() const &>();
test_function1<void() const &&>();
-#endif
// But a cv- or ref-qualified member function *is* "a referenceable type"
test_function0<void (Foo::*)()>();
-#if TEST_STD_VER >= 11
test_function0<void (Foo::*)() const>();
test_function0<void (Foo::*)() &>();
test_function0<void (Foo::*)() &&>();
test_function0<void (Foo::*)() const &>();
test_function0<void (Foo::*)() const &&>();
-#endif
-#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp
index e335bd19ef2d..1f9ec2476b50 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp
@@ -37,11 +37,11 @@ int main()
test_remove_reference<int*&, int*>();
test_remove_reference<const int*&, const int*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test_remove_reference<int&&, int>();
test_remove_reference<const int&&, const int>();
test_remove_reference<int(&&)[3], int[3]>();
test_remove_reference<int*&&, int*>();
test_remove_reference<const int*&&, const int*>();
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp
index eb8e31c76e10..06f6e6152aec 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp
@@ -13,9 +13,15 @@
#include <type_traits>
+#include "test_macros.h"
+
enum Enum {zero, one_};
+#if TEST_STD_VER >= 11
+enum BigEnum : unsigned long long // MSVC's ABI doesn't follow the Standard
+#else
enum BigEnum
+#endif
{
bigzero,
big = 0xFFFFFFFFFFFFFFFFULL
@@ -32,7 +38,7 @@ template <class T, class U>
void test_make_signed()
{
static_assert((std::is_same<typename std::make_signed<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::make_signed_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp
index 984440193fa6..3d152f6049e9 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp
@@ -13,9 +13,15 @@
#include <type_traits>
+#include "test_macros.h"
+
enum Enum {zero, one_};
+#if TEST_STD_VER >= 11
+enum BigEnum : unsigned long long // MSVC's ABI doesn't follow the Standard
+#else
enum BigEnum
+#endif
{
bigzero,
big = 0xFFFFFFFFFFFFFFFFULL
@@ -32,7 +38,7 @@ template <class T, class U>
void test_make_unsigned()
{
static_assert((std::is_same<typename std::make_unsigned<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::make_unsigned_t<T>, U>::value), "");
#endif
}
diff --git a/test/std/utilities/meta/meta.unary.prop.query/void_t_feature_test_macro.pass.cpp b/test/std/utilities/meta/meta.unary.prop.query/void_t_feature_test_macro.pass.cpp
new file mode 100644
index 000000000000..f188c098c034
--- /dev/null
+++ b/test/std/utilities/meta/meta.unary.prop.query/void_t_feature_test_macro.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// type_traits
+
+// void_t
+
+#include <type_traits>
+
+#include "test_macros.h"
+
+#if TEST_STD_VER <= 14
+# ifdef __cpp_lib_void_t
+# error Feature test macro should not be defined!
+# endif
+#else
+# ifndef __cpp_lib_void_t
+# error Feature test macro is not defined
+# endif
+# if __cpp_lib_void_t != 201411
+# error Feature test macro has the wrong value
+# endif
+#endif
+
+int main()
+{
+#if defined(__cpp_lib_void_t)
+ static_assert(std::is_same_v<std::void_t<int>, void>, "");
+#endif
+}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp
index 13cad58c0ef3..5154a1d12936 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp
@@ -13,11 +13,13 @@
#include <type_traits>
+#include "test_macros.h"
+
template <class T>
void test_lvalue_ref()
{
static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(!std::is_null_pointer<T>::value, "");
#endif
static_assert(!std::is_integral<T>::value, "");
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer_no_variadics.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer_no_variadics.pass.cpp
index b0edea37e8e8..cdaf713ac928 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer_no_variadics.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer_no_variadics.pass.cpp
@@ -14,11 +14,13 @@
#define _LIBCPP_HAS_NO_VARIADICS
#include <type_traits>
+#include "test_macros.h"
+
template <class T>
void test_member_function_pointer_imp()
{
static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(!std::is_null_pointer<T>::value, "");
#endif
static_assert(!std::is_integral<T>::value, "");
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp
index 99fd2887981f..23d391b490e5 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// type_traits
// rvalue_ref
@@ -39,11 +41,9 @@ struct incomplete_type;
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
test_rvalue_ref<int&&>();
test_rvalue_ref<const int&&>();
// LWG#2582
static_assert(!std::is_rvalue_reference<incomplete_type>::value, "");
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp
index 7563c2fd5850..b9b28fd8c3f1 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// type_traits
// rvalue_ref
@@ -27,8 +29,6 @@ void test_rvalue_ref()
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
test_rvalue_ref<int&&>();
test_rvalue_ref<const int&&>();
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
index b734a1aa60d8..f4736e713422 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
@@ -43,7 +43,7 @@ void test_is_not_assignable()
struct D;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
struct C
{
template <class U>
@@ -59,6 +59,8 @@ struct E
template <typename T>
struct X { T t; };
+struct Incomplete;
+
int main()
{
test_is_assignable<int&, int&> ();
@@ -67,7 +69,7 @@ int main()
test_is_assignable<B, A> ();
test_is_assignable<void*&, void*> ();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test_is_assignable<E, int> ();
test_is_not_assignable<int, int&> ();
@@ -80,4 +82,5 @@ int main()
// pointer to incomplete template type
test_is_assignable<X<D>*&, X<D>*> ();
+ test_is_not_assignable<Incomplete&, Incomplete const&>();
}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
index 9f8fdc7fc635..f6ae401533a9 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
@@ -14,9 +14,18 @@
// template <class T, class... Args>
// struct is_constructible;
+// MODULES_DEFINES: _LIBCPP_TESTING_FALLBACK_IS_CONSTRUCTIBLE
+#define _LIBCPP_TESTING_FALLBACK_IS_CONSTRUCTIBLE
#include <type_traits>
#include "test_macros.h"
+#if TEST_STD_VER >= 11 && defined(_LIBCPP_VERSION)
+#define LIBCPP11_STATIC_ASSERT(...) static_assert(__VA_ARGS__)
+#else
+#define LIBCPP11_STATIC_ASSERT(...) ((void)0)
+#endif
+
+
struct A
{
explicit A(int);
@@ -27,6 +36,9 @@ private:
A(char);
};
+struct Base {};
+struct Derived : public Base {};
+
class Abstract
{
virtual void foo() = 0;
@@ -37,10 +49,38 @@ class AbstractDestructor
virtual ~AbstractDestructor() = 0;
};
+struct PrivateDtor {
+ PrivateDtor(int) {}
+private:
+ ~PrivateDtor() {}
+};
+
+struct S {
+ template <class T>
+#if TEST_STD_VER >= 11
+ explicit
+#endif
+ operator T () const;
+};
+
+template <class To>
+struct ImplicitTo {
+ operator To();
+};
+
+#if TEST_STD_VER >= 11
+template <class To>
+struct ExplicitTo {
+ explicit operator To ();
+};
+#endif
+
+
template <class T>
void test_is_constructible()
{
static_assert( (std::is_constructible<T>::value), "");
+ LIBCPP11_STATIC_ASSERT((std::__libcpp_is_constructible<T>::type::value), "");
#if TEST_STD_VER > 14
static_assert( std::is_constructible_v<T>, "");
#endif
@@ -50,6 +90,7 @@ template <class T, class A0>
void test_is_constructible()
{
static_assert(( std::is_constructible<T, A0>::value), "");
+ LIBCPP11_STATIC_ASSERT((std::__libcpp_is_constructible<T, A0>::type::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_constructible_v<T, A0>), "");
#endif
@@ -59,6 +100,7 @@ template <class T, class A0, class A1>
void test_is_constructible()
{
static_assert(( std::is_constructible<T, A0, A1>::value), "");
+ LIBCPP11_STATIC_ASSERT((std::__libcpp_is_constructible<T, A0, A1>::type::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_constructible_v<T, A0, A1>), "");
#endif
@@ -68,6 +110,7 @@ template <class T>
void test_is_not_constructible()
{
static_assert((!std::is_constructible<T>::value), "");
+ LIBCPP11_STATIC_ASSERT((!std::__libcpp_is_constructible<T>::type::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_constructible_v<T>), "");
#endif
@@ -77,13 +120,28 @@ template <class T, class A0>
void test_is_not_constructible()
{
static_assert((!std::is_constructible<T, A0>::value), "");
+ LIBCPP11_STATIC_ASSERT((!std::__libcpp_is_constructible<T, A0>::type::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_constructible_v<T, A0>), "");
#endif
}
+#if TEST_STD_VER >= 11
+template <class T = int, class = decltype(static_cast<T&&>(std::declval<double&>()))>
+constexpr bool clang_disallows_valid_static_cast_test(int) { return false; };
+
+constexpr bool clang_disallows_valid_static_cast_test(long) { return true; }
+
+static constexpr bool clang_disallows_valid_static_cast_bug =
+ clang_disallows_valid_static_cast_test(0);
+#endif
+
+
int main()
{
+ typedef Base B;
+ typedef Derived D;
+
test_is_constructible<int> ();
test_is_constructible<int, const int> ();
test_is_constructible<A, int> ();
@@ -97,17 +155,138 @@ int main()
test_is_constructible<A, char> ();
#endif
test_is_not_constructible<A, void> ();
+ test_is_not_constructible<int, void()>();
+ test_is_not_constructible<int, void(&)()>();
+ test_is_not_constructible<int, void() const>();
+ test_is_not_constructible<int&, void>();
+ test_is_not_constructible<int&, void()>();
+ test_is_not_constructible<int&, void() const>();
+ test_is_not_constructible<int&, void(&)()>();
+
test_is_not_constructible<void> ();
+ test_is_not_constructible<const void> (); // LWG 2738
+ test_is_not_constructible<volatile void> ();
+ test_is_not_constructible<const volatile void> ();
test_is_not_constructible<int&> ();
test_is_not_constructible<Abstract> ();
test_is_not_constructible<AbstractDestructor> ();
+ test_is_constructible<int, S>();
+ test_is_not_constructible<int&, S>();
-// LWG 2560 -- postpone this test until bots updated
-// test_is_not_constructible<void()> ();
-#if TEST_STD_VER > 11
-// test_is_not_constructible<void() const> ();
-// test_is_not_constructible<void() volatile> ();
-// test_is_not_constructible<void() &> ();
-// test_is_not_constructible<void() &&> ();
+ test_is_constructible<void(&)(), void(&)()>();
+ test_is_constructible<void(&)(), void()>();
+#if TEST_STD_VER >= 11
+ test_is_constructible<void(&&)(), void(&&)()>();
+ test_is_constructible<void(&&)(), void()>();
+ test_is_constructible<void(&&)(), void(&)()>();
+#endif
+
+#if TEST_STD_VER >= 11
+ test_is_constructible<int const&, int>();
+ test_is_constructible<int const&, int&&>();
+
+ test_is_constructible<int&&, double&>();
+ test_is_constructible<void(&)(), void(&&)()>();
+
+ test_is_not_constructible<int&, int>();
+ test_is_not_constructible<int&, int const&>();
+ test_is_not_constructible<int&, int&&>();
+
+ test_is_constructible<int&&, int>();
+ test_is_constructible<int&&, int&&>();
+ test_is_not_constructible<int&&, int&>();
+ test_is_not_constructible<int&&, int const&&>();
+
+ test_is_constructible<Base, Derived>();
+ test_is_constructible<Base&, Derived&>();
+ test_is_not_constructible<Derived&, Base&>();
+ test_is_constructible<Base const&, Derived const&>();
+ test_is_not_constructible<Derived const&, Base const&>();
+ test_is_not_constructible<Derived const&, Base>();
+
+ test_is_constructible<Base&&, Derived>();
+ test_is_constructible<Base&&, Derived&&>();
+ test_is_not_constructible<Derived&&, Base&&>();
+ test_is_not_constructible<Derived&&, Base>();
+
+ // test that T must also be destructible
+ test_is_constructible<PrivateDtor&, PrivateDtor&>();
+ test_is_not_constructible<PrivateDtor, int>();
+
+ test_is_not_constructible<void() const, void() const>();
+ test_is_not_constructible<void() const, void*>();
+
+ test_is_constructible<int&, ImplicitTo<int&>>();
+ test_is_constructible<const int&, ImplicitTo<int&&>>();
+ test_is_constructible<int&&, ImplicitTo<int&&>>();
+ test_is_constructible<const int&, ImplicitTo<int>>();
+
+ test_is_not_constructible<B&&, B&>();
+ test_is_not_constructible<B&&, D&>();
+ test_is_constructible<B&&, ImplicitTo<D&&>>();
+ test_is_constructible<B&&, ImplicitTo<D&&>&>();
+ test_is_constructible<int&&, double&>();
+ test_is_constructible<const int&, ImplicitTo<int&>&>();
+ test_is_constructible<const int&, ImplicitTo<int&>>();
+ test_is_constructible<const int&, ExplicitTo<int&>&>();
+ test_is_constructible<const int&, ExplicitTo<int&>>();
+
+ test_is_constructible<const int&, ExplicitTo<int&>&>();
+ test_is_constructible<const int&, ExplicitTo<int&>>();
+ test_is_constructible<int&, ExplicitTo<int&>>();
+ test_is_constructible<const int&, ExplicitTo<int&&>>();
+
+ // Binding through reference-compatible type is required to perform
+ // direct-initialization as described in [over.match.ref] p. 1 b. 1:
+ test_is_constructible<int&, ExplicitTo<int&>>();
+ test_is_constructible<const int&, ExplicitTo<int&&>>();
+
+ static_assert(std::is_constructible<int&&, ExplicitTo<int&&>>::value, "");
+#ifdef __clang__
+#if defined(CLANG_TEST_VER) && CLANG_TEST_VER < 400
+ static_assert(clang_disallows_valid_static_cast_bug, "bug still exists");
+#endif
+ // FIXME Clang disallows this construction because it thinks that
+ // 'static_cast<int&&>(declval<ExplicitTo<int&&>>())' is ill-formed.
+ LIBCPP_STATIC_ASSERT(
+ clang_disallows_valid_static_cast_bug !=
+ std::__libcpp_is_constructible<int&&, ExplicitTo<int&&>>::value, "");
+#else
+ static_assert(clang_disallows_valid_static_cast_bug == false, "");
+ LIBCPP_STATIC_ASSERT(std::__libcpp_is_constructible<int&&, ExplicitTo<int&&>>::value, "");
+#endif
+
+#ifdef __clang__
+ // FIXME Clang and GCC disagree on the validity of this expression.
+ test_is_constructible<const int&, ExplicitTo<int>>();
+ static_assert(std::is_constructible<int&&, ExplicitTo<int>>::value, "");
+ LIBCPP_STATIC_ASSERT(
+ clang_disallows_valid_static_cast_bug !=
+ std::__libcpp_is_constructible<int&&, ExplicitTo<int>>::value, "");
+#else
+ test_is_not_constructible<const int&, ExplicitTo<int>>();
+ test_is_not_constructible<int&&, ExplicitTo<int>>();
+#endif
+
+ // Binding through temporary behaves like copy-initialization,
+ // see [dcl.init.ref] p. 5, very last sub-bullet:
+ test_is_not_constructible<const int&, ExplicitTo<double&&>>();
+ test_is_not_constructible<int&&, ExplicitTo<double&&>>();
+
+
+// TODO: Remove this workaround once Clang <= 3.7 are no longer used regularly.
+// In those compiler versions the __is_constructible builtin gives the wrong
+// results for abominable function types.
+#if (defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER < 703) \
+ || (defined(TEST_CLANG_VER) && TEST_CLANG_VER < 308)
+#define WORKAROUND_CLANG_BUG
+#endif
+#if !defined(WORKAROUND_CLANG_BUG)
+ test_is_not_constructible<void()>();
+ test_is_not_constructible<void() const> ();
+ test_is_not_constructible<void() volatile> ();
+ test_is_not_constructible<void() &> ();
+ test_is_not_constructible<void() &&> ();
#endif
+#endif // TEST_STD_VER >= 11
}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp
index ac8b80bbd3a4..06cf8007889d 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp
@@ -74,12 +74,10 @@ int main()
test_is_copy_assignable<NotEmpty> ();
test_is_copy_assignable<Empty> ();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test_is_not_copy_assignable<const int> ();
test_is_not_copy_assignable<int[]> ();
test_is_not_copy_assignable<int[3]> ();
-#endif
-#if TEST_STD_VER >= 11
test_is_not_copy_assignable<B> ();
#endif
test_is_not_copy_assignable<void> ();
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp
index 318147e5d4a3..22755dc33dc3 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp
@@ -92,15 +92,35 @@ int main()
test_is_default_constructible<int*>();
test_is_default_constructible<const int*>();
test_is_default_constructible<char[3]>();
+ test_is_default_constructible<char[5][3]>();
+
test_is_default_constructible<NotEmpty>();
test_is_default_constructible<bit_zero>();
test_is_not_default_constructible<void>();
test_is_not_default_constructible<int&>();
test_is_not_default_constructible<char[]>();
+ test_is_not_default_constructible<char[][3]>();
+
test_is_not_default_constructible<Abstract>();
test_is_not_default_constructible<NoDefaultConstructor>();
#if TEST_STD_VER >= 11
test_is_not_default_constructible<B>();
+ test_is_not_default_constructible<int&&>();
+
+// TODO: Remove this workaround once Clang <= 3.7 are no longer used regularly.
+// In those compiler versions the __is_constructible builtin gives the wrong
+// results for abominable function types.
+#if (defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER < 703) \
+ || (defined(TEST_CLANG_VER) && TEST_CLANG_VER < 308)
+#define WORKAROUND_CLANG_BUG
+#endif
+#if !defined(WORKAROUND_CLANG_BUG)
+ test_is_not_default_constructible<void()>();
+ test_is_not_default_constructible<void() const> ();
+ test_is_not_default_constructible<void() volatile> ();
+ test_is_not_default_constructible<void() &> ();
+ test_is_not_default_constructible<void() &&> ();
+#endif
#endif
}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp
index 410c1db7244d..7be76f4fa96a 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp
@@ -11,6 +11,14 @@
// is_empty
+// T is a non-union class type with:
+// no non-static data members,
+// no unnamed bit-fields of non-zero length,
+// no virtual member functions,
+// no virtual base classes,
+// and no base class B for which is_empty_v<B> is false.
+
+
#include <type_traits>
#include "test_macros.h"
@@ -44,22 +52,33 @@ void test_is_not_empty()
#endif
}
-class Empty
-{
-};
+class Empty {};
+struct NotEmpty { int foo; };
-class NotEmpty
+class VirtualFn
{
- virtual ~NotEmpty();
+ virtual ~VirtualFn();
};
union Union {};
+struct EmptyBase : public Empty {};
+struct VirtualBase : virtual Empty {};
+struct NotEmptyBase : public NotEmpty {};
+
+struct StaticMember { static int foo; };
+struct NonStaticMember { int foo; };
+
struct bit_zero
{
int : 0;
};
+struct bit_one
+{
+ int : 1;
+};
+
int main()
{
test_is_not_empty<void>();
@@ -72,7 +91,14 @@ int main()
test_is_not_empty<char[]>();
test_is_not_empty<Union>();
test_is_not_empty<NotEmpty>();
+ test_is_not_empty<VirtualFn>();
+ test_is_not_empty<VirtualBase>();
+ test_is_not_empty<NotEmptyBase>();
+ test_is_not_empty<NonStaticMember>();
+// test_is_not_empty<bit_one>();
test_is_empty<Empty>();
+ test_is_empty<EmptyBase>();
+ test_is_empty<StaticMember>();
test_is_empty<bit_zero>();
}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp
index 613c1123e3fa..6209bc7b1483 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp
@@ -63,7 +63,7 @@ int main()
test_is_move_assignable<NotEmpty> ();
test_is_move_assignable<Empty> ();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test_is_not_move_assignable<const int> ();
test_is_not_move_assignable<int[]> ();
test_is_not_move_assignable<int[3]> ();
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp
index 07c283bf8890..e81f8d4f43c4 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp
@@ -62,7 +62,7 @@ struct A
struct B
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
B(B&&);
#endif
};
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_assignable.pass.cpp
index 9d629dc7ef46..3349a9d3a968 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_assignable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_assignable.pass.cpp
@@ -50,7 +50,7 @@ int main()
{
test_is_nothrow_assignable<int&, int&> ();
test_is_nothrow_assignable<int&, int> ();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test_is_nothrow_assignable<int&, double> ();
#endif
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp
index 8200b468fe3a..f36b80cac17c 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp
@@ -92,7 +92,7 @@ struct C
void operator=(C&); // not const
};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
struct Tuple {
Tuple(Empty&&) noexcept {}
};
@@ -104,15 +104,14 @@ int main()
test_is_nothrow_constructible<int, const int&> ();
test_is_nothrow_constructible<Empty> ();
test_is_nothrow_constructible<Empty, const Empty&> ();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- test_is_nothrow_constructible<Tuple &&, Empty> (); // See bug #19616.
-#endif
test_is_not_nothrow_constructible<A, int> ();
test_is_not_nothrow_constructible<A, int, double> ();
test_is_not_nothrow_constructible<A> ();
test_is_not_nothrow_constructible<C> ();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
+ test_is_nothrow_constructible<Tuple &&, Empty> (); // See bug #19616.
+
static_assert(!std::is_constructible<Tuple&, Empty>::value, "");
test_is_not_nothrow_constructible<Tuple &, Empty> (); // See bug #19616.
#endif
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_swappable_with.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_swappable_with.pass.cpp
index 408231f6057f..b23a5e45f287 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_swappable_with.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_swappable_with.pass.cpp
@@ -59,7 +59,7 @@ int main()
!std::is_nothrow_swappable_with<A&, A&>::value, "");
}
{
- // test that hetrogenius swap is allowed only if both 'swap(A, B)' and
+ // test that heterogeneous swap is allowed only if both 'swap(A, B)' and
// 'swap(B, A)' are valid.
static_assert(std::is_nothrow_swappable_with<A&, B&>::value, "");
static_assert(!std::is_nothrow_swappable_with<A&, C&>::value &&
diff --git a/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp b/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp
new file mode 100644
index 000000000000..e3c7bb5ad27b
--- /dev/null
+++ b/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <optional>
+
+// class bad_optional_access is default constructible
+
+#include <optional>
+#include <type_traits>
+
+int main()
+{
+ using std::bad_optional_access;
+ bad_optional_access ex;
+}
diff --git a/test/std/utilities/optional/optional.bad_optional_access/derive.pass.cpp b/test/std/utilities/optional/optional.bad_optional_access/derive.pass.cpp
new file mode 100644
index 000000000000..85e36d2c107d
--- /dev/null
+++ b/test/std/utilities/optional/optional.bad_optional_access/derive.pass.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <optional>
+
+// class bad_optional_access : public logic_error
+
+#include <optional>
+#include <type_traits>
+
+int main()
+{
+ using std::bad_optional_access;
+
+ static_assert(std::is_base_of<std::logic_error, bad_optional_access>::value, "");
+ static_assert(std::is_convertible<bad_optional_access*, std::logic_error*>::value, "");
+}
diff --git a/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp
new file mode 100644
index 000000000000..b54a08f5575b
--- /dev/null
+++ b/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator==(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator==(const T& v, const optional<T>& x);
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator == ( const X &lhs, const X &rhs )
+ { return lhs.i_ == rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef X T;
+ typedef optional<T> O;
+
+ constexpr T val(2);
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+ constexpr O o3{val}; // engaged
+
+ static_assert ( !(o1 == T(1)), "" );
+ static_assert ( (o2 == T(1)), "" );
+ static_assert ( !(o3 == T(1)), "" );
+ static_assert ( (o3 == T(2)), "" );
+ static_assert ( (o3 == val), "" );
+
+ static_assert ( !(T(1) == o1), "" );
+ static_assert ( (T(1) == o2), "" );
+ static_assert ( !(T(1) == o3), "" );
+ static_assert ( (T(2) == o3), "" );
+ static_assert ( (val == o3), "" );
+ }
+}
diff --git a/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp
new file mode 100644
index 000000000000..064114fb9db2
--- /dev/null
+++ b/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator>(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator>(const T& v, const optional<T>& x);
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator > ( const X &lhs, const X &rhs )
+ { return lhs.i_ > rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef X T;
+ typedef optional<T> O;
+
+ constexpr T val(2);
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+ constexpr O o3{val}; // engaged
+
+ static_assert ( !(o1 > T(1)), "" );
+ static_assert ( !(o2 > T(1)), "" ); // equal
+ static_assert ( (o3 > T(1)), "" );
+ static_assert ( !(o2 > val), "" );
+ static_assert ( !(o3 > val), "" ); // equal
+ static_assert ( !(o3 > T(3)), "" );
+
+ static_assert ( (T(1) > o1), "" );
+ static_assert ( !(T(1) > o2), "" ); // equal
+ static_assert ( !(T(1) > o3), "" );
+ static_assert ( (val > o2), "" );
+ static_assert ( !(val > o3), "" ); // equal
+ static_assert ( (T(3) > o3), "" );
+ }
+}
diff --git a/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp
new file mode 100644
index 000000000000..663686cdf347
--- /dev/null
+++ b/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator>=(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator>=(const T& v, const optional<T>& x);
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator >= ( const X &lhs, const X &rhs )
+ { return lhs.i_ >= rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef X T;
+ typedef optional<T> O;
+
+ constexpr T val(2);
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+ constexpr O o3{val}; // engaged
+
+ static_assert ( !(o1 >= T(1)), "" );
+ static_assert ( (o2 >= T(1)), "" ); // equal
+ static_assert ( (o3 >= T(1)), "" );
+ static_assert ( !(o2 >= val), "" );
+ static_assert ( (o3 >= val), "" ); // equal
+ static_assert ( !(o3 >= T(3)), "" );
+
+ static_assert ( (T(1) >= o1), "" );
+ static_assert ( (T(1) >= o2), "" ); // equal
+ static_assert ( !(T(1) >= o3), "" );
+ static_assert ( (val >= o2), "" );
+ static_assert ( (val >= o3), "" ); // equal
+ static_assert ( (T(3) >= o3), "" );
+ }
+}
diff --git a/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp
new file mode 100644
index 000000000000..05ac5eb12b48
--- /dev/null
+++ b/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator<=(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator<=(const T& v, const optional<T>& x);
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator <= ( const X &lhs, const X &rhs )
+ { return lhs.i_ <= rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef X T;
+ typedef optional<T> O;
+
+ constexpr T val(2);
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+ constexpr O o3{val}; // engaged
+
+ static_assert ( (o1 <= T(1)), "" );
+ static_assert ( (o2 <= T(1)), "" ); // equal
+ static_assert ( !(o3 <= T(1)), "" );
+ static_assert ( (o2 <= val), "" );
+ static_assert ( (o3 <= val), "" ); // equal
+ static_assert ( (o3 <= T(3)), "" );
+
+ static_assert ( !(T(1) <= o1), "" );
+ static_assert ( (T(1) <= o2), "" ); // equal
+ static_assert ( (T(1) <= o3), "" );
+ static_assert ( !(val <= o2), "" );
+ static_assert ( (val <= o3), "" ); // equal
+ static_assert ( !(T(3) <= o3), "" );
+ }
+}
diff --git a/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp
new file mode 100644
index 000000000000..d1891a286d7b
--- /dev/null
+++ b/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator<(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator<(const T& v, const optional<T>& x);
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator < ( const X &lhs, const X &rhs )
+ { return lhs.i_ < rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef X T;
+ typedef optional<T> O;
+
+ constexpr T val(2);
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+ constexpr O o3{val}; // engaged
+
+ static_assert ( (o1 < T(1)), "" );
+ static_assert ( !(o2 < T(1)), "" ); // equal
+ static_assert ( !(o3 < T(1)), "" );
+ static_assert ( (o2 < val), "" );
+ static_assert ( !(o3 < val), "" ); // equal
+ static_assert ( (o3 < T(3)), "" );
+
+ static_assert ( !(T(1) < o1), "" );
+ static_assert ( !(T(1) < o2), "" ); // equal
+ static_assert ( (T(1) < o3), "" );
+ static_assert ( !(val < o2), "" );
+ static_assert ( !(val < o3), "" ); // equal
+ static_assert ( !(T(3) < o3), "" );
+ }
+}
diff --git a/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp
new file mode 100644
index 000000000000..ae2ff808fb25
--- /dev/null
+++ b/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator!=(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator!=(const T& v, const optional<T>& x);
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator != ( const X &lhs, const X &rhs )
+ { return lhs.i_ != rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef X T;
+ typedef optional<T> O;
+
+ constexpr T val(2);
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+ constexpr O o3{val}; // engaged
+
+ static_assert ( (o1 != T(1)), "" );
+ static_assert ( !(o2 != T(1)), "" );
+ static_assert ( (o3 != T(1)), "" );
+ static_assert ( !(o3 != T(2)), "" );
+ static_assert ( !(o3 != val), "" );
+
+ static_assert ( (T(1) != o1), "" );
+ static_assert ( !(T(1) != o2), "" );
+ static_assert ( (T(1) != o3), "" );
+ static_assert ( !(T(2) != o3), "" );
+ static_assert ( !(val != o3), "" );
+ }
+}
diff --git a/test/std/utilities/optional/optional.hash/hash.pass.cpp b/test/std/utilities/optional/optional.hash/hash.pass.cpp
new file mode 100644
index 000000000000..dfdd07ddf452
--- /dev/null
+++ b/test/std/utilities/optional/optional.hash/hash.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> struct hash<optional<T>>;
+
+#include <optional>
+#include <string>
+#include <memory>
+#include <cassert>
+
+
+int main()
+{
+ using std::optional;
+ const std::size_t nullopt_hash =
+ std::hash<optional<double>>{}(optional<double>{});
+
+ {
+ typedef int T;
+ optional<T> opt;
+ assert(std::hash<optional<T>>{}(opt) == nullopt_hash);
+ opt = 2;
+ assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
+ }
+ {
+ typedef std::string T;
+ optional<T> opt;
+ assert(std::hash<optional<T>>{}(opt) == nullopt_hash);
+ opt = std::string("123");
+ assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
+ }
+ {
+ typedef std::unique_ptr<int> T;
+ optional<T> opt;
+ assert(std::hash<optional<T>>{}(opt) == nullopt_hash);
+ opt = std::unique_ptr<int>(new int(3));
+ assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
+ }
+}
diff --git a/test/std/utilities/optional/optional.nullops/equal.pass.cpp b/test/std/utilities/optional/optional.nullops/equal.pass.cpp
new file mode 100644
index 000000000000..a87a87f877fc
--- /dev/null
+++ b/test/std/utilities/optional/optional.nullops/equal.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator==(const optional<T>& x, nullopt_t) noexcept;
+// template <class T> constexpr bool operator==(nullopt_t, const optional<T>& x) noexcept;
+
+#include <optional>
+
+int main()
+{
+ using std::optional;
+ using std::nullopt_t;
+ using std::nullopt;
+
+ {
+ typedef int T;
+ typedef optional<T> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+
+ static_assert ( (nullopt == o1), "" );
+ static_assert ( !(nullopt == o2), "" );
+ static_assert ( (o1 == nullopt), "" );
+ static_assert ( !(o2 == nullopt), "" );
+
+ static_assert (noexcept(nullopt == o1), "");
+ static_assert (noexcept(o1 == nullopt), "");
+ }
+}
diff --git a/test/std/utilities/optional/optional.nullops/greater.pass.cpp b/test/std/utilities/optional/optional.nullops/greater.pass.cpp
new file mode 100644
index 000000000000..3986a0a92658
--- /dev/null
+++ b/test/std/utilities/optional/optional.nullops/greater.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator>(const optional<T>& x, nullopt_t) noexcept;
+// template <class T> constexpr bool operator>(nullopt_t, const optional<T>& x) noexcept;
+
+#include <optional>
+
+int main()
+{
+ using std::optional;
+ using std::nullopt_t;
+ using std::nullopt;
+
+ {
+ typedef int T;
+ typedef optional<T> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+
+ static_assert ( !(nullopt > o1), "" );
+ static_assert ( !(nullopt > o2), "" );
+ static_assert ( !(o1 > nullopt), "" );
+ static_assert ( (o2 > nullopt), "" );
+
+ static_assert (noexcept(nullopt > o1), "");
+ static_assert (noexcept(o1 > nullopt), "");
+ }
+}
diff --git a/test/std/utilities/optional/optional.nullops/greater_equal.pass.cpp b/test/std/utilities/optional/optional.nullops/greater_equal.pass.cpp
new file mode 100644
index 000000000000..9f2427273476
--- /dev/null
+++ b/test/std/utilities/optional/optional.nullops/greater_equal.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator>=(const optional<T>& x, nullopt_t) noexcept;
+// template <class T> constexpr bool operator>=(nullopt_t, const optional<T>& x) noexcept;
+
+#include <optional>
+
+int main()
+{
+ using std::optional;
+ using std::nullopt_t;
+ using std::nullopt;
+
+ {
+ typedef int T;
+ typedef optional<T> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+
+ static_assert ( (nullopt >= o1), "" );
+ static_assert ( !(nullopt >= o2), "" );
+ static_assert ( (o1 >= nullopt), "" );
+ static_assert ( (o2 >= nullopt), "" );
+
+ static_assert (noexcept(nullopt >= o1), "");
+ static_assert (noexcept(o1 >= nullopt), "");
+ }
+}
diff --git a/test/std/utilities/optional/optional.nullops/less_equal.pass.cpp b/test/std/utilities/optional/optional.nullops/less_equal.pass.cpp
new file mode 100644
index 000000000000..8e73247b9d6e
--- /dev/null
+++ b/test/std/utilities/optional/optional.nullops/less_equal.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <optional>
+
+// template <class T> constexpr bool operator<=(const optional<T>& x, nullopt_t) noexcept;
+// template <class T> constexpr bool operator<=(nullopt_t, const optional<T>& x) noexcept;
+
+#include <optional>
+
+int main()
+{
+ using std::optional;
+ using std::nullopt_t;
+ using std::nullopt;
+
+ {
+ typedef int T;
+ typedef optional<T> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+
+ static_assert ( (nullopt <= o1), "" );
+ static_assert ( (nullopt <= o2), "" );
+ static_assert ( (o1 <= nullopt), "" );
+ static_assert ( !(o2 <= nullopt), "" );
+
+ static_assert (noexcept(nullopt <= o1), "");
+ static_assert (noexcept(o1 <= nullopt), "");
+ }
+}
diff --git a/test/std/utilities/optional/optional.nullops/less_than.pass.cpp b/test/std/utilities/optional/optional.nullops/less_than.pass.cpp
new file mode 100644
index 000000000000..39a8e4a39363
--- /dev/null
+++ b/test/std/utilities/optional/optional.nullops/less_than.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator<(const optional<T>& x, nullopt_t) noexcept;
+// template <class T> constexpr bool operator<(nullopt_t, const optional<T>& x) noexcept;
+
+#include <optional>
+
+int main()
+{
+ using std::optional;
+ using std::nullopt_t;
+ using std::nullopt;
+
+ {
+ typedef int T;
+ typedef optional<T> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+
+ static_assert ( !(nullopt < o1), "" );
+ static_assert ( (nullopt < o2), "" );
+ static_assert ( !(o1 < nullopt), "" );
+ static_assert ( !(o2 < nullopt), "" );
+
+ static_assert (noexcept(nullopt < o1), "");
+ static_assert (noexcept(o1 < nullopt), "");
+ }
+}
diff --git a/test/std/utilities/optional/optional.nullops/not_equal.pass.cpp b/test/std/utilities/optional/optional.nullops/not_equal.pass.cpp
new file mode 100644
index 000000000000..1c96dd42e808
--- /dev/null
+++ b/test/std/utilities/optional/optional.nullops/not_equal.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator!=(const optional<T>& x, nullopt_t) noexcept;
+// template <class T> constexpr bool operator!=(nullopt_t, const optional<T>& x) noexcept;
+
+#include <optional>
+
+int main()
+{
+ using std::optional;
+ using std::nullopt_t;
+ using std::nullopt;
+
+ {
+ typedef int T;
+ typedef optional<T> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2{1}; // engaged
+
+ static_assert ( !(nullopt != o1), "" );
+ static_assert ( (nullopt != o2), "" );
+ static_assert ( !(o1 != nullopt), "" );
+ static_assert ( (o2 != nullopt), "" );
+
+ static_assert (noexcept(nullopt != o1), "");
+ static_assert (noexcept(o1 != nullopt), "");
+ }
+}
diff --git a/test/std/utilities/optional/optional.nullopt/not_brace_initializable.fail.cpp b/test/std/utilities/optional/optional.nullopt/not_brace_initializable.fail.cpp
new file mode 100644
index 000000000000..86da5054a708
--- /dev/null
+++ b/test/std/utilities/optional/optional.nullopt/not_brace_initializable.fail.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// struct nullopt_t{see below};
+
+#include <optional>
+
+using std::optional;
+using std::nullopt_t;
+
+int main()
+{
+ // I roughly interpret LWG2736 as "it shall not be possible to copy-list-initialize nullopt_t with an
+ // empty braced-init-list."
+ nullopt_t foo = {};
+}
diff --git a/test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp b/test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp
new file mode 100644
index 000000000000..84bb29fabac8
--- /dev/null
+++ b/test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// struct nullopt_t{see below};
+// constexpr nullopt_t nullopt(unspecified);
+
+#include <optional>
+#include <type_traits>
+
+using std::optional;
+using std::nullopt_t;
+using std::nullopt;
+
+constexpr
+int
+test(const nullopt_t&)
+{
+ return 3;
+}
+
+int main()
+{
+ static_assert((std::is_class<nullopt_t>::value), "");
+ static_assert((std::is_empty<nullopt_t>::value), "");
+ static_assert((std::is_literal_type<nullopt_t>::value), "");
+ static_assert((!std::is_default_constructible<nullopt_t>::value), "");
+
+ static_assert(test(nullopt) == 3, "");
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/assign_value.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/assign_value.pass.cpp
new file mode 100644
index 000000000000..1207e24150ff
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/assign_value.pass.cpp
@@ -0,0 +1,273 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class U> optional<T>& operator=(U&& v);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+#include <memory>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+struct ThrowAssign {
+ static int dtor_called;
+ ThrowAssign() = default;
+ ThrowAssign(int) { TEST_THROW(42); }
+ ThrowAssign& operator=(int) {
+ TEST_THROW(42);
+ }
+ ~ThrowAssign() { ++dtor_called; }
+};
+int ThrowAssign::dtor_called = 0;
+
+template <class T, class Arg = T, bool Expect = true>
+void assert_assignable() {
+ static_assert(std::is_assignable<optional<T>&, Arg>::value == Expect, "");
+ static_assert(!std::is_assignable<const optional<T>&, Arg>::value, "");
+}
+
+struct MismatchType {
+ explicit MismatchType(int) {}
+ explicit MismatchType(char*) {}
+ explicit MismatchType(int*) = delete;
+ MismatchType& operator=(int) { return *this; }
+ MismatchType& operator=(int*) { return *this; }
+ MismatchType& operator=(char*) = delete;
+};
+
+struct FromOptionalType {
+ using Opt = std::optional<FromOptionalType>;
+ FromOptionalType() = default;
+ FromOptionalType(FromOptionalType const&) = delete;
+ template <class Dummy = void>
+ constexpr FromOptionalType(Opt&) { Dummy::BARK; }
+ template <class Dummy = void>
+ constexpr FromOptionalType& operator=(Opt&) { Dummy::BARK; return *this; }
+};
+
+void test_sfinae() {
+ using I = TestTypes::TestType;
+ using E = ExplicitTestTypes::TestType;
+ assert_assignable<int>();
+ assert_assignable<int, int&>();
+ assert_assignable<int, int const&>();
+ // Implicit test type
+ assert_assignable<I, I const&>();
+ assert_assignable<I, I&&>();
+ assert_assignable<I, int>();
+ assert_assignable<I, void*, false>();
+ // Explicit test type
+ assert_assignable<E, E const&>();
+ assert_assignable<E, E &&>();
+ assert_assignable<E, int>();
+ assert_assignable<E, void*, false>();
+ // Mismatch type
+ assert_assignable<MismatchType, int>();
+ assert_assignable<MismatchType, int*, false>();
+ assert_assignable<MismatchType, char*, false>();
+ // Type constructible from optional
+ assert_assignable<FromOptionalType, std::optional<FromOptionalType>&, false>();
+}
+
+void test_with_test_type()
+{
+ using T = TestTypes::TestType;
+ T::reset();
+ { // to empty
+ optional<T> opt;
+ opt = 3;
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::value_constructed == 1);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(3));
+ }
+ { // to existing
+ optional<T> opt(42);
+ T::reset_constructors();
+ opt = 3;
+ assert(T::alive == 1);
+ assert(T::constructed == 0);
+ assert(T::assigned == 1);
+ assert(T::value_assigned == 1);
+ assert(T::destroyed == 0);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(3));
+ }
+ { // test default argument
+ optional<T> opt;
+ T::reset_constructors();
+ opt = {1, 2};
+ assert(T::alive == 1);
+ assert(T::constructed == 2);
+ assert(T::value_constructed == 1);
+ assert(T::move_constructed == 1);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(1, 2));
+ }
+ { // test default argument
+ optional<T> opt(42);
+ T::reset_constructors();
+ opt = {1, 2};
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::value_constructed == 1);
+ assert(T::assigned == 1);
+ assert(T::move_assigned == 1);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(1, 2));
+ }
+ { // test default argument
+ optional<T> opt;
+ T::reset_constructors();
+ opt = {1};
+ assert(T::alive == 1);
+ assert(T::constructed == 2);
+ assert(T::value_constructed == 1);
+ assert(T::move_constructed == 1);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(1));
+ }
+ { // test default argument
+ optional<T> opt(42);
+ T::reset_constructors();
+ opt = {};
+ assert(static_cast<bool>(opt) == false);
+ assert(T::alive == 0);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 1);
+ }
+}
+
+template <class T, class Value = int>
+void test_with_type() {
+ { // to empty
+ optional<T> opt;
+ opt = Value(3);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(3));
+ }
+ { // to existing
+ optional<T> opt(Value(42));
+ opt = Value(3);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(3));
+ }
+ { // test const
+ optional<T> opt(Value(42));
+ const T t(Value(3));
+ opt = t;
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(3));
+ }
+ { // test default argument
+ optional<T> opt;
+ opt = {Value(1)};
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(1));
+ }
+ { // test default argument
+ optional<T> opt(Value(42));
+ opt = {};
+ assert(static_cast<bool>(opt) == false);
+ }
+}
+
+template <class T>
+void test_with_type_multi() {
+ test_with_type<T>();
+ { // test default argument
+ optional<T> opt;
+ opt = {1, 2};
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(1, 2));
+ }
+ { // test default argument
+ optional<T> opt(42);
+ opt = {1, 2};
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(1, 2));
+ }
+}
+
+void test_throws()
+{
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using T = ThrowAssign;
+ {
+ using T = ThrowAssign;
+ optional<T> opt;
+ try {
+ opt = 42;
+ assert(false);
+ } catch (int) {}
+ assert(static_cast<bool>(opt) == false);
+ }
+ assert(T::dtor_called == 0);
+ {
+ T::dtor_called = 0;
+ optional<T> opt(std::in_place);
+ try {
+ opt = 42;
+ assert(false);
+ } catch (int) {}
+ assert(static_cast<bool>(opt) == true);
+ assert(T::dtor_called == 0);
+ }
+ assert(T::dtor_called == 1);
+#endif
+}
+
+enum MyEnum { Zero, One, Two, Three, FortyTwo = 42 };
+
+using Fn = void(*)();
+
+int main()
+{
+ test_sfinae();
+ // Test with instrumented type
+ test_with_test_type();
+ // Test with various scalar types
+ test_with_type<int>();
+ test_with_type<MyEnum, MyEnum>();
+ test_with_type<int, MyEnum>();
+ test_with_type<Fn, Fn>();
+ // Test types with multi argument constructors
+ test_with_type_multi<ConstexprTestTypes::TestType>();
+ test_with_type_multi<TrivialTestTypes::TestType>();
+ // Test move only types
+ {
+ optional<std::unique_ptr<int>> opt;
+ opt = std::unique_ptr<int>(new int(3));
+ assert(static_cast<bool>(opt) == true);
+ assert(**opt == 3);
+ }
+ {
+ optional<std::unique_ptr<int>> opt(std::unique_ptr<int>(new int(2)));
+ opt = std::unique_ptr<int>(new int(3));
+ assert(static_cast<bool>(opt) == true);
+ assert(**opt == 3);
+ }
+ test_throws();
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/const_optional_U.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/const_optional_U.pass.cpp
new file mode 100644
index 000000000000..d471c053c907
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/const_optional_U.pass.cpp
@@ -0,0 +1,254 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// From LWG2451:
+// template<class U>
+// optional<T>& operator=(const optional<U>& rhs);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+struct X
+{
+ static bool throw_now;
+
+ X() = default;
+ X(int)
+ {
+ if (throw_now)
+ TEST_THROW(6);
+ }
+};
+
+bool X::throw_now = false;
+
+struct Y1
+{
+ Y1() = default;
+ Y1(const int&) {}
+ Y1& operator=(const Y1&) = delete;
+};
+
+struct Y2
+{
+ Y2() = default;
+ Y2(const int&) = delete;
+ Y2& operator=(const int&) { return *this; }
+};
+
+template <class T>
+struct AssignableFrom {
+ static int type_constructed;
+ static int type_assigned;
+static int int_constructed;
+ static int int_assigned;
+
+ static void reset() {
+ type_constructed = int_constructed = 0;
+ type_assigned = int_assigned = 0;
+ }
+
+ AssignableFrom() = default;
+
+ explicit AssignableFrom(T) { ++type_constructed; }
+ AssignableFrom& operator=(T) { ++type_assigned; return *this; }
+
+ AssignableFrom(int) { ++int_constructed; }
+ AssignableFrom& operator=(int) { ++int_assigned; return *this; }
+private:
+ AssignableFrom(AssignableFrom const&) = delete;
+ AssignableFrom& operator=(AssignableFrom const&) = delete;
+};
+
+template <class T> int AssignableFrom<T>::type_constructed = 0;
+template <class T> int AssignableFrom<T>::type_assigned = 0;
+template <class T> int AssignableFrom<T>::int_constructed = 0;
+template <class T> int AssignableFrom<T>::int_assigned = 0;
+
+
+void test_with_test_type() {
+ using T = TestTypes::TestType;
+ T::reset();
+ { // non-empty to empty
+ T::reset_constructors();
+ optional<T> opt;
+ const optional<int> other(42);
+ opt = other;
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::value_constructed == 1);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ assert(static_cast<bool>(other) == true);
+ assert(*other == 42);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(42));
+ }
+ assert(T::alive == 0);
+ { // non-empty to non-empty
+ optional<T> opt(101);
+ const optional<int> other(42);
+ T::reset_constructors();
+ opt = other;
+ assert(T::alive == 1);
+ assert(T::constructed == 0);
+ assert(T::assigned == 1);
+ assert(T::value_assigned == 1);
+ assert(T::destroyed == 0);
+ assert(static_cast<bool>(other) == true);
+ assert(*other == 42);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(42));
+ }
+ assert(T::alive == 0);
+ { // empty to non-empty
+ optional<T> opt(101);
+ const optional<int> other;
+ T::reset_constructors();
+ opt = other;
+ assert(T::alive == 0);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(other) == false);
+ assert(static_cast<bool>(opt) == false);
+ }
+ assert(T::alive == 0);
+ { // empty to empty
+ optional<T> opt;
+ const optional<int> other;
+ T::reset_constructors();
+ opt = other;
+ assert(T::alive == 0);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ assert(static_cast<bool>(other) == false);
+ assert(static_cast<bool>(opt) == false);
+ }
+ assert(T::alive == 0);
+}
+
+void test_ambigious_assign() {
+ using OptInt = std::optional<int>;
+ {
+ using T = AssignableFrom<OptInt const&>;
+ const OptInt a(42);
+ T::reset();
+ {
+ std::optional<T> t;
+ t = a;
+ assert(T::type_constructed == 1);
+ assert(T::type_assigned == 0);
+ assert(T::int_constructed == 0);
+ assert(T::int_assigned == 0);
+ }
+ T::reset();
+ {
+ std::optional<T> t(42);
+ t = a;
+ assert(T::type_constructed == 0);
+ assert(T::type_assigned == 1);
+ assert(T::int_constructed == 1);
+ assert(T::int_assigned == 0);
+ }
+ T::reset();
+ {
+ std::optional<T> t(42);
+ t = std::move(a);
+ assert(T::type_constructed == 0);
+ assert(T::type_assigned == 1);
+ assert(T::int_constructed == 1);
+ assert(T::int_assigned == 0);
+ }
+ }
+ {
+ using T = AssignableFrom<OptInt&>;
+ OptInt a(42);
+ T::reset();
+ {
+ std::optional<T> t;
+ t = a;
+ assert(T::type_constructed == 1);
+ assert(T::type_assigned == 0);
+ assert(T::int_constructed == 0);
+ assert(T::int_assigned == 0);
+ }
+ {
+ using Opt = std::optional<T>;
+ static_assert(!std::is_assignable_v<Opt&, OptInt const&>, "");
+ }
+ }
+}
+
+
+int main()
+{
+ test_with_test_type();
+ test_ambigious_assign();
+ {
+ optional<int> opt;
+ constexpr optional<short> opt2;
+ opt = opt2;
+ static_assert(static_cast<bool>(opt2) == false, "");
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ }
+ {
+ optional<int> opt;
+ constexpr optional<short> opt2(short{2});
+ opt = opt2;
+ static_assert(static_cast<bool>(opt2) == true, "");
+ static_assert(*opt2 == 2, "");
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ assert(*opt == *opt2);
+ }
+ {
+ optional<int> opt(3);
+ constexpr optional<short> opt2;
+ opt = opt2;
+ static_assert(static_cast<bool>(opt2) == false, "");
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ }
+ {
+ optional<int> opt(3);
+ constexpr optional<short> opt2(short{2});
+ opt = opt2;
+ static_assert(static_cast<bool>(opt2) == true, "");
+ static_assert(*opt2 == 2, "");
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ assert(*opt == *opt2);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ optional<X> opt;
+ optional<int> opt2(42);
+ assert(static_cast<bool>(opt2) == true);
+ try
+ {
+ X::throw_now = true;
+ opt = opt2;
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ assert(static_cast<bool>(opt) == false);
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp
new file mode 100644
index 000000000000..98c90aa1d4fb
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp
@@ -0,0 +1,102 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// optional<T>& operator=(const optional<T>& rhs);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+struct X
+{
+ static bool throw_now;
+
+ X() = default;
+ X(const X&)
+ {
+ if (throw_now)
+ TEST_THROW(6);
+ }
+};
+
+bool X::throw_now = false;
+
+template <class Tp>
+constexpr bool assign_empty(optional<Tp>&& lhs) {
+ const optional<Tp> rhs;
+ lhs = rhs;
+ return !lhs.has_value() && !rhs.has_value();
+}
+
+template <class Tp>
+constexpr bool assign_value(optional<Tp>&& lhs) {
+ const optional<Tp> rhs(101);
+ lhs = rhs;
+ return lhs.has_value() && rhs.has_value() && *lhs == *rhs;
+}
+
+int main()
+{
+ {
+ using O = optional<int>;
+ LIBCPP_STATIC_ASSERT(assign_empty(O{42}), "");
+ LIBCPP_STATIC_ASSERT(assign_value(O{42}), "");
+ assert(assign_empty(O{42}));
+ assert(assign_value(O{42}));
+ }
+ {
+ using O = optional<TrivialTestTypes::TestType>;
+ LIBCPP_STATIC_ASSERT(assign_empty(O{42}), "");
+ LIBCPP_STATIC_ASSERT(assign_value(O{42}), "");
+ assert(assign_empty(O{42}));
+ assert(assign_value(O{42}));
+ }
+ {
+ using O = optional<TestTypes::TestType>;
+ assert(assign_empty(O{42}));
+ assert(assign_value(O{42}));
+ }
+ {
+ using T = TestTypes::TestType;
+ T::reset();
+ optional<T> opt(3);
+ const optional<T> opt2;
+ assert(T::alive == 1);
+ opt = opt2;
+ assert(T::alive == 0);
+ assert(!opt2.has_value());
+ assert(!opt.has_value());
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ optional<X> opt;
+ optional<X> opt2(X{});
+ assert(static_cast<bool>(opt2) == true);
+ try
+ {
+ X::throw_now = true;
+ opt = opt2;
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ assert(static_cast<bool>(opt) == false);
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
new file mode 100644
index 000000000000..b5362589963c
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
@@ -0,0 +1,237 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class... Args> void optional<T>::emplace(Args&&... args);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+#include <memory>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+class X
+{
+ int i_;
+ int j_ = 0;
+public:
+ X() : i_(0) {}
+ X(int i) : i_(i) {}
+ X(int i, int j) : i_(i), j_(j) {}
+
+ friend bool operator==(const X& x, const X& y)
+ {return x.i_ == y.i_ && x.j_ == y.j_;}
+};
+
+class Y
+{
+public:
+ static bool dtor_called;
+ Y() = default;
+ Y(int) { TEST_THROW(6);}
+ ~Y() {dtor_called = true;}
+};
+
+bool Y::dtor_called = false;
+
+template <class T>
+void test_one_arg() {
+ using Opt = std::optional<T>;
+ {
+ Opt opt;
+ opt.emplace();
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(0));
+ }
+ {
+ Opt opt;
+ opt.emplace(1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(1));
+ }
+ {
+ Opt opt(2);
+ opt.emplace();
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(0));
+ }
+ {
+ Opt opt(2);
+ opt.emplace(1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(1));
+ }
+}
+
+
+template <class T>
+void test_multi_arg()
+{
+ test_one_arg<T>();
+ using Opt = std::optional<T>;
+ {
+ Opt opt;
+ opt.emplace(101, 41);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(101, 41));
+ }
+ {
+ Opt opt;
+ opt.emplace({1, 2, 3, 4});
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(4)); // T sets its value to the size of the init list
+ }
+ {
+ Opt opt;
+ opt.emplace({1, 2, 3, 4, 5}, 6);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(5)); // T sets its value to the size of the init list
+ }
+}
+
+template <class T>
+void test_on_test_type() {
+
+ T::reset();
+ optional<T> opt;
+ assert(T::alive == 0);
+ {
+ T::reset_constructors();
+ opt.emplace();
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::default_constructed == 1);
+ assert(T::destroyed == 0);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T());
+ }
+ {
+ T::reset_constructors();
+ opt.emplace();
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::default_constructed == 1);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T());
+ }
+ {
+ T::reset_constructors();
+ opt.emplace(101);
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::value_constructed == 1);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(101));
+ }
+ {
+ T::reset_constructors();
+ opt.emplace(-10, 99);
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::value_constructed == 1);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(-10, 99));
+ }
+ {
+ T::reset_constructors();
+ opt.emplace(-10, 99);
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::value_constructed == 1);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(-10, 99));
+ }
+ {
+ T::reset_constructors();
+ opt.emplace({-10, 99, 42, 1});
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::value_constructed == 1);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(4)); // size of the initializer list
+ }
+ {
+ T::reset_constructors();
+ opt.emplace({-10, 99, 42, 1}, 42);
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::value_constructed == 1);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(4)); // size of the initializer list
+ }
+}
+
+
+
+int main()
+{
+ {
+ test_on_test_type<TestTypes::TestType>();
+ test_on_test_type<ExplicitTestTypes::TestType>();
+ }
+ {
+ using T = int;
+ test_one_arg<T>();
+ test_one_arg<const T>();
+ }
+ {
+ using T = ConstexprTestTypes::TestType;
+ test_multi_arg<T>();
+ }
+ {
+ using T = ExplicitConstexprTestTypes::TestType;
+ test_multi_arg<T>();
+ }
+ {
+ using T = TrivialTestTypes::TestType;
+ test_multi_arg<T>();
+ }
+ {
+ using T = ExplicitTrivialTestTypes::TestType;
+ test_multi_arg<T>();
+ }
+ {
+ optional<const int> opt;
+ opt.emplace(42);
+ assert(*opt == 42);
+ opt.emplace();
+ assert(*opt == 0);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ Y::dtor_called = false;
+ {
+ Y y;
+ optional<Y> opt(y);
+ try
+ {
+ assert(static_cast<bool>(opt) == true);
+ assert(Y::dtor_called == false);
+ opt.emplace(1);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ assert(static_cast<bool>(opt) == false);
+ assert(Y::dtor_called == true);
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
new file mode 100644
index 000000000000..1c3c69a70303
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
@@ -0,0 +1,113 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class U, class... Args>
+// void optional<T>::emplace(initializer_list<U> il, Args&&... args);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+#include <vector>
+
+#include "test_macros.h"
+
+using std::optional;
+
+class X
+{
+ int i_;
+ int j_ = 0;
+public:
+ static bool dtor_called;
+ constexpr X() : i_(0) {}
+ constexpr X(int i) : i_(i) {}
+ constexpr X(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) {}
+ ~X() {dtor_called = true;}
+
+ friend constexpr bool operator==(const X& x, const X& y)
+ {return x.i_ == y.i_ && x.j_ == y.j_;}
+};
+
+bool X::dtor_called = false;
+
+class Y
+{
+ int i_;
+ int j_ = 0;
+public:
+ constexpr Y() : i_(0) {}
+ constexpr Y(int i) : i_(i) {}
+ constexpr Y(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) {}
+
+ friend constexpr bool operator==(const Y& x, const Y& y)
+ {return x.i_ == y.i_ && x.j_ == y.j_;}
+};
+
+class Z
+{
+ int i_;
+ int j_ = 0;
+public:
+ static bool dtor_called;
+ Z() : i_(0) {}
+ Z(int i) : i_(i) {}
+ Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
+ { TEST_THROW(6);}
+ ~Z() {dtor_called = true;}
+
+ friend bool operator==(const Z& x, const Z& y)
+ {return x.i_ == y.i_ && x.j_ == y.j_;}
+};
+
+bool Z::dtor_called = false;
+
+int main()
+{
+ {
+ X x;
+ optional<X> opt(x);
+ assert(X::dtor_called == false);
+ opt.emplace({1, 2});
+ assert(X::dtor_called == true);
+ assert(*opt == X({1, 2}));
+ }
+ {
+ optional<std::vector<int>> opt;
+ opt.emplace({1, 2, 3}, std::allocator<int>());
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == std::vector<int>({1, 2, 3}));
+ }
+ {
+ optional<Y> opt;
+ opt.emplace({1, 2});
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == Y({1, 2}));
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ Z z;
+ optional<Z> opt(z);
+ try
+ {
+ assert(static_cast<bool>(opt) == true);
+ assert(Z::dtor_called == false);
+ opt.emplace({1, 2});
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ assert(static_cast<bool>(opt) == false);
+ assert(Z::dtor_called == true);
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/move.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/move.pass.cpp
new file mode 100644
index 000000000000..3ba261b52464
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/move.pass.cpp
@@ -0,0 +1,174 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// optional<T>& operator=(optional<T>&& rhs)
+// noexcept(is_nothrow_move_assignable<T>::value &&
+// is_nothrow_move_constructible<T>::value);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+struct X
+{
+ static bool throw_now;
+ static int alive;
+
+ X() { ++alive; }
+ X(X&&)
+ {
+ if (throw_now)
+ TEST_THROW(6);
+ ++alive;
+ }
+
+ X& operator=(X&&)
+ {
+ if (throw_now)
+ TEST_THROW(42);
+ return *this;
+ }
+
+ ~X() { assert(alive > 0); --alive; }
+};
+
+struct Y {};
+
+bool X::throw_now = false;
+int X::alive = 0;
+
+int main()
+{
+ {
+ static_assert(std::is_nothrow_move_assignable<optional<int>>::value, "");
+ optional<int> opt;
+ constexpr optional<int> opt2;
+ opt = std::move(opt2);
+ static_assert(static_cast<bool>(opt2) == false, "");
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ }
+ {
+ optional<int> opt;
+ constexpr optional<int> opt2(2);
+ opt = std::move(opt2);
+ static_assert(static_cast<bool>(opt2) == true, "");
+ static_assert(*opt2 == 2, "");
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ assert(*opt == *opt2);
+ }
+ {
+ optional<int> opt(3);
+ constexpr optional<int> opt2;
+ opt = std::move(opt2);
+ static_assert(static_cast<bool>(opt2) == false, "");
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ }
+ {
+ using T = TestTypes::TestType;
+ T::reset();
+ optional<T> opt(3);
+ optional<T> opt2;
+ assert(T::alive == 1);
+ opt = std::move(opt2);
+ assert(T::alive == 0);
+ assert(static_cast<bool>(opt2) == false);
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ }
+ {
+ optional<int> opt(3);
+ constexpr optional<int> opt2(2);
+ opt = std::move(opt2);
+ static_assert(static_cast<bool>(opt2) == true, "");
+ static_assert(*opt2 == 2, "");
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ assert(*opt == *opt2);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ static_assert(!std::is_nothrow_move_assignable<optional<X>>::value, "");
+ X::alive = 0;
+ X::throw_now = false;
+ optional<X> opt;
+ optional<X> opt2(X{});
+ assert(X::alive == 1);
+ assert(static_cast<bool>(opt2) == true);
+ try
+ {
+ X::throw_now = true;
+ opt = std::move(opt2);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ assert(static_cast<bool>(opt) == false);
+ }
+ assert(X::alive == 1);
+ }
+ assert(X::alive == 0);
+ {
+ static_assert(!std::is_nothrow_move_assignable<optional<X>>::value, "");
+ X::throw_now = false;
+ optional<X> opt(X{});
+ optional<X> opt2(X{});
+ assert(X::alive == 2);
+ assert(static_cast<bool>(opt2) == true);
+ try
+ {
+ X::throw_now = true;
+ opt = std::move(opt2);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 42);
+ assert(static_cast<bool>(opt) == true);
+ }
+ assert(X::alive == 2);
+ }
+ assert(X::alive == 0);
+#endif // TEST_HAS_NO_EXCEPTIONS
+ {
+ static_assert(std::is_nothrow_move_assignable<optional<Y>>::value, "");
+ }
+ {
+ struct ThrowsMove {
+ ThrowsMove() noexcept {}
+ ThrowsMove(ThrowsMove const&) noexcept {}
+ ThrowsMove(ThrowsMove &&) noexcept(false) {}
+ ThrowsMove& operator=(ThrowsMove const&) noexcept { return *this; }
+ ThrowsMove& operator=(ThrowsMove &&) noexcept { return *this; }
+ };
+ static_assert(!std::is_nothrow_move_assignable<optional<ThrowsMove>>::value, "");
+ struct ThrowsMoveAssign {
+ ThrowsMoveAssign() noexcept {}
+ ThrowsMoveAssign(ThrowsMoveAssign const&) noexcept {}
+ ThrowsMoveAssign(ThrowsMoveAssign &&) noexcept {}
+ ThrowsMoveAssign& operator=(ThrowsMoveAssign const&) noexcept { return *this; }
+ ThrowsMoveAssign& operator=(ThrowsMoveAssign &&) noexcept(false) { return *this; }
+ };
+ static_assert(!std::is_nothrow_move_assignable<optional<ThrowsMoveAssign>>::value, "");
+ struct NoThrowMove {
+ NoThrowMove() noexcept(false) {}
+ NoThrowMove(NoThrowMove const&) noexcept(false) {}
+ NoThrowMove(NoThrowMove &&) noexcept {}
+ NoThrowMove& operator=(NoThrowMove const&) noexcept { return *this; }
+ NoThrowMove& operator=(NoThrowMove&&) noexcept { return *this; }
+ };
+ static_assert(std::is_nothrow_move_assignable<optional<NoThrowMove>>::value, "");
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp
new file mode 100644
index 000000000000..991f4334304c
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// optional<T>& operator=(nullopt_t) noexcept;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+using std::nullopt_t;
+using std::nullopt;
+
+int main()
+{
+ {
+ optional<int> opt;
+ static_assert(noexcept(opt = nullopt) == true, "");
+ opt = nullopt;
+ assert(static_cast<bool>(opt) == false);
+ }
+ {
+ optional<int> opt(3);
+ opt = nullopt;
+ assert(static_cast<bool>(opt) == false);
+ }
+ using TT = TestTypes::TestType;
+ TT::reset();
+ {
+ optional<TT> opt;
+ static_assert(noexcept(opt = nullopt) == true, "");
+ assert(TT::destroyed == 0);
+ opt = nullopt;
+ assert(TT::constructed == 0);
+ assert(TT::alive == 0);
+ assert(TT::destroyed == 0);
+ assert(static_cast<bool>(opt) == false);
+ }
+ assert(TT::alive == 0);
+ assert(TT::destroyed == 0);
+ TT::reset();
+ {
+ optional<TT> opt(42);
+ assert(TT::destroyed == 0);
+ TT::reset_constructors();
+ opt = nullopt;
+ assert(TT::constructed == 0);
+ assert(TT::alive == 0);
+ assert(TT::destroyed == 1);
+ assert(static_cast<bool>(opt) == false);
+ }
+ assert(TT::alive == 0);
+ assert(TT::destroyed == 1);
+ TT::reset();
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/optional_U.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/optional_U.pass.cpp
new file mode 100644
index 000000000000..db7fc19bfb10
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/optional_U.pass.cpp
@@ -0,0 +1,268 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// From LWG2451:
+// template <class U>
+// optional<T>& operator=(optional<U>&& rhs);
+
+#include <optional>
+#include <type_traits>
+#include <memory>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+struct X
+{
+ static bool throw_now;
+
+ X() = default;
+ X(int &&)
+ {
+ if (throw_now)
+ TEST_THROW(6);
+ }
+};
+
+bool X::throw_now = false;
+
+struct Y1
+{
+ Y1() = default;
+ Y1(const int&) {}
+ Y1& operator=(const Y1&) = delete;
+};
+
+struct Y2
+{
+ Y2() = default;
+ Y2(const int&) = delete;
+ Y2& operator=(const int&) { return *this; }
+};
+
+class B {};
+class D : public B {};
+
+
+template <class T>
+struct AssignableFrom {
+ static int type_constructed;
+ static int type_assigned;
+static int int_constructed;
+ static int int_assigned;
+
+ static void reset() {
+ type_constructed = int_constructed = 0;
+ type_assigned = int_assigned = 0;
+ }
+
+ AssignableFrom() = default;
+
+ explicit AssignableFrom(T) { ++type_constructed; }
+ AssignableFrom& operator=(T) { ++type_assigned; return *this; }
+
+ AssignableFrom(int) { ++int_constructed; }
+ AssignableFrom& operator=(int) { ++int_assigned; return *this; }
+private:
+ AssignableFrom(AssignableFrom const&) = delete;
+ AssignableFrom& operator=(AssignableFrom const&) = delete;
+};
+
+template <class T> int AssignableFrom<T>::type_constructed = 0;
+template <class T> int AssignableFrom<T>::type_assigned = 0;
+template <class T> int AssignableFrom<T>::int_constructed = 0;
+template <class T> int AssignableFrom<T>::int_assigned = 0;
+
+void test_with_test_type() {
+ using T = TestTypes::TestType;
+ T::reset();
+ { // non-empty to empty
+ T::reset_constructors();
+ optional<T> opt;
+ optional<int> other(42);
+ opt = std::move(other);
+ assert(T::alive == 1);
+ assert(T::constructed == 1);
+ assert(T::value_constructed == 1);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ assert(static_cast<bool>(other) == true);
+ assert(*other == 42);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(42));
+ }
+ assert(T::alive == 0);
+ { // non-empty to non-empty
+ optional<T> opt(101);
+ optional<int> other(42);
+ T::reset_constructors();
+ opt = std::move(other);
+ assert(T::alive == 1);
+ assert(T::constructed == 0);
+ assert(T::assigned == 1);
+ assert(T::value_assigned == 1);
+ assert(T::destroyed == 0);
+ assert(static_cast<bool>(other) == true);
+ assert(*other == 42);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == T(42));
+ }
+ assert(T::alive == 0);
+ { // empty to non-empty
+ optional<T> opt(101);
+ optional<int> other;
+ T::reset_constructors();
+ opt = std::move(other);
+ assert(T::alive == 0);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 1);
+ assert(static_cast<bool>(other) == false);
+ assert(static_cast<bool>(opt) == false);
+ }
+ assert(T::alive == 0);
+ { // empty to empty
+ optional<T> opt;
+ optional<int> other;
+ T::reset_constructors();
+ opt = std::move(other);
+ assert(T::alive == 0);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ assert(static_cast<bool>(other) == false);
+ assert(static_cast<bool>(opt) == false);
+ }
+ assert(T::alive == 0);
+}
+
+
+void test_ambigious_assign() {
+ using OptInt = std::optional<int>;
+ {
+ using T = AssignableFrom<OptInt&&>;
+ T::reset();
+ {
+ OptInt a(42);
+ std::optional<T> t;
+ t = std::move(a);
+ assert(T::type_constructed == 1);
+ assert(T::type_assigned == 0);
+ assert(T::int_constructed == 0);
+ assert(T::int_assigned == 0);
+ }
+ {
+ using Opt = std::optional<T>;
+ static_assert(!std::is_assignable<Opt&, const OptInt&&>::value, "");
+ static_assert(!std::is_assignable<Opt&, const OptInt&>::value, "");
+ static_assert(!std::is_assignable<Opt&, OptInt&>::value, "");
+ }
+ }
+ {
+ using T = AssignableFrom<OptInt const&&>;
+ T::reset();
+ {
+ const OptInt a(42);
+ std::optional<T> t;
+ t = std::move(a);
+ assert(T::type_constructed == 1);
+ assert(T::type_assigned == 0);
+ assert(T::int_constructed == 0);
+ assert(T::int_assigned == 0);
+ }
+ T::reset();
+ {
+ OptInt a(42);
+ std::optional<T> t;
+ t = std::move(a);
+ assert(T::type_constructed == 1);
+ assert(T::type_assigned == 0);
+ assert(T::int_constructed == 0);
+ assert(T::int_assigned == 0);
+ }
+ {
+ using Opt = std::optional<T>;
+ static_assert(std::is_assignable<Opt&, OptInt&&>::value, "");
+ static_assert(!std::is_assignable<Opt&, const OptInt&>::value, "");
+ static_assert(!std::is_assignable<Opt&, OptInt&>::value, "");
+ }
+ }
+}
+
+
+int main()
+{
+ test_with_test_type();
+ test_ambigious_assign();
+ {
+ optional<int> opt;
+ optional<short> opt2;
+ opt = std::move(opt2);
+ assert(static_cast<bool>(opt2) == false);
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ }
+ {
+ optional<int> opt;
+ optional<short> opt2(short{2});
+ opt = std::move(opt2);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ assert(*opt == *opt2);
+ }
+ {
+ optional<int> opt(3);
+ optional<short> opt2;
+ opt = std::move(opt2);
+ assert(static_cast<bool>(opt2) == false);
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ }
+ {
+ optional<int> opt(3);
+ optional<short> opt2(short{2});
+ opt = std::move(opt2);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ assert(static_cast<bool>(opt) == static_cast<bool>(opt2));
+ assert(*opt == *opt2);
+ }
+ {
+ optional<std::unique_ptr<B>> opt;
+ optional<std::unique_ptr<D>> other(new D());
+ opt = std::move(other);
+ assert(static_cast<bool>(opt) == true);
+ assert(static_cast<bool>(other) == true);
+ assert(opt->get() != nullptr);
+ assert(other->get() == nullptr);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ optional<X> opt;
+ optional<int> opt2(42);
+ assert(static_cast<bool>(opt2) == true);
+ try
+ {
+ X::throw_now = true;
+ opt = std::move(opt2);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ assert(static_cast<bool>(opt) == false);
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
new file mode 100644
index 000000000000..c4d4763a6f0a
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
@@ -0,0 +1,143 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <optional>
+
+// template <class U>
+// constexpr EXPLICIT optional(U&& u);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+#include "test_convertible.hpp"
+
+
+using std::optional;
+
+struct ImplicitThrow
+{
+ constexpr ImplicitThrow(int x) { if (x != -1) TEST_THROW(6);}
+};
+
+struct ExplicitThrow
+{
+ constexpr explicit ExplicitThrow(int x) { if (x != -1) TEST_THROW(6);}
+};
+
+
+template <class To, class From>
+constexpr bool implicit_conversion(optional<To>&& opt, const From& v)
+{
+ using O = optional<To>;
+ static_assert(test_convertible<O, From>(), "");
+ static_assert(!test_convertible<O, void*>(), "");
+ static_assert(!test_convertible<O, From, int>(), "");
+ return opt && *opt == static_cast<To>(v);
+}
+
+template <class To, class Input, class Expect>
+constexpr bool explicit_conversion(Input&& in, const Expect& v)
+{
+ using O = optional<To>;
+ static_assert(std::is_constructible<O, Input>::value, "");
+ static_assert(!std::is_convertible<Input, O>::value, "");
+ static_assert(!std::is_constructible<O, void*>::value, "");
+ static_assert(!std::is_constructible<O, Input, int>::value, "");
+ optional<To> opt(std::forward<Input>(in));
+ return opt && *opt == static_cast<To>(v);
+}
+
+void test_implicit()
+{
+ {
+ using T = long long;
+ static_assert(implicit_conversion<long long>(42, 42), "");
+ }
+ {
+ using T = long double;
+ static_assert(implicit_conversion<long double>(3.14, 3.14), "");
+ }
+ {
+ int x = 42;
+ optional<void* const> o(&x);
+ assert(*o == &x);
+ }
+ {
+ using T = TrivialTestTypes::TestType;
+ static_assert(implicit_conversion<T>(42, 42), "");
+ }
+ {
+ using T = TestTypes::TestType;
+ assert(implicit_conversion<T>(3, T(3)));
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ try {
+ using T = ImplicitThrow;
+ optional<T> t = 42;
+ assert(false);
+ ((void)t);
+ } catch (int) {
+ }
+ }
+#endif
+}
+
+void test_explicit() {
+ {
+ using T = ExplicitTrivialTestTypes::TestType;
+ using O = optional<T>;
+ static_assert(explicit_conversion<T>(42, 42), "");
+ }
+ {
+ using T = ExplicitConstexprTestTypes::TestType;
+ using O = optional<T>;
+ static_assert(explicit_conversion<T>(42, 42), "");
+ static_assert(!std::is_convertible<int, T>::value, "");
+ }
+ {
+ using T = ExplicitTestTypes::TestType;
+ using O = optional<T>;
+ T::reset();
+ {
+ assert(explicit_conversion<T>(42, 42));
+ assert(T::alive == 0);
+ }
+ T::reset();
+ {
+ optional<T> t(42);
+ assert(T::alive == 1);
+ assert(T::value_constructed == 1);
+ assert(T::move_constructed == 0);
+ assert(T::copy_constructed == 0);
+ assert(t.value().value == 42);
+ }
+ assert(T::alive == 0);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ try {
+ using T = ExplicitThrow;
+ optional<T> t(42);
+ assert(false);
+ } catch (int) {
+ }
+ }
+#endif
+}
+
+int main() {
+ test_implicit();
+ test_explicit();
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp
new file mode 100644
index 000000000000..34a12b8ad1c3
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp
@@ -0,0 +1,128 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <optional>
+
+// constexpr optional(const T& v);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+int main()
+{
+ {
+ typedef int T;
+ constexpr T t(5);
+ constexpr optional<T> opt(t);
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(*opt == 5, "");
+
+ struct test_constexpr_ctor
+ : public optional<T>
+ {
+ constexpr test_constexpr_ctor(const T&) {}
+ };
+
+ }
+ {
+ typedef double T;
+ constexpr T t(3);
+ constexpr optional<T> opt(t);
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(*opt == 3, "");
+
+ struct test_constexpr_ctor
+ : public optional<T>
+ {
+ constexpr test_constexpr_ctor(const T&) {}
+ };
+
+ }
+ {
+ const int x = 42;
+ optional<const int> o(x);
+ assert(*o == x);
+ }
+ {
+ typedef TestTypes::TestType T;
+ T::reset();
+ const T t(3);
+ optional<T> opt = t;
+ assert(T::alive == 2);
+ assert(T::copy_constructed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(opt.value().value == 3);
+ }
+ {
+ typedef ExplicitTestTypes::TestType T;
+ static_assert(!std::is_convertible<T const&, optional<T>>::value, "");
+ T::reset();
+ const T t(3);
+ optional<T> opt(t);
+ assert(T::alive == 2);
+ assert(T::copy_constructed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(opt.value().value == 3);
+ }
+ {
+ typedef ConstexprTestTypes::TestType T;
+ constexpr T t(3);
+ constexpr optional<T> opt = {t};
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(opt.value().value == 3, "");
+
+ struct test_constexpr_ctor
+ : public optional<T>
+ {
+ constexpr test_constexpr_ctor(const T&) {}
+ };
+ }
+ {
+ typedef ExplicitConstexprTestTypes::TestType T;
+ static_assert(!std::is_convertible<const T&, optional<T>>::value, "");
+ constexpr T t(3);
+ constexpr optional<T> opt(t);
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(opt.value().value == 3, "");
+
+ struct test_constexpr_ctor
+ : public optional<T>
+ {
+ constexpr test_constexpr_ctor(const T&) {}
+ };
+
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ struct Z {
+ Z(int) {}
+ Z(const Z&) {throw 6;}
+ };
+ typedef Z T;
+ try
+ {
+ const T t(3);
+ optional<T> opt(t);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/const_optional_U.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/const_optional_U.pass.cpp
new file mode 100644
index 000000000000..e12f6cb28f5a
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/const_optional_U.pass.cpp
@@ -0,0 +1,134 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class U>
+// optional(const optional<U>& rhs);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+
+template <class T, class U>
+void
+test(const optional<U>& rhs, bool is_going_to_throw = false)
+{
+ bool rhs_engaged = static_cast<bool>(rhs);
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try
+ {
+ optional<T> lhs = rhs;
+ assert(is_going_to_throw == false);
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+ if (rhs_engaged)
+ assert(*lhs == *rhs);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+#else
+ if (is_going_to_throw) return;
+ optional<T> lhs = rhs;
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+ if (rhs_engaged)
+ assert(*lhs == *rhs);
+#endif
+}
+
+class X
+{
+ int i_;
+public:
+ X(int i) : i_(i) {}
+ X(const X& x) : i_(x.i_) {}
+ ~X() {i_ = 0;}
+ friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
+};
+
+class Y
+{
+ int i_;
+public:
+ Y(int i) : i_(i) {}
+
+ friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;}
+};
+
+int count = 0;
+
+class Z
+{
+ int i_;
+public:
+ Z(int i) : i_(i) {TEST_THROW(6);}
+
+ friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
+};
+
+
+int main()
+{
+ {
+ typedef short U;
+ typedef int T;
+ optional<U> rhs;
+ test<T>(rhs);
+ }
+ {
+ typedef short U;
+ typedef int T;
+ optional<U> rhs(U{3});
+ test<T>(rhs);
+ }
+ {
+ typedef X T;
+ typedef int U;
+ optional<U> rhs;
+ test<T>(rhs);
+ }
+ {
+ typedef X T;
+ typedef int U;
+ optional<U> rhs(U{3});
+ test<T>(rhs);
+ }
+ {
+ typedef Y T;
+ typedef int U;
+ optional<U> rhs;
+ test<T>(rhs);
+ }
+ {
+ typedef Y T;
+ typedef int U;
+ optional<U> rhs(U{3});
+ test<T>(rhs);
+ }
+ {
+ typedef Z T;
+ typedef int U;
+ optional<U> rhs;
+ test<T>(rhs);
+ }
+ {
+ typedef Z T;
+ typedef int U;
+ optional<U> rhs(U{3});
+ test<T>(rhs, true);
+ }
+
+ static_assert(!(std::is_constructible<optional<X>, const optional<Y>&>::value), "");
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp
new file mode 100644
index 000000000000..5906d4edd119
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp
@@ -0,0 +1,155 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// optional(const optional<T>& rhs);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+template <class T, class ...InitArgs>
+void test(InitArgs&&... args)
+{
+ const optional<T> rhs(std::forward<InitArgs>(args)...);
+ bool rhs_engaged = static_cast<bool>(rhs);
+ optional<T> lhs = rhs;
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+ if (rhs_engaged)
+ assert(*lhs == *rhs);
+}
+
+void test_throwing_ctor() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ struct Z {
+ Z() : count(0) {}
+ Z(Z const& o) : count(o.count + 1)
+ { if (count == 2) throw 6; }
+ int count;
+ };
+ const Z z;
+ const optional<Z> rhs(z);
+ try
+ {
+ optional<Z> lhs(rhs);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+#endif
+}
+
+template <class T, class ...InitArgs>
+void test_ref(InitArgs&&... args)
+{
+ const optional<T> rhs(std::forward<InitArgs>(args)...);
+ bool rhs_engaged = static_cast<bool>(rhs);
+ optional<T> lhs = rhs;
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+ if (rhs_engaged)
+ assert(&(*lhs) == &(*rhs));
+}
+
+
+void test_reference_extension()
+{
+#if defined(_LIBCPP_VERSION) && 0 // FIXME these extensions are currently disabled.
+ using T = TestTypes::TestType;
+ T::reset();
+ {
+ T t;
+ T::reset_constructors();
+ test_ref<T&>();
+ test_ref<T&>(t);
+ assert(T::alive == 1);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ }
+ assert(T::destroyed == 1);
+ assert(T::alive == 0);
+ {
+ T t;
+ const T& ct = t;
+ T::reset_constructors();
+ test_ref<T const&>();
+ test_ref<T const&>(t);
+ test_ref<T const&>(ct);
+ assert(T::alive == 1);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ }
+ assert(T::alive == 0);
+ assert(T::destroyed == 1);
+ {
+ static_assert(!std::is_copy_constructible<std::optional<T&&>>::value, "");
+ static_assert(!std::is_copy_constructible<std::optional<T const&&>>::value, "");
+ }
+#endif
+}
+
+int main()
+{
+ test<int>();
+ test<int>(3);
+ {
+ const optional<const int> o(42);
+ optional<const int> o2(o);
+ assert(*o2 == 42);
+ }
+ {
+ using T = TestTypes::TestType;
+ T::reset();
+ const optional<T> rhs;
+ assert(T::alive == 0);
+ const optional<T> lhs(rhs);
+ assert(lhs.has_value() == false);
+ assert(T::alive == 0);
+ }
+ TestTypes::TestType::reset();
+ {
+ using T = TestTypes::TestType;
+ T::reset();
+ const optional<T> rhs(42);
+ assert(T::alive == 1);
+ assert(T::value_constructed == 1);
+ assert(T::copy_constructed == 0);
+ const optional<T> lhs(rhs);
+ assert(lhs.has_value());
+ assert(T::copy_constructed == 1);
+ assert(T::alive == 2);
+ }
+ TestTypes::TestType::reset();
+ {
+ using namespace ConstexprTestTypes;
+ test<TestType>();
+ test<TestType>(42);
+ }
+ {
+ using namespace TrivialTestTypes;
+ test<TestType>();
+ test<TestType>(42);
+ }
+ {
+ test_throwing_ctor();
+ }
+ {
+ test_reference_extension();
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/default.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/default.pass.cpp
new file mode 100644
index 000000000000..62795b91f9fd
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/default.pass.cpp
@@ -0,0 +1,81 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr optional() noexcept;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+template <class Opt>
+void
+test_constexpr()
+{
+ static_assert(std::is_nothrow_default_constructible<Opt>::value, "");
+ static_assert(std::is_trivially_destructible<Opt>::value, "");
+ static_assert(std::is_trivially_destructible<typename Opt::value_type>::value, "");
+
+ constexpr Opt opt;
+ static_assert(static_cast<bool>(opt) == false, "");
+
+ struct test_constexpr_ctor
+ : public Opt
+ {
+ constexpr test_constexpr_ctor() {}
+ };
+}
+
+template <class Opt>
+void
+test()
+{
+ static_assert(std::is_nothrow_default_constructible<Opt>::value, "");
+ static_assert(!std::is_trivially_destructible<Opt>::value, "");
+ static_assert(!std::is_trivially_destructible<typename Opt::value_type>::value, "");
+ {
+ Opt opt;
+ assert(static_cast<bool>(opt) == false);
+ }
+ {
+ const Opt opt;
+ assert(static_cast<bool>(opt) == false);
+ }
+
+ struct test_constexpr_ctor
+ : public Opt
+ {
+ constexpr test_constexpr_ctor() {}
+ };
+}
+
+int main()
+{
+ test_constexpr<optional<int>>();
+ test_constexpr<optional<int*>>();
+ test_constexpr<optional<ImplicitTypes::NoCtors>>();
+ test_constexpr<optional<NonTrivialTypes::NoCtors>>();
+ test_constexpr<optional<NonConstexprTypes::NoCtors>>();
+ test<optional<NonLiteralTypes::NoCtors>>();
+ // EXTENSIONS
+#if defined(_LIBCPP_VERSION) && 0 // FIXME these extensions are currently disabled.
+ test_constexpr<optional<int&>>();
+ test_constexpr<optional<const int&>>();
+ test_constexpr<optional<int&>>();
+ test_constexpr<optional<NonLiteralTypes::NoCtors&>>();
+ test_constexpr<optional<NonLiteralTypes::NoCtors&&>>();
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/explicit_const_optional_U.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/explicit_const_optional_U.pass.cpp
new file mode 100644
index 000000000000..64ac05316c2a
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/explicit_const_optional_U.pass.cpp
@@ -0,0 +1,121 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class U>
+// explicit optional(const optional<U>& rhs);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+
+template <class T, class U>
+void
+test(const optional<U>& rhs, bool is_going_to_throw = false)
+{
+ static_assert(!(std::is_convertible<const optional<U>&, optional<T>>::value), "");
+ bool rhs_engaged = static_cast<bool>(rhs);
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try
+ {
+ optional<T> lhs(rhs);
+ assert(is_going_to_throw == false);
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+ if (rhs_engaged)
+ assert(*lhs == T(*rhs));
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+#else
+ if (is_going_to_throw) return;
+ optional<T> lhs(rhs);
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+ if (rhs_engaged)
+ assert(*lhs == T(*rhs));
+#endif
+}
+
+class X
+{
+ int i_;
+public:
+ explicit X(int i) : i_(i) {}
+ X(const X& x) : i_(x.i_) {}
+ ~X() {i_ = 0;}
+ friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
+};
+
+class Y
+{
+ int i_;
+public:
+ explicit Y(int i) : i_(i) {}
+
+ friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;}
+};
+
+int count = 0;
+
+class Z
+{
+ int i_;
+public:
+ explicit Z(int i) : i_(i) { TEST_THROW(6);}
+
+ friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
+};
+
+
+int main()
+{
+ {
+ typedef X T;
+ typedef int U;
+ optional<U> rhs;
+ test<T>(rhs);
+ }
+ {
+ typedef X T;
+ typedef int U;
+ optional<U> rhs(3);
+ test<T>(rhs);
+ }
+ {
+ typedef Y T;
+ typedef int U;
+ optional<U> rhs;
+ test<T>(rhs);
+ }
+ {
+ typedef Y T;
+ typedef int U;
+ optional<U> rhs(3);
+ test<T>(rhs);
+ }
+ {
+ typedef Z T;
+ typedef int U;
+ optional<U> rhs;
+ test<T>(rhs);
+ }
+ {
+ typedef Z T;
+ typedef int U;
+ optional<U> rhs(3);
+ test<T>(rhs, true);
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/explicit_optional_U.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/explicit_optional_U.pass.cpp
new file mode 100644
index 000000000000..2c6757a95825
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/explicit_optional_U.pass.cpp
@@ -0,0 +1,84 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class U>
+// explicit optional(optional<U>&& rhs);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+
+template <class T, class U>
+void
+test(optional<U>&& rhs, bool is_going_to_throw = false)
+{
+ static_assert(!(std::is_convertible<optional<U>&&, optional<T>>::value), "");
+ bool rhs_engaged = static_cast<bool>(rhs);
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try
+ {
+ optional<T> lhs(std::move(rhs));
+ assert(is_going_to_throw == false);
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+#else
+ if (is_going_to_throw) return;
+ optional<T> lhs(std::move(rhs));
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+#endif
+}
+
+class X
+{
+ int i_;
+public:
+ explicit X(int i) : i_(i) {}
+ X(X&& x) : i_(std::exchange(x.i_, 0)) {}
+ ~X() {i_ = 0;}
+ friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
+};
+
+int count = 0;
+
+class Z
+{
+public:
+ explicit Z(int) { TEST_THROW(6); }
+};
+
+int main()
+{
+ {
+ optional<int> rhs;
+ test<X>(std::move(rhs));
+ }
+ {
+ optional<int> rhs(3);
+ test<X>(std::move(rhs));
+ }
+ {
+ optional<int> rhs;
+ test<Z>(std::move(rhs));
+ }
+ {
+ optional<int> rhs(3);
+ test<Z>(std::move(rhs), true);
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp
new file mode 100644
index 000000000000..d0823d2c8c82
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp
@@ -0,0 +1,148 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <optional>
+
+// template <class... Args>
+// constexpr explicit optional(in_place_t, Args&&... args);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+using std::in_place_t;
+using std::in_place;
+
+class X
+{
+ int i_;
+ int j_ = 0;
+public:
+ X() : i_(0) {}
+ X(int i) : i_(i) {}
+ X(int i, int j) : i_(i), j_(j) {}
+
+ ~X() {}
+
+ friend bool operator==(const X& x, const X& y)
+ {return x.i_ == y.i_ && x.j_ == y.j_;}
+};
+
+class Y
+{
+ int i_;
+ int j_ = 0;
+public:
+ constexpr Y() : i_(0) {}
+ constexpr Y(int i) : i_(i) {}
+ constexpr Y(int i, int j) : i_(i), j_(j) {}
+
+ friend constexpr bool operator==(const Y& x, const Y& y)
+ {return x.i_ == y.i_ && x.j_ == y.j_;}
+};
+
+class Z
+{
+public:
+ Z(int) {TEST_THROW(6);}
+};
+
+
+int main()
+{
+ {
+ constexpr optional<int> opt(in_place, 5);
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(*opt == 5, "");
+
+ struct test_constexpr_ctor
+ : public optional<int>
+ {
+ constexpr test_constexpr_ctor(in_place_t, int i)
+ : optional<int>(in_place, i) {}
+ };
+
+ }
+ {
+ optional<const int> opt(in_place, 5);
+ assert(*opt == 5);
+ }
+ {
+ const optional<X> opt(in_place);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == X());
+ }
+ {
+ const optional<X> opt(in_place, 5);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == X(5));
+ }
+ {
+ const optional<X> opt(in_place, 5, 4);
+ assert(static_cast<bool>(opt) == true);
+ assert(*opt == X(5, 4));
+ }
+ {
+ constexpr optional<Y> opt(in_place);
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(*opt == Y(), "");
+
+ struct test_constexpr_ctor
+ : public optional<Y>
+ {
+ constexpr test_constexpr_ctor(in_place_t)
+ : optional<Y>(in_place) {}
+ };
+
+ }
+ {
+ constexpr optional<Y> opt(in_place, 5);
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(*opt == Y(5), "");
+
+ struct test_constexpr_ctor
+ : public optional<Y>
+ {
+ constexpr test_constexpr_ctor(in_place_t, int i)
+ : optional<Y>(in_place, i) {}
+ };
+
+ }
+ {
+ constexpr optional<Y> opt(in_place, 5, 4);
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(*opt == Y(5, 4), "");
+
+ struct test_constexpr_ctor
+ : public optional<Y>
+ {
+ constexpr test_constexpr_ctor(in_place_t, int i, int j)
+ : optional<Y>(in_place, i, j) {}
+ };
+
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ try
+ {
+ const optional<Z> opt(in_place, 1);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
new file mode 100644
index 000000000000..6d9f45a97d45
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp
@@ -0,0 +1,116 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class U, class... Args>
+// constexpr
+// explicit optional(in_place_t, initializer_list<U> il, Args&&... args);
+
+#include <optional>
+#include <type_traits>
+#include <vector>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+using std::in_place_t;
+using std::in_place;
+
+class X
+{
+ int i_;
+ int j_ = 0;
+public:
+ X() : i_(0) {}
+ X(int i) : i_(i) {}
+ X(int i, int j) : i_(i), j_(j) {}
+
+ ~X() {}
+
+ friend bool operator==(const X& x, const X& y)
+ {return x.i_ == y.i_ && x.j_ == y.j_;}
+};
+
+class Y
+{
+ int i_;
+ int j_ = 0;
+public:
+ constexpr Y() : i_(0) {}
+ constexpr Y(int i) : i_(i) {}
+ constexpr Y(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) {}
+
+ friend constexpr bool operator==(const Y& x, const Y& y)
+ {return x.i_ == y.i_ && x.j_ == y.j_;}
+};
+
+class Z
+{
+ int i_;
+ int j_ = 0;
+public:
+ Z() : i_(0) {}
+ Z(int i) : i_(i) {}
+ Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
+ {TEST_THROW(6);}
+
+ friend bool operator==(const Z& x, const Z& y)
+ {return x.i_ == y.i_ && x.j_ == y.j_;}
+};
+
+int main()
+{
+ {
+ static_assert(!std::is_constructible<X, std::initializer_list<int>&>::value, "");
+ static_assert(!std::is_constructible<optional<X>, std::initializer_list<int>&>::value, "");
+ }
+ {
+ optional<std::vector<int>> opt(in_place, {3, 1});
+ assert(static_cast<bool>(opt) == true);
+ assert((*opt == std::vector<int>{3, 1}));
+ assert(opt->size() == 2);
+ }
+ {
+ optional<std::vector<int>> opt(in_place, {3, 1}, std::allocator<int>());
+ assert(static_cast<bool>(opt) == true);
+ assert((*opt == std::vector<int>{3, 1}));
+ assert(opt->size() == 2);
+ }
+ {
+ static_assert(std::is_constructible<optional<Y>, std::initializer_list<int>&>::value, "");
+ constexpr optional<Y> opt(in_place, {3, 1});
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(*opt == Y{3, 1}, "");
+
+ struct test_constexpr_ctor
+ : public optional<Y>
+ {
+ constexpr test_constexpr_ctor(in_place_t, std::initializer_list<int> i)
+ : optional<Y>(in_place, i) {}
+ };
+
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ static_assert(std::is_constructible<optional<Z>, std::initializer_list<int>&>::value, "");
+ try
+ {
+ optional<Z> opt(in_place, {3, 1});
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
new file mode 100644
index 000000000000..bff6f5bf8f6f
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
@@ -0,0 +1,201 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// optional(optional<T>&& rhs);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+template <class T, class ...InitArgs>
+void test(InitArgs&&... args)
+{
+ const optional<T> orig(std::forward<InitArgs>(args)...);
+ optional<T> rhs(orig);
+ bool rhs_engaged = static_cast<bool>(rhs);
+ optional<T> lhs = std::move(rhs);
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+ if (rhs_engaged)
+ assert(*lhs == *orig);
+}
+
+void test_throwing_ctor() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ struct Z {
+ Z() : count(0) {}
+ Z(Z&& o) : count(o.count + 1)
+ { if (count == 2) throw 6; }
+ int count;
+ };
+ Z z;
+ optional<Z> rhs(std::move(z));
+ try
+ {
+ optional<Z> lhs(std::move(rhs));
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+#endif
+}
+
+
+template <class T, class ...InitArgs>
+void test_ref(InitArgs&&... args)
+{
+ optional<T> rhs(std::forward<InitArgs>(args)...);
+ bool rhs_engaged = static_cast<bool>(rhs);
+ optional<T> lhs = std::move(rhs);
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+ if (rhs_engaged)
+ assert(&(*lhs) == &(*rhs));
+}
+
+void test_reference_extension()
+{
+#if defined(_LIBCPP_VERSION) && 0 // FIXME these extensions are currently disabled.
+ using T = TestTypes::TestType;
+ T::reset();
+ {
+ T t;
+ T::reset_constructors();
+ test_ref<T&>();
+ test_ref<T&>(t);
+ assert(T::alive == 1);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ }
+ assert(T::destroyed == 1);
+ assert(T::alive == 0);
+ {
+ T t;
+ const T& ct = t;
+ T::reset_constructors();
+ test_ref<T const&>();
+ test_ref<T const&>(t);
+ test_ref<T const&>(ct);
+ assert(T::alive == 1);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ }
+ assert(T::alive == 0);
+ assert(T::destroyed == 1);
+ {
+ T t;
+ T::reset_constructors();
+ test_ref<T&&>();
+ test_ref<T&&>(std::move(t));
+ assert(T::alive == 1);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ }
+ assert(T::alive == 0);
+ assert(T::destroyed == 1);
+ {
+ T t;
+ const T& ct = t;
+ T::reset_constructors();
+ test_ref<T const&&>();
+ test_ref<T const&&>(std::move(t));
+ test_ref<T const&&>(std::move(ct));
+ assert(T::alive == 1);
+ assert(T::constructed == 0);
+ assert(T::assigned == 0);
+ assert(T::destroyed == 0);
+ }
+ assert(T::alive == 0);
+ assert(T::destroyed == 1);
+ {
+ static_assert(!std::is_copy_constructible<std::optional<T&&>>::value, "");
+ static_assert(!std::is_copy_constructible<std::optional<T const&&>>::value, "");
+ }
+#endif
+}
+
+
+int main()
+{
+ test<int>();
+ test<int>(3);
+ {
+ optional<const int> o(42);
+ optional<const int> o2(std::move(o));
+ assert(*o2 == 42);
+ }
+ {
+ using T = TestTypes::TestType;
+ T::reset();
+ optional<T> rhs;
+ assert(T::alive == 0);
+ const optional<T> lhs(std::move(rhs));
+ assert(lhs.has_value() == false);
+ assert(rhs.has_value() == false);
+ assert(T::alive == 0);
+ }
+ TestTypes::TestType::reset();
+ {
+ using T = TestTypes::TestType;
+ T::reset();
+ optional<T> rhs(42);
+ assert(T::alive == 1);
+ assert(T::value_constructed == 1);
+ assert(T::move_constructed == 0);
+ const optional<T> lhs(std::move(rhs));
+ assert(lhs.has_value());
+ assert(rhs.has_value());
+ assert(lhs.value().value == 42);
+ assert(rhs.value().value == -1);
+ assert(T::move_constructed == 1);
+ assert(T::alive == 2);
+ }
+ TestTypes::TestType::reset();
+ {
+ using namespace ConstexprTestTypes;
+ test<TestType>();
+ test<TestType>(42);
+ }
+ {
+ using namespace TrivialTestTypes;
+ test<TestType>();
+ test<TestType>(42);
+ }
+ {
+ test_throwing_ctor();
+ }
+ {
+ struct ThrowsMove {
+ ThrowsMove() noexcept(false) {}
+ ThrowsMove(ThrowsMove const&) noexcept(false) {}
+ ThrowsMove(ThrowsMove &&) noexcept(false) {}
+ };
+ static_assert(!std::is_nothrow_move_constructible<optional<ThrowsMove>>::value, "");
+ struct NoThrowMove {
+ NoThrowMove() noexcept(false) {}
+ NoThrowMove(NoThrowMove const&) noexcept(false) {}
+ NoThrowMove(NoThrowMove &&) noexcept(true) {}
+ };
+ static_assert(std::is_nothrow_move_constructible<optional<NoThrowMove>>::value, "");
+ }
+ {
+ test_reference_extension();
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp
new file mode 100644
index 000000000000..468a00346fc7
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr optional(nullopt_t) noexcept;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "archetypes.hpp"
+
+using std::optional;
+using std::nullopt_t;
+using std::nullopt;
+
+template <class Opt>
+void
+test_constexpr()
+{
+ static_assert(std::is_nothrow_constructible<Opt, nullopt_t&>::value, "");
+ static_assert(std::is_trivially_destructible<Opt>::value, "");
+ static_assert(std::is_trivially_destructible<typename Opt::value_type>::value, "");
+
+ constexpr Opt opt(nullopt);
+ static_assert(static_cast<bool>(opt) == false, "");
+
+ struct test_constexpr_ctor
+ : public Opt
+ {
+ constexpr test_constexpr_ctor() {}
+ };
+}
+
+template <class Opt>
+void
+test()
+{
+ static_assert(std::is_nothrow_constructible<Opt, nullopt_t&>::value, "");
+ static_assert(!std::is_trivially_destructible<Opt>::value, "");
+ static_assert(!std::is_trivially_destructible<typename Opt::value_type>::value, "");
+ {
+ Opt opt(nullopt);
+ assert(static_cast<bool>(opt) == false);
+ }
+ {
+ const Opt opt(nullopt);
+ assert(static_cast<bool>(opt) == false);
+ }
+ struct test_constexpr_ctor
+ : public Opt
+ {
+ constexpr test_constexpr_ctor() {}
+ };
+}
+
+int main()
+{
+ test_constexpr<optional<int>>();
+ test_constexpr<optional<int*>>();
+ test_constexpr<optional<ImplicitTypes::NoCtors>>();
+ test_constexpr<optional<NonTrivialTypes::NoCtors>>();
+ test_constexpr<optional<NonConstexprTypes::NoCtors>>();
+ test<optional<NonLiteralTypes::NoCtors>>();
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/optional_U.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/optional_U.pass.cpp
new file mode 100644
index 000000000000..0e180c14ec67
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/optional_U.pass.cpp
@@ -0,0 +1,93 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class U>
+// optional(optional<U>&& rhs);
+
+#include <optional>
+#include <type_traits>
+#include <memory>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+
+template <class T, class U>
+void
+test(optional<U>&& rhs, bool is_going_to_throw = false)
+{
+ bool rhs_engaged = static_cast<bool>(rhs);
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try
+ {
+ optional<T> lhs = std::move(rhs);
+ assert(is_going_to_throw == false);
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+#else
+ if (is_going_to_throw) return;
+ optional<T> lhs = std::move(rhs);
+ assert(static_cast<bool>(lhs) == rhs_engaged);
+#endif
+}
+
+class X
+{
+ int i_;
+public:
+ X(int i) : i_(i) {}
+ X(X&& x) : i_(std::exchange(x.i_, 0)) {}
+ ~X() {i_ = 0;}
+ friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
+};
+
+int count = 0;
+
+struct Z
+{
+ Z(int) { TEST_THROW(6); }
+};
+
+int main()
+{
+ {
+ optional<short> rhs;
+ test<int>(std::move(rhs));
+ }
+ {
+ optional<short> rhs(short{3});
+ test<int>(std::move(rhs));
+ }
+ {
+ optional<int> rhs;
+ test<X>(std::move(rhs));
+ }
+ {
+ optional<int> rhs(3);
+ test<X>(std::move(rhs));
+ }
+ {
+ optional<int> rhs;
+ test<Z>(std::move(rhs));
+ }
+ {
+ optional<int> rhs(3);
+ test<Z>(std::move(rhs), true);
+ }
+
+ static_assert(!(std::is_constructible<optional<X>, optional<Z>>::value), "");
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
new file mode 100644
index 000000000000..eee749d01707
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
@@ -0,0 +1,153 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <optional>
+
+// constexpr optional(T&& v);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+
+using std::optional;
+
+
+class Z
+{
+public:
+ Z(int) {}
+ Z(Z&&) {TEST_THROW(6);}
+};
+
+
+int main()
+{
+ {
+ typedef int T;
+ constexpr optional<T> opt(T(5));
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(*opt == 5, "");
+
+ struct test_constexpr_ctor
+ : public optional<T>
+ {
+ constexpr test_constexpr_ctor(T&&) {}
+ };
+ }
+ {
+ typedef double T;
+ constexpr optional<T> opt(T(3));
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(*opt == 3, "");
+
+ struct test_constexpr_ctor
+ : public optional<T>
+ {
+ constexpr test_constexpr_ctor(T&&) {}
+ };
+ }
+ {
+ const int x = 42;
+ optional<const int> o(std::move(x));
+ assert(*o == 42);
+ }
+ {
+ typedef TestTypes::TestType T;
+ T::reset();
+ optional<T> opt = T{3};
+ assert(T::alive == 1);
+ assert(T::move_constructed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(opt.value().value == 3);
+ }
+ {
+ typedef ExplicitTestTypes::TestType T;
+ static_assert(!std::is_convertible<T&&, optional<T>>::value, "");
+ T::reset();
+ optional<T> opt(T{3});
+ assert(T::alive == 1);
+ assert(T::move_constructed == 1);
+ assert(static_cast<bool>(opt) == true);
+ assert(opt.value().value == 3);
+ }
+ {
+ typedef TestTypes::TestType T;
+ T::reset();
+ optional<T> opt = {3};
+ assert(T::alive == 1);
+ assert(T::value_constructed == 1);
+ assert(T::copy_constructed == 0);
+ assert(T::move_constructed == 0);
+ assert(static_cast<bool>(opt) == true);
+ assert(opt.value().value == 3);
+ }
+ {
+ typedef ConstexprTestTypes::TestType T;
+ constexpr optional<T> opt = {T(3)};
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(opt.value().value == 3, "");
+
+ struct test_constexpr_ctor
+ : public optional<T>
+ {
+ constexpr test_constexpr_ctor(const T&) {}
+ };
+ }
+ {
+ typedef ConstexprTestTypes::TestType T;
+ constexpr optional<T> opt = {3};
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(opt.value().value == 3, "");
+
+ struct test_constexpr_ctor
+ : public optional<T>
+ {
+ constexpr test_constexpr_ctor(const T&) {}
+ };
+ }
+ {
+ typedef ExplicitConstexprTestTypes::TestType T;
+ static_assert(!std::is_convertible<T&&, optional<T>>::value, "");
+ constexpr optional<T> opt(T{3});
+ static_assert(static_cast<bool>(opt) == true, "");
+ static_assert(opt.value().value == 3, "");
+
+ struct test_constexpr_ctor
+ : public optional<T>
+ {
+ constexpr test_constexpr_ctor(T&&) {}
+ };
+
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ struct Z {
+ Z(int) {}
+ Z(Z&&) {throw 6;}
+ };
+ typedef Z T;
+ try
+ {
+ T t(3);
+ optional<T> opt(std::move(t));
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp
new file mode 100644
index 000000000000..5132c9a73d0f
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// ~optional();
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+using std::optional;
+
+struct PODType {
+ int value;
+ int value2;
+};
+
+class X
+{
+public:
+ static bool dtor_called;
+ X() = default;
+ ~X() {dtor_called = true;}
+};
+
+bool X::dtor_called = false;
+
+int main()
+{
+ {
+ typedef int T;
+ static_assert(std::is_trivially_destructible<T>::value, "");
+ static_assert(std::is_trivially_destructible<optional<T>>::value, "");
+ static_assert(std::is_literal_type<optional<T>>::value, "");
+ }
+ {
+ typedef double T;
+ static_assert(std::is_trivially_destructible<T>::value, "");
+ static_assert(std::is_trivially_destructible<optional<T>>::value, "");
+ static_assert(std::is_literal_type<optional<T>>::value, "");
+ }
+ {
+ typedef PODType T;
+ static_assert(std::is_trivially_destructible<T>::value, "");
+ static_assert(std::is_trivially_destructible<optional<T>>::value, "");
+ static_assert(std::is_literal_type<optional<T>>::value, "");
+ }
+ {
+ typedef X T;
+ static_assert(!std::is_trivially_destructible<T>::value, "");
+ static_assert(!std::is_trivially_destructible<optional<T>>::value, "");
+ static_assert(!std::is_literal_type<optional<T>>::value, "");
+ {
+ X x;
+ optional<X> opt{x};
+ assert(X::dtor_called == false);
+ }
+ assert(X::dtor_called == true);
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
new file mode 100644
index 000000000000..cee73da849b6
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <optional>
+
+// void reset() noexcept;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+using std::optional;
+
+struct X
+{
+ static bool dtor_called;
+ ~X() {dtor_called = true;}
+};
+
+bool X::dtor_called = false;
+
+int main()
+{
+ {
+ optional<int> opt;
+ static_assert(noexcept(opt.reset()) == true, "");
+ opt.reset();
+ assert(static_cast<bool>(opt) == false);
+ }
+ {
+ optional<int> opt(3);
+ opt.reset();
+ assert(static_cast<bool>(opt) == false);
+ }
+ {
+ optional<X> opt;
+ static_assert(noexcept(opt.reset()) == true, "");
+ assert(X::dtor_called == false);
+ opt.reset();
+ assert(X::dtor_called == false);
+ assert(static_cast<bool>(opt) == false);
+ }
+ assert(X::dtor_called == false); // TRANSITION, Clang/C2 VSO#239997
+ {
+ optional<X> opt(X{});
+ X::dtor_called = false;
+ opt.reset();
+ assert(X::dtor_called == true);
+ assert(static_cast<bool>(opt) == false);
+ X::dtor_called = false;
+ }
+ assert(X::dtor_called == false); // TRANSITION, Clang/C2 VSO#239997
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/bool.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/bool.pass.cpp
new file mode 100644
index 000000000000..9820d50f632e
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/bool.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr explicit optional<T>::operator bool() const noexcept;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main()
+{
+ using std::optional;
+ {
+ const optional<int> opt; ((void)opt);
+ ASSERT_NOEXCEPT(bool(opt));
+ static_assert(!std::is_convertible<optional<int>, bool>::value, "");
+ }
+ {
+ constexpr optional<int> opt;
+ static_assert(!opt, "");
+ }
+ {
+ constexpr optional<int> opt(0);
+ static_assert(opt, "");
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp
new file mode 100644
index 000000000000..4087cfdf104e
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr T& optional<T>::operator*() &;
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+
+struct X
+{
+ constexpr int test() const& {return 3;}
+ int test() & {return 4;}
+ constexpr int test() const&& {return 5;}
+ int test() && {return 6;}
+};
+
+struct Y
+{
+ constexpr int test() {return 7;}
+};
+
+constexpr int
+test()
+{
+ optional<Y> opt{Y{}};
+ return (*opt).test();
+}
+
+int main()
+{
+ {
+ optional<X> opt; ((void)opt);
+ ASSERT_SAME_TYPE(decltype(*opt), X&);
+ // ASSERT_NOT_NOEXCEPT(*opt);
+ // FIXME: This assertion fails with GCC because it can see that
+ // (A) operator*() is constexpr, and
+ // (B) there is no path through the function that throws.
+ // It's arguable if this is the correct behavior for the noexcept
+ // operator.
+ // Regardless this function should still be noexcept(false) because
+ // it has a narrow contract.
+ }
+ {
+ optional<X> opt(X{});
+ assert((*opt).test() == 4);
+ }
+ static_assert(test() == 7, "");
+#ifdef _LIBCPP_DEBUG
+ {
+ optional<X> opt;
+ assert((*opt).test() == 3);
+ assert(false);
+ }
+#endif // _LIBCPP_DEBUG
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp
new file mode 100644
index 000000000000..0779c9047c9e
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr const T& optional<T>::operator*() const &;
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+
+struct X
+{
+ constexpr int test() const& {return 3;}
+ int test() & {return 4;}
+ constexpr int test() const&& {return 5;}
+ int test() && {return 6;}
+};
+
+struct Y
+{
+ int test() const {return 2;}
+};
+
+int main()
+{
+ {
+ const optional<X> opt; ((void)opt);
+ ASSERT_SAME_TYPE(decltype(*opt), X const&);
+ // ASSERT_NOT_NOEXCEPT(*opt);
+ // FIXME: This assertion fails with GCC because it can see that
+ // (A) operator*() is constexpr, and
+ // (B) there is no path through the function that throws.
+ // It's arguable if this is the correct behavior for the noexcept
+ // operator.
+ // Regardless this function should still be noexcept(false) because
+ // it has a narrow contract.
+ }
+ {
+ constexpr optional<X> opt(X{});
+ static_assert((*opt).test() == 3, "");
+ }
+ {
+ constexpr optional<Y> opt(Y{});
+ assert((*opt).test() == 2);
+ }
+#ifdef _LIBCPP_DEBUG
+ {
+ const optional<X> opt;
+ assert((*opt).test() == 3);
+ assert(false);
+ }
+#endif // _LIBCPP_DEBUG
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp
new file mode 100644
index 000000000000..78fd992952c9
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr T&& optional<T>::operator*() const &&;
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+
+struct X
+{
+ constexpr int test() const& {return 3;}
+ int test() & {return 4;}
+ constexpr int test() const&& {return 5;}
+ int test() && {return 6;}
+};
+
+struct Y
+{
+ int test() const && {return 2;}
+};
+
+int main()
+{
+ {
+ const optional<X> opt; ((void)opt);
+ ASSERT_SAME_TYPE(decltype(*std::move(opt)), X const &&);
+ // ASSERT_NOT_NOEXCEPT(*std::move(opt));
+ // FIXME: This assertion fails with GCC because it can see that
+ // (A) operator*() is constexpr, and
+ // (B) there is no path through the function that throws.
+ // It's arguable if this is the correct behavior for the noexcept
+ // operator.
+ // Regardless this function should still be noexcept(false) because
+ // it has a narrow contract.
+ }
+ {
+ constexpr optional<X> opt(X{});
+ static_assert((*std::move(opt)).test() == 5, "");
+ }
+ {
+ constexpr optional<Y> opt(Y{});
+ assert((*std::move(opt)).test() == 2);
+ }
+#ifdef _LIBCPP_DEBUG
+ {
+ optional<X> opt;
+ assert((*std::move(opt)).test() == 5);
+ assert(false);
+ }
+#endif // _LIBCPP_DEBUG
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp
new file mode 100644
index 000000000000..2924123234a8
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr T&& optional<T>::operator*() &&;
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+
+struct X
+{
+ constexpr int test() const& {return 3;}
+ int test() & {return 4;}
+ constexpr int test() const&& {return 5;}
+ int test() && {return 6;}
+};
+
+struct Y
+{
+ constexpr int test() && {return 7;}
+};
+
+constexpr int
+test()
+{
+ optional<Y> opt{Y{}};
+ return (*std::move(opt)).test();
+}
+
+int main()
+{
+ {
+ optional<X> opt; ((void)opt);
+ ASSERT_SAME_TYPE(decltype(*std::move(opt)), X&&);
+ // ASSERT_NOT_NOEXCEPT(*std::move(opt));
+ // FIXME: This assertion fails with GCC because it can see that
+ // (A) operator*() is constexpr, and
+ // (B) there is no path through the function that throws.
+ // It's arguable if this is the correct behavior for the noexcept
+ // operator.
+ // Regardless this function should still be noexcept(false) because
+ // it has a narrow contract.
+ }
+ {
+ optional<X> opt(X{});
+ assert((*std::move(opt)).test() == 6);
+ }
+ static_assert(test() == 7, "");
+#ifdef _LIBCPP_DEBUG
+ {
+ optional<X> opt;
+ assert((*std::move(opt)).test() == 3);
+ assert(false);
+ }
+#endif // _LIBCPP_DEBUG
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/has_value.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/has_value.pass.cpp
new file mode 100644
index 000000000000..5df295d01e22
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/has_value.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr bool optional<T>::has_value() const noexcept;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main()
+{
+ using std::optional;
+ {
+ const optional<int> opt; ((void)opt);
+ ASSERT_NOEXCEPT(opt.has_value());
+ ASSERT_SAME_TYPE(decltype(opt.has_value()), bool);
+ }
+ {
+ constexpr optional<int> opt;
+ static_assert(!opt.has_value(), "");
+ }
+ {
+ constexpr optional<int> opt(0);
+ static_assert(opt.has_value(), "");
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp
new file mode 100644
index 000000000000..2f1648c48c89
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr T* optional<T>::operator->();
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+
+struct X
+{
+ int test() noexcept {return 3;}
+};
+
+struct Y
+{
+ constexpr int test() {return 3;}
+};
+
+constexpr int
+test()
+{
+ optional<Y> opt{Y{}};
+ return opt->test();
+}
+
+int main()
+{
+ {
+ std::optional<X> opt; ((void)opt);
+ ASSERT_SAME_TYPE(decltype(opt.operator->()), X*);
+ // ASSERT_NOT_NOEXCEPT(opt.operator->());
+ // FIXME: This assertion fails with GCC because it can see that
+ // (A) operator->() is constexpr, and
+ // (B) there is no path through the function that throws.
+ // It's arguable if this is the correct behavior for the noexcept
+ // operator.
+ // Regardless this function should still be noexcept(false) because
+ // it has a narrow contract.
+ }
+ {
+ optional<X> opt(X{});
+ assert(opt->test() == 3);
+ }
+ {
+ static_assert(test() == 3, "");
+ }
+#ifdef _LIBCPP_DEBUG
+ {
+ optional<X> opt;
+ assert(opt->test() == 3);
+ assert(false);
+ }
+#endif // _LIBCPP_DEBUG
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
new file mode 100644
index 000000000000..887edc7114eb
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr const T* optional<T>::operator->() const;
+
+#ifdef _LIBCPP_DEBUG
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+
+struct X
+{
+ constexpr int test() const {return 3;}
+};
+
+struct Y
+{
+ int test() const noexcept {return 2;}
+};
+
+struct Z
+{
+ const Z* operator&() const;
+ constexpr int test() const {return 1;}
+};
+
+int main()
+{
+ {
+ const std::optional<X> opt; ((void)opt);
+ ASSERT_SAME_TYPE(decltype(opt.operator->()), X const*);
+ // ASSERT_NOT_NOEXCEPT(opt.operator->());
+ // FIXME: This assertion fails with GCC because it can see that
+ // (A) operator->() is constexpr, and
+ // (B) there is no path through the function that throws.
+ // It's arguable if this is the correct behavior for the noexcept
+ // operator.
+ // Regardless this function should still be noexcept(false) because
+ // it has a narrow contract.
+ }
+ {
+ constexpr optional<X> opt(X{});
+ static_assert(opt->test() == 3, "");
+ }
+ {
+ constexpr optional<Y> opt(Y{});
+ assert(opt->test() == 2);
+ }
+ {
+ constexpr optional<Z> opt(Z{});
+ static_assert(opt->test() == 1, "");
+ }
+#ifdef _LIBCPP_DEBUG
+ {
+ const optional<X> opt;
+ assert(opt->test() == 3);
+ assert(false);
+ }
+#endif // _LIBCPP_DEBUG
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp
new file mode 100644
index 000000000000..516a79db5f64
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr T& optional<T>::value() &;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+using std::bad_optional_access;
+
+struct X
+{
+ X() = default;
+ X(const X&) = delete;
+ constexpr int test() const & {return 3;}
+ int test() & {return 4;}
+ constexpr int test() const && {return 5;}
+ int test() && {return 6;}
+};
+
+struct Y
+{
+ constexpr int test() & {return 7;}
+};
+
+constexpr int
+test()
+{
+ optional<Y> opt{Y{}};
+ return opt.value().test();
+}
+
+
+int main()
+{
+ {
+ optional<X> opt; ((void)opt);
+ ASSERT_NOT_NOEXCEPT(opt.value());
+ ASSERT_SAME_TYPE(decltype(opt.value()), X&);
+ }
+ {
+ optional<X> opt;
+ opt.emplace();
+ assert(opt.value().test() == 4);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ optional<X> opt;
+ try
+ {
+ opt.value();
+ assert(false);
+ }
+ catch (const bad_optional_access&)
+ {
+ }
+ }
+#endif
+ static_assert(test() == 7, "");
+}
diff --git a/test/libcxx/containers/sequences/list/db_front.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_const.fail.cpp
index fc02895a8912..6076c509fa41 100644
--- a/test/libcxx/containers/sequences/list/db_front.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_const.fail.cpp
@@ -7,26 +7,27 @@
//
//===----------------------------------------------------------------------===//
-// <list>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
-// Call front() on empty container.
+// constexpr const T& optional<T>::value() const &;
-#define _LIBCPP_DEBUG 1
-#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
-
-#include <list>
+#include <optional>
+#include <type_traits>
#include <cassert>
-#include <iterator>
-#include <exception>
-#include <cstdlib>
+
+using std::optional;
+
+struct X
+{
+ constexpr int test() const {return 3;}
+ int test() {return 4;}
+};
int main()
{
- typedef int T;
- typedef std::list<T> C;
- C c(1);
- assert(c.front() == 0);
- c.clear();
- assert(c.front() == 0);
- assert(false);
+ {
+ constexpr optional<X> opt;
+ static_assert(opt.value().test() == 3, "");
+ }
}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp
new file mode 100644
index 000000000000..d4038e4efa6b
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr const T& optional<T>::value() const &;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+using std::in_place_t;
+using std::in_place;
+using std::bad_optional_access;
+
+struct X
+{
+ X() = default;
+ X(const X&) = delete;
+ constexpr int test() const & {return 3;}
+ int test() & {return 4;}
+ constexpr int test() const && {return 5;}
+ int test() && {return 6;}
+};
+
+int main()
+{
+ {
+ const optional<X> opt; ((void)opt);
+ ASSERT_NOT_NOEXCEPT(opt.value());
+ ASSERT_SAME_TYPE(decltype(opt.value()), X const&);
+ }
+ {
+ constexpr optional<X> opt(in_place);
+ static_assert(opt.value().test() == 3, "");
+ }
+ {
+ const optional<X> opt(in_place);
+ assert(opt.value().test() == 3);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ const optional<X> opt;
+ try
+ {
+ opt.value();
+ assert(false);
+ }
+ catch (const bad_optional_access&)
+ {
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp
new file mode 100644
index 000000000000..e189d3af6886
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr const T& optional<T>::value() const &&;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+using std::in_place_t;
+using std::in_place;
+using std::bad_optional_access;
+
+struct X
+{
+ X() = default;
+ X(const X&) = delete;
+ constexpr int test() const & {return 3;}
+ int test() & {return 4;}
+ constexpr int test() const && {return 5;}
+ int test() && {return 6;}
+};
+
+int main()
+{
+ {
+ const optional<X> opt; ((void)opt);
+ ASSERT_NOT_NOEXCEPT(std::move(opt).value());
+ ASSERT_SAME_TYPE(decltype(std::move(opt).value()), X const&&);
+ }
+ {
+ constexpr optional<X> opt(in_place);
+ static_assert(std::move(opt).value().test() == 5, "");
+ }
+ {
+ const optional<X> opt(in_place);
+ assert(std::move(opt).value().test() == 5);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ const optional<X> opt;
+ try
+ {
+ std::move(opt).value();
+ assert(false);
+ }
+ catch (const bad_optional_access&)
+ {
+ }
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_or.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_or.pass.cpp
new file mode 100644
index 000000000000..c219e9704716
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_or.pass.cpp
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class U> T optional<T>::value_or(U&& v) &&;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+using std::in_place_t;
+using std::in_place;
+
+struct Y
+{
+ int i_;
+
+ Y(int i) : i_(i) {}
+};
+
+struct X
+{
+ int i_;
+
+ X(int i) : i_(i) {}
+ X(X&& x) : i_(x.i_) {x.i_ = 0;}
+ X(const Y& y) : i_(y.i_) {}
+ X(Y&& y) : i_(y.i_+1) {}
+ friend constexpr bool operator==(const X& x, const X& y)
+ {return x.i_ == y.i_;}
+};
+
+int main()
+{
+ {
+ optional<X> opt(in_place, 2);
+ Y y(3);
+ assert(std::move(opt).value_or(y) == 2);
+ assert(*opt == 0);
+ }
+ {
+ optional<X> opt(in_place, 2);
+ assert(std::move(opt).value_or(Y(3)) == 2);
+ assert(*opt == 0);
+ }
+ {
+ optional<X> opt;
+ Y y(3);
+ assert(std::move(opt).value_or(y) == 3);
+ assert(!opt);
+ }
+ {
+ optional<X> opt;
+ assert(std::move(opt).value_or(Y(3)) == 4);
+ assert(!opt);
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_or_const.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_or_const.pass.cpp
new file mode 100644
index 000000000000..36a85811ba49
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_or_const.pass.cpp
@@ -0,0 +1,77 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class U> constexpr T optional<T>::value_or(U&& v) const&;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+using std::optional;
+
+struct Y
+{
+ int i_;
+
+ constexpr Y(int i) : i_(i) {}
+};
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+ constexpr X(const Y& y) : i_(y.i_) {}
+ constexpr X(Y&& y) : i_(y.i_+1) {}
+ friend constexpr bool operator==(const X& x, const X& y)
+ {return x.i_ == y.i_;}
+};
+
+int main()
+{
+ {
+ constexpr optional<X> opt(2);
+ constexpr Y y(3);
+ static_assert(opt.value_or(y) == 2, "");
+ }
+ {
+ constexpr optional<X> opt(2);
+ static_assert(opt.value_or(Y(3)) == 2, "");
+ }
+ {
+ constexpr optional<X> opt;
+ constexpr Y y(3);
+ static_assert(opt.value_or(y) == 3, "");
+ }
+ {
+ constexpr optional<X> opt;
+ static_assert(opt.value_or(Y(3)) == 4, "");
+ }
+ {
+ const optional<X> opt(2);
+ const Y y(3);
+ assert(opt.value_or(y) == 2);
+ }
+ {
+ const optional<X> opt(2);
+ assert(opt.value_or(Y(3)) == 2);
+ }
+ {
+ const optional<X> opt;
+ const Y y(3);
+ assert(opt.value_or(y) == 3);
+ }
+ {
+ const optional<X> opt;
+ assert(opt.value_or(Y(3)) == 4);
+ }
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp
new file mode 100644
index 000000000000..2ef485b7fe50
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// constexpr T& optional<T>::value() &&;
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+using std::optional;
+using std::bad_optional_access;
+
+struct X
+{
+ X() = default;
+ X(const X&) = delete;
+ constexpr int test() const & {return 3;}
+ int test() & {return 4;}
+ constexpr int test() const && {return 5;}
+ int test() && {return 6;}
+};
+
+struct Y
+{
+ constexpr int test() && {return 7;}
+};
+
+constexpr int
+test()
+{
+ optional<Y> opt{Y{}};
+ return std::move(opt).value().test();
+}
+
+int main()
+{
+ {
+ optional<X> opt; ((void)opt);
+ ASSERT_NOT_NOEXCEPT(std::move(opt).value());
+ ASSERT_SAME_TYPE(decltype(std::move(opt).value()), X&&);
+ }
+ {
+ optional<X> opt;
+ opt.emplace();
+ assert(std::move(opt).value().test() == 6);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ optional<X> opt;
+ try
+ {
+ std::move(opt).value();
+ assert(false);
+ }
+ catch (const bad_optional_access&)
+ {
+ }
+ }
+#endif
+ static_assert(test() == 7, "");
+}
diff --git a/test/std/utilities/optional/optional.object/optional.object.swap/swap.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.swap/swap.pass.cpp
new file mode 100644
index 000000000000..26041259fa93
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional.object.swap/swap.pass.cpp
@@ -0,0 +1,306 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// void swap(optional&)
+// noexcept(is_nothrow_move_constructible<T>::value &&
+// is_nothrow_swappable<T>::value)
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+class X
+{
+ int i_;
+public:
+ static unsigned dtor_called;
+ X(int i) : i_(i) {}
+ X(X&& x) = default;
+ X& operator=(X&&) = default;
+ ~X() {++dtor_called;}
+
+ friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
+};
+
+unsigned X::dtor_called = 0;
+
+class Y
+{
+ int i_;
+public:
+ static unsigned dtor_called;
+ Y(int i) : i_(i) {}
+ Y(Y&&) = default;
+ ~Y() {++dtor_called;}
+
+ friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;}
+ friend void swap(Y& x, Y& y) {std::swap(x.i_, y.i_);}
+};
+
+unsigned Y::dtor_called = 0;
+
+class Z
+{
+ int i_;
+public:
+ Z(int i) : i_(i) {}
+ Z(Z&&) {TEST_THROW(7);}
+
+ friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
+ friend void swap(Z&, Z&) {TEST_THROW(6);}
+};
+
+
+int main()
+{
+ {
+ optional<int> opt1;
+ optional<int> opt2;
+ static_assert(noexcept(opt1.swap(opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ opt1.swap(opt2);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ }
+ {
+ optional<int> opt1(1);
+ optional<int> opt2;
+ static_assert(noexcept(opt1.swap(opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == false);
+ opt1.swap(opt2);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<int> opt1;
+ optional<int> opt2(2);
+ static_assert(noexcept(opt1.swap(opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ opt1.swap(opt2);
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == false);
+ }
+ {
+ optional<int> opt1(1);
+ optional<int> opt2(2);
+ static_assert(noexcept(opt1.swap(opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ opt1.swap(opt2);
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<X> opt1;
+ optional<X> opt2;
+ static_assert(noexcept(opt1.swap(opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ opt1.swap(opt2);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ assert(X::dtor_called == 0);
+ }
+ {
+ optional<X> opt1(1);
+ optional<X> opt2;
+ static_assert(noexcept(opt1.swap(opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == false);
+ X::dtor_called = 0;
+ opt1.swap(opt2);
+ assert(X::dtor_called == 1);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<X> opt1;
+ optional<X> opt2(2);
+ static_assert(noexcept(opt1.swap(opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ X::dtor_called = 0;
+ opt1.swap(opt2);
+ assert(X::dtor_called == 1);
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == false);
+ }
+ {
+ optional<X> opt1(1);
+ optional<X> opt2(2);
+ static_assert(noexcept(opt1.swap(opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ X::dtor_called = 0;
+ opt1.swap(opt2);
+ assert(X::dtor_called == 1); // from inside std::swap
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<Y> opt1;
+ optional<Y> opt2;
+ static_assert(noexcept(opt1.swap(opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ opt1.swap(opt2);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ assert(Y::dtor_called == 0);
+ }
+ {
+ optional<Y> opt1(1);
+ optional<Y> opt2;
+ static_assert(noexcept(opt1.swap(opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == false);
+ Y::dtor_called = 0;
+ opt1.swap(opt2);
+ assert(Y::dtor_called == 1);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<Y> opt1;
+ optional<Y> opt2(2);
+ static_assert(noexcept(opt1.swap(opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ Y::dtor_called = 0;
+ opt1.swap(opt2);
+ assert(Y::dtor_called == 1);
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == false);
+ }
+ {
+ optional<Y> opt1(1);
+ optional<Y> opt2(2);
+ static_assert(noexcept(opt1.swap(opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ Y::dtor_called = 0;
+ opt1.swap(opt2);
+ assert(Y::dtor_called == 0);
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<Z> opt1;
+ optional<Z> opt2;
+ static_assert(noexcept(opt1.swap(opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ opt1.swap(opt2);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ optional<Z> opt1;
+ opt1.emplace(1);
+ optional<Z> opt2;
+ static_assert(noexcept(opt1.swap(opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == false);
+ try
+ {
+ opt1.swap(opt2);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 7);
+ }
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == false);
+ }
+ {
+ optional<Z> opt1;
+ optional<Z> opt2;
+ opt2.emplace(2);
+ static_assert(noexcept(opt1.swap(opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ try
+ {
+ opt1.swap(opt2);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 7);
+ }
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ }
+ {
+ optional<Z> opt1;
+ opt1.emplace(1);
+ optional<Z> opt2;
+ opt2.emplace(2);
+ static_assert(noexcept(opt1.swap(opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ try
+ {
+ opt1.swap(opt2);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ }
+#endif
+}
diff --git a/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp b/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp
new file mode 100644
index 000000000000..8a2c77af0ec1
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// T shall be an object type and shall satisfy the requirements of Destructible
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+private:
+ ~X() {}
+};
+
+int main()
+{
+ using std::optional;
+ {
+ // expected-error@optional:* 2 {{static_assert failed "instantiation of optional with a reference type is ill-formed}}
+ optional<int&> opt1;
+ optional<int&&> opt2;
+ }
+ {
+ // expected-error@optional:* {{static_assert failed "instantiation of optional with a non-destructible type is ill-formed"}}
+ optional<X> opt3;
+ }
+ {
+ // expected-error@optional:* {{static_assert failed "instantiation of optional with a non-object type is undefined behavior"}}
+ // expected-error@optional:* {{static_assert failed "instantiation of optional with a non-destructible type is ill-formed}}
+ optional<void()> opt4;
+ }
+ {
+ // expected-error@optional:* {{static_assert failed "instantiation of optional with a non-object type is undefined behavior"}}
+ // expected-error@optional:* {{static_assert failed "instantiation of optional with a non-destructible type is ill-formed}}
+ // expected-error@optional:* 1+ {{cannot form a reference to 'void'}}
+ optional<const void> opt4;
+ }
+ // FIXME these are garbage diagnostics that Clang should not produce
+ // expected-error@optional:* 0+ {{is not a base class}}
+}
diff --git a/test/std/utilities/optional/optional.object/special_member_gen.pass.cpp b/test/std/utilities/optional/optional.object/special_member_gen.pass.cpp
new file mode 100644
index 000000000000..fdd0f154f0e5
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/special_member_gen.pass.cpp
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "archetypes.hpp"
+
+template <class T>
+struct SpecialMemberTest {
+ using O = std::optional<T>;
+
+ static_assert(std::is_default_constructible_v<O>,
+ "optional is always default constructible.");
+ static_assert(std::is_copy_constructible_v<O> == std::is_copy_constructible_v<T>,
+ "optional<T> is copy constructible if and only if T is copy constructible.");
+ static_assert(std::is_move_constructible_v<O> ==
+ (std::is_copy_constructible_v<T> || std::is_move_constructible_v<T>),
+ "optional<T> is move constructible if and only if T is copy or move constructible.");
+ static_assert(std::is_copy_assignable_v<O> ==
+ (std::is_copy_constructible_v<T> && std::is_copy_assignable_v<T>),
+ "optional<T> is copy assignable if and only if T is both copy "
+ "constructible and copy assignable.");
+ static_assert(std::is_move_assignable_v<O> ==
+ ((std::is_copy_constructible_v<T> && std::is_copy_assignable_v<T>) ||
+ (std::is_move_constructible_v<T> && std::is_move_assignable_v<T>)),
+ "optional<T> is move assignable if and only if T is both move assignable and "
+ "move constructible, or both copy constructible and copy assignable.");
+};
+
+template <class ...Args> static void sink(Args&&...) {}
+
+template <class ...TestTypes>
+struct DoTestsMetafunction {
+ DoTestsMetafunction() { sink(SpecialMemberTest<TestTypes>{}...); }
+};
+
+struct TrivialMoveNonTrivialCopy {
+ TrivialMoveNonTrivialCopy() = default;
+ TrivialMoveNonTrivialCopy(const TrivialMoveNonTrivialCopy&) {}
+ TrivialMoveNonTrivialCopy(TrivialMoveNonTrivialCopy&&) = default;
+ TrivialMoveNonTrivialCopy& operator=(const TrivialMoveNonTrivialCopy&) { return *this; }
+ TrivialMoveNonTrivialCopy& operator=(TrivialMoveNonTrivialCopy&&) = default;
+};
+
+struct TrivialCopyNonTrivialMove {
+ TrivialCopyNonTrivialMove() = default;
+ TrivialCopyNonTrivialMove(const TrivialCopyNonTrivialMove&) = default;
+ TrivialCopyNonTrivialMove(TrivialCopyNonTrivialMove&&) {}
+ TrivialCopyNonTrivialMove& operator=(const TrivialCopyNonTrivialMove&) = default;
+ TrivialCopyNonTrivialMove& operator=(TrivialCopyNonTrivialMove&&) { return *this; }
+};
+
+int main()
+{
+ sink(
+ ImplicitTypes::ApplyTypes<DoTestsMetafunction>{},
+ ExplicitTypes::ApplyTypes<DoTestsMetafunction>{},
+ NonLiteralTypes::ApplyTypes<DoTestsMetafunction>{},
+ NonTrivialTypes::ApplyTypes<DoTestsMetafunction>{},
+ DoTestsMetafunction<TrivialMoveNonTrivialCopy, TrivialCopyNonTrivialMove>{}
+ );
+}
diff --git a/test/std/utilities/optional/optional.object/types.pass.cpp b/test/std/utilities/optional/optional.object/types.pass.cpp
new file mode 100644
index 000000000000..0230a13dded1
--- /dev/null
+++ b/test/std/utilities/optional/optional.object/types.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T>
+// class optional
+// {
+// public:
+// typedef T value_type;
+// ...
+
+#include <optional>
+#include <type_traits>
+
+using std::optional;
+
+template <class Opt, class T>
+void
+test()
+{
+ static_assert(std::is_same<typename Opt::value_type, T>::value, "");
+}
+
+int main()
+{
+ test<optional<int>, int>();
+ test<optional<const int>, const int>();
+ test<optional<double>, double>();
+ test<optional<const double>, const double>();
+}
diff --git a/test/std/utilities/optional/optional.relops/equal.pass.cpp b/test/std/utilities/optional/optional.relops/equal.pass.cpp
new file mode 100644
index 000000000000..6650b6720a8e
--- /dev/null
+++ b/test/std/utilities/optional/optional.relops/equal.pass.cpp
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator==(const optional<T>& x, const optional<T>& y);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator == ( const X &lhs, const X &rhs )
+ { return lhs.i_ == rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef X T;
+ typedef optional<T> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2; // disengaged
+ constexpr O o3{1}; // engaged
+ constexpr O o4{2}; // engaged
+ constexpr O o5{1}; // engaged
+
+ static_assert ( o1 == o1 , "" );
+ static_assert ( o1 == o2 , "" );
+ static_assert ( !(o1 == o3), "" );
+ static_assert ( !(o1 == o4), "" );
+ static_assert ( !(o1 == o5), "" );
+
+ static_assert ( o2 == o1 , "" );
+ static_assert ( o2 == o2 , "" );
+ static_assert ( !(o2 == o3), "" );
+ static_assert ( !(o2 == o4), "" );
+ static_assert ( !(o2 == o5), "" );
+
+ static_assert ( !(o3 == o1), "" );
+ static_assert ( !(o3 == o2), "" );
+ static_assert ( o3 == o3 , "" );
+ static_assert ( !(o3 == o4), "" );
+ static_assert ( o3 == o5 , "" );
+
+ static_assert ( !(o4 == o1), "" );
+ static_assert ( !(o4 == o2), "" );
+ static_assert ( !(o4 == o3), "" );
+ static_assert ( o4 == o4 , "" );
+ static_assert ( !(o4 == o5), "" );
+
+ static_assert ( !(o5 == o1), "" );
+ static_assert ( !(o5 == o2), "" );
+ static_assert ( o5 == o3 , "" );
+ static_assert ( !(o5 == o4), "" );
+ static_assert ( o5 == o5 , "" );
+
+ }
+}
diff --git a/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp b/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp
new file mode 100644
index 000000000000..f9b30449638a
--- /dev/null
+++ b/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator>= (const optional<T>& x, const optional<T>& y);
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator >= ( const X &lhs, const X &rhs )
+ { return lhs.i_ >= rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef optional<X> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2; // disengaged
+ constexpr O o3{1}; // engaged
+ constexpr O o4{2}; // engaged
+ constexpr O o5{1}; // engaged
+
+ static_assert ( (o1 >= o1), "" );
+ static_assert ( (o1 >= o2), "" );
+ static_assert ( !(o1 >= o3), "" );
+ static_assert ( !(o1 >= o4), "" );
+ static_assert ( !(o1 >= o5), "" );
+
+ static_assert ( (o2 >= o1), "" );
+ static_assert ( (o2 >= o2), "" );
+ static_assert ( !(o2 >= o3), "" );
+ static_assert ( !(o2 >= o4), "" );
+ static_assert ( !(o2 >= o5), "" );
+
+ static_assert ( (o3 >= o1), "" );
+ static_assert ( (o3 >= o2), "" );
+ static_assert ( (o3 >= o3), "" );
+ static_assert ( !(o3 >= o4), "" );
+ static_assert ( (o3 >= o5), "" );
+
+ static_assert ( (o4 >= o1), "" );
+ static_assert ( (o4 >= o2), "" );
+ static_assert ( (o4 >= o3), "" );
+ static_assert ( (o4 >= o4), "" );
+ static_assert ( (o4 >= o5), "" );
+
+ static_assert ( (o5 >= o1), "" );
+ static_assert ( (o5 >= o2), "" );
+ static_assert ( (o5 >= o3), "" );
+ static_assert ( !(o5 >= o4), "" );
+ static_assert ( (o5 >= o5), "" );
+ }
+}
diff --git a/test/std/utilities/optional/optional.relops/greater_than.pass.cpp b/test/std/utilities/optional/optional.relops/greater_than.pass.cpp
new file mode 100644
index 000000000000..8a27eb471f28
--- /dev/null
+++ b/test/std/utilities/optional/optional.relops/greater_than.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator> (const optional<T>& x, const optional<T>& y);
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator > ( const X &lhs, const X &rhs )
+ { return lhs.i_ > rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef optional<X> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2; // disengaged
+ constexpr O o3{1}; // engaged
+ constexpr O o4{2}; // engaged
+ constexpr O o5{1}; // engaged
+
+ static_assert ( !(o1 > o1), "" );
+ static_assert ( !(o1 > o2), "" );
+ static_assert ( !(o1 > o3), "" );
+ static_assert ( !(o1 > o4), "" );
+ static_assert ( !(o1 > o5), "" );
+
+ static_assert ( !(o2 > o1), "" );
+ static_assert ( !(o2 > o2), "" );
+ static_assert ( !(o2 > o3), "" );
+ static_assert ( !(o2 > o4), "" );
+ static_assert ( !(o2 > o5), "" );
+
+ static_assert ( (o3 > o1), "" );
+ static_assert ( (o3 > o2), "" );
+ static_assert ( !(o3 > o3), "" );
+ static_assert ( !(o3 > o4), "" );
+ static_assert ( !(o3 > o5), "" );
+
+ static_assert ( (o4 > o1), "" );
+ static_assert ( (o4 > o2), "" );
+ static_assert ( (o4 > o3), "" );
+ static_assert ( !(o4 > o4), "" );
+ static_assert ( (o4 > o5), "" );
+
+ static_assert ( (o5 > o1), "" );
+ static_assert ( (o5 > o2), "" );
+ static_assert ( !(o5 > o3), "" );
+ static_assert ( !(o5 > o4), "" );
+ static_assert ( !(o5 > o5), "" );
+ }
+}
diff --git a/test/std/utilities/optional/optional.relops/less_equal.pass.cpp b/test/std/utilities/optional/optional.relops/less_equal.pass.cpp
new file mode 100644
index 000000000000..a7d594dd34a2
--- /dev/null
+++ b/test/std/utilities/optional/optional.relops/less_equal.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator<= (const optional<T>& x, const optional<T>& y);
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator <= ( const X &lhs, const X &rhs )
+ { return lhs.i_ <= rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef optional<X> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2; // disengaged
+ constexpr O o3{1}; // engaged
+ constexpr O o4{2}; // engaged
+ constexpr O o5{1}; // engaged
+
+ static_assert ( (o1 <= o1), "" );
+ static_assert ( (o1 <= o2), "" );
+ static_assert ( (o1 <= o3), "" );
+ static_assert ( (o1 <= o4), "" );
+ static_assert ( (o1 <= o5), "" );
+
+ static_assert ( (o2 <= o1), "" );
+ static_assert ( (o2 <= o2), "" );
+ static_assert ( (o2 <= o3), "" );
+ static_assert ( (o2 <= o4), "" );
+ static_assert ( (o2 <= o5), "" );
+
+ static_assert ( !(o3 <= o1), "" );
+ static_assert ( !(o3 <= o2), "" );
+ static_assert ( (o3 <= o3), "" );
+ static_assert ( (o3 <= o4), "" );
+ static_assert ( (o3 <= o5), "" );
+
+ static_assert ( !(o4 <= o1), "" );
+ static_assert ( !(o4 <= o2), "" );
+ static_assert ( !(o4 <= o3), "" );
+ static_assert ( (o4 <= o4), "" );
+ static_assert ( !(o4 <= o5), "" );
+
+ static_assert ( !(o5 <= o1), "" );
+ static_assert ( !(o5 <= o2), "" );
+ static_assert ( (o5 <= o3), "" );
+ static_assert ( (o5 <= o4), "" );
+ static_assert ( (o5 <= o5), "" );
+ }
+}
diff --git a/test/std/utilities/optional/optional.relops/less_than.pass.cpp b/test/std/utilities/optional/optional.relops/less_than.pass.cpp
new file mode 100644
index 000000000000..deffa5e849f9
--- /dev/null
+++ b/test/std/utilities/optional/optional.relops/less_than.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator< (const optional<T>& x, const optional<T>& y);
+
+#include <optional>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator < ( const X &lhs, const X &rhs )
+ { return lhs.i_ < rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef optional<X> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2; // disengaged
+ constexpr O o3{1}; // engaged
+ constexpr O o4{2}; // engaged
+ constexpr O o5{1}; // engaged
+
+ static_assert ( !(o1 < o1), "" );
+ static_assert ( !(o1 < o2), "" );
+ static_assert ( (o1 < o3), "" );
+ static_assert ( (o1 < o4), "" );
+ static_assert ( (o1 < o5), "" );
+
+ static_assert ( !(o2 < o1), "" );
+ static_assert ( !(o2 < o2), "" );
+ static_assert ( (o2 < o3), "" );
+ static_assert ( (o2 < o4), "" );
+ static_assert ( (o2 < o5), "" );
+
+ static_assert ( !(o3 < o1), "" );
+ static_assert ( !(o3 < o2), "" );
+ static_assert ( !(o3 < o3), "" );
+ static_assert ( (o3 < o4), "" );
+ static_assert ( !(o3 < o5), "" );
+
+ static_assert ( !(o4 < o1), "" );
+ static_assert ( !(o4 < o2), "" );
+ static_assert ( !(o4 < o3), "" );
+ static_assert ( !(o4 < o4), "" );
+ static_assert ( !(o4 < o5), "" );
+
+ static_assert ( !(o5 < o1), "" );
+ static_assert ( !(o5 < o2), "" );
+ static_assert ( !(o5 < o3), "" );
+ static_assert ( (o5 < o4), "" );
+ static_assert ( !(o5 < o5), "" );
+ }
+}
diff --git a/test/std/utilities/optional/optional.relops/not_equal.pass.cpp b/test/std/utilities/optional/optional.relops/not_equal.pass.cpp
new file mode 100644
index 000000000000..fd11b2a207ca
--- /dev/null
+++ b/test/std/utilities/optional/optional.relops/not_equal.pass.cpp
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> constexpr bool operator!=(const optional<T>& x, const optional<T>& y);
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+using std::optional;
+
+struct X
+{
+ int i_;
+
+ constexpr X(int i) : i_(i) {}
+};
+
+constexpr bool operator != ( const X &lhs, const X &rhs )
+ { return lhs.i_ != rhs.i_ ; }
+
+int main()
+{
+ {
+ typedef X T;
+ typedef optional<T> O;
+
+ constexpr O o1; // disengaged
+ constexpr O o2; // disengaged
+ constexpr O o3{1}; // engaged
+ constexpr O o4{2}; // engaged
+ constexpr O o5{1}; // engaged
+
+ static_assert ( !(o1 != o1), "" );
+ static_assert ( !(o1 != o2), "" );
+ static_assert ( (o1 != o3), "" );
+ static_assert ( (o1 != o4), "" );
+ static_assert ( (o1 != o5), "" );
+
+ static_assert ( !(o2 != o1), "" );
+ static_assert ( !(o2 != o2), "" );
+ static_assert ( (o2 != o3), "" );
+ static_assert ( (o2 != o4), "" );
+ static_assert ( (o2 != o5), "" );
+
+ static_assert ( (o3 != o1), "" );
+ static_assert ( (o3 != o2), "" );
+ static_assert ( !(o3 != o3), "" );
+ static_assert ( (o3 != o4), "" );
+ static_assert ( !(o3 != o5), "" );
+
+ static_assert ( (o4 != o1), "" );
+ static_assert ( (o4 != o2), "" );
+ static_assert ( (o4 != o3), "" );
+ static_assert ( !(o4 != o4), "" );
+ static_assert ( (o4 != o5), "" );
+
+ static_assert ( (o5 != o1), "" );
+ static_assert ( (o5 != o2), "" );
+ static_assert ( !(o5 != o3), "" );
+ static_assert ( (o5 != o4), "" );
+ static_assert ( !(o5 != o5), "" );
+
+ }
+}
diff --git a/test/std/utilities/optional/optional.specalg/make_optional.pass.cpp b/test/std/utilities/optional/optional.specalg/make_optional.pass.cpp
new file mode 100644
index 000000000000..3fbf19f8ee1b
--- /dev/null
+++ b/test/std/utilities/optional/optional.specalg/make_optional.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T>
+// constexpr optional<decay_t<T>> make_optional(T&& v);
+
+#include <optional>
+#include <string>
+#include <memory>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main()
+{
+ using std::optional;
+ using std::make_optional;
+ {
+ int arr[10]; ((void)arr);
+ ASSERT_SAME_TYPE(decltype(make_optional(arr)), optional<int*>);
+ }
+ {
+ constexpr auto opt = make_optional(2);
+ ASSERT_SAME_TYPE(decltype(opt), const optional<int>);
+ static_assert(opt.value() == 2);
+ }
+ {
+ optional<int> opt = make_optional(2);
+ assert(*opt == 2);
+ }
+ {
+ std::string s("123");
+ optional<std::string> opt = make_optional(s);
+ assert(*opt == s);
+ }
+ {
+ std::unique_ptr<int> s(new int(3));
+ optional<std::unique_ptr<int>> opt = make_optional(std::move(s));
+ assert(**opt == 3);
+ assert(s == nullptr);
+ }
+}
diff --git a/test/std/utilities/optional/optional.specalg/make_optional_explicit.pass.cpp b/test/std/utilities/optional/optional.specalg/make_optional_explicit.pass.cpp
new file mode 100644
index 000000000000..bdfeefbcc1d8
--- /dev/null
+++ b/test/std/utilities/optional/optional.specalg/make_optional_explicit.pass.cpp
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T, class... Args>
+// constexpr optional<T> make_optional(Args&&... args);
+
+#include <optional>
+#include <string>
+#include <memory>
+#include <cassert>
+
+int main()
+{
+ using std::optional;
+ using std::make_optional;
+
+ {
+ constexpr auto opt = make_optional<int>('a');
+ static_assert(*opt == int('a'), "");
+ }
+ {
+ std::string s("123");
+ auto opt = make_optional<std::string>(s);
+ assert(*opt == s);
+ }
+ {
+ std::unique_ptr<int> s(new int(3));
+ auto opt = make_optional<std::unique_ptr<int>>(std::move(s));
+ assert(**opt == 3);
+ assert(s == nullptr);
+ }
+ {
+ auto opt = make_optional<std::string>(4, 'X');
+ assert(*opt == "XXXX");
+ }
+}
diff --git a/test/std/utilities/optional/optional.specalg/make_optional_explicit_initializer_list.pass.cpp b/test/std/utilities/optional/optional.specalg/make_optional_explicit_initializer_list.pass.cpp
new file mode 100644
index 000000000000..e6ed0129ddc7
--- /dev/null
+++ b/test/std/utilities/optional/optional.specalg/make_optional_explicit_initializer_list.pass.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T, class U, class... Args>
+// constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args);
+
+#include <optional>
+#include <string>
+#include <memory>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct TestT {
+ int x;
+ int size;
+ constexpr TestT(std::initializer_list<int> il) : x(*il.begin()), size(static_cast<int>(il.size())) {}
+ constexpr TestT(std::initializer_list<int> il, const int*)
+ : x(*il.begin()), size(static_cast<int>(il.size())) {}
+};
+
+int main()
+{
+ using std::make_optional;
+ {
+ constexpr auto opt = make_optional<TestT>({42, 2, 3});
+ ASSERT_SAME_TYPE(decltype(opt), const std::optional<TestT>);
+ static_assert(opt->x == 42, "");
+ static_assert(opt->size == 3, "");
+ }
+ {
+ constexpr auto opt = make_optional<TestT>({42, 2, 3}, nullptr);
+ static_assert(opt->x == 42, "");
+ static_assert(opt->size == 3, "");
+ }
+ {
+ auto opt = make_optional<std::string>({'1', '2', '3'});
+ assert(*opt == "123");
+ }
+ {
+ auto opt = make_optional<std::string>({'a', 'b', 'c'}, std::allocator<char>{});
+ assert(*opt == "abc");
+ }
+}
diff --git a/test/std/utilities/optional/optional.specalg/swap.pass.cpp b/test/std/utilities/optional/optional.specalg/swap.pass.cpp
new file mode 100644
index 000000000000..31779243e32a
--- /dev/null
+++ b/test/std/utilities/optional/optional.specalg/swap.pass.cpp
@@ -0,0 +1,352 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// template <class T> void swap(optional<T>& x, optional<T>& y)
+// noexcept(noexcept(x.swap(y)));
+
+#include <optional>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "archetypes.hpp"
+
+using std::optional;
+
+class X
+{
+ int i_;
+public:
+ static unsigned dtor_called;
+ X(int i) : i_(i) {}
+ X(X&& x) = default;
+ X& operator=(X&&) = default;
+ ~X() {++dtor_called;}
+
+ friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;}
+};
+
+unsigned X::dtor_called = 0;
+
+class Y
+{
+ int i_;
+public:
+ static unsigned dtor_called;
+ Y(int i) : i_(i) {}
+ Y(Y&&) = default;
+ ~Y() {++dtor_called;}
+
+ friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;}
+ friend void swap(Y& x, Y& y) {std::swap(x.i_, y.i_);}
+};
+
+unsigned Y::dtor_called = 0;
+
+class Z
+{
+ int i_;
+public:
+ Z(int i) : i_(i) {}
+ Z(Z&&) { TEST_THROW(7);}
+
+ friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;}
+ friend void swap(Z&, Z&) { TEST_THROW(6);}
+};
+
+
+struct NonSwappable {
+ NonSwappable(NonSwappable const&) = delete;
+};
+void swap(NonSwappable&, NonSwappable&) = delete;
+
+void test_swap_sfinae() {
+ using std::optional;
+ {
+ using T = TestTypes::TestType;
+ static_assert(std::is_swappable_v<optional<T>>, "");
+ }
+ {
+ using T = TestTypes::MoveOnly;
+ static_assert(std::is_swappable_v<optional<T>>, "");
+ }
+ {
+ using T = TestTypes::Copyable;
+ static_assert(std::is_swappable_v<optional<T>>, "");
+ }
+ {
+ using T = TestTypes::NoCtors;
+ static_assert(!std::is_swappable_v<optional<T>>, "");
+ }
+ {
+ using T = NonSwappable;
+ static_assert(!std::is_swappable_v<optional<T>>, "");
+ }
+ {
+ // Even thought CopyOnly has deleted move operations, those operations
+ // cause optional<CopyOnly> to have implicitly deleted move operations
+ // that decay into copies.
+ using T = TestTypes::CopyOnly;
+ using Opt = optional<T>;
+ T::reset();
+ Opt L(101), R(42);
+ T::reset_constructors();
+ std::swap(L, R);
+ assert(L->value == 42);
+ assert(R->value == 101);
+ assert(T::copy_constructed == 1);
+ assert(T::constructed == T::copy_constructed);
+ assert(T::assigned == 2);
+ assert(T::assigned == T::copy_assigned);
+ }
+}
+
+int main()
+{
+ test_swap_sfinae();
+ {
+ optional<int> opt1;
+ optional<int> opt2;
+ static_assert(noexcept(swap(opt1, opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ swap(opt1, opt2);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ }
+ {
+ optional<int> opt1(1);
+ optional<int> opt2;
+ static_assert(noexcept(swap(opt1, opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == false);
+ swap(opt1, opt2);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<int> opt1;
+ optional<int> opt2(2);
+ static_assert(noexcept(swap(opt1, opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ swap(opt1, opt2);
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == false);
+ }
+ {
+ optional<int> opt1(1);
+ optional<int> opt2(2);
+ static_assert(noexcept(swap(opt1, opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ swap(opt1, opt2);
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<X> opt1;
+ optional<X> opt2;
+ static_assert(noexcept(swap(opt1, opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ swap(opt1, opt2);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ assert(X::dtor_called == 0);
+ }
+ {
+ optional<X> opt1(1);
+ optional<X> opt2;
+ static_assert(noexcept(swap(opt1, opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == false);
+ X::dtor_called = 0;
+ swap(opt1, opt2);
+ assert(X::dtor_called == 1);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<X> opt1;
+ optional<X> opt2(2);
+ static_assert(noexcept(swap(opt1, opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ X::dtor_called = 0;
+ swap(opt1, opt2);
+ assert(X::dtor_called == 1);
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == false);
+ }
+ {
+ optional<X> opt1(1);
+ optional<X> opt2(2);
+ static_assert(noexcept(swap(opt1, opt2)) == true, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ X::dtor_called = 0;
+ swap(opt1, opt2);
+ assert(X::dtor_called == 1); // from inside std::swap
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<Y> opt1;
+ optional<Y> opt2;
+ static_assert(noexcept(swap(opt1, opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ swap(opt1, opt2);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ assert(Y::dtor_called == 0);
+ }
+ {
+ optional<Y> opt1(1);
+ optional<Y> opt2;
+ static_assert(noexcept(swap(opt1, opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == false);
+ Y::dtor_called = 0;
+ swap(opt1, opt2);
+ assert(Y::dtor_called == 1);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<Y> opt1;
+ optional<Y> opt2(2);
+ static_assert(noexcept(swap(opt1, opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ Y::dtor_called = 0;
+ swap(opt1, opt2);
+ assert(Y::dtor_called == 1);
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == false);
+ }
+ {
+ optional<Y> opt1(1);
+ optional<Y> opt2(2);
+ static_assert(noexcept(swap(opt1, opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ Y::dtor_called = 0;
+ swap(opt1, opt2);
+ assert(Y::dtor_called == 0);
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 2);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 1);
+ }
+ {
+ optional<Z> opt1;
+ optional<Z> opt2;
+ static_assert(noexcept(swap(opt1, opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ swap(opt1, opt2);
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == false);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ optional<Z> opt1;
+ opt1.emplace(1);
+ optional<Z> opt2;
+ static_assert(noexcept(swap(opt1, opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == false);
+ try
+ {
+ swap(opt1, opt2);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 7);
+ }
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == false);
+ }
+ {
+ optional<Z> opt1;
+ optional<Z> opt2;
+ opt2.emplace(2);
+ static_assert(noexcept(swap(opt1, opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ try
+ {
+ swap(opt1, opt2);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 7);
+ }
+ assert(static_cast<bool>(opt1) == false);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ }
+ {
+ optional<Z> opt1;
+ opt1.emplace(1);
+ optional<Z> opt2;
+ opt2.emplace(2);
+ static_assert(noexcept(swap(opt1, opt2)) == false, "");
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ try
+ {
+ swap(opt1, opt2);
+ assert(false);
+ }
+ catch (int i)
+ {
+ assert(i == 6);
+ }
+ assert(static_cast<bool>(opt1) == true);
+ assert(*opt1 == 1);
+ assert(static_cast<bool>(opt2) == true);
+ assert(*opt2 == 2);
+ }
+#endif // TEST_HAS_NO_EXCEPTIONS
+}
diff --git a/test/std/utilities/optional/optional.syn/optional_in_place_t.fail.cpp b/test/std/utilities/optional/optional.syn/optional_in_place_t.fail.cpp
new file mode 100644
index 000000000000..20c90c7e34fd
--- /dev/null
+++ b/test/std/utilities/optional/optional.syn/optional_in_place_t.fail.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// A program that necessitates the instantiation of template optional for
+// (possibly cv-qualified) in_place_t is ill-formed.
+
+#include <optional>
+
+int main()
+{
+ using std::optional;
+ using std::in_place_t;
+ using std::in_place;
+
+ optional<in_place_t> opt; // expected-note {{requested here}}
+ // expected-error@optional:* {{"instantiation of optional with in_place_t is ill-formed"}}
+}
diff --git a/test/std/utilities/utility/forward/forward2.fail.cpp b/test/std/utilities/optional/optional.syn/optional_includes_initializer_list.pass.cpp
index 9ff07233fee8..687625e8b673 100644
--- a/test/std/utilities/utility/forward/forward2.fail.cpp
+++ b/test/std/utilities/optional/optional.syn/optional_includes_initializer_list.pass.cpp
@@ -7,19 +7,16 @@
//
//===----------------------------------------------------------------------===//
-// test forward
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
-#include <utility>
+// #include <initializer_list>
-struct A
-{
-};
-
-A source() {return A();}
-const A csource() {return A();}
+#include <optional>
int main()
{
- const A ca = A();
- std::forward<A&>(ca); // error
+ using std::optional;
+
+ std::initializer_list<int> list;
}
diff --git a/test/std/utilities/optional/optional.syn/optional_nullopt_t.fail.cpp b/test/std/utilities/optional/optional.syn/optional_nullopt_t.fail.cpp
new file mode 100644
index 000000000000..56a30ccb0db9
--- /dev/null
+++ b/test/std/utilities/optional/optional.syn/optional_nullopt_t.fail.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// <optional>
+
+// A program that necessitates the instantiation of template optional for
+// (possibly cv-qualified) nullopt_t is ill-formed.
+
+#include <optional>
+
+int main()
+{
+ using std::optional;
+ using std::nullopt_t;
+ using std::nullopt;
+
+ optional<nullopt_t> opt; // expected-note 1 {{requested here}}
+ optional<const nullopt_t> opt1; // expected-note 1 {{requested here}}
+ optional<nullopt_t &> opt2; // expected-note 1 {{requested here}}
+ optional<nullopt_t &&> opt3; // expected-note 1 {{requested here}}
+ // expected-error@optional:* 4 {{instantiation of optional with nullopt_t is ill-formed}}
+}
diff --git a/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
index 1b121c5fb928..3ba88ee2db53 100644
--- a/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
@@ -12,6 +12,7 @@
#include <bitset>
#include <cassert>
#include <algorithm> // for 'min' and 'max'
+#include <cstddef>
#include "test_macros.h"
@@ -21,9 +22,9 @@ void test_val_ctor()
{
TEST_CONSTEXPR std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
assert(v.size() == N);
- unsigned M = std::min<std::size_t>(N, 64);
+ std::size_t M = std::min<std::size_t>(N, 64);
for (std::size_t i = 0; i < M; ++i)
- assert(v[i] == (i & 1));
+ assert(v[i] == ((i & 1) != 0));
for (std::size_t i = M; i < N; ++i)
assert(v[i] == false);
}
diff --git a/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp b/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
index 88ce8e943caf..18a64a214a45 100644
--- a/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
@@ -7,13 +7,14 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// test bitset<N>& flip(size_t pos);
#include <bitset>
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
template <std::size_t N>
std::bitset<N>
make_bitset()
@@ -25,11 +26,15 @@ make_bitset()
}
template <std::size_t N>
-void test_flip_one()
+void test_flip_one(bool test_throws)
{
std::bitset<N> v = make_bitset<N>();
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (test_throws) return;
+#else
try
{
+#endif
v.flip(50);
bool b = v[50];
if (50 >= v.size())
@@ -39,21 +44,25 @@ void test_flip_one()
assert(v[50] != b);
v.flip(50);
assert(v[50] == b);
+ assert(!test_throws);
+#ifndef TEST_HAS_NO_EXCEPTIONS
}
catch (std::out_of_range&)
{
+ assert(test_throws);
}
+#endif
}
int main()
{
- test_flip_one<0>();
- test_flip_one<1>();
- test_flip_one<31>();
- test_flip_one<32>();
- test_flip_one<33>();
- test_flip_one<63>();
- test_flip_one<64>();
- test_flip_one<65>();
- test_flip_one<1000>();
+ test_flip_one<0>(true);
+ test_flip_one<1>(true);
+ test_flip_one<31>(true);
+ test_flip_one<32>(true);
+ test_flip_one<33>(true);
+ test_flip_one<63>(false);
+ test_flip_one<64>(false);
+ test_flip_one<65>(false);
+ test_flip_one<1000>(false);
}
diff --git a/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp b/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
index f01d35b9a33c..6847694e4b73 100644
--- a/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
@@ -7,18 +7,23 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// test bitset<N>& reset(size_t pos);
#include <bitset>
#include <cassert>
+#include "test_macros.h"
+
template <std::size_t N>
-void test_reset_one()
+void test_reset_one(bool test_throws)
{
std::bitset<N> v;
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (test_throws) return;
+#else
try
{
+#endif
v.set();
v.reset(50);
if (50 >= v.size())
@@ -28,21 +33,25 @@ void test_reset_one()
assert(!v[i]);
else
assert(v[i]);
+ assert(!test_throws);
+#ifndef TEST_HAS_NO_EXCEPTIONS
}
catch (std::out_of_range&)
{
+ assert(test_throws);
}
+#endif
}
int main()
{
- test_reset_one<0>();
- test_reset_one<1>();
- test_reset_one<31>();
- test_reset_one<32>();
- test_reset_one<33>();
- test_reset_one<63>();
- test_reset_one<64>();
- test_reset_one<65>();
- test_reset_one<1000>();
+ test_reset_one<0>(true);
+ test_reset_one<1>(true);
+ test_reset_one<31>(true);
+ test_reset_one<32>(true);
+ test_reset_one<33>(true);
+ test_reset_one<63>(false);
+ test_reset_one<64>(false);
+ test_reset_one<65>(false);
+ test_reset_one<1000>(false);
}
diff --git a/test/std/utilities/template.bitset/bitset.members/set_one.pass.cpp b/test/std/utilities/template.bitset/bitset.members/set_one.pass.cpp
index debe5431d8d0..1c8d6a1c32a4 100644
--- a/test/std/utilities/template.bitset/bitset.members/set_one.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/set_one.pass.cpp
@@ -7,47 +7,60 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// test bitset<N>& set(size_t pos, bool val = true);
#include <bitset>
#include <cassert>
+#include "test_macros.h"
+
template <std::size_t N>
-void test_set_one()
+void test_set_one(bool test_throws)
{
std::bitset<N> v;
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (test_throws) return;
+#else
try
+#endif
{
v.set(50);
if (50 >= v.size())
assert(false);
assert(v[50]);
+ assert(!test_throws);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (std::out_of_range&)
{
+ assert(test_throws);
}
try
+#endif
{
v.set(50, false);
if (50 >= v.size())
assert(false);
assert(!v[50]);
+ assert(!test_throws);
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
catch (std::out_of_range&)
{
+ assert(test_throws);
}
+#endif
}
int main()
{
- test_set_one<0>();
- test_set_one<1>();
- test_set_one<31>();
- test_set_one<32>();
- test_set_one<33>();
- test_set_one<63>();
- test_set_one<64>();
- test_set_one<65>();
- test_set_one<1000>();
+ test_set_one<0>(true);
+ test_set_one<1>(true);
+ test_set_one<31>(true);
+ test_set_one<32>(true);
+ test_set_one<33>(true);
+ test_set_one<63>(false);
+ test_set_one<64>(false);
+ test_set_one<65>(false);
+ test_set_one<1000>(false);
}
diff --git a/test/std/utilities/template.bitset/bitset.members/test.pass.cpp b/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
index 161afd11c291..1a2d70613e1f 100644
--- a/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
@@ -7,13 +7,14 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// test constexpr bool test(size_t pos) const;
#include <bitset>
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
template <std::size_t N>
std::bitset<N>
make_bitset()
@@ -25,30 +26,38 @@ make_bitset()
}
template <std::size_t N>
-void test_test()
+void test_test(bool test_throws)
{
const std::bitset<N> v1 = make_bitset<N>();
+#ifdef TEST_HAS_NO_EXCEPTIONS
+ if (test_throws) return;
+#else
try
{
+#endif
bool b = v1.test(50);
if (50 >= v1.size())
assert(false);
assert(b == v1[50]);
+ assert(!test_throws);
+#ifndef TEST_HAS_NO_EXCEPTIONS
}
catch (std::out_of_range&)
{
+ assert(test_throws);
}
+#endif
}
int main()
{
- test_test<0>();
- test_test<1>();
- test_test<31>();
- test_test<32>();
- test_test<33>();
- test_test<63>();
- test_test<64>();
- test_test<65>();
- test_test<1000>();
+ test_test<0>(true);
+ test_test<1>(true);
+ test_test<31>(true);
+ test_test<32>(true);
+ test_test<33>(true);
+ test_test<63>(false);
+ test_test<64>(false);
+ test_test<65>(false);
+ test_test<1000>(false);
}
diff --git a/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp b/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
index 80792d919ccf..d86a10c6df13 100644
--- a/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
@@ -33,7 +33,7 @@ void test_op_and()
std::bitset<N> v1 = make_bitset<N>();
std::bitset<N> v2 = make_bitset<N>();
std::bitset<N> v3 = v1;
- assert((v1 & v2) == (v3 &= v2));;
+ assert((v1 & v2) == (v3 &= v2));
}
int main()
diff --git a/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp b/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
index 65a7004acb86..0a8024d5eb9b 100644
--- a/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
@@ -33,7 +33,7 @@ void test_op_not()
std::bitset<N> v1 = make_bitset<N>();
std::bitset<N> v2 = make_bitset<N>();
std::bitset<N> v3 = v1;
- assert((v1 ^ v2) == (v3 ^= v2));;
+ assert((v1 ^ v2) == (v3 ^= v2));
}
int main()
diff --git a/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp b/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
index dcabaa4a9a4d..449115edd757 100644
--- a/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
@@ -33,7 +33,7 @@ void test_op_or()
std::bitset<N> v1 = make_bitset<N>();
std::bitset<N> v2 = make_bitset<N>();
std::bitset<N> v3 = v1;
- assert((v1 | v2) == (v3 |= v2));;
+ assert((v1 | v2) == (v3 |= v2));
}
int main()
diff --git a/test/std/utilities/time/rep.h b/test/std/utilities/time/rep.h
index 2ec3514ab567..1c76582d3725 100644
--- a/test/std/utilities/time/rep.h
+++ b/test/std/utilities/time/rep.h
@@ -10,15 +10,17 @@
#ifndef REP_H
#define REP_H
+#include "test_macros.h"
+
class Rep
{
int data_;
public:
- _LIBCPP_CONSTEXPR Rep() : data_(-1) {}
- explicit _LIBCPP_CONSTEXPR Rep(int i) : data_(i) {}
+ TEST_CONSTEXPR Rep() : data_(-1) {}
+ explicit TEST_CONSTEXPR Rep(int i) : data_(i) {}
- bool _LIBCPP_CONSTEXPR operator==(int i) const {return data_ == i;}
- bool _LIBCPP_CONSTEXPR operator==(const Rep& r) const {return data_ == r.data_;}
+ bool TEST_CONSTEXPR operator==(int i) const {return data_ == i;}
+ bool TEST_CONSTEXPR operator==(const Rep& r) const {return data_ == r.data_;}
Rep& operator*=(Rep x) {data_ *= x.data_; return *this;}
Rep& operator/=(Rep x) {data_ /= x.data_; return *this;}
diff --git a/test/std/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp b/test/std/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp
index 7d7e82ac5e23..ae5423ef1161 100644
--- a/test/std/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp
+++ b/test/std/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp
@@ -19,6 +19,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
template <class FromDuration, class ToDuration>
void
test(const FromDuration& df, const ToDuration& d)
@@ -35,7 +37,7 @@ test(const FromDuration& df, const ToDuration& d)
}
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
template<class FromDuration, long long From, class ToDuration, long long To>
void test_constexpr ()
@@ -65,7 +67,7 @@ int main()
std::chrono::duration<double, std::ratio<3600> >(7265./3600));
test(std::chrono::duration<int, std::ratio<2, 3> >(9),
std::chrono::duration<int, std::ratio<3, 5> >(10));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
test_constexpr<std::chrono::milliseconds, 7265000, std::chrono::hours, 2> ();
test_constexpr<std::chrono::milliseconds, 7265000, std::chrono::minutes,121> ();
diff --git a/test/std/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp b/test/std/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp
index a37bb266a0a9..a6f7cc0b89b2 100644
--- a/test/std/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp
+++ b/test/std/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp
@@ -22,6 +22,8 @@
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
@@ -55,7 +57,7 @@ int main()
assert( (t1 != t2));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T1 t1(Duration1(3));
constexpr T1 t2(Duration1(3));
diff --git a/test/std/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp b/test/std/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp
index 9d94400ed3d1..d7adf29f2ef8 100644
--- a/test/std/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp
+++ b/test/std/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp
@@ -30,6 +30,8 @@
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
@@ -71,7 +73,7 @@ int main()
assert(!(t1 >= t2));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T1 t1(Duration1(3));
constexpr T1 t2(Duration1(3));
diff --git a/test/std/utilities/time/time.point/time.point.cons/convert.pass.cpp b/test/std/utilities/time/time.point/time.point.cons/convert.pass.cpp
index 6cd7dcb7d2f4..33e349fe8941 100644
--- a/test/std/utilities/time/time.point/time.point.cons/convert.pass.cpp
+++ b/test/std/utilities/time/time.point/time.point.cons/convert.pass.cpp
@@ -17,6 +17,8 @@
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
@@ -27,7 +29,7 @@ int main()
std::chrono::time_point<Clock, Duration1> t1 = t2;
assert(t1.time_since_epoch() == Duration1(3000));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration2> t2(Duration2(3));
constexpr std::chrono::time_point<Clock, Duration1> t1 = t2;
diff --git a/test/std/utilities/time/time.point/time.point.cons/default.pass.cpp b/test/std/utilities/time/time.point/time.point.cons/default.pass.cpp
index 01f0bc169933..120fd3fb4e9f 100644
--- a/test/std/utilities/time/time.point/time.point.cons/default.pass.cpp
+++ b/test/std/utilities/time/time.point/time.point.cons/default.pass.cpp
@@ -16,6 +16,7 @@
#include <chrono>
#include <cassert>
+#include "test_macros.h"
#include "../../rep.h"
int main()
@@ -26,7 +27,7 @@ int main()
std::chrono::time_point<Clock, Duration> t;
assert(t.time_since_epoch() == Duration::zero());
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration> t;
static_assert(t.time_since_epoch() == Duration::zero(), "");
diff --git a/test/std/utilities/time/time.point/time.point.cons/duration.pass.cpp b/test/std/utilities/time/time.point/time.point.cons/duration.pass.cpp
index 9d53d86dea3b..1b96902aba3b 100644
--- a/test/std/utilities/time/time.point/time.point.cons/duration.pass.cpp
+++ b/test/std/utilities/time/time.point/time.point.cons/duration.pass.cpp
@@ -16,6 +16,8 @@
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
@@ -28,7 +30,7 @@ int main()
std::chrono::time_point<Clock, Duration> t(std::chrono::seconds(3));
assert(t.time_since_epoch() == Duration(3000));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration> t(Duration(3));
static_assert(t.time_since_epoch() == Duration(3), "");
diff --git a/test/std/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp b/test/std/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp
index 7a8fa6dcf14f..19f5cbcd9f41 100644
--- a/test/std/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp
+++ b/test/std/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp
@@ -22,6 +22,8 @@
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
@@ -34,7 +36,7 @@ int main()
t2 = Duration2(6) + t1;
assert(t2.time_since_epoch() == Duration2(3006));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration1> t1(Duration1(3));
constexpr std::chrono::time_point<Clock, Duration2> t2 = t1 + Duration2(5);
diff --git a/test/std/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp b/test/std/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp
index 342d27b5aebd..978f09d66bb2 100644
--- a/test/std/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp
+++ b/test/std/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp
@@ -18,6 +18,19 @@
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
+template <class D>
+void test2739() // LWG2739
+{
+ typedef std::chrono::time_point<std::chrono::system_clock> TimePoint;
+ typedef std::chrono::duration<D> Dur;
+ const Dur d(5);
+ TimePoint t0 = std::chrono::system_clock::from_time_t(200);
+ TimePoint t1 = t0 - d;
+ assert(t1 < t0);
+}
+
int main()
{
typedef std::chrono::system_clock Clock;
@@ -28,11 +41,13 @@ int main()
std::chrono::time_point<Clock, Duration2> t2 = t1 - Duration2(5);
assert(t2.time_since_epoch() == Duration2(2995));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration1> t1(Duration1(3));
constexpr std::chrono::time_point<Clock, Duration2> t2 = t1 - Duration2(5);
static_assert(t2.time_since_epoch() == Duration2(2995), "");
}
#endif
+ test2739<int32_t>();
+ test2739<uint32_t>();
}
diff --git a/test/std/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp b/test/std/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp
index 5267f07e1b86..fcef3f249733 100644
--- a/test/std/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp
+++ b/test/std/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp
@@ -18,6 +18,8 @@
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
@@ -28,7 +30,7 @@ int main()
std::chrono::time_point<Clock, Duration2> t2(Duration2(5));
assert((t1 - t2) == Duration2(2995));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration1> t1(Duration1(3));
constexpr std::chrono::time_point<Clock, Duration2> t2(Duration2(5));
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
index 2e821945d09a..4c15499f5c1d 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
@@ -166,7 +166,6 @@ void check_apply_quals_and_types(Tuple&& t) {
void test_call_quals_and_arg_types()
{
- TrackedCallable obj;
using Tup = std::tuple<int, int const&, unsigned&&>;
const int x = 42;
unsigned y = 101;
@@ -199,7 +198,7 @@ void test_noexcept()
// test that the functions noexcept-ness is propagated
using Tup = std::tuple<int, const char*, long>;
Tup t;
- ASSERT_NOEXCEPT(std::apply(nec, t));
+ LIBCPP_ASSERT_NOEXCEPT(std::apply(nec, t));
ASSERT_NOT_NOEXCEPT(std::apply(tc, t));
}
{
@@ -207,7 +206,7 @@ void test_noexcept()
using Tup = std::tuple<NothrowMoveable, int>;
Tup t;
ASSERT_NOT_NOEXCEPT(std::apply(nec, t));
- ASSERT_NOEXCEPT(std::apply(nec, std::move(t)));
+ LIBCPP_ASSERT_NOEXCEPT(std::apply(nec, std::move(t)));
}
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
index 143ae195e6f4..eee1dd88253c 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
@@ -175,14 +175,14 @@ void test_noexcept() {
Tuple tup; ((void)tup);
Tuple const& ctup = tup; ((void)ctup);
ASSERT_NOT_NOEXCEPT(std::make_from_tuple<TestType>(ctup));
- ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(std::move(tup)));
+ LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(std::move(tup)));
}
{
using Tuple = std::pair<int, NothrowMoveable>;
Tuple tup; ((void)tup);
Tuple const& ctup = tup; ((void)ctup);
ASSERT_NOT_NOEXCEPT(std::make_from_tuple<TestType>(ctup));
- ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(std::move(tup)));
+ LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(std::move(tup)));
}
{
using Tuple = std::tuple<int, int, int>;
@@ -192,7 +192,7 @@ void test_noexcept() {
{
using Tuple = std::tuple<long, long, long>;
Tuple tup; ((void)tup);
- ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(tup));
+ LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(tup));
}
{
using Tuple = std::array<int, 3>;
@@ -202,7 +202,7 @@ void test_noexcept() {
{
using Tuple = std::array<long, 3>;
Tuple tup; ((void)tup);
- ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(tup));
+ LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple<TestType>(tup));
}
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp
index a3d14487b47d..a66fba22d919 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp
@@ -23,9 +23,9 @@
int main()
{
{
- typedef std::pair<double, char> T0;
- typedef std::tuple<int, short> T1;
- T0 t0(2.5, 'a');
+ typedef std::pair<long, char> T0;
+ typedef std::tuple<long long, short> T1;
+ T0 t0(2, 'a');
T1 t1;
t1 = t0;
assert(std::get<0>(t1) == 2);
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp
index 91892efaf139..85dcee893a07 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp
@@ -36,26 +36,26 @@ struct D
int main()
{
{
- typedef std::tuple<double> T0;
- typedef std::tuple<int> T1;
- T0 t0(2.5);
+ typedef std::tuple<long> T0;
+ typedef std::tuple<long long> T1;
+ T0 t0(2);
T1 t1;
t1 = t0;
assert(std::get<0>(t1) == 2);
}
{
- typedef std::tuple<double, char> T0;
- typedef std::tuple<int, int> T1;
- T0 t0(2.5, 'a');
+ typedef std::tuple<long, char> T0;
+ typedef std::tuple<long long, int> T1;
+ T0 t0(2, 'a');
T1 t1;
t1 = t0;
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
}
{
- typedef std::tuple<double, char, D> T0;
- typedef std::tuple<int, int, B> T1;
- T0 t0(2.5, 'a', D(3));
+ typedef std::tuple<long, char, D> T0;
+ typedef std::tuple<long long, int, B> T1;
+ T0 t0(2, 'a', D(3));
T1 t1;
t1 = t0;
assert(std::get<0>(t1) == 2);
@@ -65,10 +65,10 @@ int main()
{
D d(3);
D d2(2);
- typedef std::tuple<double, char, D&> T0;
- typedef std::tuple<int, int, B&> T1;
- T0 t0(2.5, 'a', d2);
- T1 t1(1.5, 'b', d);
+ typedef std::tuple<long, char, D&> T0;
+ typedef std::tuple<long long, int, B&> T1;
+ T0 t0(2, 'a', d2);
+ T1 t1(1, 'b', d);
t1 = t0;
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp
index afd3e0fdb8e3..1a32acd55cff 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp
@@ -39,7 +39,7 @@ struct D
struct E {
E() = default;
- E& operator=(int val) {
+ E& operator=(int) {
return *this;
}
};
@@ -47,26 +47,26 @@ struct E {
int main()
{
{
- typedef std::tuple<double> T0;
- typedef std::tuple<int> T1;
- T0 t0(2.5);
+ typedef std::tuple<long> T0;
+ typedef std::tuple<long long> T1;
+ T0 t0(2);
T1 t1;
t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
}
{
- typedef std::tuple<double, char> T0;
- typedef std::tuple<int, int> T1;
- T0 t0(2.5, 'a');
+ typedef std::tuple<long, char> T0;
+ typedef std::tuple<long long, int> T1;
+ T0 t0(2, 'a');
T1 t1;
t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
}
{
- typedef std::tuple<double, char, D> T0;
- typedef std::tuple<int, int, B> T1;
- T0 t0(2.5, 'a', D(3));
+ typedef std::tuple<long, char, D> T0;
+ typedef std::tuple<long long, int, B> T1;
+ T0 t0(2, 'a', D(3));
T1 t1;
t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
@@ -76,19 +76,19 @@ int main()
{
D d(3);
D d2(2);
- typedef std::tuple<double, char, D&> T0;
- typedef std::tuple<int, int, B&> T1;
- T0 t0(2.5, 'a', d2);
- T1 t1(1.5, 'b', d);
+ typedef std::tuple<long, char, D&> T0;
+ typedef std::tuple<long long, int, B&> T1;
+ T0 t0(2, 'a', d2);
+ T1 t1(1, 'b', d);
t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
assert(std::get<2>(t1).id_ == 2);
}
{
- typedef std::tuple<double, char, std::unique_ptr<D>> T0;
- typedef std::tuple<int, int, std::unique_ptr<B>> T1;
- T0 t0(2.5, 'a', std::unique_ptr<D>(new D(3)));
+ typedef std::tuple<long, char, std::unique_ptr<D>> T0;
+ typedef std::tuple<long long, int, std::unique_ptr<B>> T1;
+ T0 t0(2, 'a', std::unique_ptr<D>(new D(3)));
T1 t1;
t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp
index d5d020779726..edb235a41919 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp
@@ -16,9 +16,26 @@
// UNSUPPORTED: c++98, c++03
#include <tuple>
+#include <memory>
#include <string>
#include <cassert>
+#include "test_macros.h"
+
+struct NonAssignable {
+ NonAssignable& operator=(NonAssignable const&) = delete;
+ NonAssignable& operator=(NonAssignable&&) = delete;
+};
+struct CopyAssignable {
+ CopyAssignable& operator=(CopyAssignable const&) = default;
+ CopyAssignable& operator=(CopyAssignable &&) = delete;
+};
+static_assert(std::is_copy_assignable<CopyAssignable>::value, "");
+struct MoveAssignable {
+ MoveAssignable& operator=(MoveAssignable const&) = delete;
+ MoveAssignable& operator=(MoveAssignable&&) = default;
+};
+
int main()
{
{
@@ -51,4 +68,37 @@ int main()
assert(std::get<1>(t) == 'a');
assert(std::get<2>(t) == "some text");
}
+ {
+ // test reference assignment.
+ using T = std::tuple<int&, int&&>;
+ int x = 42;
+ int y = 100;
+ int x2 = -1;
+ int y2 = 500;
+ T t(x, std::move(y));
+ T t2(x2, std::move(y2));
+ t = t2;
+ assert(std::get<0>(t) == x2);
+ assert(&std::get<0>(t) == &x);
+ assert(std::get<1>(t) == y2);
+ assert(&std::get<1>(t) == &y);
+ }
+ {
+ // test that the implicitly generated copy assignment operator
+ // is properly deleted
+ using T = std::tuple<std::unique_ptr<int>>;
+ static_assert(!std::is_copy_assignable<T>::value, "");
+ }
+ {
+ using T = std::tuple<int, NonAssignable>;
+ static_assert(!std::is_copy_assignable<T>::value, "");
+ }
+ {
+ using T = std::tuple<int, CopyAssignable>;
+ static_assert(std::is_copy_assignable<T>::value, "");
+ }
+ {
+ using T = std::tuple<int, MoveAssignable>;
+ static_assert(!std::is_copy_assignable<T>::value, "");
+ }
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp
index fc5e41ad569d..210f14be318a 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp
@@ -21,6 +21,33 @@
#include "MoveOnly.h"
+struct NonAssignable {
+ NonAssignable& operator=(NonAssignable const&) = delete;
+ NonAssignable& operator=(NonAssignable&&) = delete;
+};
+struct CopyAssignable {
+ CopyAssignable& operator=(CopyAssignable const&) = default;
+ CopyAssignable& operator=(CopyAssignable&&) = delete;
+};
+static_assert(std::is_copy_assignable<CopyAssignable>::value, "");
+struct MoveAssignable {
+ MoveAssignable& operator=(MoveAssignable const&) = delete;
+ MoveAssignable& operator=(MoveAssignable&&) = default;
+};
+
+
+struct CountAssign {
+ static int copied;
+ static int moved;
+ static void reset() { copied = moved = 0; }
+ CountAssign() = default;
+ CountAssign& operator=(CountAssign const&) { ++copied; return *this; }
+ CountAssign& operator=(CountAssign&&) { ++moved; return *this; }
+};
+int CountAssign::copied = 0;
+int CountAssign::moved = 0;
+
+
int main()
{
{
@@ -53,4 +80,46 @@ int main()
assert(std::get<1>(t) == 1);
assert(std::get<2>(t) == 2);
}
+ {
+ // test reference assignment.
+ using T = std::tuple<int&, int&&>;
+ int x = 42;
+ int y = 100;
+ int x2 = -1;
+ int y2 = 500;
+ T t(x, std::move(y));
+ T t2(x2, std::move(y2));
+ t = std::move(t2);
+ assert(std::get<0>(t) == x2);
+ assert(&std::get<0>(t) == &x);
+ assert(std::get<1>(t) == y2);
+ assert(&std::get<1>(t) == &y);
+ }
+ {
+ // test that the implicitly generated move assignment operator
+ // is properly deleted
+ using T = std::tuple<std::unique_ptr<int>>;
+ static_assert(std::is_move_assignable<T>::value, "");
+ static_assert(!std::is_copy_assignable<T>::value, "");
+
+ }
+ {
+ using T = std::tuple<int, NonAssignable>;
+ static_assert(!std::is_move_assignable<T>::value, "");
+ }
+ {
+ using T = std::tuple<int, MoveAssignable>;
+ static_assert(std::is_move_assignable<T>::value, "");
+ }
+ {
+ // The move should decay to a copy.
+ CountAssign::reset();
+ using T = std::tuple<CountAssign, CopyAssignable>;
+ static_assert(std::is_move_assignable<T>::value, "");
+ T t1;
+ T t2;
+ t1 = std::move(t2);
+ assert(CountAssign::copied == 1);
+ assert(CountAssign::moved == 0);
+ }
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp
index 812e6329bb3e..27656a675982 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp
@@ -39,9 +39,9 @@ struct D
int main()
{
{
- typedef std::pair<double, std::unique_ptr<D>> T0;
- typedef std::tuple<int, std::unique_ptr<B>> T1;
- T0 t0(2.5, std::unique_ptr<D>(new D(3)));
+ typedef std::pair<long, std::unique_ptr<D>> T0;
+ typedef std::tuple<long long, std::unique_ptr<B>> T1;
+ T0 t0(2, std::unique_ptr<D>(new D(3)));
T1 t1;
t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp
index ed3cafadbf08..a5b3d4415e38 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp
@@ -91,6 +91,8 @@ int main() {
}
{
std::tuple<A&&> t(std::forward_as_tuple(A{}));
+ ((void)t);
std::tuple<ExplicitA&&> t2(std::forward_as_tuple(ExplicitA{}));
+ ((void)t2);
}
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp
new file mode 100644
index 000000000000..dd9b832423a6
--- /dev/null
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <tuple>
+
+// template <class TupleLike> tuple(TupleLike&&); // libc++ extension
+
+// See llvm.org/PR31384
+#include <tuple>
+#include <cassert>
+
+int count = 0;
+
+struct Explicit {
+ Explicit() = default;
+ explicit Explicit(int) {}
+};
+
+struct Implicit {
+ Implicit() = default;
+ Implicit(int) {}
+};
+
+template<class T>
+struct Derived : std::tuple<T> {
+ using std::tuple<T>::tuple;
+ template<class U>
+ operator std::tuple<U>() && { ++count; return {}; }
+};
+
+
+template<class T>
+struct ExplicitDerived : std::tuple<T> {
+ using std::tuple<T>::tuple;
+ template<class U>
+ explicit operator std::tuple<U>() && { ++count; return {}; }
+};
+
+int main() {
+ {
+ std::tuple<Explicit> foo = Derived<int>{42}; ((void)foo);
+ assert(count == 1);
+ std::tuple<Explicit> bar(Derived<int>{42}); ((void)bar);
+ assert(count == 2);
+ }
+ count = 0;
+ {
+ std::tuple<Implicit> foo = Derived<int>{42}; ((void)foo);
+ assert(count == 1);
+ std::tuple<Implicit> bar(Derived<int>{42}); ((void)bar);
+ assert(count == 2);
+ }
+ count = 0;
+ {
+ static_assert(!std::is_convertible<
+ ExplicitDerived<int>, std::tuple<Explicit>>::value, "");
+ std::tuple<Explicit> bar(ExplicitDerived<int>{42}); ((void)bar);
+ assert(count == 1);
+ }
+ count = 0;
+ {
+ // FIXME: Libc++ incorrectly rejects this code.
+#ifndef _LIBCPP_VERSION
+ std::tuple<Implicit> foo = ExplicitDerived<int>{42}; ((void)foo);
+ static_assert(std::is_convertible<
+ ExplicitDerived<int>, std::tuple<Implicit>>::value,
+ "correct STLs accept this");
+#else
+ static_assert(!std::is_convertible<
+ ExplicitDerived<int>, std::tuple<Implicit>>::value,
+ "libc++ incorrectly rejects this");
+#endif
+ assert(count == 0);
+ std::tuple<Implicit> bar(ExplicitDerived<int>{42}); ((void)bar);
+ assert(count == 1);
+ }
+ count = 0;
+
+}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp
index 6ab303c735be..06284df56642 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp
@@ -20,9 +20,11 @@
#include <cassert>
#include <type_traits>
+#include "test_macros.h"
+#include "test_convertible.hpp"
#include "MoveOnly.h"
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
struct Empty {};
struct A
@@ -123,17 +125,23 @@ int main()
// extensions
#ifdef _LIBCPP_VERSION
{
- std::tuple<MoveOnly, MoveOnly, MoveOnly> t(MoveOnly(0),
- MoveOnly(1));
+ using E = MoveOnly;
+ using Tup = std::tuple<E, E, E>;
+ // Test that the reduced arity initialization extension is only
+ // allowed on the explicit constructor.
+ static_assert(test_convertible<Tup, E, E, E>(), "");
+
+ Tup t(E(0), E(1));
+ static_assert(!test_convertible<Tup, E, E>(), "");
assert(std::get<0>(t) == 0);
assert(std::get<1>(t) == 1);
assert(std::get<2>(t) == MoveOnly());
- }
- {
- std::tuple<MoveOnly, MoveOnly, MoveOnly> t(MoveOnly(0));
+
+ Tup t2(E(0));
+ static_assert(!test_convertible<Tup, E>(), "");
assert(std::get<0>(t) == 0);
- assert(std::get<1>(t) == MoveOnly());
- assert(std::get<2>(t) == MoveOnly());
+ assert(std::get<1>(t) == E());
+ assert(std::get<2>(t) == E());
}
#endif
#if TEST_STD_VER > 11
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_pair.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_pair.pass.cpp
index c5941618180d..1d0c7b49aaaa 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_pair.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_pair.pass.cpp
@@ -27,8 +27,8 @@
int main()
{
{
- typedef std::pair<double, int> T0;
- typedef std::tuple<int, double> T1;
+ typedef std::pair<long, int> T0;
+ typedef std::tuple<long long, double> T1;
T0 t0(2, 3);
T1 t1(std::allocator_arg, A1<int>(5), t0);
assert(std::get<0>(t1) == 2);
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp
index 36d9f32879cb..153cd2b3d7ce 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp
@@ -37,9 +37,9 @@ struct Implicit {
int main()
{
{
- typedef std::tuple<double> T0;
- typedef std::tuple<int> T1;
- T0 t0(2.5);
+ typedef std::tuple<long> T0;
+ typedef std::tuple<long long> T1;
+ T0 t0(2);
T1 t1(std::allocator_arg, A1<int>(), t0);
assert(std::get<0>(t1) == 2);
}
@@ -65,9 +65,9 @@ int main()
assert(std::get<1>(t1) == 3);
}
{
- typedef std::tuple<double, int, int> T0;
- typedef std::tuple<int, alloc_first, alloc_last> T1;
- T0 t0(1.5, 2, 3);
+ typedef std::tuple<long, int, int> T0;
+ typedef std::tuple<long long, alloc_first, alloc_last> T1;
+ T0 t0(1, 2, 3);
alloc_first::allocator_constructed = false;
alloc_last::allocator_constructed = false;
T1 t1(std::allocator_arg, A1<int>(5), t0);
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp
index 367f19e5d8dd..0da132fcfc26 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp
@@ -19,6 +19,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
template <class ...>
struct never {
@@ -81,12 +82,13 @@ int main()
{
// check that the literal '0' can implicitly initialize a stored pointer.
std::tuple<int*> t = 0;
+ assert(std::get<0>(t) == nullptr);
}
{
std::tuple<int> t(2);
assert(std::get<0>(t) == 2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::tuple<int> t(2);
static_assert(std::get<0>(t) == 2, "");
@@ -101,7 +103,7 @@ int main()
assert(std::get<0>(t) == 2);
assert(std::get<1>(t) == nullptr);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::tuple<int, char*> t(2, nullptr);
static_assert(std::get<0>(t) == 2, "");
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp
index d6d489fd0ea4..bed161a3dcef 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp
@@ -19,23 +19,25 @@
#include <utility>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
- typedef std::pair<double, char> T0;
- typedef std::tuple<int, short> T1;
- T0 t0(2.5, 'a');
+ typedef std::pair<long, char> T0;
+ typedef std::tuple<long long, short> T1;
+ T0 t0(2, 'a');
T1 t1 = t0;
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == short('a'));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
- typedef std::pair<double, char> P0;
- typedef std::tuple<int, short> T1;
- constexpr P0 p0(2.5, 'a');
+ typedef std::pair<long, char> P0;
+ typedef std::tuple<long long, short> T1;
+ constexpr P0 p0(2, 'a');
constexpr T1 t1 = p0;
- static_assert(std::get<0>(t1) != std::get<0>(p0), "");
+ static_assert(std::get<0>(t1) == std::get<0>(p0), "");
static_assert(std::get<1>(t1) == std::get<1>(p0), "");
static_assert(std::get<0>(t1) == 2, "");
static_assert(std::get<1>(t1) == short('a'), "");
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp
index b7fa2e3a03cc..4609b042556b 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp
@@ -20,6 +20,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
struct Explicit {
int value;
explicit Explicit(int x) : value(x) {}
@@ -43,7 +45,7 @@ struct D
explicit D(int i) : B(i) {}
};
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
struct A
{
@@ -66,17 +68,17 @@ struct C
int main()
{
{
- typedef std::tuple<double> T0;
- typedef std::tuple<int> T1;
- T0 t0(2.5);
+ typedef std::tuple<long> T0;
+ typedef std::tuple<long long> T1;
+ T0 t0(2);
T1 t1 = t0;
assert(std::get<0>(t1) == 2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
- typedef std::tuple<double> T0;
+ typedef std::tuple<int> T0;
typedef std::tuple<A> T1;
- constexpr T0 t0(2.5);
+ constexpr T0 t0(2);
constexpr T1 t1 = t0;
static_assert(std::get<0>(t1) == 2, "");
}
@@ -89,17 +91,17 @@ int main()
}
#endif
{
- typedef std::tuple<double, char> T0;
- typedef std::tuple<int, int> T1;
- T0 t0(2.5, 'a');
+ typedef std::tuple<long, char> T0;
+ typedef std::tuple<long long, int> T1;
+ T0 t0(2, 'a');
T1 t1 = t0;
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
}
{
- typedef std::tuple<double, char, D> T0;
- typedef std::tuple<int, int, B> T1;
- T0 t0(2.5, 'a', D(3));
+ typedef std::tuple<long, char, D> T0;
+ typedef std::tuple<long long, int, B> T1;
+ T0 t0(2, 'a', D(3));
T1 t1 = t0;
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
@@ -107,9 +109,9 @@ int main()
}
{
D d(3);
- typedef std::tuple<double, char, D&> T0;
- typedef std::tuple<int, int, B&> T1;
- T0 t0(2.5, 'a', d);
+ typedef std::tuple<long, char, D&> T0;
+ typedef std::tuple<long long, int, B&> T1;
+ T0 t0(2, 'a', d);
T1 t1 = t0;
d.id_ = 2;
assert(std::get<0>(t1) == 2);
@@ -117,9 +119,9 @@ int main()
assert(std::get<2>(t1).id_ == 2);
}
{
- typedef std::tuple<double, char, int> T0;
- typedef std::tuple<int, int, B> T1;
- T0 t0(2.5, 'a', 3);
+ typedef std::tuple<long, char, int> T0;
+ typedef std::tuple<long long, int, B> T1;
+ T0 t0(2, 'a', 3);
T1 t1(t0);
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
index 8423f5d0145f..2af86fdd0868 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
@@ -48,24 +48,24 @@ struct D
int main()
{
{
- typedef std::tuple<double> T0;
- typedef std::tuple<int> T1;
- T0 t0(2.5);
+ typedef std::tuple<long> T0;
+ typedef std::tuple<long long> T1;
+ T0 t0(2);
T1 t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
}
{
- typedef std::tuple<double, char> T0;
- typedef std::tuple<int, int> T1;
- T0 t0(2.5, 'a');
+ typedef std::tuple<long, char> T0;
+ typedef std::tuple<long long, int> T1;
+ T0 t0(2, 'a');
T1 t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
}
{
- typedef std::tuple<double, char, D> T0;
- typedef std::tuple<int, int, B> T1;
- T0 t0(2.5, 'a', D(3));
+ typedef std::tuple<long, char, D> T0;
+ typedef std::tuple<long long, int, B> T1;
+ T0 t0(2, 'a', D(3));
T1 t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
@@ -73,9 +73,9 @@ int main()
}
{
D d(3);
- typedef std::tuple<double, char, D&> T0;
- typedef std::tuple<int, int, B&> T1;
- T0 t0(2.5, 'a', d);
+ typedef std::tuple<long, char, D&> T0;
+ typedef std::tuple<long long, int, B&> T1;
+ T0 t0(2, 'a', d);
T1 t1 = std::move(t0);
d.id_ = 2;
assert(std::get<0>(t1) == 2);
@@ -83,9 +83,9 @@ int main()
assert(std::get<2>(t1).id_ == 2);
}
{
- typedef std::tuple<double, char, std::unique_ptr<D>> T0;
- typedef std::tuple<int, int, std::unique_ptr<B>> T1;
- T0 t0(2.5, 'a', std::unique_ptr<D>(new D(3)));
+ typedef std::tuple<long, char, std::unique_ptr<D>> T0;
+ typedef std::tuple<long long, int, std::unique_ptr<B>> T1;
+ T0 t0(2, 'a', std::unique_ptr<D>(new D(3)));
T1 t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == int('a'));
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
index 783c9d1f06a8..1137df2918dd 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
@@ -19,6 +19,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
struct Empty {};
int main()
@@ -50,7 +52,7 @@ int main()
assert(std::get<1>(t) == 'a');
assert(std::get<2>(t) == "some text");
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::tuple<int> T;
constexpr T t0(2);
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp
new file mode 100644
index 000000000000..fbcda44e4065
--- /dev/null
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <tuple>
+
+// template <class... Types> class tuple;
+
+// ~tuple();
+
+#include <tuple>
+#include <string>
+#include <cassert>
+#include <type_traits>
+
+int main()
+{
+ static_assert(std::is_trivially_destructible<
+ std::tuple<> >::value, "");
+ static_assert(std::is_trivially_destructible<
+ std::tuple<void*> >::value, "");
+ static_assert(std::is_trivially_destructible<
+ std::tuple<int, float> >::value, "");
+ static_assert(!std::is_trivially_destructible<
+ std::tuple<std::string> >::value, "");
+ static_assert(!std::is_trivially_destructible<
+ std::tuple<int, std::string> >::value, "");
+}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp
index 0c93673532bb..1cc13cf58ba8 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp
@@ -29,7 +29,7 @@ struct ConstructsWithTupleLeaf
ConstructsWithTupleLeaf(ConstructsWithTupleLeaf &&) {}
template <class T>
- ConstructsWithTupleLeaf(T t) {
+ ConstructsWithTupleLeaf(T) {
static_assert(!std::is_same<T, T>::value,
"Constructor instantiated for type other than int");
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move_pair.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move_pair.pass.cpp
index 2dfbaff6cc1a..13558f3fbe17 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move_pair.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move_pair.pass.cpp
@@ -38,9 +38,9 @@ struct D
int main()
{
{
- typedef std::pair<double, std::unique_ptr<D>> T0;
- typedef std::tuple<int, std::unique_ptr<B>> T1;
- T0 t0(2.5, std::unique_ptr<D>(new D(3)));
+ typedef std::pair<long, std::unique_ptr<D>> T0;
+ typedef std::tuple<long long, std::unique_ptr<B>> T1;
+ T0 t0(2, std::unique_ptr<D>(new D(3)));
T1 t1 = std::move(t0);
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1)->id_ == 3);
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp
index 2dbe81513a1a..1099e3579687 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp
@@ -18,6 +18,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
template <class Tuple>
void
test0(const Tuple&)
@@ -54,7 +56,7 @@ test2a(const Tuple& t)
assert(std::get<1>(t) == 'a');
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
template <class Tuple>
constexpr int
test3(const Tuple&)
@@ -79,7 +81,7 @@ int main()
double i = 2.5;
char c = 'a';
test2a(std::forward_as_tuple(i, c));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert ( test3 (std::forward_as_tuple(i, c)) == 2, "" );
#endif
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.creation/make_tuple.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.creation/make_tuple.pass.cpp
index f27e8a09fb97..2c38bf7d230c 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.creation/make_tuple.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.creation/make_tuple.pass.cpp
@@ -20,6 +20,8 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -40,7 +42,7 @@ int main()
assert(i == 0);
assert(j == 0);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr auto t1 = std::make_tuple(0, 1, 3.14);
constexpr int i1 = std::get<1>(t1);
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp
index 52ecd249402f..c4c3c242d8f8 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp
@@ -20,6 +20,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -29,7 +31,7 @@ int main()
assert(i == 42);
assert(s == "C++");
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static constexpr int i = 42;
static constexpr double f = 1.1;
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp
index 770edcaca5e1..18095f7e3033 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp
@@ -21,6 +21,7 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
int main()
@@ -48,7 +49,7 @@ int main()
assert(std::get<0>(t) == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::tuple<> t = std::tuple_cat();
((void)t); // Prevent unused warning
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp
index 002ad148ad6d..f014916742ad 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp
@@ -21,6 +21,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
struct Empty {};
int main()
@@ -36,7 +38,7 @@ int main()
assert(std::get<0>(t) == "high");
assert(std::get<1>(t) == 5);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::tuple<double, int> T;
constexpr T t(2.718, 5);
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.cpp
index 58df2df7679a..9c2d992b8e49 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.cpp
@@ -19,7 +19,7 @@
#include <tuple>
-template <class T> void cref(T const&) {};
+template <class T> void cref(T const&) {}
template <class T> void cref(T const&&) = delete;
std::tuple<int> const tup4() { return std::make_tuple(4); }
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp
index 86d1191db556..fc53412899fb 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp
@@ -71,7 +71,7 @@ int main()
assert(std::get<2>(t) == 4);
assert(d == 2.5);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // get on an rvalue tuple
static_assert ( std::get<0> ( std::make_tuple ( 0.0f, 1, 2.0, 3L )) == 0, "" );
static_assert ( std::get<1> ( std::make_tuple ( 0.0f, 1, 2.0, 3L )) == 1, "" );
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp
index 42e4fab88ffa..5beedbe9d157 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp
@@ -23,6 +23,8 @@
#include <tuple>
#include <type_traits>
+#include "test_macros.h"
+
template <class T, std::size_t N, class U>
void test()
{
@@ -30,7 +32,7 @@ void test()
static_assert((std::is_same<typename std::tuple_element<N, const T>::type, const U>::value), "");
static_assert((std::is_same<typename std::tuple_element<N, volatile T>::type, volatile U>::value), "");
static_assert((std::is_same<typename std::tuple_element<N, const volatile T>::type, const volatile U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<typename std::tuple_element_t<N, T>, U>::value), "");
static_assert((std::is_same<typename std::tuple_element_t<N, const T>, const U>::value), "");
static_assert((std::is_same<typename std::tuple_element_t<N, volatile T>, volatile U>::value), "");
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
index 3f132e47b626..50c6f17efbef 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
@@ -21,7 +21,7 @@
int main()
{
- (void)std::tuple_size<std::tuple<> &>::value; // expected-error {{implicit instantiation of undefined template}}
- (void)std::tuple_size<int>::value; // expected-error {{implicit instantiation of undefined template}}
- (void)std::tuple_size<std::tuple<>*>::value; // expected-error {{implicit instantiation of undefined template}}
+ (void)std::tuple_size<std::tuple<> &>::value; // expected-error {{no member named 'value'}}
+ (void)std::tuple_size<int>::value; // expected-error {{no member named 'value'}}
+ (void)std::tuple_size<std::tuple<>*>::value; // expected-error {{no member named 'value'}}
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp
index 49b4215a1956..40214f632e75 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.pass.cpp
@@ -18,19 +18,36 @@
// UNSUPPORTED: c++98, c++03
#include <tuple>
+#include <utility>
+#include <array>
#include <type_traits>
+template <class T, class = decltype(std::tuple_size<T>::value)>
+constexpr bool has_value(int) { return true; }
+template <class> constexpr bool has_value(long) { return false; }
+template <class T> constexpr bool has_value() { return has_value<T>(0); }
+
+
template <class T, std::size_t N>
void test()
{
+ static_assert(has_value<T>(), "");
static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,
std::tuple_size<T> >::value), "");
+ static_assert(has_value<const T>(), "");
static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,
std::tuple_size<const T> >::value), "");
+ static_assert(has_value<volatile T>(), "");
static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,
std::tuple_size<volatile T> >::value), "");
+
+ static_assert(has_value<const volatile T>(), "");
static_assert((std::is_base_of<std::integral_constant<std::size_t, N>,
std::tuple_size<const volatile T> >::value), "");
+ {
+ static_assert(!has_value<T &>(), "");
+ static_assert(!has_value<T *>(), "");
+ }
}
int main()
@@ -39,4 +56,13 @@ int main()
test<std::tuple<int>, 1>();
test<std::tuple<char, int>, 2>();
test<std::tuple<char, char*, int>, 3>();
+ test<std::pair<int, void*>, 2>();
+ test<std::array<int, 42>, 42>();
+ {
+ static_assert(!has_value<void>(), "");
+ static_assert(!has_value<void*>(), "");
+ static_assert(!has_value<int>(), "");
+ static_assert(!has_value<std::pair<int, int>*>(), "");
+ static_assert(!has_value<std::array<int, 42>&>(), "");
+ }
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp
index 957a683b47f8..700dd95c959c 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp
@@ -22,5 +22,5 @@ int main()
(void)std::tuple_size_v<std::tuple<> &>; // expected-note {{requested here}}
(void)std::tuple_size_v<int>; // expected-note {{requested here}}
(void)std::tuple_size_v<std::tuple<>*>; // expected-note {{requested here}}
- // expected-error@tuple:* 3 {{implicit instantiation of undefined template}}
+ // expected-error@tuple:* 3 {{no member named 'value'}}
}
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.rel/eq.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.rel/eq.pass.cpp
index e5991df636f8..a802a05da2bc 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.rel/eq.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.rel/eq.pass.cpp
@@ -21,6 +21,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -49,104 +51,104 @@ int main()
}
{
typedef std::tuple<int, double> T1;
- typedef std::tuple<double, char> T2;
+ typedef std::tuple<double, long> T2;
const T1 t1(1, 2);
- const T2 t2(1, char(2));
+ const T2 t2(1, 2);
assert(t1 == t2);
assert(!(t1 != t2));
}
{
typedef std::tuple<int, double> T1;
- typedef std::tuple<double, char> T2;
+ typedef std::tuple<double, long> T2;
const T1 t1(1, 2);
- const T2 t2(1, char(3));
+ const T2 t2(1, 3);
assert(!(t1 == t2));
assert(t1 != t2);
}
{
typedef std::tuple<int, double> T1;
- typedef std::tuple<double, char> T2;
+ typedef std::tuple<double, long> T2;
const T1 t1(1, 2);
- const T2 t2(1.1, char(2));
+ const T2 t2(1.1, 2);
assert(!(t1 == t2));
assert(t1 != t2);
}
{
typedef std::tuple<int, double> T1;
- typedef std::tuple<double, char> T2;
+ typedef std::tuple<double, long> T2;
const T1 t1(1, 2);
- const T2 t2(1.1, char(3));
+ const T2 t2(1.1, 3);
assert(!(t1 == t2));
assert(t1 != t2);
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1, 2, 3);
assert(t1 == t2);
assert(!(t1 != t2));
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1.1, 2, 3);
assert(!(t1 == t2));
assert(t1 != t2);
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1, 3, 3);
assert(!(t1 == t2));
assert(t1 != t2);
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1, 2, 4);
assert(!(t1 == t2));
assert(t1 != t2);
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1, 3, 2);
assert(!(t1 == t2));
assert(t1 != t2);
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1.1, 2, 2);
assert(!(t1 == t2));
assert(t1 != t2);
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1.1, 3, 3);
assert(!(t1 == t2));
assert(t1 != t2);
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1.1, 3, 2);
assert(!(t1 == t2));
assert(t1 != t2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
constexpr T1 t1(1, 2, 3);
constexpr T2 t2(1.1, 3, 2);
static_assert(!(t1 == t2), "");
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.rel/lt.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.rel/lt.pass.cpp
index 34aafb1e1347..f4d764b87ee9 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.rel/lt.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.rel/lt.pass.cpp
@@ -33,6 +33,8 @@
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
@@ -46,7 +48,7 @@ int main()
assert( (t1 >= t2));
}
{
- typedef std::tuple<char> T1;
+ typedef std::tuple<long> T1;
typedef std::tuple<double> T2;
const T1 t1(1);
const T2 t2(1);
@@ -56,7 +58,7 @@ int main()
assert( (t1 >= t2));
}
{
- typedef std::tuple<char> T1;
+ typedef std::tuple<long> T1;
typedef std::tuple<double> T2;
const T1 t1(1);
const T2 t2(0.9);
@@ -66,7 +68,7 @@ int main()
assert( (t1 >= t2));
}
{
- typedef std::tuple<char> T1;
+ typedef std::tuple<long> T1;
typedef std::tuple<double> T2;
const T1 t1(1);
const T2 t2(1.1);
@@ -76,8 +78,8 @@ int main()
assert(!(t1 >= t2));
}
{
- typedef std::tuple<char, int> T1;
- typedef std::tuple<double, char> T2;
+ typedef std::tuple<long, int> T1;
+ typedef std::tuple<double, long> T2;
const T1 t1(1, 2);
const T2 t2(1, 2);
assert(!(t1 < t2));
@@ -86,8 +88,8 @@ int main()
assert( (t1 >= t2));
}
{
- typedef std::tuple<char, int> T1;
- typedef std::tuple<double, char> T2;
+ typedef std::tuple<long, int> T1;
+ typedef std::tuple<double, long> T2;
const T1 t1(1, 2);
const T2 t2(0.9, 2);
assert(!(t1 < t2));
@@ -96,8 +98,8 @@ int main()
assert( (t1 >= t2));
}
{
- typedef std::tuple<char, int> T1;
- typedef std::tuple<double, char> T2;
+ typedef std::tuple<long, int> T1;
+ typedef std::tuple<double, long> T2;
const T1 t1(1, 2);
const T2 t2(1.1, 2);
assert( (t1 < t2));
@@ -106,8 +108,8 @@ int main()
assert(!(t1 >= t2));
}
{
- typedef std::tuple<char, int> T1;
- typedef std::tuple<double, char> T2;
+ typedef std::tuple<long, int> T1;
+ typedef std::tuple<double, long> T2;
const T1 t1(1, 2);
const T2 t2(1, 1);
assert(!(t1 < t2));
@@ -116,8 +118,8 @@ int main()
assert( (t1 >= t2));
}
{
- typedef std::tuple<char, int> T1;
- typedef std::tuple<double, char> T2;
+ typedef std::tuple<long, int> T1;
+ typedef std::tuple<double, long> T2;
const T1 t1(1, 2);
const T2 t2(1, 3);
assert( (t1 < t2));
@@ -126,8 +128,8 @@ int main()
assert(!(t1 >= t2));
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1, 2, 3);
assert(!(t1 < t2));
@@ -136,8 +138,8 @@ int main()
assert( (t1 >= t2));
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(0.9, 2, 3);
assert(!(t1 < t2));
@@ -146,8 +148,8 @@ int main()
assert( (t1 >= t2));
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1.1, 2, 3);
assert( (t1 < t2));
@@ -156,8 +158,8 @@ int main()
assert(!(t1 >= t2));
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1, 1, 3);
assert(!(t1 < t2));
@@ -166,8 +168,8 @@ int main()
assert( (t1 >= t2));
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1, 3, 3);
assert( (t1 < t2));
@@ -176,8 +178,8 @@ int main()
assert(!(t1 >= t2));
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1, 2, 2);
assert(!(t1 < t2));
@@ -186,8 +188,8 @@ int main()
assert( (t1 >= t2));
}
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
const T1 t1(1, 2, 3);
const T2 t2(1, 2, 4);
assert( (t1 < t2));
@@ -195,10 +197,10 @@ int main()
assert(!(t1 > t2));
assert(!(t1 >= t2));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
- typedef std::tuple<char, int, double> T1;
- typedef std::tuple<double, char, int> T2;
+ typedef std::tuple<long, int, double> T1;
+ typedef std::tuple<double, long, int> T2;
constexpr T1 t1(1, 2, 3);
constexpr T2 t2(1, 2, 4);
static_assert( (t1 < t2), "");
diff --git a/test/std/utilities/utility/exchange/exchange.pass.cpp b/test/std/utilities/utility/exchange/exchange.pass.cpp
index 5ef0ac3b09f5..2d01d6c8c8af 100644
--- a/test/std/utilities/utility/exchange/exchange.pass.cpp
+++ b/test/std/utilities/utility/exchange/exchange.pass.cpp
@@ -22,10 +22,10 @@ int main()
int v = 12;
assert ( std::exchange ( v, 23 ) == 12 );
assert ( v == 23 );
- assert ( std::exchange ( v, 67.2 ) == 23 );
+ assert ( std::exchange ( v, static_cast<short>(67) ) == 23 );
assert ( v == 67 );
- assert ((std::exchange<int, float> ( v, {} )) == 67 );
+ assert ((std::exchange<int, short> ( v, {} )) == 67 );
assert ( v == 0 );
}
diff --git a/test/std/utilities/utility/forward/forward.fail.cpp b/test/std/utilities/utility/forward/forward.fail.cpp
new file mode 100644
index 000000000000..a3bb890482ef
--- /dev/null
+++ b/test/std/utilities/utility/forward/forward.fail.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// test forward
+
+#include <utility>
+
+#include "test_macros.h"
+
+struct A
+{
+};
+
+A source() {return A();}
+const A csource() {return A();}
+
+int main()
+{
+#if TEST_STD_VER >= 11
+ {
+ std::forward<A&>(source()); // expected-note {{requested here}}
+ // expected-error@type_traits:* 1 {{static_assert failed "can not forward an rvalue as an lvalue"}}
+ }
+#else
+ {
+ std::forward<A&>(source()); // expected-error {{no matching function for call to 'forward'}}
+ }
+#endif
+ {
+ const A ca = A();
+ std::forward<A&>(ca); // expected-error {{no matching function for call to 'forward'}}
+ }
+ {
+ std::forward<A&>(csource()); // expected-error {{no matching function for call to 'forward'}}
+ }
+ {
+ const A ca = A();
+ std::forward<A>(ca); // expected-error {{no matching function for call to 'forward'}}
+ }
+ {
+ std::forward<A>(csource()); // expected-error {{no matching function for call to 'forward'}}
+ }
+ {
+ A a;
+ std::forward(a); // expected-error {{no matching function for call to 'forward'}}
+ }
+}
diff --git a/test/std/utilities/utility/forward/forward.pass.cpp b/test/std/utilities/utility/forward/forward.pass.cpp
index 94575485df04..afff8d627fad 100644
--- a/test/std/utilities/utility/forward/forward.pass.cpp
+++ b/test/std/utilities/utility/forward/forward.pass.cpp
@@ -7,32 +7,40 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// test forward
#include <utility>
+#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
struct A
{
};
-A source() {return A();}
-const A csource() {return A();}
-
-typedef char one;
-struct two {one _[2];};
-struct four {one _[4];};
-struct eight {one _[8];};
-
-one test(A&);
-two test(const A&);
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-four test(A&&);
-eight test(const A&&);
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+A source() noexcept {return A();}
+const A csource() noexcept {return A();}
+
+
+constexpr bool test_constexpr_forward() {
+#if TEST_STD_VER > 11
+ int x = 42;
+ const int cx = 101;
+ return std::forward<int&>(x) == 42
+ && std::forward<int>(x) == 42
+ && std::forward<const int&>(x) == 42
+ && std::forward<const int>(x) == 42
+ && std::forward<int&&>(x) == 42
+ && std::forward<const int&&>(x) == 42
+ && std::forward<const int&>(cx) == 101
+ && std::forward<const int>(cx) == 101;
+#else
+ return true;
+#endif
+}
int main()
{
@@ -42,42 +50,42 @@ int main()
((void)a); // Prevent unused warning
((void)ca); // Prevent unused warning
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- static_assert(sizeof(test(std::forward<A&>(a))) == 1, "");
- static_assert(sizeof(test(std::forward<A>(a))) == 4, "");
- static_assert(sizeof(test(std::forward<A>(source()))) == 4, "");
-
- static_assert(sizeof(test(std::forward<const A&>(a))) == 2, "");
-// static_assert(sizeof(test(std::forward<const A&>(source()))) == 2, "");
- static_assert(sizeof(test(std::forward<const A>(a))) == 8, "");
- static_assert(sizeof(test(std::forward<const A>(source()))) == 8, "");
-
- static_assert(sizeof(test(std::forward<const A&>(ca))) == 2, "");
-// static_assert(sizeof(test(std::forward<const A&>(csource()))) == 2, "");
- static_assert(sizeof(test(std::forward<const A>(ca))) == 8, "");
- static_assert(sizeof(test(std::forward<const A>(csource()))) == 8, "");
-
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- static_assert(sizeof(test(std::forward<A&>(a))) == 1, "");
- static_assert(sizeof(test(std::forward<A>(a))) == 1, "");
-// static_assert(sizeof(test(std::forward<A>(source()))) == 2, "");
-
- static_assert(sizeof(test(std::forward<const A&>(a))) == 2, "");
- static_assert(sizeof(test(std::forward<const A&>(source()))) == 2, "");
- static_assert(sizeof(test(std::forward<const A>(a))) == 2, "");
- static_assert(sizeof(test(std::forward<const A>(source()))) == 2, "");
-
- static_assert(sizeof(test(std::forward<const A&>(ca))) == 2, "");
- static_assert(sizeof(test(std::forward<const A&>(csource()))) == 2, "");
- static_assert(sizeof(test(std::forward<const A>(ca))) == 2, "");
- static_assert(sizeof(test(std::forward<const A>(csource()))) == 2, "");
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#if _LIBCPP_STD_VER > 11
- constexpr int i1 = std::move(23);
- static_assert(i1 == 23, "" );
+ static_assert(std::is_same<decltype(std::forward<A&>(a)), A&>::value, "");
+ static_assert(std::is_same<decltype(std::forward<A>(a)), A&&>::value, "");
+ static_assert(std::is_same<decltype(std::forward<A>(source())), A&&>::value, "");
+ static_assert(noexcept(std::forward<A&>(a)), "");
+ static_assert(noexcept(std::forward<A>(a)), "");
+ static_assert(noexcept(std::forward<A>(source())), "");
+
+ static_assert(std::is_same<decltype(std::forward<const A&>(a)), const A&>::value, "");
+ static_assert(std::is_same<decltype(std::forward<const A>(a)), const A&&>::value, "");
+ static_assert(std::is_same<decltype(std::forward<const A>(source())), const A&&>::value, "");
+ static_assert(noexcept(std::forward<const A&>(a)), "");
+ static_assert(noexcept(std::forward<const A>(a)), "");
+ static_assert(noexcept(std::forward<const A>(source())), "");
+
+ static_assert(std::is_same<decltype(std::forward<const A&>(ca)), const A&>::value, "");
+ static_assert(std::is_same<decltype(std::forward<const A>(ca)), const A&&>::value, "");
+ static_assert(std::is_same<decltype(std::forward<const A>(csource())), const A&&>::value, "");
+ static_assert(noexcept(std::forward<const A&>(ca)), "");
+ static_assert(noexcept(std::forward<const A>(ca)), "");
+ static_assert(noexcept(std::forward<const A>(csource())), "");
+
+#if TEST_STD_VER > 11
+ {
+ constexpr int i2 = std::forward<int>(42);
+ static_assert(std::forward<int>(42) == 42, "");
+ static_assert(std::forward<const int&>(i2) == 42, "");
+ static_assert(test_constexpr_forward(), "");
+ }
+#endif
+#if TEST_STD_VER == 11 && defined(_LIBCPP_VERSION)
+ // Test that std::forward is constexpr in C++11. This is an extension
+ // provided by both libc++ and libstdc++.
+ {
constexpr int i2 = std::forward<int>(42);
- static_assert(i2 == 42, "" );
+ static_assert(std::forward<int>(42) == 42, "" );
+ static_assert(std::forward<const int&>(i2) == 42, "");
+ }
#endif
}
diff --git a/test/std/utilities/utility/forward/forward5.fail.cpp b/test/std/utilities/utility/forward/forward5.fail.cpp
deleted file mode 100644
index 86c2b5651b90..000000000000
--- a/test/std/utilities/utility/forward/forward5.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// test forward
-
-#include <utility>
-
-struct A
-{
-};
-
-A source() {return A();}
-const A csource() {return A();}
-
-int main()
-{
- const A ca = A();
- std::forward<A>(csource()); // error
-}
diff --git a/test/std/utilities/utility/forward/forward_03.pass.cpp b/test/std/utilities/utility/forward/forward_03.pass.cpp
new file mode 100644
index 000000000000..7e141bad94e8
--- /dev/null
+++ b/test/std/utilities/utility/forward/forward_03.pass.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// test forward
+
+#include <utility>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A
+{
+};
+
+A source() {return A();}
+const A csource() {return A();}
+
+typedef char one;
+struct two {one _[2];};
+struct four {one _[4];};
+struct eight {one _[8];};
+
+one test(A&);
+two test(const A&);
+
+int main()
+{
+ A a;
+ const A ca = A();
+
+ ((void)a); // Prevent unused warning
+ ((void)ca); // Prevent unused warning
+
+#if TEST_STD_VER < 11
+ static_assert(sizeof(test(std::forward<A&>(a))) == 1, "");
+ static_assert(sizeof(test(std::forward<A>(a))) == 1, "");
+
+ // Libc++'s C++03 implementation of 'forward' cannot accept true non-const
+ // rvalues.
+ // static_assert(sizeof(test(std::forward<A>(source()))) == 2, "");
+
+ static_assert(sizeof(test(std::forward<const A&>(a))) == 2, "");
+ static_assert(sizeof(test(std::forward<const A&>(source()))) == 2, "");
+ static_assert(sizeof(test(std::forward<const A>(a))) == 2, "");
+ static_assert(sizeof(test(std::forward<const A>(source()))) == 2, "");
+
+ static_assert(sizeof(test(std::forward<const A&>(ca))) == 2, "");
+ static_assert(sizeof(test(std::forward<const A&>(csource()))) == 2, "");
+ static_assert(sizeof(test(std::forward<const A>(ca))) == 2, "");
+ static_assert(sizeof(test(std::forward<const A>(csource()))) == 2, "");
+#endif
+}
diff --git a/test/std/utilities/utility/forward/move_only.pass.cpp b/test/std/utilities/utility/forward/move.fail.cpp
index 520bf5e5b6a1..bd2126cbaee4 100644
--- a/test/std/utilities/utility/forward/move_only.pass.cpp
+++ b/test/std/utilities/utility/forward/move.fail.cpp
@@ -7,22 +7,17 @@
//
//===----------------------------------------------------------------------===//
-// test move
-
// UNSUPPORTED: c++98, c++03
+// test move
+
#include <utility>
#include <cassert>
-class move_only
-{
- move_only(const move_only&);
- move_only& operator=(const move_only&);
-public:
- move_only(move_only&&) {}
- move_only& operator=(move_only&&) {return *this;}
-
+struct move_only {
move_only() {}
+ move_only(move_only&&) = default;
+ move_only& operator=(move_only&&) = default;
};
move_only source() {return move_only();}
@@ -32,8 +27,8 @@ void test(move_only) {}
int main()
{
- move_only mo;
+ move_only a;
+ const move_only ca = move_only();
- test(std::move(mo));
- test(source());
+ test(std::move(ca)); // c
}
diff --git a/test/std/utilities/utility/forward/move.pass.cpp b/test/std/utilities/utility/forward/move.pass.cpp
new file mode 100644
index 000000000000..e2edc2a2afad
--- /dev/null
+++ b/test/std/utilities/utility/forward/move.pass.cpp
@@ -0,0 +1,121 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// test move
+
+// UNSUPPORTED: c++98, c++03
+
+#include <utility>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+class move_only
+{
+ move_only(const move_only&);
+ move_only& operator=(const move_only&);
+public:
+ move_only(move_only&&) {}
+ move_only& operator=(move_only&&) {return *this;}
+
+ move_only() {}
+};
+
+move_only source() {return move_only();}
+const move_only csource() {return move_only();}
+
+void test(move_only) {}
+
+int x = 42;
+const int& cx = x;
+
+template <class QualInt>
+QualInt get() noexcept { return static_cast<QualInt>(x); }
+
+
+int copy_ctor = 0;
+int move_ctor = 0;
+
+struct A {
+ A() {}
+ A(const A&) {++copy_ctor;}
+ A(A&&) {++move_ctor;}
+ A& operator=(const A&) = delete;
+};
+
+constexpr bool test_constexpr_move() {
+#if TEST_STD_VER > 11
+ int y = 42;
+ const int cy = y;
+ return std::move(y) == 42
+ && std::move(cy) == 42
+ && std::move(static_cast<int&&>(y)) == 42
+ && std::move(static_cast<int const&&>(y)) == 42;
+#else
+ return true;
+#endif
+}
+
+int main()
+{
+ { // Test return type and noexcept.
+ static_assert(std::is_same<decltype(std::move(x)), int&&>::value, "");
+ static_assert(noexcept(std::move(x)), "");
+ static_assert(std::is_same<decltype(std::move(cx)), const int&&>::value, "");
+ static_assert(noexcept(std::move(cx)), "");
+ static_assert(std::is_same<decltype(std::move(42)), int&&>::value, "");
+ static_assert(noexcept(std::move(42)), "");
+ static_assert(std::is_same<decltype(std::move(get<const int&&>())), const int&&>::value, "");
+ static_assert(noexcept(std::move(get<int const&&>())), "");
+ }
+ { // test copy and move semantics
+ A a;
+ const A ca = A();
+
+ assert(copy_ctor == 0);
+ assert(move_ctor == 0);
+
+ A a2 = a;
+ assert(copy_ctor == 1);
+ assert(move_ctor == 0);
+
+ A a3 = std::move(a);
+ assert(copy_ctor == 1);
+ assert(move_ctor == 1);
+
+ A a4 = ca;
+ assert(copy_ctor == 2);
+ assert(move_ctor == 1);
+
+ A a5 = std::move(ca);
+ assert(copy_ctor == 3);
+ assert(move_ctor == 1);
+ }
+ { // test on a move only type
+ move_only mo;
+ test(std::move(mo));
+ test(source());
+ }
+#if TEST_STD_VER > 11
+ {
+ constexpr int y = 42;
+ static_assert(std::move(y) == 42, "");
+ static_assert(test_constexpr_move(), "");
+ }
+#endif
+#if TEST_STD_VER == 11 && defined(_LIBCPP_VERSION)
+ // Test that std::forward is constexpr in C++11. This is an extension
+ // provided by both libc++ and libstdc++.
+ {
+ constexpr int y = 42;
+ static_assert(std::move(y) == 42, "");
+ }
+#endif
+}
diff --git a/test/std/utilities/utility/forward/move_copy.pass.cpp b/test/std/utilities/utility/forward/move_copy.pass.cpp
deleted file mode 100644
index fa15553f669f..000000000000
--- a/test/std/utilities/utility/forward/move_copy.pass.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// test move
-
-// UNSUPPORTED: c++98, c++03
-
-#include <utility>
-#include <cassert>
-
-int copy_ctor = 0;
-int move_ctor = 0;
-
-class A
-{
-public:
-
- A(const A&) {++copy_ctor;}
- A& operator=(const A&);
-
- A(A&&) {++move_ctor;}
- A& operator=(A&&);
-
- A() {}
-};
-
-A source() {return A();}
-const A csource() {return A();}
-
-void test(A) {}
-
-int main()
-{
- A a;
- const A ca = A();
-
- assert(copy_ctor == 0);
- assert(move_ctor == 0);
-
- A a2 = a;
- assert(copy_ctor == 1);
- assert(move_ctor == 0);
-
- A a3 = std::move(a);
- assert(copy_ctor == 1);
- assert(move_ctor == 1);
-
- A a4 = ca;
- assert(copy_ctor == 2);
- assert(move_ctor == 1);
-
- A a5 = std::move(ca);
- assert(copy_ctor == 3);
- assert(move_ctor == 1);
-}
diff --git a/test/std/utilities/utility/forward/move_only1.fail.cpp b/test/std/utilities/utility/forward/move_only1.fail.cpp
deleted file mode 100644
index 5e7623a1bd19..000000000000
--- a/test/std/utilities/utility/forward/move_only1.fail.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// test move
-
-#include <utility>
-#include <cassert>
-
-#include <typeinfo>
-#include <stdio.h>
-
-class move_only
-{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(const move_only&);
- move_only& operator=(const move_only&);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(move_only&);
- move_only& operator=(move_only&);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-public:
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(move_only&&) {}
- move_only& operator=(move_only&&) {}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- operator std::__rv<move_only> () {return std::__rv<move_only>(*this);}
- move_only(std::__rv<move_only>) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- move_only() {}
-};
-
-move_only source() {return move_only();}
-const move_only csource() {return move_only();}
-
-void test(move_only) {}
-
-int main()
-{
- move_only a;
- const move_only ca = move_only();
-
- test(a);
-}
diff --git a/test/std/utilities/utility/forward/move_only2.fail.cpp b/test/std/utilities/utility/forward/move_only2.fail.cpp
deleted file mode 100644
index 2043f3d4bde7..000000000000
--- a/test/std/utilities/utility/forward/move_only2.fail.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// test move
-
-#include <utility>
-#include <cassert>
-
-#include <typeinfo>
-#include <stdio.h>
-
-class move_only
-{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(const move_only&);
- move_only& operator=(const move_only&);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(move_only&);
- move_only& operator=(move_only&);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-public:
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(move_only&&) {}
- move_only& operator=(move_only&&) {}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- operator std::__rv<move_only> () {return std::__rv<move_only>(*this);}
- move_only(std::__rv<move_only>) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- move_only() {}
-};
-
-move_only source() {return move_only();}
-const move_only csource() {return move_only();}
-
-void test(move_only) {}
-
-int main()
-{
- move_only a;
- const move_only ca = move_only();
-
- test(ca);
-}
diff --git a/test/std/utilities/utility/forward/move_only3.fail.cpp b/test/std/utilities/utility/forward/move_only3.fail.cpp
deleted file mode 100644
index 84c83ae48f8a..000000000000
--- a/test/std/utilities/utility/forward/move_only3.fail.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// test move
-
-#include <utility>
-#include <cassert>
-
-class move_only
-{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(const move_only&);
- move_only& operator=(const move_only&);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(move_only&);
- move_only& operator=(move_only&);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-public:
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(move_only&&) {}
- move_only& operator=(move_only&&) {}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- operator std::__rv<move_only> () {return std::__rv<move_only>(*this);}
- move_only(std::__rv<move_only>) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- move_only() {}
-};
-
-move_only source() {return move_only();}
-const move_only csource() {return move_only();}
-
-void test(move_only) {}
-
-int main()
-{
- move_only a;
- const move_only ca = move_only();
-
- test(std::move(ca));
-}
diff --git a/test/std/utilities/utility/forward/move_only4.fail.cpp b/test/std/utilities/utility/forward/move_only4.fail.cpp
deleted file mode 100644
index 5eeca89abe36..000000000000
--- a/test/std/utilities/utility/forward/move_only4.fail.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// test move
-
-#include <utility>
-#include <cassert>
-
-#include <typeinfo>
-#include <stdio.h>
-
-class move_only
-{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(const move_only&);
- move_only& operator=(const move_only&);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(move_only&);
- move_only& operator=(move_only&);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-public:
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(move_only&&) {}
- move_only& operator=(move_only&&) {}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- operator std::__rv<move_only> () {return std::__rv<move_only>(*this);}
- move_only(std::__rv<move_only>) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- move_only() {}
-};
-
-move_only source() {return move_only();}
-const move_only csource() {return move_only();}
-
-void test(move_only) {}
-
-int main()
-{
- move_only a;
- const move_only ca = move_only();
-
- test(csource());
-}
diff --git a/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp b/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp
index 9ef7bcff2ba8..c09c8815e16f 100644
--- a/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp
+++ b/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp
@@ -24,7 +24,7 @@ int main()
{
{
typedef std::pair<int, short> P;
- const P p(3, 4);
+ const P p(3, static_cast<short>(4));
assert(std::get<0>(p) == 3);
assert(std::get<1>(p) == 4);
}
@@ -32,7 +32,7 @@ int main()
#if TEST_STD_VER > 11
{
typedef std::pair<int, short> P;
- constexpr P p1(3, 4);
+ constexpr P p1(3, static_cast<short>(4));
static_assert(std::get<0>(p1) == 3, "");
static_assert(std::get<1>(p1) == 4, "");
}
diff --git a/test/std/utilities/utility/pairs/pair.astuple/get_const_rv.pass.cpp b/test/std/utilities/utility/pairs/pair.astuple/get_const_rv.pass.cpp
index edd2f3d0752f..5c38318d26da 100644
--- a/test/std/utilities/utility/pairs/pair.astuple/get_const_rv.pass.cpp
+++ b/test/std/utilities/utility/pairs/pair.astuple/get_const_rv.pass.cpp
@@ -28,7 +28,7 @@ int main()
{
{
typedef std::pair<std::unique_ptr<int>, short> P;
- const P p(std::unique_ptr<int>(new int(3)), 4);
+ const P p(std::unique_ptr<int>(new int(3)), static_cast<short>(4));
static_assert(std::is_same<const std::unique_ptr<int>&&, decltype(std::get<0>(std::move(p)))>::value, "");
static_assert(noexcept(std::get<0>(std::move(p))), "");
const std::unique_ptr<int>&& ptr = std::get<0>(std::move(p));
@@ -58,7 +58,7 @@ int main()
#if TEST_STD_VER > 11
{
typedef std::pair<int, short> P;
- constexpr const P p1(3, 4);
+ constexpr const P p1(3, static_cast<short>(4));
static_assert(std::get<0>(std::move(p1)) == 3, "");
static_assert(std::get<1>(std::move(p1)) == 4, "");
}
diff --git a/test/std/utilities/utility/pairs/pair.astuple/get_non_const.pass.cpp b/test/std/utilities/utility/pairs/pair.astuple/get_non_const.pass.cpp
index 47b4c06134d9..2f8b6c1e8497 100644
--- a/test/std/utilities/utility/pairs/pair.astuple/get_non_const.pass.cpp
+++ b/test/std/utilities/utility/pairs/pair.astuple/get_non_const.pass.cpp
@@ -34,7 +34,7 @@ int main()
{
{
typedef std::pair<int, short> P;
- P p(3, 4);
+ P p(3, static_cast<short>(4));
assert(std::get<0>(p) == 3);
assert(std::get<1>(p) == 4);
std::get<0>(p) = 5;
diff --git a/test/std/utilities/utility/pairs/pair.astuple/get_rv.pass.cpp b/test/std/utilities/utility/pairs/pair.astuple/get_rv.pass.cpp
index aa5ca530913c..0601e4e73a74 100644
--- a/test/std/utilities/utility/pairs/pair.astuple/get_rv.pass.cpp
+++ b/test/std/utilities/utility/pairs/pair.astuple/get_rv.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <utility>
// template <class T1, class T2> struct pair
@@ -21,12 +23,10 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::pair<std::unique_ptr<int>, short> P;
- P p(std::unique_ptr<int>(new int(3)), 4);
+ P p(std::unique_ptr<int>(new int(3)), static_cast<short>(4));
std::unique_ptr<int> ptr = std::get<0>(std::move(p));
assert(*ptr == 3);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/U_V.pass.cpp
index 8c7dee2499dd..1ef2d9402fc3 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/U_V.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/U_V.pass.cpp
@@ -7,24 +7,94 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <utility>
// template <class T1, class T2> struct pair
// template<class U, class V> pair(U&& x, V&& y);
+
#include <utility>
#include <memory>
#include <cassert>
+#include "archetypes.hpp"
+#include "test_convertible.hpp"
+using namespace ImplicitTypes; // Get implicitly archetypes
+
+template <class T1, class T1Arg,
+ bool CanCopy = true, bool CanConvert = CanCopy>
+void test_sfinae() {
+ using P1 = std::pair<T1, int>;
+ using P2 = std::pair<int, T1>;
+ using T2 = int const&;
+ static_assert(std::is_constructible<P1, T1Arg, T2>::value == CanCopy, "");
+ static_assert(test_convertible<P1, T1Arg, T2>() == CanConvert, "");
+ static_assert(std::is_constructible<P2, T2, T1Arg>::value == CanCopy, "");
+ static_assert(test_convertible<P2, T2, T1Arg>() == CanConvert, "");
+}
+
+struct ExplicitT {
+ constexpr explicit ExplicitT(int x) : value(x) {}
+ int value;
+};
+
+struct ImplicitT {
+ constexpr ImplicitT(int x) : value(x) {}
+ int value;
+};
+
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::pair<std::unique_ptr<int>, short*> P;
P p(std::unique_ptr<int>(new int(3)), nullptr);
assert(*p.first == 3);
assert(p.second == nullptr);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ {
+ // Test non-const lvalue and rvalue types
+ test_sfinae<AllCtors, AllCtors&>();
+ test_sfinae<AllCtors, AllCtors&&>();
+ test_sfinae<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&, true, false>();
+ test_sfinae<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&&, true, false>();
+ test_sfinae<CopyOnly, CopyOnly&>();
+ test_sfinae<CopyOnly, CopyOnly&&>();
+ test_sfinae<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&, true, false>();
+ test_sfinae<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&&, true, false>();
+ test_sfinae<MoveOnly, MoveOnly&, false>();
+ test_sfinae<MoveOnly, MoveOnly&&>();
+ test_sfinae<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&, false>();
+ test_sfinae<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&&, true, false>();
+ test_sfinae<NonCopyable, NonCopyable&, false>();
+ test_sfinae<NonCopyable, NonCopyable&&, false>();
+ test_sfinae<ExplicitTypes::NonCopyable, ExplicitTypes::NonCopyable&, false>();
+ test_sfinae<ExplicitTypes::NonCopyable, ExplicitTypes::NonCopyable&&, false>();
+ }
+ {
+ // Test converting types
+ test_sfinae<ConvertingType, int&>();
+ test_sfinae<ConvertingType, const int&>();
+ test_sfinae<ConvertingType, int&&>();
+ test_sfinae<ConvertingType, const int&&>();
+ test_sfinae<ExplicitTypes::ConvertingType, int&, true, false>();
+ test_sfinae<ExplicitTypes::ConvertingType, const int&, true, false>();
+ test_sfinae<ExplicitTypes::ConvertingType, int&&, true, false>();
+ test_sfinae<ExplicitTypes::ConvertingType, const int&&, true, false>();
+ }
+#if TEST_STD_VER > 11
+ { // explicit constexpr test
+ constexpr std::pair<ExplicitT, ExplicitT> p(42, 43);
+ static_assert(p.first.value == 42, "");
+ static_assert(p.second.value == 43, "");
+ }
+ { // implicit constexpr test
+ constexpr std::pair<ImplicitT, ImplicitT> p = {42, 43};
+ static_assert(p.first.value == 42, "");
+ static_assert(p.second.value == 43, "");
+ }
+#endif
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp
index fdef5961437a..132443f66a7c 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp
@@ -21,7 +21,7 @@ int main()
{
typedef std::pair<int, short> P1;
typedef std::pair<double, long> P2;
- P1 p1(3, 4);
+ P1 p1(3, static_cast<short>(4));
P2 p2;
p2 = p1;
assert(p2.first == 3);
diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp
new file mode 100644
index 000000000000..3f7066310002
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp
@@ -0,0 +1,101 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <utility>
+
+// template <class T1, class T2> struct pair
+
+// pair& operator=(pair const& p);
+
+#include <utility>
+#include <memory>
+#include <cassert>
+
+
+struct NonAssignable {
+ NonAssignable& operator=(NonAssignable const&) = delete;
+ NonAssignable& operator=(NonAssignable&&) = delete;
+};
+struct CopyAssignable {
+ CopyAssignable() = default;
+ CopyAssignable(CopyAssignable const&) = default;
+ CopyAssignable& operator=(CopyAssignable const&) = default;
+ CopyAssignable& operator=(CopyAssignable&&) = delete;
+};
+struct MoveAssignable {
+ MoveAssignable() = default;
+ MoveAssignable& operator=(MoveAssignable const&) = delete;
+ MoveAssignable& operator=(MoveAssignable&&) = default;
+};
+
+struct CountAssign {
+ static int copied;
+ static int moved;
+ static void reset() { copied = moved = 0; }
+ CountAssign() = default;
+ CountAssign& operator=(CountAssign const&) { ++copied; return *this; }
+ CountAssign& operator=(CountAssign&&) { ++moved; return *this; }
+};
+int CountAssign::copied = 0;
+int CountAssign::moved = 0;
+
+struct Incomplete;
+extern Incomplete inc_obj;
+
+int main()
+{
+ {
+ typedef std::pair<CopyAssignable, short> P;
+ const P p1(CopyAssignable(), 4);
+ P p2;
+ p2 = p1;
+ assert(p2.second == 4);
+ }
+ {
+ using P = std::pair<int&, int&&>;
+ int x = 42;
+ int y = 101;
+ int x2 = -1;
+ int y2 = 300;
+ P p1(x, std::move(y));
+ P p2(x2, std::move(y2));
+ p1 = p2;
+ assert(p1.first == x2);
+ assert(p1.second == y2);
+ }
+ {
+ using P = std::pair<int, NonAssignable>;
+ static_assert(!std::is_copy_assignable<P>::value, "");
+ }
+ {
+ CountAssign::reset();
+ using P = std::pair<CountAssign, CopyAssignable>;
+ static_assert(std::is_copy_assignable<P>::value, "");
+ P p;
+ P p2;
+ p = p2;
+ assert(CountAssign::copied == 1);
+ assert(CountAssign::moved == 0);
+ }
+ {
+ using P = std::pair<int, MoveAssignable>;
+ static_assert(!std::is_copy_assignable<P>::value, "");
+ }
+ {
+ using P = std::pair<int, Incomplete&>;
+ static_assert(!std::is_copy_assignable<P>::value, "");
+ P p(42, inc_obj);
+ assert(&p.second == &inc_obj);
+ }
+}
+
+struct Incomplete {};
+Incomplete inc_obj;
diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_pair_cxx03.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_pair_cxx03.pass.cpp
new file mode 100644
index 000000000000..2623b800fff7
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pairs.pair/assign_pair_cxx03.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES-ANY: c++98, c++03
+
+// <utility>
+
+// template <class T1, class T2> struct pair
+
+// pair& operator=(pair const& p);
+
+#include <utility>
+#include <memory>
+#include <cassert>
+
+struct NonAssignable {
+ NonAssignable() {}
+private:
+ NonAssignable& operator=(NonAssignable const&);
+};
+
+struct Incomplete;
+extern Incomplete inc_obj;
+
+int main()
+{
+ {
+ // Test that we don't constrain the assignment operator in C++03 mode.
+ // Since we don't have access control SFINAE having pair evaluate SFINAE
+ // may cause a hard error.
+ typedef std::pair<int, NonAssignable> P;
+ static_assert(std::is_copy_assignable<P>::value, "");
+ }
+ {
+ typedef std::pair<int, Incomplete&> P;
+ static_assert(std::is_copy_assignable<P>::value, "");
+ P p(42, inc_obj);
+ assert(&p.second == &inc_obj);
+ }
+}
+
+struct Incomplete {};
+Incomplete inc_obj;
diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
index a753ee520dfa..38089200e4da 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <utility>
// template <class T1, class T2> struct pair
@@ -17,9 +19,35 @@
#include <memory>
#include <cassert>
+
+struct NonAssignable {
+ NonAssignable& operator=(NonAssignable const&) = delete;
+ NonAssignable& operator=(NonAssignable&&) = delete;
+};
+struct CopyAssignable {
+ CopyAssignable() = default;
+ CopyAssignable& operator=(CopyAssignable const&) = default;
+ CopyAssignable& operator=(CopyAssignable&&) = delete;
+};
+struct MoveAssignable {
+ MoveAssignable() = default;
+ MoveAssignable& operator=(MoveAssignable const&) = delete;
+ MoveAssignable& operator=(MoveAssignable&&) = default;
+};
+
+struct CountAssign {
+ static int copied;
+ static int moved;
+ static void reset() { copied = moved = 0; }
+ CountAssign() = default;
+ CountAssign& operator=(CountAssign const&) { ++copied; return *this; }
+ CountAssign& operator=(CountAssign&&) { ++moved; return *this; }
+};
+int CountAssign::copied = 0;
+int CountAssign::moved = 0;
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::pair<std::unique_ptr<int>, short> P;
P p1(std::unique_ptr<int>(new int(3)), 4);
@@ -28,5 +56,41 @@ int main()
assert(*p2.first == 3);
assert(p2.second == 4);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ {
+ using P = std::pair<int&, int&&>;
+ int x = 42;
+ int y = 101;
+ int x2 = -1;
+ int y2 = 300;
+ P p1(x, std::move(y));
+ P p2(x2, std::move(y2));
+ p1 = std::move(p2);
+ assert(p1.first == x2);
+ assert(p1.second == y2);
+ }
+ {
+ using P = std::pair<int, NonAssignable>;
+ static_assert(!std::is_move_assignable<P>::value, "");
+ }
+ {
+ // The move decays to the copy constructor
+ CountAssign::reset();
+ using P = std::pair<CountAssign, CopyAssignable>;
+ static_assert(std::is_move_assignable<P>::value, "");
+ P p;
+ P p2;
+ p = std::move(p2);
+ assert(CountAssign::moved == 0);
+ assert(CountAssign::copied == 1);
+ }
+ {
+ CountAssign::reset();
+ using P = std::pair<CountAssign, MoveAssignable>;
+ static_assert(std::is_move_assignable<P>::value, "");
+ P p;
+ P p2;
+ p = std::move(p2);
+ assert(CountAssign::moved == 1);
+ assert(CountAssign::copied == 0);
+ }
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp
index a200390f4882..76dfc3f65a23 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <utility>
// template <class T1, class T2> struct pair
@@ -29,15 +31,13 @@ struct Derived
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::pair<std::unique_ptr<Derived>, short> P1;
typedef std::pair<std::unique_ptr<Base>, long> P2;
- P1 p1(std::unique_ptr<Derived>(), 4);
+ P1 p1(std::unique_ptr<Derived>(), static_cast<short>(4));
P2 p2;
p2 = std::move(p1);
assert(p2.first == nullptr);
assert(p2.second == 4);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_tuple.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_tuple.pass.cpp
new file mode 100644
index 000000000000..ef7bebcf5c29
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pairs.pair/assign_tuple.pass.cpp
@@ -0,0 +1,140 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <utility>
+
+// template <class T1, class T2> struct pair
+
+// template<class U, class V> pair& operator=(tuple<U, V>&& p);
+
+#include <utility>
+#include <tuple>
+#include <array>
+#include <memory>
+#include <cassert>
+
+// Clang warns about missing braces when initializing std::array.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wmissing-braces"
+#endif
+
+struct CountingType {
+ static int constructed;
+ static int copy_constructed;
+ static int move_constructed;
+ static int assigned;
+ static int copy_assigned;
+ static int move_assigned;
+ static void reset() {
+ constructed = copy_constructed = move_constructed = 0;
+ assigned = copy_assigned = move_assigned = 0;
+ }
+ CountingType() : value(0) { ++constructed; }
+ CountingType(int v) : value(v) { ++constructed; }
+ CountingType(CountingType const& o) : value(o.value) { ++constructed; ++copy_constructed; }
+ CountingType(CountingType&& o) : value(o.value) { ++constructed; ++move_constructed; o.value = -1;}
+
+ CountingType& operator=(CountingType const& o) {
+ ++assigned;
+ ++copy_assigned;
+ value = o.value;
+ return *this;
+ }
+ CountingType& operator=(CountingType&& o) {
+ ++assigned;
+ ++move_assigned;
+ value = o.value;
+ o.value = -1;
+ return *this;
+ }
+ int value;
+};
+int CountingType::constructed;
+int CountingType::copy_constructed;
+int CountingType::move_constructed;
+int CountingType::assigned;
+int CountingType::copy_assigned;
+int CountingType::move_assigned;
+
+int main()
+{
+ using C = CountingType;
+ {
+ using P = std::pair<int, C>;
+ using T = std::tuple<int, C>;
+ T t(42, C{42});
+ P p(101, C{101});
+ C::reset();
+ p = t;
+ assert(C::constructed == 0);
+ assert(C::assigned == 1);
+ assert(C::copy_assigned == 1);
+ assert(C::move_assigned == 0);
+ assert(p.first == 42);
+ assert(p.second.value == 42);
+ }
+ {
+ using P = std::pair<int, C>;
+ using T = std::tuple<int, C>;
+ T t(42, -42);
+ P p(101, 101);
+ C::reset();
+ p = std::move(t);
+ assert(C::constructed == 0);
+ assert(C::assigned == 1);
+ assert(C::copy_assigned == 0);
+ assert(C::move_assigned == 1);
+ assert(p.first == 42);
+ assert(p.second.value == -42);
+ }
+ {
+ using P = std::pair<C, C>;
+ using T = std::array<C, 2>;
+ T t = {42, -42};
+ P p{101, 101};
+ C::reset();
+ p = t;
+ assert(C::constructed == 0);
+ assert(C::assigned == 2);
+ assert(C::copy_assigned == 2);
+ assert(C::move_assigned == 0);
+ assert(p.first.value == 42);
+ assert(p.second.value == -42);
+ }
+ {
+ using P = std::pair<C, C>;
+ using T = std::array<C, 2>;
+ T t = {42, -42};
+ P p{101, 101};
+ C::reset();
+ p = t;
+ assert(C::constructed == 0);
+ assert(C::assigned == 2);
+ assert(C::copy_assigned == 2);
+ assert(C::move_assigned == 0);
+ assert(p.first.value == 42);
+ assert(p.second.value == -42);
+ }
+ {
+ using P = std::pair<C, C>;
+ using T = std::array<C, 2>;
+ T t = {42, -42};
+ P p{101, 101};
+ C::reset();
+ p = std::move(t);
+ assert(C::constructed == 0);
+ assert(C::assigned == 2);
+ assert(C::copy_assigned == 0);
+ assert(C::move_assigned == 2);
+ assert(p.first.value == 42);
+ assert(p.second.value == -42);
+ }
+}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp
index 2041b39c2dc9..bf19d1abe4c5 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <utility>
// template <class T1, class T2> struct pair
@@ -16,25 +18,34 @@
#include <utility>
#include <cassert>
-class A
-{
- int data_;
-public:
- A(int data) : data_(data) {}
+#include "archetypes.hpp"
+#include "test_convertible.hpp"
+using namespace ImplicitTypes; // Get implicitly archetypes
- bool operator==(const A& a) const {return data_ == a.data_;}
+struct ExplicitT {
+ constexpr explicit ExplicitT(int x) : value(x) {}
+ constexpr explicit ExplicitT(ExplicitT const& o) : value(o.value) {}
+ int value;
};
-#if _LIBCPP_STD_VER > 11
-class AC
-{
- int data_;
-public:
- constexpr AC(int data) : data_(data) {}
-
- constexpr bool operator==(const AC& a) const {return data_ == a.data_;}
+struct ImplicitT {
+ constexpr ImplicitT(int x) : value(x) {}
+ constexpr ImplicitT(ImplicitT const& o) : value(o.value) {}
+ int value;
};
-#endif
+
+template <class T1,
+ bool CanCopy = true, bool CanConvert = CanCopy>
+void test_sfinae() {
+ using P1 = std::pair<T1, int>;
+ using P2 = std::pair<int, T1>;
+ using T1Arg = T1 const&;
+ using T2 = int const&;
+ static_assert(std::is_constructible<P1, T1Arg, T2>::value == CanCopy, "");
+ static_assert(test_convertible<P1, T1Arg, T2>() == CanConvert, "");
+ static_assert(std::is_constructible<P2, T2, T1Arg>::value == CanCopy, "");
+ static_assert(test_convertible<P2, T2, T1Arg>() == CanConvert, "");
+}
int main()
{
@@ -45,13 +56,22 @@ int main()
assert(p.second == nullptr);
}
{
- typedef std::pair<A, int> P;
+ typedef std::pair<ImplicitT, int> P;
P p(1, 2);
- assert(p.first == A(1));
+ assert(p.first.value == 1);
assert(p.second == 2);
}
-
-#if _LIBCPP_STD_VER > 11
+ {
+ test_sfinae<AllCtors>();
+ test_sfinae<ExplicitTypes::AllCtors, true, false>();
+ test_sfinae<CopyOnly>();
+ test_sfinae<ExplicitTypes::CopyOnly, true, false>();
+ test_sfinae<MoveOnly, false>();
+ test_sfinae<ExplicitTypes::MoveOnly, false>();
+ test_sfinae<NonCopyable, false>();
+ test_sfinae<ExplicitTypes::NonCopyable, false>();
+ }
+#if TEST_STD_VER > 11
{
typedef std::pair<float, short*> P;
constexpr P p(3.5f, 0);
@@ -59,10 +79,20 @@ int main()
static_assert(p.second == nullptr, "");
}
{
- typedef std::pair<AC, int> P;
- constexpr P p(1, 2);
- static_assert(p.first == AC(1), "");
- static_assert(p.second == 2, "");
+ using P = std::pair<ExplicitT, int>;
+ constexpr ExplicitT e(42);
+ constexpr int x = 10;
+ constexpr P p(e, x);
+ static_assert(p.first.value == 42, "");
+ static_assert(p.second == 10, "");
+ }
+ {
+ using P = std::pair<ImplicitT, int>;
+ constexpr ImplicitT e(42);
+ constexpr int x = 10;
+ constexpr P p = {e, x};
+ static_assert(p.first.value == 42, "");
+ static_assert(p.second == 10, "");
}
#endif
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second_cxx03.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second_cxx03.pass.cpp
new file mode 100644
index 000000000000..8c56c2003460
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pairs.pair/const_first_const_second_cxx03.pass.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <utility>
+
+// template <class T1, class T2> struct pair
+
+// pair(const T1& x, const T2& y);
+
+#include <utility>
+#include <cassert>
+
+class A
+{
+ int data_;
+public:
+ A(int data) : data_(data) {}
+
+ bool operator==(const A& a) const {return data_ == a.data_;}
+};
+
+int main()
+{
+ {
+ typedef std::pair<float, short*> P;
+ P p(3.5f, 0);
+ assert(p.first == 3.5f);
+ assert(p.second == nullptr);
+ }
+ {
+ typedef std::pair<A, int> P;
+ P p(1, 2);
+ assert(p.first == A(1));
+ assert(p.second == 2);
+ }
+}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
index 286cce47f050..ade8130d7822 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
@@ -7,27 +7,152 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <utility>
// template <class T1, class T2> struct pair
-// template <class U, class V> pair(const pair<U, V>& p);
+// template <class U, class V> EXPLICIT constexpr pair(const pair<U, V>& p);
#include <utility>
#include <cassert>
+#include "archetypes.hpp"
+#include "test_convertible.hpp"
+using namespace ImplicitTypes; // Get implicitly archetypes
+
+template <class T1, class U1,
+ bool CanCopy = true, bool CanConvert = CanCopy>
+void test_pair_const()
+{
+ using P1 = std::pair<T1, int>;
+ using P2 = std::pair<int, T1>;
+ using UP1 = std::pair<U1, int> const&;
+ using UP2 = std::pair<int, U1> const&;
+ static_assert(std::is_constructible<P1, UP1>::value == CanCopy, "");
+ static_assert(test_convertible<P1, UP1>() == CanConvert, "");
+ static_assert(std::is_constructible<P2, UP2>::value == CanCopy, "");
+ static_assert(test_convertible<P2, UP2>() == CanConvert, "");
+}
+
+template <class T, class U>
+struct DPair : public std::pair<T, U> {
+ using Base = std::pair<T, U>;
+ using Base::Base;
+};
+
+struct ExplicitT {
+ constexpr explicit ExplicitT(int x) : value(x) {}
+ constexpr explicit ExplicitT(ExplicitT const& o) : value(o.value) {}
+ int value;
+};
+
+struct ImplicitT {
+ constexpr ImplicitT(int x) : value(x) {}
+ constexpr ImplicitT(ImplicitT const& o) : value(o.value) {}
+ int value;
+};
+
int main()
{
{
typedef std::pair<int, short> P1;
typedef std::pair<double, long> P2;
- P1 p1(3, 4);
- P2 p2 = p1;
+ const P1 p1(3, 4);
+ const P2 p2 = p1;
assert(p2.first == 3);
assert(p2.second == 4);
}
+ {
+ // We allow derived types to use this constructor
+ using P1 = DPair<long, long>;
+ using P2 = std::pair<int, int>;
+ P1 p1(42, 101);
+ P2 p2(p1);
+ assert(p2.first == 42);
+ assert(p2.second = 101);
+ }
+ {
+ test_pair_const<AllCtors, AllCtors>(); // copy construction
+ test_pair_const<AllCtors, AllCtors&>();
+ test_pair_const<AllCtors, AllCtors&&>();
+ test_pair_const<AllCtors, const AllCtors&>();
+ test_pair_const<AllCtors, const AllCtors&&>();
+
+ test_pair_const<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors>(); // copy construction
+ test_pair_const<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&, true, false>();
+ test_pair_const<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&&, true, false>();
+ test_pair_const<ExplicitTypes::AllCtors, const ExplicitTypes::AllCtors&, true, false>();
+ test_pair_const<ExplicitTypes::AllCtors, const ExplicitTypes::AllCtors&&, true, false>();
+
+ test_pair_const<MoveOnly, MoveOnly, false>(); // copy construction
+ test_pair_const<MoveOnly, MoveOnly&, false>();
+ test_pair_const<MoveOnly, MoveOnly&&, false>();
+
+ test_pair_const<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly, false>(); // copy construction
+ test_pair_const<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&, false>();
+ test_pair_const<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&&, false>();
+
+ test_pair_const<CopyOnly, CopyOnly>();
+ test_pair_const<CopyOnly, CopyOnly&>();
+ test_pair_const<CopyOnly, CopyOnly&&>();
+
+ test_pair_const<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly>();
+ test_pair_const<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&, true, false>();
+ test_pair_const<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&&, true, false>();
-#if _LIBCPP_STD_VER > 11
+ test_pair_const<NonCopyable, NonCopyable, false>();
+ test_pair_const<NonCopyable, NonCopyable&, false>();
+ test_pair_const<NonCopyable, NonCopyable&&, false>();
+ test_pair_const<NonCopyable, const NonCopyable&, false>();
+ test_pair_const<NonCopyable, const NonCopyable&&, false>();
+ }
+
+ { // Test construction of references
+ test_pair_const<NonCopyable&, NonCopyable&>();
+ test_pair_const<NonCopyable&, NonCopyable&&>();
+ test_pair_const<NonCopyable&, NonCopyable const&, false>();
+ test_pair_const<NonCopyable const&, NonCopyable&&>();
+ test_pair_const<NonCopyable&&, NonCopyable&&, false>();
+
+ test_pair_const<ConvertingType&, int, false>();
+ test_pair_const<ExplicitTypes::ConvertingType&, int, false>();
+ // Unfortunately the below conversions are allowed and create dangling
+ // references.
+ //test_pair_const<ConvertingType&&, int>();
+ //test_pair_const<ConvertingType const&, int>();
+ //test_pair_const<ConvertingType const&&, int>();
+ // But these are not because the converting constructor is explicit.
+ test_pair_const<ExplicitTypes::ConvertingType&&, int, false>();
+ test_pair_const<ExplicitTypes::ConvertingType const&, int, false>();
+ test_pair_const<ExplicitTypes::ConvertingType const&&, int, false>();
+
+ }
+ {
+ test_pair_const<AllCtors, int, false>();
+ test_pair_const<ExplicitTypes::AllCtors, int, false>();
+ test_pair_const<ConvertingType, int>();
+ test_pair_const<ExplicitTypes::ConvertingType, int, true, false>();
+
+ test_pair_const<ConvertingType, int>();
+ test_pair_const<ConvertingType, ConvertingType>();
+ test_pair_const<ConvertingType, ConvertingType const&>();
+ test_pair_const<ConvertingType, ConvertingType&>();
+ test_pair_const<ConvertingType, ConvertingType&&>();
+
+ test_pair_const<ExplicitTypes::ConvertingType, int, true, false>();
+ test_pair_const<ExplicitTypes::ConvertingType, int&, true, false>();
+ test_pair_const<ExplicitTypes::ConvertingType, const int&, true, false>();
+ test_pair_const<ExplicitTypes::ConvertingType, int&&, true, false>();
+ test_pair_const<ExplicitTypes::ConvertingType, const int&&, true, false>();
+
+ test_pair_const<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType>();
+ test_pair_const<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType const&, true, false>();
+ test_pair_const<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType&, true, false>();
+ test_pair_const<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType&&, true, false>();
+ }
+#if TEST_STD_VER > 11
{
typedef std::pair<int, short> P1;
typedef std::pair<double, long> P2;
@@ -36,5 +161,21 @@ int main()
static_assert(p2.first == 3, "");
static_assert(p2.second == 4, "");
}
+ {
+ using P1 = std::pair<int, int>;
+ using P2 = std::pair<ExplicitT, ExplicitT>;
+ constexpr P1 p1(42, 101);
+ constexpr P2 p2(p1);
+ static_assert(p2.first.value == 42, "");
+ static_assert(p2.second.value == 101, "");
+ }
+ {
+ using P1 = std::pair<int, int>;
+ using P2 = std::pair<ImplicitT, ImplicitT>;
+ constexpr P1 p1(42, 101);
+ constexpr P2 p2 = p1;
+ static_assert(p2.first.value == 42, "");
+ static_assert(p2.second.value == 101, "");
+ }
#endif
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V_cxx03.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V_cxx03.pass.cpp
new file mode 100644
index 000000000000..fbf461f9b7e0
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V_cxx03.pass.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <utility>
+
+// template <class T1, class T2> struct pair
+
+// template <class U, class V> pair(const pair<U, V>& p);
+
+#include <utility>
+#include <cassert>
+
+int main()
+{
+ {
+ typedef std::pair<int, short> P1;
+ typedef std::pair<double, long> P2;
+ const P1 p1(3, static_cast<short>(4));
+ const P2 p2 = p1;
+ assert(p2.first == 3);
+ assert(p2.second == 4);
+ }
+}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp
index 1117db3297b8..1003f3c8b68f 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/copy_ctor.pass.cpp
@@ -22,7 +22,7 @@ int main()
{
{
typedef std::pair<int, short> P1;
- P1 p1(3, 4);
+ P1 p1(3, static_cast<short>(4));
P1 p2 = p1;
assert(p2.first == 3);
assert(p2.second == 4);
@@ -30,7 +30,7 @@ int main()
#if TEST_STD_VER > 11
{
typedef std::pair<int, short> P1;
- constexpr P1 p1(3, 4);
+ constexpr P1 p1(3, static_cast<short>(4));
constexpr P1 p2 = p1;
static_assert(p2.first == 3, "");
static_assert(p2.second == 4, "");
diff --git a/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
index 97182d24d021..ace00a16f21e 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
@@ -27,14 +27,15 @@
#include <cassert>
#include "test_macros.h"
+#include "archetypes.hpp"
int main()
{
{
- typedef std::pair<float, short*> P;
- P p;
- assert(p.first == 0.0f);
- assert(p.second == nullptr);
+ typedef std::pair<float, short*> P;
+ P p;
+ assert(p.first == 0.0f);
+ assert(p.second == nullptr);
}
#if TEST_STD_VER >= 11
{
@@ -43,5 +44,12 @@ int main()
static_assert(p.first == 0.0f, "");
static_assert(p.second == nullptr, "");
}
+ {
+ using NoDefault = ImplicitTypes::NoDefault;
+ using P = std::pair<int, NoDefault>;
+ static_assert(!std::is_default_constructible<P>::value, "");
+ using P2 = std::pair<NoDefault, int>;
+ static_assert(!std::is_default_constructible<P>::value, "");
+ }
#endif
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp
new file mode 100644
index 000000000000..2d87e7ababab
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <utility>
+
+// template <class T1, class T2> struct pair
+
+// ~pair()
+
+
+#include <utility>
+#include <type_traits>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main()
+{
+ static_assert((std::is_trivially_destructible<
+ std::pair<int, float> >::value), "");
+ static_assert((!std::is_trivially_destructible<
+ std::pair<int, std::string> >::value), "");
+}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp
index 06cb5e5658c9..99e00b025da2 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp
@@ -31,7 +31,7 @@ int main()
{
typedef std::pair<int, short> P1;
static_assert(std::is_move_constructible<P1>::value, "");
- P1 p1(3, 4);
+ P1 p1(3, static_cast<short>(4));
P1 p2 = std::move(p1);
assert(p2.first == 3);
assert(p2.second == 4);
diff --git a/test/std/utilities/utility/pairs/pairs.pair/not_constexpr_cxx11.fail.cpp b/test/std/utilities/utility/pairs/pairs.pair/not_constexpr_cxx11.fail.cpp
new file mode 100644
index 000000000000..3704dcc32edc
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pairs.pair/not_constexpr_cxx11.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: c++11
+
+// <utility>
+
+// Test that only the default constructor is constexpr in C++11
+
+#include <utility>
+#include <cassert>
+
+struct ExplicitT {
+ constexpr explicit ExplicitT(int x) : value(x) {}
+ constexpr explicit ExplicitT(ExplicitT const& o) : value(o.value) {}
+ int value;
+};
+
+struct ImplicitT {
+ constexpr ImplicitT(int x) : value(x) {}
+ constexpr ImplicitT(ImplicitT const& o) : value(o.value) {}
+ int value;
+};
+
+int main()
+{
+ {
+ using P = std::pair<int, int>;
+ constexpr int x = 42;
+ constexpr P default_p{};
+ constexpr P copy_p(default_p);
+ constexpr P const_U_V(x, x); // expected-error {{must be initialized by a constant expression}}
+ constexpr P U_V(42, 101); // expected-error {{must be initialized by a constant expression}}
+ }
+ {
+ using P = std::pair<ExplicitT, ExplicitT>;
+ constexpr std::pair<int, int> other;
+ constexpr ExplicitT e(99);
+ constexpr P const_U_V(e, e); // expected-error {{must be initialized by a constant expression}}
+ constexpr P U_V(42, 101); // expected-error {{must be initialized by a constant expression}}
+ constexpr P pair_U_V(other); // expected-error {{must be initialized by a constant expression}}
+ }
+ {
+ using P = std::pair<ImplicitT, ImplicitT>;
+ constexpr std::pair<int, int> other;
+ constexpr ImplicitT i = 99;
+ constexpr P const_U_V = {i, i}; // expected-error {{must be initialized by a constant expression}}
+ constexpr P U_V = {42, 101}; // expected-error {{must be initialized by a constant expression}}
+ constexpr P pair_U_V = other; // expected-error {{must be initialized by a constant expression}}
+ }
+}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
index 5fb6c98979b5..2856190841c0 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <utility>
// template <class T1, class T2> struct pair
@@ -17,6 +19,24 @@
#include <memory>
#include <cassert>
+#include "archetypes.hpp"
+#include "test_convertible.hpp"
+using namespace ImplicitTypes; // Get implicitly archetypes
+
+template <class T1, class U1,
+ bool CanCopy = true, bool CanConvert = CanCopy>
+void test_pair_rv()
+{
+ using P1 = std::pair<T1, int>;
+ using P2 = std::pair<int, T1>;
+ using UP1 = std::pair<U1, int>&&;
+ using UP2 = std::pair<int, U1>&&;
+ static_assert(std::is_constructible<P1, UP1>::value == CanCopy, "");
+ static_assert(test_convertible<P1, UP1>() == CanConvert, "");
+ static_assert(std::is_constructible<P2, UP2>::value == CanCopy, "");
+ static_assert(test_convertible<P2, UP2>() == CanConvert, "");
+}
+
struct Base
{
virtual ~Base() {}
@@ -27,9 +47,25 @@ struct Derived
{
};
+
+template <class T, class U>
+struct DPair : public std::pair<T, U> {
+ using Base = std::pair<T, U>;
+ using Base::Base;
+};
+
+struct ExplicitT {
+ constexpr explicit ExplicitT(int x) : value(x) {}
+ int value;
+};
+
+struct ImplicitT {
+ constexpr ImplicitT(int x) : value(x) {}
+ int value;
+};
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef std::pair<std::unique_ptr<Derived>, short> P1;
typedef std::pair<std::unique_ptr<Base>, long> P2;
@@ -38,5 +74,104 @@ int main()
assert(p2.first == nullptr);
assert(p2.second == 4);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ {
+ // We allow derived types to use this constructor
+ using P1 = DPair<long, long>;
+ using P2 = std::pair<int, int>;
+ P1 p1(42, 101);
+ P2 p2(std::move(p1));
+ assert(p2.first == 42);
+ assert(p2.second = 101);
+ }
+ {
+ test_pair_rv<AllCtors, AllCtors>();
+ test_pair_rv<AllCtors, AllCtors&>();
+ test_pair_rv<AllCtors, AllCtors&&>();
+ test_pair_rv<AllCtors, const AllCtors&>();
+ test_pair_rv<AllCtors, const AllCtors&&>();
+
+ test_pair_rv<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors>();
+ test_pair_rv<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&, true, false>();
+ test_pair_rv<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&&, true, false>();
+ test_pair_rv<ExplicitTypes::AllCtors, const ExplicitTypes::AllCtors&, true, false>();
+ test_pair_rv<ExplicitTypes::AllCtors, const ExplicitTypes::AllCtors&&, true, false>();
+
+ test_pair_rv<MoveOnly, MoveOnly>();
+ test_pair_rv<MoveOnly, MoveOnly&, false>();
+ test_pair_rv<MoveOnly, MoveOnly&&>();
+
+ test_pair_rv<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly>(); // copy construction
+ test_pair_rv<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&, false>();
+ test_pair_rv<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&&, true, false>();
+
+ test_pair_rv<CopyOnly, CopyOnly>();
+ test_pair_rv<CopyOnly, CopyOnly&>();
+ test_pair_rv<CopyOnly, CopyOnly&&>();
+
+ test_pair_rv<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly>();
+ test_pair_rv<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&, true, false>();
+ test_pair_rv<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&&, true, false>();
+
+ test_pair_rv<NonCopyable, NonCopyable, false>();
+ test_pair_rv<NonCopyable, NonCopyable&, false>();
+ test_pair_rv<NonCopyable, NonCopyable&&, false>();
+ test_pair_rv<NonCopyable, const NonCopyable&, false>();
+ test_pair_rv<NonCopyable, const NonCopyable&&, false>();
+ }
+ { // Test construction of references
+ test_pair_rv<NonCopyable&, NonCopyable&>();
+ test_pair_rv<NonCopyable&, NonCopyable&&>();
+ test_pair_rv<NonCopyable&, NonCopyable const&, false>();
+ test_pair_rv<NonCopyable const&, NonCopyable&&>();
+ test_pair_rv<NonCopyable&&, NonCopyable&&>();
+
+ test_pair_rv<ConvertingType&, int, false>();
+ test_pair_rv<ExplicitTypes::ConvertingType&, int, false>();
+ // Unfortunately the below conversions are allowed and create dangling
+ // references.
+ //test_pair_rv<ConvertingType&&, int>();
+ //test_pair_rv<ConvertingType const&, int>();
+ //test_pair_rv<ConvertingType const&&, int>();
+ // But these are not because the converting constructor is explicit.
+ test_pair_rv<ExplicitTypes::ConvertingType&&, int, false>();
+ test_pair_rv<ExplicitTypes::ConvertingType const&, int, false>();
+ test_pair_rv<ExplicitTypes::ConvertingType const&&, int, false>();
+ }
+ {
+ test_pair_rv<AllCtors, int, false>();
+ test_pair_rv<ExplicitTypes::AllCtors, int, false>();
+ test_pair_rv<ConvertingType, int>();
+ test_pair_rv<ExplicitTypes::ConvertingType, int, true, false>();
+
+ test_pair_rv<ConvertingType, int>();
+ test_pair_rv<ConvertingType, ConvertingType>();
+ test_pair_rv<ConvertingType, ConvertingType const&>();
+ test_pair_rv<ConvertingType, ConvertingType&>();
+ test_pair_rv<ConvertingType, ConvertingType&&>();
+
+ test_pair_rv<ExplicitTypes::ConvertingType, int, true, false>();
+ test_pair_rv<ExplicitTypes::ConvertingType, int&, true, false>();
+ test_pair_rv<ExplicitTypes::ConvertingType, const int&, true, false>();
+ test_pair_rv<ExplicitTypes::ConvertingType, int&&, true, false>();
+ test_pair_rv<ExplicitTypes::ConvertingType, const int&&, true, false>();
+
+ test_pair_rv<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType>();
+ test_pair_rv<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType const&, true, false>();
+ test_pair_rv<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType&, true, false>();
+ test_pair_rv<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType&&, true, false>();
+ }
+#if TEST_STD_VER > 11
+ { // explicit constexpr test
+ constexpr std::pair<int, int> p1(42, 43);
+ constexpr std::pair<ExplicitT, ExplicitT> p2(std::move(p1));
+ static_assert(p2.first.value == 42, "");
+ static_assert(p2.second.value == 43, "");
+ }
+ { // implicit constexpr test
+ constexpr std::pair<int, int> p1(42, 43);
+ constexpr std::pair<ImplicitT, ImplicitT> p2 = std::move(p1);
+ static_assert(p2.first.value == 42, "");
+ static_assert(p2.second.value == 43, "");
+ }
+#endif
}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/special_member_generation_test.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/special_member_generation_test.pass.cpp
new file mode 100644
index 000000000000..1331a3153641
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pairs.pair/special_member_generation_test.pass.cpp
@@ -0,0 +1,127 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <utility>
+
+// template <class T, class U> struct pair;
+
+// pair(pair const&) = default;
+// pair(pair &&) = default;
+// pair& operator=(pair const&);
+// pair& operator=(pair&&);
+
+// Test that the copy/move constructors and assignment operators are
+// correctly defined or deleted based on the properties of `T` and `U`.
+
+#include <cassert>
+#include <string>
+#include <tuple>
+
+#include "archetypes.hpp"
+using namespace ImplicitTypes; // Get implicitly archetypes
+
+namespace ConstructorTest {
+
+template <class T1, bool CanCopy = true, bool CanMove = CanCopy> void test() {
+ using P1 = std::pair<T1, int>;
+ using P2 = std::pair<int, T1>;
+ static_assert(std::is_copy_constructible<P1>::value == CanCopy, "");
+ static_assert(std::is_move_constructible<P1>::value == CanMove, "");
+ static_assert(std::is_copy_constructible<P2>::value == CanCopy, "");
+ static_assert(std::is_move_constructible<P2>::value == CanMove, "");
+};
+
+} // namespace ConstructorTest
+
+void test_constructors_exist() {
+ using namespace ConstructorTest;
+ {
+ test<int>();
+ test<int &>();
+ test<int &&, false, true>();
+ test<const int>();
+ test<const int &>();
+ test<const int &&, false, true>();
+ }
+ {
+ test<Copyable>();
+ test<Copyable &>();
+ test<Copyable &&, false, true>();
+ }
+ {
+ test<NonCopyable, false>();
+ test<NonCopyable &, true>();
+ test<NonCopyable &&, false, true>();
+ }
+ {
+ // Even though CopyOnly has an explicitly deleted move constructor
+ // pair's move constructor is only implicitly deleted and therefore
+ // it doesn't participate in overload resolution.
+ test<CopyOnly, true, true>();
+ test<CopyOnly &, true>();
+ test<CopyOnly &&, false, true>();
+ }
+ {
+ test<MoveOnly, false, true>();
+ test<MoveOnly &, true>();
+ test<MoveOnly &&, false, true>();
+ }
+}
+
+namespace AssignmentOperatorTest {
+
+template <class T1, bool CanCopy = true, bool CanMove = CanCopy> void test() {
+ using P1 = std::pair<T1, int>;
+ using P2 = std::pair<int, T1>;
+ static_assert(std::is_copy_assignable<P1>::value == CanCopy, "");
+ static_assert(std::is_move_assignable<P1>::value == CanMove, "");
+ static_assert(std::is_copy_assignable<P2>::value == CanCopy, "");
+ static_assert(std::is_move_assignable<P2>::value == CanMove, "");
+};
+
+} // namespace AssignmentOperatorTest
+
+void test_assignment_operator_exists() {
+ using namespace AssignmentOperatorTest;
+ {
+ test<int>();
+ test<int &>();
+ test<int &&>();
+ test<const int, false>();
+ test<const int &, false>();
+ test<const int &&, false>();
+ }
+ {
+ test<Copyable>();
+ test<Copyable &>();
+ test<Copyable &&>();
+ }
+ {
+ test<NonCopyable, false>();
+ test<NonCopyable &, false>();
+ test<NonCopyable &&, false>();
+ }
+ {
+ test<CopyOnly, true>();
+ test<CopyOnly &, true>();
+ test<CopyOnly &&, true>();
+ }
+ {
+ test<MoveOnly, false, true>();
+ test<MoveOnly &, false, false>();
+ test<MoveOnly &&, false, true>();
+ }
+}
+
+int main() {
+ test_constructors_exist();
+ test_assignment_operator_exists();
+}
diff --git a/test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp
index dfea61eeacdb..95b1f66d64aa 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/swap.pass.cpp
@@ -29,8 +29,8 @@ int main()
{
{
typedef std::pair<int, short> P1;
- P1 p1(3, 4);
- P1 p2(5, 6);
+ P1 p1(3, static_cast<short>(4));
+ P1 p2(5, static_cast<short>(6));
p1.swap(p2);
assert(p1.first == 5);
assert(p1.second == 6);
diff --git a/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp
index 53cf56700df8..200f044c6359 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp
@@ -32,19 +32,25 @@ int main()
typedef std::pair<int, short> P;
{
static_assert(std::is_copy_constructible<P>::value, "");
+#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
static_assert(std::is_trivially_copy_constructible<P>::value, "");
+#endif
}
#if TEST_STD_VER >= 11
{
static_assert(std::is_move_constructible<P>::value, "");
+#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
static_assert(std::is_trivially_move_constructible<P>::value, "");
+#endif
}
{
using P1 = std::pair<Dummy, int>;
static_assert(!std::is_copy_constructible<P1>::value, "");
static_assert(!std::is_trivially_copy_constructible<P1>::value, "");
static_assert(std::is_move_constructible<P1>::value, "");
+#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
static_assert(std::is_trivially_move_constructible<P1>::value, "");
+#endif
}
#endif
}
diff --git a/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp b/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp
index 9ba8532ab29e..3b994dfd4dfe 100644
--- a/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp
@@ -21,12 +21,14 @@
#include <utility>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
typedef std::pair<int, short> P;
- P p1(3, 4);
- P p2(3, 4);
+ P p1(3, static_cast<short>(4));
+ P p2(3, static_cast<short>(4));
assert( (p1 == p2));
assert(!(p1 != p2));
assert(!(p1 < p2));
@@ -36,8 +38,8 @@ int main()
}
{
typedef std::pair<int, short> P;
- P p1(2, 4);
- P p2(3, 4);
+ P p1(2, static_cast<short>(4));
+ P p2(3, static_cast<short>(4));
assert(!(p1 == p2));
assert( (p1 != p2));
assert( (p1 < p2));
@@ -47,8 +49,8 @@ int main()
}
{
typedef std::pair<int, short> P;
- P p1(3, 2);
- P p2(3, 4);
+ P p1(3, static_cast<short>(2));
+ P p2(3, static_cast<short>(4));
assert(!(p1 == p2));
assert( (p1 != p2));
assert( (p1 < p2));
@@ -58,8 +60,8 @@ int main()
}
{
typedef std::pair<int, short> P;
- P p1(3, 4);
- P p2(2, 4);
+ P p1(3, static_cast<short>(4));
+ P p2(2, static_cast<short>(4));
assert(!(p1 == p2));
assert( (p1 != p2));
assert(!(p1 < p2));
@@ -69,8 +71,8 @@ int main()
}
{
typedef std::pair<int, short> P;
- P p1(3, 4);
- P p2(3, 2);
+ P p1(3, static_cast<short>(4));
+ P p2(3, static_cast<short>(2));
assert(!(p1 == p2));
assert( (p1 != p2));
assert(!(p1 < p2));
@@ -79,11 +81,11 @@ int main()
assert( (p1 >= p2));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<int, short> P;
- constexpr P p1(3, 4);
- constexpr P p2(3, 2);
+ constexpr P p1(3, static_cast<short>(4));
+ constexpr P p2(3, static_cast<short>(2));
static_assert(!(p1 == p2), "");
static_assert( (p1 != p2), "");
static_assert(!(p1 < p2), "");
diff --git a/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp b/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp
index 4a6d71e7b9c8..3586243f8bac 100644
--- a/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp
@@ -15,34 +15,35 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
typedef std::pair<int, short> P1;
- P1 p1 = std::make_pair(3, 4);
+ P1 p1 = std::make_pair(3, static_cast<short>(4));
assert(p1.first == 3);
assert(p1.second == 4);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
typedef std::pair<std::unique_ptr<int>, short> P1;
- P1 p1 = std::make_pair(std::unique_ptr<int>(new int(3)), 4);
+ P1 p1 = std::make_pair(std::unique_ptr<int>(new int(3)), static_cast<short>(4));
assert(*p1.first == 3);
assert(p1.second == 4);
}
{
typedef std::pair<std::unique_ptr<int>, short> P1;
- P1 p1 = std::make_pair(nullptr, 4);
+ P1 p1 = std::make_pair(nullptr, static_cast<short>(4));
assert(p1.first == nullptr);
assert(p1.second == 4);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#if _LIBCPP_STD_VER > 11
+#endif
+#if TEST_STD_VER >= 14
{
typedef std::pair<int, short> P1;
- constexpr P1 p1 = std::make_pair(3, 4);
+ constexpr P1 p1 = std::make_pair(3, static_cast<short>(4));
static_assert(p1.first == 3, "");
static_assert(p1.second == 4, "");
}
diff --git a/test/std/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp b/test/std/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp
index d9d8f27b5225..62fa94247946 100644
--- a/test/std/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp
@@ -20,8 +20,8 @@ int main()
{
{
typedef std::pair<int, short> P1;
- P1 p1(3, 4);
- P1 p2(5, 6);
+ P1 p1(3, static_cast<short>(4));
+ P1 p2(5, static_cast<short>(6));
swap(p1, p2);
assert(p1.first == 5);
assert(p1.second == 6);
diff --git a/test/std/utilities/utility/utility.inplace/inplace.pass.cpp b/test/std/utilities/utility/utility.inplace/inplace.pass.cpp
new file mode 100644
index 000000000000..e87c6f399e93
--- /dev/null
+++ b/test/std/utilities/utility/utility.inplace/inplace.pass.cpp
@@ -0,0 +1,74 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <utility>
+
+// struct in_place_t {
+// explicit in_place_t() = default;
+// };
+// inline constexpr in_place_t in_place{};
+
+// template <class T>
+// struct in_place_type_t {
+// explicit in_place_type_t() = default;
+// };
+// template <class T>
+// inline constexpr in_place_type_t<T> in_place_type{};
+
+// template <size_t I>
+// struct in_place_index_t {
+// explicit in_place_index_t() = default;
+// };
+// template <size_t I>
+// inline constexpr in_place_index_t<I> in_place_index{};
+
+#include <utility>
+#include <cassert>
+#include <memory>
+
+#include "test_macros.h"
+#include "type_id.h"
+
+template <class Tp, class Up>
+constexpr bool check_tag(Up) {
+ return std::is_same<Tp, std::decay_t<Tp>>::value
+ && std::is_same<Tp, Up>::value;
+}
+
+int main() {
+ // test in_place_t
+ {
+ using T = std::in_place_t;
+ static_assert(check_tag<T>(std::in_place));
+ }
+ // test in_place_type_t
+ {
+ using T1 = std::in_place_type_t<void>;
+ using T2 = std::in_place_type_t<int>;
+ using T3 = std::in_place_type_t<const int>;
+ static_assert(!std::is_same<T1, T2>::value && !std::is_same<T1, T3>::value);
+ static_assert(!std::is_same<T2, T3>::value);
+ static_assert(check_tag<T1>(std::in_place_type<void>));
+ static_assert(check_tag<T2>(std::in_place_type<int>));
+ static_assert(check_tag<T3>(std::in_place_type<const int>));
+ }
+ // test in_place_index_t
+ {
+ using T1 = std::in_place_index_t<0>;
+ using T2 = std::in_place_index_t<1>;
+ using T3 = std::in_place_index_t<static_cast<size_t>(-1)>;
+ static_assert(!std::is_same<T1, T2>::value && !std::is_same<T1, T3>::value);
+ static_assert(!std::is_same<T2, T3>::value);
+ static_assert(check_tag<T1>(std::in_place_index<0>));
+ static_assert(check_tag<T2>(std::in_place_index<1>));
+ static_assert(check_tag<T3>(std::in_place_index<static_cast<size_t>(-1)>));
+ }
+}
diff --git a/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp b/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp
new file mode 100644
index 000000000000..77fd1719ff33
--- /dev/null
+++ b/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+/*
+
+ class bad_variant_access : public exception {
+public:
+ bad_variant_access() noexcept;
+ virtual const char* what() const noexcept;
+};
+
+*/
+
+#include <cassert>
+#include <exception>
+#include <type_traits>
+#include <variant>
+
+int main() {
+ static_assert(std::is_base_of<std::exception, std::bad_variant_access>::value,
+ "");
+ static_assert(noexcept(std::bad_variant_access{}), "must be noexcept");
+ static_assert(noexcept(std::bad_variant_access{}.what()), "must be noexcept");
+ std::bad_variant_access ex;
+ assert(ex.what());
+}
diff --git a/test/std/utilities/variant/variant.general/nothing_to_do.pass.cpp b/test/std/utilities/variant/variant.general/nothing_to_do.pass.cpp
new file mode 100644
index 000000000000..8fb3817dba9b
--- /dev/null
+++ b/test/std/utilities/variant/variant.general/nothing_to_do.pass.cpp
@@ -0,0 +1,11 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main() {}
diff --git a/test/std/utilities/variant/variant.get/get_if_index.pass.cpp b/test/std/utilities/variant/variant.get/get_if_index.pass.cpp
new file mode 100644
index 000000000000..94cc08031fda
--- /dev/null
+++ b/test/std/utilities/variant/variant.get/get_if_index.pass.cpp
@@ -0,0 +1,132 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <size_t I, class... Types>
+// constexpr add_pointer_t<variant_alternative_t<I, variant<Types...>>>
+// get_if(variant<Types...>* v) noexcept;
+// template <size_t I, class... Types>
+// constexpr add_pointer_t<const variant_alternative_t<I, variant<Types...>>>
+// get_if(const variant<Types...>* v) noexcept;
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+#include <cassert>
+#include <memory>
+#include <variant>
+
+void test_const_get_if() {
+ {
+ using V = std::variant<int>;
+ constexpr const V *v = nullptr;
+ static_assert(std::get_if<0>(v) == nullptr, "");
+ }
+ {
+ using V = std::variant<int, const long>;
+ constexpr V v(42);
+ ASSERT_NOEXCEPT(std::get_if<0>(&v));
+ ASSERT_SAME_TYPE(decltype(std::get_if<0>(&v)), const int *);
+ static_assert(*std::get_if<0>(&v) == 42, "");
+ static_assert(std::get_if<1>(&v) == nullptr, "");
+ }
+ {
+ using V = std::variant<int, const long>;
+ constexpr V v(42l);
+ ASSERT_SAME_TYPE(decltype(std::get_if<1>(&v)), const long *);
+ static_assert(*std::get_if<1>(&v) == 42, "");
+ static_assert(std::get_if<0>(&v) == nullptr, "");
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ const V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get_if<0>(&v)), int *);
+ assert(std::get_if<0>(&v) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get_if<0>(&v)), int *);
+ assert(std::get_if<0>(&v) == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get_if<0>(&v)), const int *);
+ assert(std::get_if<0>(&v) == &x);
+ }
+#endif
+}
+
+void test_get_if() {
+ {
+ using V = std::variant<int>;
+ V *v = nullptr;
+ assert(std::get_if<0>(v) == nullptr);
+ }
+ {
+ using V = std::variant<int, long>;
+ V v(42);
+ ASSERT_NOEXCEPT(std::get_if<0>(&v));
+ ASSERT_SAME_TYPE(decltype(std::get_if<0>(&v)), int *);
+ assert(*std::get_if<0>(&v) == 42);
+ assert(std::get_if<1>(&v) == nullptr);
+ }
+ {
+ using V = std::variant<int, const long>;
+ V v(42l);
+ ASSERT_SAME_TYPE(decltype(std::get_if<1>(&v)), const long *);
+ assert(*std::get_if<1>(&v) == 42);
+ assert(std::get_if<0>(&v) == nullptr);
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get_if<0>(&v)), int *);
+ assert(std::get_if<0>(&v) == &x);
+ }
+ {
+ using V = std::variant<const int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get_if<0>(&v)), const int *);
+ assert(std::get_if<0>(&v) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get_if<0>(&v)), int *);
+ assert(std::get_if<0>(&v) == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get_if<0>(&v)), const int *);
+ assert(std::get_if<0>(&v) == &x);
+ }
+#endif
+}
+
+int main() {
+ test_const_get_if();
+ test_get_if();
+}
diff --git a/test/std/utilities/variant/variant.get/get_if_type.pass.cpp b/test/std/utilities/variant/variant.get/get_if_type.pass.cpp
new file mode 100644
index 000000000000..a8cc664ef113
--- /dev/null
+++ b/test/std/utilities/variant/variant.get/get_if_type.pass.cpp
@@ -0,0 +1,130 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class T, class... Types>
+// constexpr add_pointer_t<T> get_if(variant<Types...>* v) noexcept;
+// template <class T, class... Types>
+// constexpr add_pointer_t<const T> get_if(const variant<Types...>* v)
+// noexcept;
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+#include <cassert>
+#include <variant>
+
+void test_const_get_if() {
+ {
+ using V = std::variant<int>;
+ constexpr const V *v = nullptr;
+ static_assert(std::get_if<int>(v) == nullptr, "");
+ }
+ {
+ using V = std::variant<int, const long>;
+ constexpr V v(42);
+ ASSERT_NOEXCEPT(std::get_if<int>(&v));
+ ASSERT_SAME_TYPE(decltype(std::get_if<int>(&v)), const int *);
+ static_assert(*std::get_if<int>(&v) == 42, "");
+ static_assert(std::get_if<const long>(&v) == nullptr, "");
+ }
+ {
+ using V = std::variant<int, const long>;
+ constexpr V v(42l);
+ ASSERT_SAME_TYPE(decltype(std::get_if<const long>(&v)), const long *);
+ static_assert(*std::get_if<const long>(&v) == 42, "");
+ static_assert(std::get_if<int>(&v) == nullptr, "");
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ const V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get_if<int &>(&v)), int *);
+ assert(std::get_if<int &>(&v) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get_if<int &&>(&v)), int *);
+ assert(std::get_if<int &&>(&v) == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get_if<const int &&>(&v)), const int *);
+ assert(std::get_if<const int &&>(&v) == &x);
+ }
+#endif
+}
+
+void test_get_if() {
+ {
+ using V = std::variant<int>;
+ V *v = nullptr;
+ assert(std::get_if<int>(v) == nullptr);
+ }
+ {
+ using V = std::variant<int, const long>;
+ V v(42);
+ ASSERT_NOEXCEPT(std::get_if<int>(&v));
+ ASSERT_SAME_TYPE(decltype(std::get_if<int>(&v)), int *);
+ assert(*std::get_if<int>(&v) == 42);
+ assert(std::get_if<const long>(&v) == nullptr);
+ }
+ {
+ using V = std::variant<int, const long>;
+ V v(42l);
+ ASSERT_SAME_TYPE(decltype(std::get_if<const long>(&v)), const long *);
+ assert(*std::get_if<const long>(&v) == 42);
+ assert(std::get_if<int>(&v) == nullptr);
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get_if<int &>(&v)), int *);
+ assert(std::get_if<int &>(&v) == &x);
+ }
+ {
+ using V = std::variant<const int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get_if<const int &>(&v)), const int *);
+ assert(std::get_if<const int &>(&v) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get_if<int &&>(&v)), int *);
+ assert(std::get_if<int &&>(&v) == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get_if<const int &&>(&v)), const int *);
+ assert(std::get_if<const int &&>(&v) == &x);
+ }
+#endif
+}
+
+int main() {
+ test_const_get_if();
+ test_get_if();
+}
diff --git a/test/std/utilities/variant/variant.get/get_index.pass.cpp b/test/std/utilities/variant/variant.get/get_index.pass.cpp
new file mode 100644
index 000000000000..72d17b0ed971
--- /dev/null
+++ b/test/std/utilities/variant/variant.get/get_index.pass.cpp
@@ -0,0 +1,287 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <size_t I, class... Types>
+// constexpr variant_alternative_t<I, variant<Types...>>&
+// get(variant<Types...>& v);
+// template <size_t I, class... Types>
+// constexpr variant_alternative_t<I, variant<Types...>>&&
+// get(variant<Types...>&& v);
+// template <size_t I, class... Types>
+// constexpr variant_alternative_t<I, variant<Types...>> const& get(const
+// variant<Types...>& v);
+// template <size_t I, class... Types>
+// constexpr variant_alternative_t<I, variant<Types...>> const&& get(const
+// variant<Types...>&& v);
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+#include <cassert>
+#include <type_traits>
+#include <utility>
+#include <variant>
+
+void test_const_lvalue_get() {
+ {
+ using V = std::variant<int, const long>;
+ constexpr V v(42);
+#ifndef __clang__ // Avoid https://llvm.org/bugs/show_bug.cgi?id=15481
+ ASSERT_NOEXCEPT(std::get<0>(v));
+#endif
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), const int &);
+ static_assert(std::get<0>(v) == 42, "");
+ }
+ {
+ using V = std::variant<int, const long>;
+ const V v(42);
+ ASSERT_NOT_NOEXCEPT(std::get<0>(v));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), const int &);
+ assert(std::get<0>(v) == 42);
+ }
+ {
+ using V = std::variant<int, const long>;
+ constexpr V v(42l);
+#ifndef __clang__ // Avoid https://llvm.org/bugs/show_bug.cgi?id=15481
+ ASSERT_NOEXCEPT(std::get<1>(v));
+#endif
+ ASSERT_SAME_TYPE(decltype(std::get<1>(v)), const long &);
+ static_assert(std::get<1>(v) == 42, "");
+ }
+ {
+ using V = std::variant<int, const long>;
+ const V v(42l);
+ ASSERT_NOT_NOEXCEPT(std::get<1>(v));
+ ASSERT_SAME_TYPE(decltype(std::get<1>(v)), const long &);
+ assert(std::get<1>(v) == 42);
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ const V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), int &);
+ assert(&std::get<0>(v) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), int &);
+ assert(&std::get<0>(v) == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), const int &);
+ assert(&std::get<0>(v) == &x);
+ }
+#endif
+}
+
+void test_lvalue_get() {
+ {
+ using V = std::variant<int, const long>;
+ V v(42);
+ ASSERT_NOT_NOEXCEPT(std::get<0>(v));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), int &);
+ assert(std::get<0>(v) == 42);
+ }
+ {
+ using V = std::variant<int, const long>;
+ V v(42l);
+ ASSERT_SAME_TYPE(decltype(std::get<1>(v)), const long &);
+ assert(std::get<1>(v) == 42);
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), int &);
+ assert(&std::get<0>(v) == &x);
+ }
+ {
+ using V = std::variant<const int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), const int &);
+ assert(&std::get<0>(v) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), int &);
+ assert(&std::get<0>(v) == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), const int &);
+ assert(&std::get<0>(v) == &x);
+ }
+#endif
+}
+
+void test_rvalue_get() {
+ {
+ using V = std::variant<int, const long>;
+ V v(42);
+ ASSERT_NOT_NOEXCEPT(std::get<0>(std::move(v)));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(std::move(v))), int &&);
+ assert(std::get<0>(std::move(v)) == 42);
+ }
+ {
+ using V = std::variant<int, const long>;
+ V v(42l);
+ ASSERT_SAME_TYPE(decltype(std::get<1>(std::move(v))), const long &&);
+ assert(std::get<1>(std::move(v)) == 42);
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<0>(std::move(v))), int &);
+ assert(&std::get<0>(std::move(v)) == &x);
+ }
+ {
+ using V = std::variant<const int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<0>(std::move(v))), const int &);
+ assert(&std::get<0>(std::move(v)) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(std::move(v))), int &&);
+ int &&xref = std::get<0>(std::move(v));
+ assert(&xref == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(std::move(v))), const int &&);
+ const int &&xref = std::get<0>(std::move(v));
+ assert(&xref == &x);
+ }
+#endif
+}
+
+void test_const_rvalue_get() {
+ {
+ using V = std::variant<int, const long>;
+ const V v(42);
+ ASSERT_NOT_NOEXCEPT(std::get<0>(std::move(v)));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(std::move(v))), const int &&);
+ assert(std::get<0>(std::move(v)) == 42);
+ }
+ {
+ using V = std::variant<int, const long>;
+ const V v(42l);
+ ASSERT_SAME_TYPE(decltype(std::get<1>(std::move(v))), const long &&);
+ assert(std::get<1>(std::move(v)) == 42);
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ const V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<0>(std::move(v))), int &);
+ assert(&std::get<0>(std::move(v)) == &x);
+ }
+ {
+ using V = std::variant<const int &>;
+ int x = 42;
+ const V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<0>(std::move(v))), const int &);
+ assert(&std::get<0>(std::move(v)) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(std::move(v))), int &&);
+ int &&xref = std::get<0>(std::move(v));
+ assert(&xref == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(std::move(v))), const int &&);
+ const int &&xref = std::get<0>(std::move(v));
+ assert(&xref == &x);
+ }
+#endif
+}
+
+template <std::size_t I> using Idx = std::integral_constant<size_t, I>;
+
+void test_throws_for_all_value_categories() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using V = std::variant<int, long>;
+ V v0(42);
+ const V &cv0 = v0;
+ assert(v0.index() == 0);
+ V v1(42l);
+ const V &cv1 = v1;
+ assert(v1.index() == 1);
+ std::integral_constant<size_t, 0> zero;
+ std::integral_constant<size_t, 1> one;
+ auto test = [](auto idx, auto &&v) {
+ using Idx = decltype(idx);
+ try {
+ std::get<Idx::value>(std::forward<decltype(v)>(v));
+ } catch (const std::bad_variant_access &) {
+ return true;
+ } catch (...) { /* ... */
+ }
+ return false;
+ };
+ { // lvalue test cases
+ assert(test(one, v0));
+ assert(test(zero, v1));
+ }
+ { // const lvalue test cases
+ assert(test(one, cv0));
+ assert(test(zero, cv1));
+ }
+ { // rvalue test cases
+ assert(test(one, std::move(v0)));
+ assert(test(zero, std::move(v1)));
+ }
+ { // const rvalue test cases
+ assert(test(one, std::move(cv0)));
+ assert(test(zero, std::move(cv1)));
+ }
+#endif
+}
+
+int main() {
+ test_const_lvalue_get();
+ test_lvalue_get();
+ test_rvalue_get();
+ test_const_rvalue_get();
+ test_throws_for_all_value_categories();
+}
diff --git a/test/std/utilities/variant/variant.get/get_type.pass.cpp b/test/std/utilities/variant/variant.get/get_type.pass.cpp
new file mode 100644
index 000000000000..fc355378a21a
--- /dev/null
+++ b/test/std/utilities/variant/variant.get/get_type.pass.cpp
@@ -0,0 +1,287 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class T, class... Types> constexpr T& get(variant<Types...>& v);
+// template <class T, class... Types> constexpr T&& get(variant<Types...>&& v);
+// template <class T, class... Types> constexpr const T& get(const
+// variant<Types...>& v);
+// template <class T, class... Types> constexpr const T&& get(const
+// variant<Types...>&& v);
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+#include <cassert>
+#include <type_traits>
+#include <utility>
+#include <variant>
+
+void test_const_lvalue_get() {
+ {
+ using V = std::variant<int, const long>;
+ constexpr V v(42);
+#ifndef __clang__ // Avoid https://llvm.org/bugs/show_bug.cgi?id=15481
+ ASSERT_NOEXCEPT(std::get<int>(v));
+#endif
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), const int &);
+ static_assert(std::get<int>(v) == 42, "");
+ }
+ {
+ using V = std::variant<int, const long>;
+ const V v(42);
+ ASSERT_NOT_NOEXCEPT(std::get<int>(v));
+ ASSERT_SAME_TYPE(decltype(std::get<0>(v)), const int &);
+ assert(std::get<int>(v) == 42);
+ }
+ {
+ using V = std::variant<int, const long>;
+ constexpr V v(42l);
+#ifndef __clang__ // Avoid https://llvm.org/bugs/show_bug.cgi?id=15481
+ ASSERT_NOEXCEPT(std::get<const long>(v));
+#endif
+ ASSERT_SAME_TYPE(decltype(std::get<const long>(v)), const long &);
+ static_assert(std::get<const long>(v) == 42, "");
+ }
+ {
+ using V = std::variant<int, const long>;
+ const V v(42l);
+ ASSERT_NOT_NOEXCEPT(std::get<const long>(v));
+ ASSERT_SAME_TYPE(decltype(std::get<const long>(v)), const long &);
+ assert(std::get<const long>(v) == 42);
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ const V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<int &>(v)), int &);
+ assert(&std::get<int &>(v) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<int &&>(v)), int &);
+ assert(&std::get<int &&>(v) == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<const int &&>(v)), const int &);
+ assert(&std::get<const int &&>(v) == &x);
+ }
+#endif
+}
+
+void test_lvalue_get() {
+ {
+ using V = std::variant<int, const long>;
+ V v(42);
+ ASSERT_NOT_NOEXCEPT(std::get<int>(v));
+ ASSERT_SAME_TYPE(decltype(std::get<int>(v)), int &);
+ assert(std::get<int>(v) == 42);
+ }
+ {
+ using V = std::variant<int, const long>;
+ V v(42l);
+ ASSERT_SAME_TYPE(decltype(std::get<const long>(v)), const long &);
+ assert(std::get<const long>(v) == 42);
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<int &>(v)), int &);
+ assert(&std::get<int &>(v) == &x);
+ }
+ {
+ using V = std::variant<const int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<const int &>(v)), const int &);
+ assert(&std::get<const int &>(v) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<int &&>(v)), int &);
+ assert(&std::get<int &&>(v) == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<const int &&>(v)), const int &);
+ assert(&std::get<const int &&>(v) == &x);
+ }
+#endif
+}
+
+void test_rvalue_get() {
+ {
+ using V = std::variant<int, const long>;
+ V v(42);
+ ASSERT_NOT_NOEXCEPT(std::get<int>(std::move(v)));
+ ASSERT_SAME_TYPE(decltype(std::get<int>(std::move(v))), int &&);
+ assert(std::get<int>(std::move(v)) == 42);
+ }
+ {
+ using V = std::variant<int, const long>;
+ V v(42l);
+ ASSERT_SAME_TYPE(decltype(std::get<const long>(std::move(v))),
+ const long &&);
+ assert(std::get<const long>(std::move(v)) == 42);
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<int &>(std::move(v))), int &);
+ assert(&std::get<int &>(std::move(v)) == &x);
+ }
+ {
+ using V = std::variant<const int &>;
+ int x = 42;
+ V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<const int &>(std::move(v))),
+ const int &);
+ assert(&std::get<const int &>(std::move(v)) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<int &&>(std::move(v))), int &&);
+ int &&xref = std::get<int &&>(std::move(v));
+ assert(&xref == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<const int &&>(std::move(v))),
+ const int &&);
+ const int &&xref = std::get<const int &&>(std::move(v));
+ assert(&xref == &x);
+ }
+#endif
+}
+
+void test_const_rvalue_get() {
+ {
+ using V = std::variant<int, const long>;
+ const V v(42);
+ ASSERT_NOT_NOEXCEPT(std::get<int>(std::move(v)));
+ ASSERT_SAME_TYPE(decltype(std::get<int>(std::move(v))), const int &&);
+ assert(std::get<int>(std::move(v)) == 42);
+ }
+ {
+ using V = std::variant<int, const long>;
+ const V v(42l);
+ ASSERT_SAME_TYPE(decltype(std::get<const long>(std::move(v))),
+ const long &&);
+ assert(std::get<const long>(std::move(v)) == 42);
+ }
+// FIXME: Remove these once reference support is reinstated
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &>;
+ int x = 42;
+ const V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<int &>(std::move(v))), int &);
+ assert(&std::get<int &>(std::move(v)) == &x);
+ }
+ {
+ using V = std::variant<const int &>;
+ int x = 42;
+ const V v(x);
+ ASSERT_SAME_TYPE(decltype(std::get<const int &>(std::move(v))),
+ const int &);
+ assert(&std::get<const int &>(std::move(v)) == &x);
+ }
+ {
+ using V = std::variant<int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<int &&>(std::move(v))), int &&);
+ int &&xref = std::get<int &&>(std::move(v));
+ assert(&xref == &x);
+ }
+ {
+ using V = std::variant<const int &&>;
+ int x = 42;
+ const V v(std::move(x));
+ ASSERT_SAME_TYPE(decltype(std::get<const int &&>(std::move(v))),
+ const int &&);
+ const int &&xref = std::get<const int &&>(std::move(v));
+ assert(&xref == &x);
+ }
+#endif
+}
+
+template <class Tp> struct identity { using type = Tp; };
+
+void test_throws_for_all_value_categories() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using V = std::variant<int, long>;
+ V v0(42);
+ const V &cv0 = v0;
+ assert(v0.index() == 0);
+ V v1(42l);
+ const V &cv1 = v1;
+ assert(v1.index() == 1);
+ identity<int> zero;
+ identity<long> one;
+ auto test = [](auto idx, auto &&v) {
+ using Idx = decltype(idx);
+ try {
+ std::get<typename Idx::type>(std::forward<decltype(v)>(v));
+ } catch (const std::bad_variant_access &) {
+ return true;
+ } catch (...) { /* ... */
+ }
+ return false;
+ };
+ { // lvalue test cases
+ assert(test(one, v0));
+ assert(test(zero, v1));
+ }
+ { // const lvalue test cases
+ assert(test(one, cv0));
+ assert(test(zero, cv1));
+ }
+ { // rvalue test cases
+ assert(test(one, std::move(v0)));
+ assert(test(zero, std::move(v1)));
+ }
+ { // const rvalue test cases
+ assert(test(one, std::move(cv0)));
+ assert(test(zero, std::move(cv1)));
+ }
+#endif
+}
+
+int main() {
+ test_const_lvalue_get();
+ test_lvalue_get();
+ test_rvalue_get();
+ test_const_rvalue_get();
+ test_throws_for_all_value_categories();
+}
diff --git a/test/std/utilities/variant/variant.get/holds_alternative.pass.cpp b/test/std/utilities/variant/variant.get/holds_alternative.pass.cpp
new file mode 100644
index 000000000000..103b0498197d
--- /dev/null
+++ b/test/std/utilities/variant/variant.get/holds_alternative.pass.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class T, class... Types>
+// constexpr bool holds_alternative(const variant<Types...>& v) noexcept;
+
+#include "test_macros.h"
+#include <variant>
+
+int main() {
+ {
+ using V = std::variant<int>;
+ constexpr V v;
+ static_assert(std::holds_alternative<int>(v), "");
+ }
+ {
+ using V = std::variant<int, long>;
+ constexpr V v;
+ static_assert(std::holds_alternative<int>(v), "");
+ static_assert(!std::holds_alternative<long>(v), "");
+ }
+ { // noexcept test
+ using V = std::variant<int>;
+ const V v;
+ ASSERT_NOEXCEPT(std::holds_alternative<int>(v));
+ }
+}
diff --git a/test/std/utilities/variant/variant.hash/hash.pass.cpp b/test/std/utilities/variant/variant.hash/hash.pass.cpp
new file mode 100644
index 000000000000..d807a7c7e2ea
--- /dev/null
+++ b/test/std/utilities/variant/variant.hash/hash.pass.cpp
@@ -0,0 +1,124 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class... Types> struct hash<variant<Types...>>;
+// template <> struct hash<monostate>;
+
+#include <cassert>
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+namespace std {
+template <> struct hash<::MakeEmptyT> {
+ size_t operator()(const ::MakeEmptyT &) const {
+ assert(false);
+ return 0;
+ }
+};
+}
+#endif
+
+void test_hash_variant() {
+ {
+ using V = std::variant<int, long, int>;
+ using H = std::hash<V>;
+ const V v(std::in_place_index<0>, 42);
+ const V v_copy = v;
+ V v2(std::in_place_index<0>, 100);
+ const H h{};
+ assert(h(v) == h(v));
+ assert(h(v) != h(v2));
+ assert(h(v) == h(v_copy));
+ {
+ ASSERT_SAME_TYPE(decltype(h(v)), std::size_t);
+ static_assert(std::is_copy_constructible<H>::value, "");
+ }
+ }
+ {
+ using V = std::variant<std::monostate, int, long, const char *>;
+ using H = std::hash<V>;
+ const char *str = "hello";
+ const V v0;
+ const V v0_other;
+ const V v1(42);
+ const V v1_other(100);
+ V v2(100l);
+ V v2_other(999l);
+ V v3(str);
+ V v3_other("not hello");
+ const H h{};
+ assert(h(v0) == h(v0));
+ assert(h(v0) == h(v0_other));
+ assert(h(v1) == h(v1));
+ assert(h(v1) != h(v1_other));
+ assert(h(v2) == h(v2));
+ assert(h(v2) != h(v2_other));
+ assert(h(v3) == h(v3));
+ assert(h(v3) != h(v3_other));
+ assert(h(v0) != h(v1));
+ assert(h(v0) != h(v2));
+ assert(h(v0) != h(v3));
+ assert(h(v1) != h(v2));
+ assert(h(v1) != h(v3));
+ assert(h(v2) != h(v3));
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ using V = std::variant<int, MakeEmptyT>;
+ using H = std::hash<V>;
+ V v;
+ makeEmpty(v);
+ V v2;
+ makeEmpty(v2);
+ const H h{};
+ assert(h(v) == h(v2));
+ }
+#endif
+}
+
+void test_hash_monostate() {
+ using H = std::hash<std::monostate>;
+ const H h{};
+ std::monostate m1{};
+ const std::monostate m2{};
+ assert(h(m1) == h(m1));
+ assert(h(m2) == h(m2));
+ assert(h(m1) == h(m2));
+ {
+ ASSERT_SAME_TYPE(decltype(h(m1)), std::size_t);
+ static_assert(std::is_copy_constructible<H>::value, "");
+ }
+}
+
+void test_hash_variant_duplicate_elements() {
+ // Test that the index of the alternative participates in the hash value.
+ using V = std::variant<std::monostate, std::monostate>;
+ using H = std::hash<V>;
+ H h{};
+ const V v1(std::in_place_index<0>);
+ const V v2(std::in_place_index<1>);
+ assert(h(v1) == h(v1));
+ assert(h(v2) == h(v2));
+ LIBCPP_ASSERT(h(v1) != h(v2));
+}
+
+int main() {
+ test_hash_variant();
+ test_hash_variant_duplicate_elements();
+ test_hash_monostate();
+}
diff --git a/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp b/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp
new file mode 100644
index 000000000000..84689a050391
--- /dev/null
+++ b/test/std/utilities/variant/variant.helpers/variant_alternative.pass.cpp
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <size_t I, class T> struct variant_alternative; // undefined
+// template <size_t I, class T> struct variant_alternative<I, const T>;
+// template <size_t I, class T> struct variant_alternative<I, volatile T>;
+// template <size_t I, class T> struct variant_alternative<I, const volatile T>;
+// template <size_t I, class T>
+// using variant_alternative_t = typename variant_alternative<I, T>::type;
+//
+// template <size_t I, class... Types>
+// struct variant_alternative<I, variant<Types...>>;
+
+#include <memory>
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+template <class V, size_t I, class E> void test() {
+ static_assert(
+ std::is_same_v<typename std::variant_alternative<I, V>::type, E>, "");
+ static_assert(
+ std::is_same_v<typename std::variant_alternative<I, const V>::type,
+ const E>,
+ "");
+ static_assert(
+ std::is_same_v<typename std::variant_alternative<I, volatile V>::type,
+ volatile E>,
+ "");
+ static_assert(
+ std::is_same_v<
+ typename std::variant_alternative<I, const volatile V>::type,
+ const volatile E>,
+ "");
+ static_assert(std::is_same_v<std::variant_alternative_t<I, V>, E>, "");
+ static_assert(std::is_same_v<std::variant_alternative_t<I, const V>, const E>,
+ "");
+ static_assert(
+ std::is_same_v<std::variant_alternative_t<I, volatile V>, volatile E>,
+ "");
+ static_assert(std::is_same_v<std::variant_alternative_t<I, const volatile V>,
+ const volatile E>,
+ "");
+}
+
+int main() {
+ {
+ using V = std::variant<int, void *, const void *, long double>;
+ test<V, 0, int>();
+ test<V, 1, void *>();
+ test<V, 2, const void *>();
+ test<V, 3, long double>();
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int, int &, const int &, int &&, long double>;
+ test<V, 0, int>();
+ test<V, 1, int &>();
+ test<V, 2, const int &>();
+ test<V, 3, int &&>();
+ test<V, 4, long double>();
+ }
+#endif
+}
diff --git a/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp b/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp
new file mode 100644
index 000000000000..2085fa56effe
--- /dev/null
+++ b/test/std/utilities/variant/variant.helpers/variant_size.pass.cpp
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class T> struct variant_size; // undefined
+// template <class T> struct variant_size<const T>;
+// template <class T> struct variant_size<volatile T>;
+// template <class T> struct variant_size<const volatile T>;
+// template <class T> constexpr size_t variant_size_v
+// = variant_size<T>::value;
+
+#include <memory>
+#include <type_traits>
+#include <variant>
+
+template <class V, size_t E> void test() {
+ static_assert(std::variant_size<V>::value == E, "");
+ static_assert(std::variant_size<const V>::value == E, "");
+ static_assert(std::variant_size<volatile V>::value == E, "");
+ static_assert(std::variant_size<const volatile V>::value == E, "");
+ static_assert(std::variant_size_v<V> == E, "");
+ static_assert(std::variant_size_v<const V> == E, "");
+ static_assert(std::variant_size_v<volatile V> == E, "");
+ static_assert(std::variant_size_v<const volatile V> == E, "");
+ static_assert(std::is_base_of<std::integral_constant<std::size_t, E>,
+ std::variant_size<V>>::value,
+ "");
+};
+
+int main() {
+ test<std::variant<>, 0>();
+ test<std::variant<void *>, 1>();
+ test<std::variant<long, long, void *, double>, 4>();
+}
diff --git a/test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp b/test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp
new file mode 100644
index 000000000000..49abba2954e5
--- /dev/null
+++ b/test/std/utilities/variant/variant.monostate.relops/relops.pass.cpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// constexpr bool operator<(monostate, monostate) noexcept { return false; }
+// constexpr bool operator>(monostate, monostate) noexcept { return false; }
+// constexpr bool operator<=(monostate, monostate) noexcept { return true; }
+// constexpr bool operator>=(monostate, monostate) noexcept { return true; }
+// constexpr bool operator==(monostate, monostate) noexcept { return true; }
+// constexpr bool operator!=(monostate, monostate) noexcept { return false; }
+
+#include "test_macros.h"
+#include <cassert>
+#include <type_traits>
+#include <variant>
+
+int main() {
+ using M = std::monostate;
+ constexpr M m1{};
+ constexpr M m2{};
+ {
+ static_assert((m1 < m2) == false, "");
+ ASSERT_NOEXCEPT(m1 < m2);
+ }
+ {
+ static_assert((m1 > m2) == false, "");
+ ASSERT_NOEXCEPT(m1 > m2);
+ }
+ {
+ static_assert((m1 <= m2) == true, "");
+ ASSERT_NOEXCEPT(m1 <= m2);
+ }
+ {
+ static_assert((m1 >= m2) == true, "");
+ ASSERT_NOEXCEPT(m1 >= m2);
+ }
+ {
+ static_assert((m1 == m2) == true, "");
+ ASSERT_NOEXCEPT(m1 == m2);
+ }
+ {
+ static_assert((m1 != m2) == false, "");
+ ASSERT_NOEXCEPT(m1 != m2);
+ }
+}
diff --git a/test/std/utilities/variant/variant.monostate/monostate.pass.cpp b/test/std/utilities/variant/variant.monostate/monostate.pass.cpp
new file mode 100644
index 000000000000..76cddf90043d
--- /dev/null
+++ b/test/std/utilities/variant/variant.monostate/monostate.pass.cpp
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// struct monostate {};
+
+#include <type_traits>
+#include <variant>
+
+int main() {
+ using M = std::monostate;
+ static_assert(std::is_trivially_default_constructible<M>::value, "");
+ static_assert(std::is_trivially_copy_constructible<M>::value, "");
+ static_assert(std::is_trivially_copy_assignable<M>::value, "");
+ static_assert(std::is_trivially_destructible<M>::value, "");
+ constexpr M m{};
+ ((void)m);
+}
diff --git a/test/std/utilities/variant/variant.relops/relops.pass.cpp b/test/std/utilities/variant/variant.relops/relops.pass.cpp
new file mode 100644
index 000000000000..4337b4bdbbd7
--- /dev/null
+++ b/test/std/utilities/variant/variant.relops/relops.pass.cpp
@@ -0,0 +1,227 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types>
+// constexpr bool
+// operator==(variant<Types...> const&, variant<Types...> const&) noexcept;
+//
+// template <class ...Types>
+// constexpr bool
+// operator!=(variant<Types...> const&, variant<Types...> const&) noexcept;
+//
+// template <class ...Types>
+// constexpr bool
+// operator<(variant<Types...> const&, variant<Types...> const&) noexcept;
+//
+// template <class ...Types>
+// constexpr bool
+// operator>(variant<Types...> const&, variant<Types...> const&) noexcept;
+//
+// template <class ...Types>
+// constexpr bool
+// operator<=(variant<Types...> const&, variant<Types...> const&) noexcept;
+//
+// template <class ...Types>
+// constexpr bool
+// operator>=(variant<Types...> const&, variant<Types...> const&) noexcept;
+
+#include <cassert>
+#include <type_traits>
+#include <utility>
+#include <variant>
+
+#include "test_macros.h"
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+struct MakeEmptyT {
+ MakeEmptyT() = default;
+ MakeEmptyT(MakeEmptyT &&) { throw 42; }
+ MakeEmptyT &operator=(MakeEmptyT &&) { throw 42; }
+};
+inline bool operator==(const MakeEmptyT &, const MakeEmptyT &) {
+ assert(false);
+ return false;
+}
+inline bool operator!=(const MakeEmptyT &, const MakeEmptyT &) {
+ assert(false);
+ return false;
+}
+inline bool operator<(const MakeEmptyT &, const MakeEmptyT &) {
+ assert(false);
+ return false;
+}
+inline bool operator<=(const MakeEmptyT &, const MakeEmptyT &) {
+ assert(false);
+ return false;
+}
+inline bool operator>(const MakeEmptyT &, const MakeEmptyT &) {
+ assert(false);
+ return false;
+}
+inline bool operator>=(const MakeEmptyT &, const MakeEmptyT &) {
+ assert(false);
+ return false;
+}
+
+template <class Variant> void makeEmpty(Variant &v) {
+ Variant v2(std::in_place_type<MakeEmptyT>);
+ try {
+ v = std::move(v2);
+ assert(false);
+ } catch (...) {
+ assert(v.valueless_by_exception());
+ }
+}
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+void test_equality() {
+ {
+ using V = std::variant<int, long>;
+ constexpr V v1(42);
+ constexpr V v2(42);
+ static_assert(v1 == v2, "");
+ static_assert(v2 == v1, "");
+ static_assert(!(v1 != v2), "");
+ static_assert(!(v2 != v1), "");
+ }
+ {
+ using V = std::variant<int, long>;
+ constexpr V v1(42);
+ constexpr V v2(43);
+ static_assert(!(v1 == v2), "");
+ static_assert(!(v2 == v1), "");
+ static_assert(v1 != v2, "");
+ static_assert(v2 != v1, "");
+ }
+ {
+ using V = std::variant<int, long>;
+ constexpr V v1(42);
+ constexpr V v2(42l);
+ static_assert(!(v1 == v2), "");
+ static_assert(!(v2 == v1), "");
+ static_assert(v1 != v2, "");
+ static_assert(v2 != v1, "");
+ }
+ {
+ using V = std::variant<int, long>;
+ constexpr V v1(42l);
+ constexpr V v2(42l);
+ static_assert(v1 == v2, "");
+ static_assert(v2 == v1, "");
+ static_assert(!(v1 != v2), "");
+ static_assert(!(v2 != v1), "");
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ using V = std::variant<int, MakeEmptyT>;
+ V v1;
+ V v2;
+ makeEmpty(v2);
+ assert(!(v1 == v2));
+ assert(!(v2 == v1));
+ assert(v1 != v2);
+ assert(v2 != v1);
+ }
+ {
+ using V = std::variant<int, MakeEmptyT>;
+ V v1;
+ makeEmpty(v1);
+ V v2;
+ assert(!(v1 == v2));
+ assert(!(v2 == v1));
+ assert(v1 != v2);
+ assert(v2 != v1);
+ }
+ {
+ using V = std::variant<int, MakeEmptyT>;
+ V v1;
+ makeEmpty(v1);
+ V v2;
+ makeEmpty(v2);
+ assert(v1 == v2);
+ assert(v2 == v1);
+ assert(!(v1 != v2));
+ assert(!(v2 != v1));
+ }
+#endif
+}
+
+template <class Var>
+constexpr bool test_less(const Var &l, const Var &r, bool expect_less,
+ bool expect_greater) {
+ return ((l < r) == expect_less) && (!(l >= r) == expect_less) &&
+ ((l > r) == expect_greater) && (!(l <= r) == expect_greater);
+}
+
+void test_relational() {
+ { // same index, same value
+ using V = std::variant<int, long>;
+ constexpr V v1(1);
+ constexpr V v2(1);
+ static_assert(test_less(v1, v2, false, false), "");
+ }
+ { // same index, value < other_value
+ using V = std::variant<int, long>;
+ constexpr V v1(0);
+ constexpr V v2(1);
+ static_assert(test_less(v1, v2, true, false), "");
+ }
+ { // same index, value > other_value
+ using V = std::variant<int, long>;
+ constexpr V v1(1);
+ constexpr V v2(0);
+ static_assert(test_less(v1, v2, false, true), "");
+ }
+ { // LHS.index() < RHS.index()
+ using V = std::variant<int, long>;
+ constexpr V v1(0);
+ constexpr V v2(0l);
+ static_assert(test_less(v1, v2, true, false), "");
+ }
+ { // LHS.index() > RHS.index()
+ using V = std::variant<int, long>;
+ constexpr V v1(0l);
+ constexpr V v2(0);
+ static_assert(test_less(v1, v2, false, true), "");
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ { // LHS.index() < RHS.index(), RHS is empty
+ using V = std::variant<int, MakeEmptyT>;
+ V v1;
+ V v2;
+ makeEmpty(v2);
+ assert(test_less(v1, v2, false, true));
+ }
+ { // LHS.index() > RHS.index(), LHS is empty
+ using V = std::variant<int, MakeEmptyT>;
+ V v1;
+ makeEmpty(v1);
+ V v2;
+ assert(test_less(v1, v2, true, false));
+ }
+ { // LHS.index() == RHS.index(), LHS and RHS are empty
+ using V = std::variant<int, MakeEmptyT>;
+ V v1;
+ makeEmpty(v1);
+ V v2;
+ makeEmpty(v2);
+ assert(test_less(v1, v2, false, false));
+ }
+#endif
+}
+
+int main() {
+ test_equality();
+ test_relational();
+}
diff --git a/test/std/utilities/variant/variant.synopsis/variant_npos.pass.cpp b/test/std/utilities/variant/variant.synopsis/variant_npos.pass.cpp
new file mode 100644
index 000000000000..4d7c8563caad
--- /dev/null
+++ b/test/std/utilities/variant/variant.synopsis/variant_npos.pass.cpp
@@ -0,0 +1,21 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// constexpr size_t variant_npos = -1;
+
+#include <variant>
+
+int main() {
+ static_assert(std::variant_npos == static_cast<std::size_t>(-1), "");
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp b/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp
new file mode 100644
index 000000000000..10022b14aa06
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp
@@ -0,0 +1,232 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// template <class T>
+// variant& operator=(T&&) noexcept(see below);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+namespace MetaHelpers {
+
+struct Dummy {
+ Dummy() = default;
+};
+
+struct ThrowsCtorT {
+ ThrowsCtorT(int) noexcept(false) {}
+ ThrowsCtorT &operator=(int) noexcept { return *this; }
+};
+
+struct ThrowsAssignT {
+ ThrowsAssignT(int) noexcept {}
+ ThrowsAssignT &operator=(int) noexcept(false) { return *this; }
+};
+
+struct NoThrowT {
+ NoThrowT(int) noexcept {}
+ NoThrowT &operator=(int) noexcept { return *this; }
+};
+
+} // namespace MetaHelpers
+
+namespace RuntimeHelpers {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+
+struct ThrowsCtorT {
+ int value;
+ ThrowsCtorT() : value(0) {}
+ ThrowsCtorT(int) noexcept(false) { throw 42; }
+ ThrowsCtorT &operator=(int v) noexcept {
+ value = v;
+ return *this;
+ }
+};
+
+struct ThrowsAssignT {
+ int value;
+ ThrowsAssignT() : value(0) {}
+ ThrowsAssignT(int v) noexcept : value(v) {}
+ ThrowsAssignT &operator=(int) noexcept(false) { throw 42; }
+};
+
+struct NoThrowT {
+ int value;
+ NoThrowT() : value(0) {}
+ NoThrowT(int v) noexcept : value(v) {}
+ NoThrowT &operator=(int v) noexcept {
+ value = v;
+ return *this;
+ }
+};
+
+#endif // !defined(TEST_HAS_NO_EXCEPTIONS)
+} // namespace RuntimeHelpers
+
+void test_T_assignment_noexcept() {
+ using namespace MetaHelpers;
+ {
+ using V = std::variant<Dummy, NoThrowT>;
+ static_assert(std::is_nothrow_assignable<V, int>::value, "");
+ }
+ {
+ using V = std::variant<Dummy, ThrowsCtorT>;
+ static_assert(!std::is_nothrow_assignable<V, int>::value, "");
+ }
+ {
+ using V = std::variant<Dummy, ThrowsAssignT>;
+ static_assert(!std::is_nothrow_assignable<V, int>::value, "");
+ }
+}
+
+void test_T_assignment_sfinae() {
+ {
+ using V = std::variant<long, unsigned>;
+ static_assert(!std::is_assignable<V, int>::value, "ambiguous");
+ }
+ {
+ using V = std::variant<std::string, std::string>;
+ static_assert(!std::is_assignable<V, const char *>::value, "ambiguous");
+ }
+ {
+ using V = std::variant<std::string, void *>;
+ static_assert(!std::is_assignable<V, int>::value, "no matching operator=");
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int, int &&>;
+ static_assert(!std::is_assignable<V, int>::value, "ambiguous");
+ }
+ {
+ using V = std::variant<int, const int &>;
+ static_assert(!std::is_assignable<V, int>::value, "ambiguous");
+ }
+#endif
+}
+
+void test_T_assignment_basic() {
+ {
+ std::variant<int> v(43);
+ v = 42;
+ assert(v.index() == 0);
+ assert(std::get<0>(v) == 42);
+ }
+ {
+ std::variant<int, long> v(43l);
+ v = 42;
+ assert(v.index() == 0);
+ assert(std::get<0>(v) == 42);
+ v = 43l;
+ assert(v.index() == 1);
+ assert(std::get<1>(v) == 43);
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &, int &&, long>;
+ int x = 42;
+ V v(43l);
+ v = x;
+ assert(v.index() == 0);
+ assert(&std::get<0>(v) == &x);
+ v = std::move(x);
+ assert(v.index() == 1);
+ assert(&std::get<1>(v) == &x);
+ // 'long' is selected by FUN(const int &) since 'const int &' cannot bind
+ // to 'int&'.
+ const int &cx = x;
+ v = cx;
+ assert(v.index() == 2);
+ assert(std::get<2>(v) == 42);
+ }
+#endif
+}
+
+void test_T_assignment_performs_construction() {
+ using namespace RuntimeHelpers;
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ using V = std::variant<std::string, ThrowsCtorT>;
+ V v(std::in_place_type<std::string>, "hello");
+ try {
+ v = 42;
+ } catch (...) { /* ... */
+ }
+ assert(v.valueless_by_exception());
+ }
+ {
+ using V = std::variant<ThrowsAssignT, std::string>;
+ V v(std::in_place_type<std::string>, "hello");
+ v = 42;
+ assert(v.index() == 0);
+ assert(std::get<0>(v).value == 42);
+ }
+#endif
+}
+
+void test_T_assignment_performs_assignment() {
+ using namespace RuntimeHelpers;
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ using V = std::variant<ThrowsCtorT>;
+ V v;
+ v = 42;
+ assert(v.index() == 0);
+ assert(std::get<0>(v).value == 42);
+ }
+ {
+ using V = std::variant<ThrowsCtorT, std::string>;
+ V v;
+ v = 42;
+ assert(v.index() == 0);
+ assert(std::get<0>(v).value == 42);
+ }
+ {
+ using V = std::variant<ThrowsAssignT>;
+ V v(100);
+ try {
+ v = 42;
+ assert(false);
+ } catch (...) { /* ... */
+ }
+ assert(v.index() == 0);
+ assert(std::get<0>(v).value == 100);
+ }
+ {
+ using V = std::variant<std::string, ThrowsAssignT>;
+ V v(100);
+ try {
+ v = 42;
+ assert(false);
+ } catch (...) { /* ... */
+ }
+ assert(v.index() == 1);
+ assert(std::get<1>(v).value == 100);
+ }
+#endif
+}
+
+int main() {
+ test_T_assignment_basic();
+ test_T_assignment_performs_construction();
+ test_T_assignment_performs_assignment();
+ test_T_assignment_noexcept();
+ test_T_assignment_sfinae();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp b/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
new file mode 100644
index 000000000000..d92f16fd6418
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
@@ -0,0 +1,397 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant& operator=(variant const&);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NoCopy {
+ NoCopy(const NoCopy &) = delete;
+ NoCopy &operator=(const NoCopy &) = default;
+};
+
+struct NothrowCopy {
+ NothrowCopy(const NothrowCopy &) noexcept = default;
+ NothrowCopy &operator=(const NothrowCopy &) noexcept = default;
+};
+
+struct CopyOnly {
+ CopyOnly(const CopyOnly &) = default;
+ CopyOnly(CopyOnly &&) = delete;
+ CopyOnly &operator=(const CopyOnly &) = default;
+ CopyOnly &operator=(CopyOnly &&) = delete;
+};
+
+struct MoveOnly {
+ MoveOnly(const MoveOnly &) = delete;
+ MoveOnly(MoveOnly &&) = default;
+ MoveOnly &operator=(const MoveOnly &) = default;
+};
+
+struct MoveOnlyNT {
+ MoveOnlyNT(const MoveOnlyNT &) = delete;
+ MoveOnlyNT(MoveOnlyNT &&) {}
+ MoveOnlyNT &operator=(const MoveOnlyNT &) = default;
+};
+
+struct CopyAssign {
+ static int alive;
+ static int copy_construct;
+ static int copy_assign;
+ static int move_construct;
+ static int move_assign;
+ static void reset() {
+ copy_construct = copy_assign = move_construct = move_assign = alive = 0;
+ }
+ CopyAssign(int v) : value(v) { ++alive; }
+ CopyAssign(const CopyAssign &o) : value(o.value) {
+ ++alive;
+ ++copy_construct;
+ }
+ CopyAssign(CopyAssign &&o) : value(o.value) {
+ o.value = -1;
+ ++alive;
+ ++move_construct;
+ }
+ CopyAssign &operator=(const CopyAssign &o) {
+ value = o.value;
+ ++copy_assign;
+ return *this;
+ }
+ CopyAssign &operator=(CopyAssign &&o) {
+ value = o.value;
+ o.value = -1;
+ ++move_assign;
+ return *this;
+ }
+ ~CopyAssign() { --alive; }
+ int value;
+};
+
+int CopyAssign::alive = 0;
+int CopyAssign::copy_construct = 0;
+int CopyAssign::copy_assign = 0;
+int CopyAssign::move_construct = 0;
+int CopyAssign::move_assign = 0;
+
+struct CopyMaybeThrows {
+ CopyMaybeThrows(const CopyMaybeThrows &);
+ CopyMaybeThrows &operator=(const CopyMaybeThrows &);
+};
+struct CopyDoesThrow {
+ CopyDoesThrow(const CopyDoesThrow &) noexcept(false);
+ CopyDoesThrow &operator=(const CopyDoesThrow &) noexcept(false);
+};
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+struct CopyThrows {
+ CopyThrows() = default;
+ CopyThrows(const CopyThrows &) { throw 42; }
+ CopyThrows &operator=(const CopyThrows &) { throw 42; }
+};
+
+struct MoveThrows {
+ static int alive;
+ MoveThrows() { ++alive; }
+ MoveThrows(const MoveThrows &) { ++alive; }
+ MoveThrows(MoveThrows &&) { throw 42; }
+ MoveThrows &operator=(const MoveThrows &) { return *this; }
+ MoveThrows &operator=(MoveThrows &&) { throw 42; }
+ ~MoveThrows() { --alive; }
+};
+
+int MoveThrows::alive = 0;
+
+struct MakeEmptyT {
+ static int alive;
+ MakeEmptyT() { ++alive; }
+ MakeEmptyT(const MakeEmptyT &) {
+ ++alive;
+ // Don't throw from the copy constructor since variant's assignment
+ // operator performs a copy before committing to the assignment.
+ }
+ MakeEmptyT(MakeEmptyT &&) { throw 42; }
+ MakeEmptyT &operator=(const MakeEmptyT &) { throw 42; }
+ MakeEmptyT &operator=(MakeEmptyT &&) { throw 42; }
+ ~MakeEmptyT() { --alive; }
+};
+
+int MakeEmptyT::alive = 0;
+
+template <class Variant> void makeEmpty(Variant &v) {
+ Variant v2(std::in_place_type<MakeEmptyT>);
+ try {
+ v = v2;
+ assert(false);
+ } catch (...) {
+ assert(v.valueless_by_exception());
+ }
+}
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+void test_copy_assignment_not_noexcept() {
+ {
+ using V = std::variant<CopyMaybeThrows>;
+ static_assert(!std::is_nothrow_copy_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, CopyDoesThrow>;
+ static_assert(!std::is_nothrow_copy_assignable<V>::value, "");
+ }
+}
+
+void test_copy_assignment_sfinae() {
+ {
+ using V = std::variant<int, long>;
+ static_assert(std::is_copy_assignable<V>::value, "");
+ }
+ {
+ // variant only provides copy assignment when both the copy and move
+ // constructors are well formed
+ using V = std::variant<int, CopyOnly>;
+ static_assert(!std::is_copy_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, NoCopy>;
+ static_assert(!std::is_copy_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnly>;
+ static_assert(!std::is_copy_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnlyNT>;
+ static_assert(!std::is_copy_assignable<V>::value, "");
+ }
+}
+
+void test_copy_assignment_empty_empty() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using MET = MakeEmptyT;
+ {
+ using V = std::variant<int, long, MET>;
+ V v1(std::in_place_index<0>);
+ makeEmpty(v1);
+ V v2(std::in_place_index<0>);
+ makeEmpty(v2);
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.valueless_by_exception());
+ assert(v1.index() == std::variant_npos);
+ }
+#endif
+}
+
+void test_copy_assignment_non_empty_empty() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using MET = MakeEmptyT;
+ {
+ using V = std::variant<int, MET>;
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<0>);
+ makeEmpty(v2);
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.valueless_by_exception());
+ assert(v1.index() == std::variant_npos);
+ }
+ {
+ using V = std::variant<int, MET, std::string>;
+ V v1(std::in_place_index<2>, "hello");
+ V v2(std::in_place_index<0>);
+ makeEmpty(v2);
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.valueless_by_exception());
+ assert(v1.index() == std::variant_npos);
+ }
+#endif
+}
+
+void test_copy_assignment_empty_non_empty() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using MET = MakeEmptyT;
+ {
+ using V = std::variant<int, MET>;
+ V v1(std::in_place_index<0>);
+ makeEmpty(v1);
+ V v2(std::in_place_index<0>, 42);
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.index() == 0);
+ assert(std::get<0>(v1) == 42);
+ }
+ {
+ using V = std::variant<int, MET, std::string>;
+ V v1(std::in_place_index<0>);
+ makeEmpty(v1);
+ V v2(std::in_place_type<std::string>, "hello");
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.index() == 2);
+ assert(std::get<2>(v1) == "hello");
+ }
+#endif
+}
+
+void test_copy_assignment_same_index() {
+ {
+ using V = std::variant<int>;
+ V v1(43);
+ V v2(42);
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.index() == 0);
+ assert(std::get<0>(v1) == 42);
+ }
+ {
+ using V = std::variant<int, long, unsigned>;
+ V v1(43l);
+ V v2(42l);
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.index() == 1);
+ assert(std::get<1>(v1) == 42);
+ }
+ {
+ using V = std::variant<int, CopyAssign, unsigned>;
+ V v1(std::in_place_type<CopyAssign>, 43);
+ V v2(std::in_place_type<CopyAssign>, 42);
+ CopyAssign::reset();
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.index() == 1);
+ assert(std::get<1>(v1).value == 42);
+ assert(CopyAssign::copy_construct == 0);
+ assert(CopyAssign::move_construct == 0);
+ assert(CopyAssign::copy_assign == 1);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using MET = MakeEmptyT;
+ {
+ using V = std::variant<int, MET, std::string>;
+ V v1(std::in_place_type<MET>);
+ MET &mref = std::get<1>(v1);
+ V v2(std::in_place_type<MET>);
+ try {
+ v1 = v2;
+ assert(false);
+ } catch (...) {
+ }
+ assert(v1.index() == 1);
+ assert(&std::get<1>(v1) == &mref);
+ }
+#endif
+}
+
+void test_copy_assignment_different_index() {
+ {
+ using V = std::variant<int, long, unsigned>;
+ V v1(43);
+ V v2(42l);
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.index() == 1);
+ assert(std::get<1>(v1) == 42);
+ }
+ {
+ using V = std::variant<int, CopyAssign, unsigned>;
+ CopyAssign::reset();
+ V v1(std::in_place_type<unsigned>, 43);
+ V v2(std::in_place_type<CopyAssign>, 42);
+ assert(CopyAssign::copy_construct == 0);
+ assert(CopyAssign::move_construct == 0);
+ assert(CopyAssign::alive == 1);
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.index() == 1);
+ assert(std::get<1>(v1).value == 42);
+ assert(CopyAssign::alive == 2);
+ assert(CopyAssign::copy_construct == 1);
+ assert(CopyAssign::move_construct == 1);
+ assert(CopyAssign::copy_assign == 0);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ // Test that if copy construction throws then original value is
+ // unchanged.
+ using V = std::variant<int, CopyThrows, std::string>;
+ V v1(std::in_place_type<std::string>, "hello");
+ V v2(std::in_place_type<CopyThrows>);
+ try {
+ v1 = v2;
+ assert(false);
+ } catch (...) { /* ... */
+ }
+ assert(v1.index() == 2);
+ assert(std::get<2>(v1) == "hello");
+ }
+ {
+ // Test that if move construction throws then the variant is left
+ // valueless by exception.
+ using V = std::variant<int, MoveThrows, std::string>;
+ V v1(std::in_place_type<std::string>, "hello");
+ V v2(std::in_place_type<MoveThrows>);
+ assert(MoveThrows::alive == 1);
+ try {
+ v1 = v2;
+ assert(false);
+ } catch (...) { /* ... */
+ }
+ assert(v1.valueless_by_exception());
+ assert(v2.index() == 1);
+ assert(MoveThrows::alive == 1);
+ }
+ {
+ using V = std::variant<int, CopyThrows, std::string>;
+ V v1(std::in_place_type<CopyThrows>);
+ V v2(std::in_place_type<std::string>, "hello");
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.index() == 2);
+ assert(std::get<2>(v1) == "hello");
+ assert(v2.index() == 2);
+ assert(std::get<2>(v2) == "hello");
+ }
+ {
+ using V = std::variant<int, MoveThrows, std::string>;
+ V v1(std::in_place_type<MoveThrows>);
+ V v2(std::in_place_type<std::string>, "hello");
+ V &vref = (v1 = v2);
+ assert(&vref == &v1);
+ assert(v1.index() == 2);
+ assert(std::get<2>(v1) == "hello");
+ assert(v2.index() == 2);
+ assert(std::get<2>(v2) == "hello");
+ }
+#endif
+}
+
+
+int main() {
+ test_copy_assignment_empty_empty();
+ test_copy_assignment_non_empty_empty();
+ test_copy_assignment_empty_non_empty();
+ test_copy_assignment_same_index();
+ test_copy_assignment_different_index();
+ test_copy_assignment_sfinae();
+ test_copy_assignment_not_noexcept();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp b/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
new file mode 100644
index 000000000000..232d77c882eb
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
@@ -0,0 +1,319 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant& operator=(variant&&) noexcept(see below);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+struct NoCopy {
+ NoCopy(const NoCopy &) = delete;
+ NoCopy &operator=(const NoCopy &) = default;
+};
+
+struct CopyOnly {
+ CopyOnly(const CopyOnly &) = default;
+ CopyOnly(CopyOnly &&) = delete;
+ CopyOnly &operator=(const CopyOnly &) = default;
+ CopyOnly &operator=(CopyOnly &&) = delete;
+};
+
+struct MoveOnly {
+ MoveOnly(const MoveOnly &) = delete;
+ MoveOnly(MoveOnly &&) = default;
+ MoveOnly &operator=(const MoveOnly &) = delete;
+ MoveOnly &operator=(MoveOnly &&) = default;
+};
+
+struct MoveOnlyNT {
+ MoveOnlyNT(const MoveOnlyNT &) = delete;
+ MoveOnlyNT(MoveOnlyNT &&) {}
+ MoveOnlyNT &operator=(const MoveOnlyNT &) = delete;
+ MoveOnlyNT &operator=(MoveOnlyNT &&) = default;
+};
+
+struct MoveOnlyOddNothrow {
+ MoveOnlyOddNothrow(MoveOnlyOddNothrow &&) noexcept(false) {}
+ MoveOnlyOddNothrow(const MoveOnlyOddNothrow &) = delete;
+ MoveOnlyOddNothrow &operator=(MoveOnlyOddNothrow &&) noexcept = default;
+ MoveOnlyOddNothrow &operator=(const MoveOnlyOddNothrow &) = delete;
+};
+
+struct MoveAssignOnly {
+ MoveAssignOnly(MoveAssignOnly &&) = delete;
+ MoveAssignOnly &operator=(MoveAssignOnly &&) = default;
+};
+
+struct MoveAssign {
+ static int move_construct;
+ static int move_assign;
+ static void reset() { move_construct = move_assign = 0; }
+ MoveAssign(int v) : value(v) {}
+ MoveAssign(MoveAssign &&o) : value(o.value) {
+ ++move_construct;
+ o.value = -1;
+ }
+ MoveAssign &operator=(MoveAssign &&o) {
+ value = o.value;
+ ++move_assign;
+ o.value = -1;
+ return *this;
+ }
+ int value;
+};
+
+int MoveAssign::move_construct = 0;
+int MoveAssign::move_assign = 0;
+
+void test_move_assignment_noexcept() {
+ {
+ using V = std::variant<int>;
+ static_assert(std::is_nothrow_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<MoveOnly>;
+ static_assert(std::is_nothrow_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, long>;
+ static_assert(std::is_nothrow_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnly>;
+ static_assert(std::is_nothrow_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<MoveOnlyNT>;
+ static_assert(!std::is_nothrow_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<MoveOnlyOddNothrow>;
+ static_assert(!std::is_nothrow_move_assignable<V>::value, "");
+ }
+}
+
+void test_move_assignment_sfinae() {
+ {
+ using V = std::variant<int, long>;
+ static_assert(std::is_move_assignable<V>::value, "");
+ }
+ {
+ // variant only provides move assignment when both the move constructor
+ // and move assignment operator are well formed.
+ using V = std::variant<int, CopyOnly>;
+ static_assert(!std::is_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, NoCopy>;
+ static_assert(!std::is_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnly>;
+ static_assert(std::is_move_assignable<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnlyNT>;
+ static_assert(std::is_move_assignable<V>::value, "");
+ }
+ {
+ // variant only provides move assignment when the types also provide
+ // a move constructor.
+ using V = std::variant<int, MoveAssignOnly>;
+ static_assert(!std::is_move_assignable<V>::value, "");
+ }
+}
+
+void test_move_assignment_empty_empty() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using MET = MakeEmptyT;
+ {
+ using V = std::variant<int, long, MET>;
+ V v1(std::in_place_index<0>);
+ makeEmpty(v1);
+ V v2(std::in_place_index<0>);
+ makeEmpty(v2);
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.valueless_by_exception());
+ assert(v1.index() == std::variant_npos);
+ }
+#endif
+}
+
+void test_move_assignment_non_empty_empty() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using MET = MakeEmptyT;
+ {
+ using V = std::variant<int, MET>;
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<0>);
+ makeEmpty(v2);
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.valueless_by_exception());
+ assert(v1.index() == std::variant_npos);
+ }
+ {
+ using V = std::variant<int, MET, std::string>;
+ V v1(std::in_place_index<2>, "hello");
+ V v2(std::in_place_index<0>);
+ makeEmpty(v2);
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.valueless_by_exception());
+ assert(v1.index() == std::variant_npos);
+ }
+#endif
+}
+
+void test_move_assignment_empty_non_empty() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using MET = MakeEmptyT;
+ {
+ using V = std::variant<int, MET>;
+ V v1(std::in_place_index<0>);
+ makeEmpty(v1);
+ V v2(std::in_place_index<0>, 42);
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.index() == 0);
+ assert(std::get<0>(v1) == 42);
+ }
+ {
+ using V = std::variant<int, MET, std::string>;
+ V v1(std::in_place_index<0>);
+ makeEmpty(v1);
+ V v2(std::in_place_type<std::string>, "hello");
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.index() == 2);
+ assert(std::get<2>(v1) == "hello");
+ }
+#endif
+}
+
+void test_move_assignment_same_index() {
+ {
+ using V = std::variant<int>;
+ V v1(43);
+ V v2(42);
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.index() == 0);
+ assert(std::get<0>(v1) == 42);
+ }
+ {
+ using V = std::variant<int, long, unsigned>;
+ V v1(43l);
+ V v2(42l);
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.index() == 1);
+ assert(std::get<1>(v1) == 42);
+ }
+ {
+ using V = std::variant<int, MoveAssign, unsigned>;
+ V v1(std::in_place_type<MoveAssign>, 43);
+ V v2(std::in_place_type<MoveAssign>, 42);
+ MoveAssign::reset();
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.index() == 1);
+ assert(std::get<1>(v1).value == 42);
+ assert(MoveAssign::move_construct == 0);
+ assert(MoveAssign::move_assign == 1);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using MET = MakeEmptyT;
+ {
+ using V = std::variant<int, MET, std::string>;
+ V v1(std::in_place_type<MET>);
+ MET &mref = std::get<1>(v1);
+ V v2(std::in_place_type<MET>);
+ try {
+ v1 = std::move(v2);
+ assert(false);
+ } catch (...) {
+ }
+ assert(v1.index() == 1);
+ assert(&std::get<1>(v1) == &mref);
+ }
+#endif
+}
+
+void test_move_assignment_different_index() {
+ {
+ using V = std::variant<int, long, unsigned>;
+ V v1(43);
+ V v2(42l);
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.index() == 1);
+ assert(std::get<1>(v1) == 42);
+ }
+ {
+ using V = std::variant<int, MoveAssign, unsigned>;
+ V v1(std::in_place_type<unsigned>, 43);
+ V v2(std::in_place_type<MoveAssign>, 42);
+ MoveAssign::reset();
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.index() == 1);
+ assert(std::get<1>(v1).value == 42);
+ assert(MoveAssign::move_construct == 1);
+ assert(MoveAssign::move_assign == 0);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using MET = MakeEmptyT;
+ {
+ using V = std::variant<int, MET, std::string>;
+ V v1(std::in_place_type<int>);
+ V v2(std::in_place_type<MET>);
+ try {
+ v1 = std::move(v2);
+ assert(false);
+ } catch (...) {
+ }
+ assert(v1.valueless_by_exception());
+ assert(v1.index() == std::variant_npos);
+ }
+ {
+ using V = std::variant<int, MET, std::string>;
+ V v1(std::in_place_type<MET>);
+ V v2(std::in_place_type<std::string>, "hello");
+ V &vref = (v1 = std::move(v2));
+ assert(&vref == &v1);
+ assert(v1.index() == 2);
+ assert(std::get<2>(v1) == "hello");
+ }
+#endif
+}
+
+int main() {
+ test_move_assignment_empty_empty();
+ test_move_assignment_non_empty_empty();
+ test_move_assignment_empty_non_empty();
+ test_move_assignment_same_index();
+ test_move_assignment_different_index();
+ test_move_assignment_sfinae();
+ test_move_assignment_noexcept();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
new file mode 100644
index 000000000000..d33ea0bd3f4e
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
@@ -0,0 +1,112 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// template <class T> constexpr variant(T&&) noexcept(see below);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "test_convertible.hpp"
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+struct Dummy {
+ Dummy() = default;
+};
+
+struct ThrowsT {
+ ThrowsT(int) noexcept(false) {}
+};
+
+struct NoThrowT {
+ NoThrowT(int) noexcept(true) {}
+};
+
+void test_T_ctor_noexcept() {
+ {
+ using V = std::variant<Dummy, NoThrowT>;
+ static_assert(std::is_nothrow_constructible<V, int>::value, "");
+ }
+ {
+ using V = std::variant<Dummy, ThrowsT>;
+ static_assert(!std::is_nothrow_constructible<V, int>::value, "");
+ }
+}
+
+void test_T_ctor_sfinae() {
+ {
+ using V = std::variant<long, unsigned>;
+ static_assert(!std::is_constructible<V, int>::value, "ambiguous");
+ }
+ {
+ using V = std::variant<std::string, std::string>;
+ static_assert(!std::is_constructible<V, const char *>::value, "ambiguous");
+ }
+ {
+ using V = std::variant<std::string, void *>;
+ static_assert(!std::is_constructible<V, int>::value,
+ "no matching constructor");
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int, int &&>;
+ static_assert(!std::is_constructible<V, int>::value, "ambiguous");
+ }
+ {
+ using V = std::variant<int, const int &>;
+ static_assert(!std::is_constructible<V, int>::value, "ambiguous");
+ }
+#endif
+}
+
+void test_T_ctor_basic() {
+ {
+ constexpr std::variant<int> v(42);
+ static_assert(v.index() == 0, "");
+ static_assert(std::get<0>(v) == 42, "");
+ }
+ {
+ constexpr std::variant<int, long> v(42l);
+ static_assert(v.index() == 1, "");
+ static_assert(std::get<1>(v) == 42, "");
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<const int &, int &&, long>;
+ static_assert(std::is_convertible<int &, V>::value, "must be implicit");
+ int x = 42;
+ V v(x);
+ assert(v.index() == 0);
+ assert(&std::get<0>(v) == &x);
+ }
+ {
+ using V = std::variant<const int &, int &&, long>;
+ static_assert(std::is_convertible<int, V>::value, "must be implicit");
+ int x = 42;
+ V v(std::move(x));
+ assert(v.index() == 1);
+ assert(&std::get<1>(v) == &x);
+ }
+#endif
+}
+
+int main() {
+ test_T_ctor_basic();
+ test_T_ctor_noexcept();
+ test_T_ctor_sfinae();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
new file mode 100644
index 000000000000..18216c6da923
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
@@ -0,0 +1,159 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant(variant const&);
+
+#include <cassert>
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NonT {
+ NonT(int v) : value(v) {}
+ NonT(const NonT &o) : value(o.value) {}
+ int value;
+};
+static_assert(!std::is_trivially_copy_constructible<NonT>::value, "");
+
+struct NoCopy {
+ NoCopy(const NoCopy &) = delete;
+};
+
+struct MoveOnly {
+ MoveOnly(const MoveOnly &) = delete;
+ MoveOnly(MoveOnly &&) = default;
+};
+
+struct MoveOnlyNT {
+ MoveOnlyNT(const MoveOnlyNT &) = delete;
+ MoveOnlyNT(MoveOnlyNT &&) {}
+};
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+struct MakeEmptyT {
+ static int alive;
+ MakeEmptyT() { ++alive; }
+ MakeEmptyT(const MakeEmptyT &) {
+ ++alive;
+ // Don't throw from the copy constructor since variant's assignment
+ // operator performs a copy before committing to the assignment.
+ }
+ MakeEmptyT(MakeEmptyT &&) { throw 42; }
+ MakeEmptyT &operator=(const MakeEmptyT &) { throw 42; }
+ MakeEmptyT &operator=(MakeEmptyT &&) { throw 42; }
+ ~MakeEmptyT() { --alive; }
+};
+
+int MakeEmptyT::alive = 0;
+
+template <class Variant> void makeEmpty(Variant &v) {
+ Variant v2(std::in_place_type<MakeEmptyT>);
+ try {
+ v = v2;
+ assert(false);
+ } catch (...) {
+ assert(v.valueless_by_exception());
+ }
+}
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+void test_copy_ctor_sfinae() {
+ {
+ using V = std::variant<int, long>;
+ static_assert(std::is_copy_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, NoCopy>;
+ static_assert(!std::is_copy_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnly>;
+ static_assert(!std::is_copy_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnlyNT>;
+ static_assert(!std::is_copy_constructible<V>::value, "");
+ }
+}
+
+void test_copy_ctor_basic() {
+ {
+ std::variant<int> v(std::in_place_index<0>, 42);
+ std::variant<int> v2 = v;
+ assert(v2.index() == 0);
+ assert(std::get<0>(v2) == 42);
+ }
+ {
+ std::variant<int, long> v(std::in_place_index<1>, 42);
+ std::variant<int, long> v2 = v;
+ assert(v2.index() == 1);
+ assert(std::get<1>(v2) == 42);
+ }
+ {
+ std::variant<NonT> v(std::in_place_index<0>, 42);
+ assert(v.index() == 0);
+ std::variant<NonT> v2(v);
+ assert(v2.index() == 0);
+ assert(std::get<0>(v2).value == 42);
+ }
+ {
+ std::variant<int, NonT> v(std::in_place_index<1>, 42);
+ assert(v.index() == 1);
+ std::variant<int, NonT> v2(v);
+ assert(v2.index() == 1);
+ assert(std::get<1>(v2).value == 42);
+ }
+}
+
+void test_copy_ctor_valueless_by_exception() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using V = std::variant<int, MakeEmptyT>;
+ V v1;
+ makeEmpty(v1);
+ const V &cv1 = v1;
+ V v(cv1);
+ assert(v.valueless_by_exception());
+#endif
+}
+
+template <size_t Idx>
+constexpr bool test_constexpr_copy_ctor_extension_imp(
+ std::variant<long, void*, const int> const& v)
+{
+ auto v2 = v;
+ return v2.index() == v.index() &&
+ v2.index() == Idx &&
+ std::get<Idx>(v2) == std::get<Idx>(v);
+}
+
+void test_constexpr_copy_ctor_extension() {
+#ifdef _LIBCPP_VERSION
+ using V = std::variant<long, void*, const int>;
+ static_assert(std::is_trivially_copyable<V>::value, "");
+ static_assert(std::is_trivially_copy_constructible<V>::value, "");
+ static_assert(test_constexpr_copy_ctor_extension_imp<0>(V(42l)), "");
+ static_assert(test_constexpr_copy_ctor_extension_imp<1>(V(nullptr)), "");
+ static_assert(test_constexpr_copy_ctor_extension_imp<2>(V(101)), "");
+#endif
+}
+
+int main() {
+ test_copy_ctor_basic();
+ test_copy_ctor_valueless_by_exception();
+ test_copy_ctor_sfinae();
+ test_constexpr_copy_ctor_extension();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp
new file mode 100644
index 000000000000..a4a86ff6c1ca
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp
@@ -0,0 +1,112 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// constexpr variant() noexcept(see below);
+
+#include <cassert>
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+struct NonDefaultConstructible {
+ NonDefaultConstructible(int) {}
+};
+
+struct NotNoexcept {
+ NotNoexcept() noexcept(false) {}
+};
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+struct DefaultCtorThrows {
+ DefaultCtorThrows() { throw 42; }
+};
+#endif
+
+void test_default_ctor_sfinae() {
+ {
+ using V = std::variant<std::monostate, int>;
+ static_assert(std::is_default_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<NonDefaultConstructible, int>;
+ static_assert(!std::is_default_constructible<V>::value, "");
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int &, int>;
+ static_assert(!std::is_default_constructible<V>::value, "");
+ }
+#endif
+}
+
+void test_default_ctor_noexcept() {
+ {
+ using V = std::variant<int>;
+ static_assert(std::is_nothrow_default_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<NotNoexcept>;
+ static_assert(!std::is_nothrow_default_constructible<V>::value, "");
+ }
+}
+
+void test_default_ctor_throws() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using V = std::variant<DefaultCtorThrows, int>;
+ try {
+ V v;
+ assert(false);
+ } catch (const int &ex) {
+ assert(ex == 42);
+ } catch (...) {
+ assert(false);
+ }
+#endif
+}
+
+void test_default_ctor_basic() {
+ {
+ std::variant<int> v;
+ assert(v.index() == 0);
+ assert(std::get<0>(v) == 0);
+ }
+ {
+ std::variant<int, long> v;
+ assert(v.index() == 0);
+ assert(std::get<0>(v) == 0);
+ }
+ {
+ using V = std::variant<int, long>;
+ constexpr V v;
+ static_assert(v.index() == 0, "");
+ static_assert(std::get<0>(v) == 0, "");
+ }
+ {
+ using V = std::variant<int, long>;
+ constexpr V v;
+ static_assert(v.index() == 0, "");
+ static_assert(std::get<0>(v) == 0, "");
+ }
+}
+
+int main() {
+ test_default_ctor_basic();
+ test_default_ctor_sfinae();
+ test_default_ctor_noexcept();
+ test_default_ctor_throws();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp
new file mode 100644
index 000000000000..18115722f8d1
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// template <size_t I, class ...Args>
+// constexpr explicit variant(in_place_index_t<I>, Args&&...);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "test_convertible.hpp"
+#include "test_macros.h"
+
+void test_ctor_sfinae() {
+ {
+ using V = std::variant<int>;
+ static_assert(
+ std::is_constructible<V, std::in_place_index_t<0>, int>::value, "");
+ static_assert(!test_convertible<V, std::in_place_index_t<0>, int>(), "");
+ }
+ {
+ using V = std::variant<int, long, long long>;
+ static_assert(
+ std::is_constructible<V, std::in_place_index_t<1>, int>::value, "");
+ static_assert(!test_convertible<V, std::in_place_index_t<1>, int>(), "");
+ }
+ {
+ using V = std::variant<int, long, int *>;
+ static_assert(
+ std::is_constructible<V, std::in_place_index_t<2>, int *>::value, "");
+ static_assert(!test_convertible<V, std::in_place_index_t<2>, int *>(), "");
+ }
+ { // args not convertible to type
+ using V = std::variant<int, long, int *>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_index_t<0>, int *>::value, "");
+ static_assert(!test_convertible<V, std::in_place_index_t<0>, int *>(), "");
+ }
+ { // index not in variant
+ using V = std::variant<int, long, int *>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_index_t<3>, int>::value, "");
+ static_assert(!test_convertible<V, std::in_place_index_t<3>, int>(), "");
+ }
+}
+
+void test_ctor_basic() {
+ {
+ constexpr std::variant<int> v(std::in_place_index<0>, 42);
+ static_assert(v.index() == 0, "");
+ static_assert(std::get<0>(v) == 42, "");
+ }
+ {
+ constexpr std::variant<int, long, long> v(std::in_place_index<1>, 42);
+ static_assert(v.index() == 1, "");
+ static_assert(std::get<1>(v) == 42, "");
+ }
+ {
+ constexpr std::variant<int, const int, long> v(std::in_place_index<1>, 42);
+ static_assert(v.index() == 1, "");
+ static_assert(std::get<1>(v) == 42, "");
+ }
+ {
+ using V = std::variant<const int, volatile int, int>;
+ int x = 42;
+ V v(std::in_place_index<0>, x);
+ assert(v.index() == 0);
+ assert(std::get<0>(v) == x);
+ }
+ {
+ using V = std::variant<const int, volatile int, int>;
+ int x = 42;
+ V v(std::in_place_index<1>, x);
+ assert(v.index() == 1);
+ assert(std::get<1>(v) == x);
+ }
+ {
+ using V = std::variant<const int, volatile int, int>;
+ int x = 42;
+ V v(std::in_place_index<2>, x);
+ assert(v.index() == 2);
+ assert(std::get<2>(v) == x);
+ }
+}
+
+int main() {
+ test_ctor_basic();
+ test_ctor_sfinae();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp
new file mode 100644
index 000000000000..608cdf9d6efb
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// template <size_t I, class Up, class ...Args>
+// constexpr explicit
+// variant(in_place_index_t<I>, initializer_list<Up>, Args&&...);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "test_convertible.hpp"
+#include "test_macros.h"
+
+struct InitList {
+ std::size_t size;
+ constexpr InitList(std::initializer_list<int> il) : size(il.size()) {}
+};
+
+struct InitListArg {
+ std::size_t size;
+ int value;
+ constexpr InitListArg(std::initializer_list<int> il, int v)
+ : size(il.size()), value(v) {}
+};
+
+void test_ctor_sfinae() {
+ using IL = std::initializer_list<int>;
+ { // just init list
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(std::is_constructible<V, std::in_place_index_t<0>, IL>::value,
+ "");
+ static_assert(!test_convertible<V, std::in_place_index_t<0>, IL>(), "");
+ }
+ { // too many arguments
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_index_t<0>, IL, int>::value,
+ "");
+ static_assert(!test_convertible<V, std::in_place_index_t<0>, IL, int>(),
+ "");
+ }
+ { // too few arguments
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_index_t<1>, IL>::value, "");
+ static_assert(!test_convertible<V, std::in_place_index_t<1>, IL>(), "");
+ }
+ { // init list and arguments
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(
+ std::is_constructible<V, std::in_place_index_t<1>, IL, int>::value, "");
+ static_assert(!test_convertible<V, std::in_place_index_t<1>, IL, int>(),
+ "");
+ }
+ { // not constructible from arguments
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_index_t<2>, IL>::value, "");
+ static_assert(!test_convertible<V, std::in_place_index_t<2>, IL>(), "");
+ }
+}
+
+void test_ctor_basic() {
+ {
+ constexpr std::variant<InitList, InitListArg, InitList> v(
+ std::in_place_index<0>, {1, 2, 3});
+ static_assert(v.index() == 0, "");
+ static_assert(std::get<0>(v).size == 3, "");
+ }
+ {
+ constexpr std::variant<InitList, InitListArg, InitList> v(
+ std::in_place_index<2>, {1, 2, 3});
+ static_assert(v.index() == 2, "");
+ static_assert(std::get<2>(v).size == 3, "");
+ }
+ {
+ constexpr std::variant<InitList, InitListArg, InitListArg> v(
+ std::in_place_index<1>, {1, 2, 3, 4}, 42);
+ static_assert(v.index() == 1, "");
+ static_assert(std::get<1>(v).size == 4, "");
+ static_assert(std::get<1>(v).value == 42, "");
+ }
+}
+
+int main() {
+ test_ctor_basic();
+ test_ctor_sfinae();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp
new file mode 100644
index 000000000000..a023f02bad6e
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// template <class Tp, class ...Args>
+// constexpr explicit variant(in_place_type_t<Tp>, Args&&...);
+
+#include <cassert>
+#include <type_traits>
+#include <variant>
+
+#include "test_convertible.hpp"
+#include "test_macros.h"
+
+void test_ctor_sfinae() {
+ {
+ using V = std::variant<int>;
+ static_assert(
+ std::is_constructible<V, std::in_place_type_t<int>, int>::value, "");
+ static_assert(!test_convertible<V, std::in_place_type_t<int>, int>(), "");
+ }
+ {
+ using V = std::variant<int, long, long long>;
+ static_assert(
+ std::is_constructible<V, std::in_place_type_t<long>, int>::value, "");
+ static_assert(!test_convertible<V, std::in_place_type_t<long>, int>(), "");
+ }
+ {
+ using V = std::variant<int, long, int *>;
+ static_assert(
+ std::is_constructible<V, std::in_place_type_t<int *>, int *>::value,
+ "");
+ static_assert(!test_convertible<V, std::in_place_type_t<int *>, int *>(),
+ "");
+ }
+ { // duplicate type
+ using V = std::variant<int, long, int>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_type_t<int>, int>::value, "");
+ static_assert(!test_convertible<V, std::in_place_type_t<int>, int>(), "");
+ }
+ { // args not convertible to type
+ using V = std::variant<int, long, int *>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_type_t<int>, int *>::value, "");
+ static_assert(!test_convertible<V, std::in_place_type_t<int>, int *>(), "");
+ }
+ { // type not in variant
+ using V = std::variant<int, long, int *>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_type_t<long long>, int>::value,
+ "");
+ static_assert(!test_convertible<V, std::in_place_type_t<long long>, int>(),
+ "");
+ }
+}
+
+void test_ctor_basic() {
+ {
+ constexpr std::variant<int> v(std::in_place_type<int>, 42);
+ static_assert(v.index() == 0, "");
+ static_assert(std::get<0>(v) == 42, "");
+ }
+ {
+ constexpr std::variant<int, long> v(std::in_place_type<long>, 42);
+ static_assert(v.index() == 1, "");
+ static_assert(std::get<1>(v) == 42, "");
+ }
+ {
+ constexpr std::variant<int, const int, long> v(
+ std::in_place_type<const int>, 42);
+ static_assert(v.index() == 1, "");
+ static_assert(std::get<1>(v) == 42, "");
+ }
+ {
+ using V = std::variant<const int, volatile int, int>;
+ int x = 42;
+ V v(std::in_place_type<const int>, x);
+ assert(v.index() == 0);
+ assert(std::get<0>(v) == x);
+ }
+ {
+ using V = std::variant<const int, volatile int, int>;
+ int x = 42;
+ V v(std::in_place_type<volatile int>, x);
+ assert(v.index() == 1);
+ assert(std::get<1>(v) == x);
+ }
+ {
+ using V = std::variant<const int, volatile int, int>;
+ int x = 42;
+ V v(std::in_place_type<int>, x);
+ assert(v.index() == 2);
+ assert(std::get<2>(v) == x);
+ }
+}
+
+int main() {
+ test_ctor_basic();
+ test_ctor_sfinae();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_init_list_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_init_list_args.pass.cpp
new file mode 100644
index 000000000000..e151572c4666
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_init_list_args.pass.cpp
@@ -0,0 +1,110 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// template <class Tp, class Up, class ...Args>
+// constexpr explicit
+// variant(in_place_type_t<Tp>, initializer_list<Up>, Args&&...);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "test_convertible.hpp"
+#include "test_macros.h"
+
+struct InitList {
+ std::size_t size;
+ constexpr InitList(std::initializer_list<int> il) : size(il.size()) {}
+};
+
+struct InitListArg {
+ std::size_t size;
+ int value;
+ constexpr InitListArg(std::initializer_list<int> il, int v)
+ : size(il.size()), value(v) {}
+};
+
+void test_ctor_sfinae() {
+ using IL = std::initializer_list<int>;
+ { // just init list
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(
+ std::is_constructible<V, std::in_place_type_t<InitList>, IL>::value,
+ "");
+ static_assert(!test_convertible<V, std::in_place_type_t<InitList>, IL>(),
+ "");
+ }
+ { // too many arguments
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(!std::is_constructible<V, std::in_place_type_t<InitList>, IL,
+ int>::value,
+ "");
+ static_assert(
+ !test_convertible<V, std::in_place_type_t<InitList>, IL, int>(), "");
+ }
+ { // too few arguments
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_type_t<InitListArg>, IL>::value,
+ "");
+ static_assert(!test_convertible<V, std::in_place_type_t<InitListArg>, IL>(),
+ "");
+ }
+ { // init list and arguments
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(std::is_constructible<V, std::in_place_type_t<InitListArg>,
+ IL, int>::value,
+ "");
+ static_assert(
+ !test_convertible<V, std::in_place_type_t<InitListArg>, IL, int>(), "");
+ }
+ { // not constructible from arguments
+ using V = std::variant<InitList, InitListArg, int>;
+ static_assert(
+ !std::is_constructible<V, std::in_place_type_t<int>, IL>::value, "");
+ static_assert(!test_convertible<V, std::in_place_type_t<int>, IL>(), "");
+ }
+ { // duplicate types in variant
+ using V = std::variant<InitListArg, InitListArg, int>;
+ static_assert(!std::is_constructible<V, std::in_place_type_t<InitListArg>,
+ IL, int>::value,
+ "");
+ static_assert(
+ !test_convertible<V, std::in_place_type_t<InitListArg>, IL, int>(), "");
+ }
+}
+
+void test_ctor_basic() {
+ {
+ constexpr std::variant<InitList, InitListArg> v(
+ std::in_place_type<InitList>, {1, 2, 3});
+ static_assert(v.index() == 0, "");
+ static_assert(std::get<0>(v).size == 3, "");
+ }
+ {
+ constexpr std::variant<InitList, InitListArg> v(
+ std::in_place_type<InitListArg>, {1, 2, 3, 4}, 42);
+ static_assert(v.index() == 1, "");
+ static_assert(std::get<1>(v).size == 4, "");
+ static_assert(std::get<1>(v).value == 42, "");
+ }
+}
+
+int main() {
+ test_ctor_basic();
+ test_ctor_sfinae();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
new file mode 100644
index 000000000000..66f67fe8d3f2
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
@@ -0,0 +1,197 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant(variant&&) noexcept(see below);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct ThrowsMove {
+ ThrowsMove(ThrowsMove &&) noexcept(false) {}
+};
+
+struct NoCopy {
+ NoCopy(const NoCopy &) = delete;
+};
+
+struct MoveOnly {
+ int value;
+ MoveOnly(int v) : value(v) {}
+ MoveOnly(const MoveOnly &) = delete;
+ MoveOnly(MoveOnly &&) = default;
+};
+
+struct MoveOnlyNT {
+ int value;
+ MoveOnlyNT(int v) : value(v) {}
+ MoveOnlyNT(const MoveOnlyNT &) = delete;
+ MoveOnlyNT(MoveOnlyNT &&other) : value(other.value) { other.value = -1; }
+};
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+struct MakeEmptyT {
+ static int alive;
+ MakeEmptyT() { ++alive; }
+ MakeEmptyT(const MakeEmptyT &) {
+ ++alive;
+ // Don't throw from the copy constructor since variant's assignment
+ // operator performs a copy before committing to the assignment.
+ }
+ MakeEmptyT(MakeEmptyT &&) { throw 42; }
+ MakeEmptyT &operator=(const MakeEmptyT &) { throw 42; }
+ MakeEmptyT &operator=(MakeEmptyT &&) { throw 42; }
+ ~MakeEmptyT() { --alive; }
+};
+
+int MakeEmptyT::alive = 0;
+
+template <class Variant> void makeEmpty(Variant &v) {
+ Variant v2(std::in_place_type<MakeEmptyT>);
+ try {
+ v = v2;
+ assert(false);
+ } catch (...) {
+ assert(v.valueless_by_exception());
+ }
+}
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+void test_move_noexcept() {
+ {
+ using V = std::variant<int, long>;
+ static_assert(std::is_nothrow_move_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnly>;
+ static_assert(std::is_nothrow_move_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnlyNT>;
+ static_assert(!std::is_nothrow_move_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, ThrowsMove>;
+ static_assert(!std::is_nothrow_move_constructible<V>::value, "");
+ }
+}
+
+void test_move_ctor_sfinae() {
+ {
+ using V = std::variant<int, long>;
+ static_assert(std::is_move_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnly>;
+ static_assert(std::is_move_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, MoveOnlyNT>;
+ static_assert(std::is_move_constructible<V>::value, "");
+ }
+ {
+ using V = std::variant<int, NoCopy>;
+ static_assert(!std::is_move_constructible<V>::value, "");
+ }
+}
+
+void test_move_ctor_basic() {
+ {
+ std::variant<int> v(std::in_place_index<0>, 42);
+ std::variant<int> v2 = std::move(v);
+ assert(v2.index() == 0);
+ assert(std::get<0>(v2) == 42);
+ }
+ {
+ std::variant<int, long> v(std::in_place_index<1>, 42);
+ std::variant<int, long> v2 = std::move(v);
+ assert(v2.index() == 1);
+ assert(std::get<1>(v2) == 42);
+ }
+ {
+ std::variant<MoveOnly> v(std::in_place_index<0>, 42);
+ assert(v.index() == 0);
+ std::variant<MoveOnly> v2(std::move(v));
+ assert(v2.index() == 0);
+ assert(std::get<0>(v2).value == 42);
+ }
+ {
+ std::variant<int, MoveOnly> v(std::in_place_index<1>, 42);
+ assert(v.index() == 1);
+ std::variant<int, MoveOnly> v2(std::move(v));
+ assert(v2.index() == 1);
+ assert(std::get<1>(v2).value == 42);
+ }
+ {
+ std::variant<MoveOnlyNT> v(std::in_place_index<0>, 42);
+ assert(v.index() == 0);
+ std::variant<MoveOnlyNT> v2(std::move(v));
+ assert(v2.index() == 0);
+ assert(std::get<0>(v).value == -1);
+ assert(std::get<0>(v2).value == 42);
+ }
+ {
+ std::variant<int, MoveOnlyNT> v(std::in_place_index<1>, 42);
+ assert(v.index() == 1);
+ std::variant<int, MoveOnlyNT> v2(std::move(v));
+ assert(v2.index() == 1);
+ assert(std::get<1>(v).value == -1);
+ assert(std::get<1>(v2).value == 42);
+ }
+}
+
+void test_move_ctor_valueless_by_exception() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using V = std::variant<int, MakeEmptyT>;
+ V v1;
+ makeEmpty(v1);
+ V v(std::move(v1));
+ assert(v.valueless_by_exception());
+#endif
+}
+
+template <size_t Idx>
+constexpr bool test_constexpr_ctor_extension_imp(
+ std::variant<long, void*, const int> const& v)
+{
+ auto copy = v;
+ auto v2 = std::move(copy);
+ return v2.index() == v.index() &&
+ v2.index() == Idx &&
+ std::get<Idx>(v2) == std::get<Idx>(v);
+}
+
+void test_constexpr_move_ctor_extension() {
+#ifdef _LIBCPP_VERSION
+ using V = std::variant<long, void*, const int>;
+ static_assert(std::is_trivially_copyable<V>::value, "");
+ static_assert(std::is_trivially_move_constructible<V>::value, "");
+ static_assert(test_constexpr_ctor_extension_imp<0>(V(42l)), "");
+ static_assert(test_constexpr_ctor_extension_imp<1>(V(nullptr)), "");
+ static_assert(test_constexpr_ctor_extension_imp<2>(V(101)), "");
+#endif
+}
+
+int main() {
+ test_move_ctor_basic();
+ test_move_ctor_valueless_by_exception();
+ test_move_noexcept();
+ test_move_ctor_sfinae();
+ test_constexpr_move_ctor_extension();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp b/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp
new file mode 100644
index 000000000000..7299394ee7bb
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// ~variant();
+
+#include <cassert>
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NonTDtor {
+ static int count;
+ NonTDtor() = default;
+ ~NonTDtor() { ++count; }
+};
+int NonTDtor::count = 0;
+static_assert(!std::is_trivially_destructible<NonTDtor>::value, "");
+
+struct NonTDtor1 {
+ static int count;
+ NonTDtor1() = default;
+ ~NonTDtor1() { ++count; }
+};
+int NonTDtor1::count = 0;
+static_assert(!std::is_trivially_destructible<NonTDtor1>::value, "");
+
+struct TDtor {
+ TDtor(const TDtor &) {} // non-trivial copy
+ ~TDtor() = default;
+};
+static_assert(!std::is_trivially_copy_constructible<TDtor>::value, "");
+static_assert(std::is_trivially_destructible<TDtor>::value, "");
+
+int main() {
+ {
+ using V = std::variant<int, long, TDtor>;
+ static_assert(std::is_trivially_destructible<V>::value, "");
+ }
+ {
+ using V = std::variant<NonTDtor, int, NonTDtor1>;
+ static_assert(!std::is_trivially_destructible<V>::value, "");
+ {
+ V v(std::in_place_index<0>);
+ assert(NonTDtor::count == 0);
+ assert(NonTDtor1::count == 0);
+ }
+ assert(NonTDtor::count == 1);
+ assert(NonTDtor1::count == 0);
+ NonTDtor::count = 0;
+ { V v(std::in_place_index<1>); }
+ assert(NonTDtor::count == 0);
+ assert(NonTDtor1::count == 0);
+ {
+ V v(std::in_place_index<2>);
+ assert(NonTDtor::count == 0);
+ assert(NonTDtor1::count == 0);
+ }
+ assert(NonTDtor::count == 0);
+ assert(NonTDtor1::count == 1);
+ }
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
new file mode 100644
index 000000000000..8f694cfd5eda
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
@@ -0,0 +1,137 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// template <size_t I, class ...Args> void emplace(Args&&... args);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "archetypes.hpp"
+#include "test_convertible.hpp"
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+template <class Var, size_t I, class... Args>
+constexpr auto test_emplace_exists_imp(int) -> decltype(
+ std::declval<Var>().template emplace<I>(std::declval<Args>()...), true) {
+ return true;
+}
+
+template <class, size_t, class...>
+constexpr auto test_emplace_exists_imp(long) -> bool {
+ return false;
+}
+
+template <class Var, size_t I, class... Args> constexpr bool emplace_exists() {
+ return test_emplace_exists_imp<Var, I, Args...>(0);
+}
+
+void test_emplace_sfinae() {
+ {
+ using V = std::variant<int, void *, const void *, TestTypes::NoCtors>;
+ static_assert(emplace_exists<V, 0>(), "");
+ static_assert(emplace_exists<V, 0, int>(), "");
+ static_assert(!emplace_exists<V, 0, decltype(nullptr)>(),
+ "cannot construct");
+ static_assert(emplace_exists<V, 1, decltype(nullptr)>(), "");
+ static_assert(emplace_exists<V, 1, int *>(), "");
+ static_assert(!emplace_exists<V, 1, const int *>(), "");
+ static_assert(!emplace_exists<V, 1, int>(), "cannot construct");
+ static_assert(emplace_exists<V, 2, const int *>(), "");
+ static_assert(emplace_exists<V, 2, int *>(), "");
+ static_assert(!emplace_exists<V, 3>(), "cannot construct");
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int, int &, const int &, int &&, TestTypes::NoCtors>;
+ static_assert(emplace_exists<V, 0>(), "");
+ static_assert(emplace_exists<V, 0, int>(), "");
+ static_assert(emplace_exists<V, 0, long long>(), "");
+ static_assert(!emplace_exists<V, 0, int, int>(), "too many args");
+ static_assert(emplace_exists<V, 1, int &>(), "");
+ static_assert(!emplace_exists<V, 1>(), "cannot default construct ref");
+ static_assert(!emplace_exists<V, 1, const int &>(), "cannot bind ref");
+ static_assert(!emplace_exists<V, 1, int &&>(), "cannot bind ref");
+ static_assert(emplace_exists<V, 2, int &>(), "");
+ static_assert(emplace_exists<V, 2, const int &>(), "");
+ static_assert(emplace_exists<V, 2, int &&>(), "");
+ static_assert(!emplace_exists<V, 2, void *>(),
+ "not constructible from void*");
+ static_assert(emplace_exists<V, 3, int>(), "");
+ static_assert(!emplace_exists<V, 3, int &>(), "cannot bind ref");
+ static_assert(!emplace_exists<V, 3, const int &>(), "cannot bind ref");
+ static_assert(!emplace_exists<V, 3, const int &&>(), "cannot bind ref");
+ static_assert(!emplace_exists<V, 4>(), "no ctors");
+ }
+#endif
+}
+
+void test_basic() {
+ {
+ using V = std::variant<int>;
+ V v(42);
+ v.emplace<0>();
+ assert(std::get<0>(v) == 0);
+ v.emplace<0>(42);
+ assert(std::get<0>(v) == 42);
+ }
+ {
+ using V =
+ std::variant<int, long, const void *, TestTypes::NoCtors, std::string>;
+ const int x = 100;
+ V v(std::in_place_index<0>, -1);
+ // default emplace a value
+ v.emplace<1>();
+ assert(std::get<1>(v) == 0);
+ v.emplace<2>(&x);
+ assert(std::get<2>(v) == &x);
+ // emplace with multiple args
+ v.emplace<4>(3, 'a');
+ assert(std::get<4>(v) == "aaa");
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int, long, const int &, int &&, TestTypes::NoCtors,
+ std::string>;
+ const int x = 100;
+ int y = 42;
+ int z = 43;
+ V v(std::in_place_index<0>, -1);
+ // default emplace a value
+ v.emplace<1>();
+ assert(std::get<1>(v) == 0);
+ // emplace a reference
+ v.emplace<2>(x);
+ assert(&std::get<2>(v) == &x);
+ // emplace an rvalue reference
+ v.emplace<3>(std::move(y));
+ assert(&std::get<3>(v) == &y);
+ // re-emplace a new reference over the active member
+ v.emplace<3>(std::move(z));
+ assert(&std::get<3>(v) == &z);
+ // emplace with multiple args
+ v.emplace<5>(3, 'a');
+ assert(std::get<5>(v) == "aaa");
+ }
+#endif
+}
+
+int main() {
+ test_basic();
+ test_emplace_sfinae();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
new file mode 100644
index 000000000000..f466b160cb4f
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// template <size_t I, class U, class ...Args>
+// void emplace(initializer_list<U> il,Args&&... args);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "archetypes.hpp"
+#include "test_convertible.hpp"
+#include "test_macros.h"
+
+struct InitList {
+ std::size_t size;
+ constexpr InitList(std::initializer_list<int> il) : size(il.size()) {}
+};
+
+struct InitListArg {
+ std::size_t size;
+ int value;
+ constexpr InitListArg(std::initializer_list<int> il, int v)
+ : size(il.size()), value(v) {}
+};
+
+template <class Var, size_t I, class... Args>
+constexpr auto test_emplace_exists_imp(int) -> decltype(
+ std::declval<Var>().template emplace<I>(std::declval<Args>()...), true) {
+ return true;
+}
+
+template <class, size_t, class...>
+constexpr auto test_emplace_exists_imp(long) -> bool {
+ return false;
+}
+
+template <class Var, size_t I, class... Args> constexpr bool emplace_exists() {
+ return test_emplace_exists_imp<Var, I, Args...>(0);
+}
+
+void test_emplace_sfinae() {
+ using V =
+ std::variant<int, TestTypes::NoCtors, InitList, InitListArg, long, long>;
+ using IL = std::initializer_list<int>;
+ static_assert(!emplace_exists<V, 1, IL>(), "no such constructor");
+ static_assert(emplace_exists<V, 2, IL>(), "");
+ static_assert(!emplace_exists<V, 2, int>(), "args don't match");
+ static_assert(!emplace_exists<V, 2, IL, int>(), "too many args");
+ static_assert(emplace_exists<V, 3, IL, int>(), "");
+ static_assert(!emplace_exists<V, 3, int>(), "args don't match");
+ static_assert(!emplace_exists<V, 3, IL>(), "too few args");
+ static_assert(!emplace_exists<V, 3, IL, int, int>(), "too many args");
+}
+
+void test_basic() {
+ using V = std::variant<int, InitList, InitListArg, TestTypes::NoCtors>;
+ V v;
+ v.emplace<1>({1, 2, 3});
+ assert(std::get<1>(v).size == 3);
+ v.emplace<2>({1, 2, 3, 4}, 42);
+ assert(std::get<2>(v).size == 4);
+ assert(std::get<2>(v).value == 42);
+ v.emplace<1>({1});
+ assert(std::get<1>(v).size == 1);
+}
+
+int main() {
+ test_basic();
+ test_emplace_sfinae();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp
new file mode 100644
index 000000000000..4ca2cc4803e3
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp
@@ -0,0 +1,138 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// template <class T, class ...Args> void emplace(Args&&... args);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "archetypes.hpp"
+#include "test_convertible.hpp"
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+template <class Var, class T, class... Args>
+constexpr auto test_emplace_exists_imp(int) -> decltype(
+ std::declval<Var>().template emplace<T>(std::declval<Args>()...), true) {
+ return true;
+}
+
+template <class, class, class...>
+constexpr auto test_emplace_exists_imp(long) -> bool {
+ return false;
+}
+
+template <class... Args> constexpr bool emplace_exists() {
+ return test_emplace_exists_imp<Args...>(0);
+}
+
+void test_emplace_sfinae() {
+ {
+ using V = std::variant<int, void *, const void *, TestTypes::NoCtors>;
+ static_assert(emplace_exists<V, int>(), "");
+ static_assert(emplace_exists<V, int, int>(), "");
+ static_assert(!emplace_exists<V, int, decltype(nullptr)>(),
+ "cannot construct");
+ static_assert(emplace_exists<V, void *, decltype(nullptr)>(), "");
+ static_assert(!emplace_exists<V, void *, int>(), "cannot construct");
+ static_assert(emplace_exists<V, void *, int *>(), "");
+ static_assert(!emplace_exists<V, void *, const int *>(), "");
+ static_assert(emplace_exists<V, const void *, const int *>(), "");
+ static_assert(emplace_exists<V, const void *, int *>(), "");
+ static_assert(!emplace_exists<V, TestTypes::NoCtors>(), "cannot construct");
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ using V = std::variant<int, int &, const int &, int &&, long, long,
+ TestTypes::NoCtors>;
+ static_assert(emplace_exists<V, int>(), "");
+ static_assert(emplace_exists<V, int, int>(), "");
+ static_assert(emplace_exists<V, int, long long>(), "");
+ static_assert(!emplace_exists<V, int, int, int>(), "too many args");
+ static_assert(emplace_exists<V, int &, int &>(), "");
+ static_assert(!emplace_exists<V, int &>(), "cannot default construct ref");
+ static_assert(!emplace_exists<V, int &, const int &>(), "cannot bind ref");
+ static_assert(!emplace_exists<V, int &, int &&>(), "cannot bind ref");
+ static_assert(emplace_exists<V, const int &, int &>(), "");
+ static_assert(emplace_exists<V, const int &, const int &>(), "");
+ static_assert(emplace_exists<V, const int &, int &&>(), "");
+ static_assert(!emplace_exists<V, const int &, void *>(),
+ "not constructible from void*");
+ static_assert(emplace_exists<V, int &&, int>(), "");
+ static_assert(!emplace_exists<V, int &&, int &>(), "cannot bind ref");
+ static_assert(!emplace_exists<V, int &&, const int &>(), "cannot bind ref");
+ static_assert(!emplace_exists<V, int &&, const int &&>(), "cannot bind ref");
+ static_assert(!emplace_exists<V, long, long>(), "ambiguous");
+ static_assert(!emplace_exists<V, TestTypes::NoCtors>(),
+ "cannot construct void");
+#endif
+}
+
+void test_basic() {
+ {
+ using V = std::variant<int>;
+ V v(42);
+ v.emplace<int>();
+ assert(std::get<0>(v) == 0);
+ v.emplace<int>(42);
+ assert(std::get<0>(v) == 42);
+ }
+ {
+ using V =
+ std::variant<int, long, const void *, TestTypes::NoCtors, std::string>;
+ const int x = 100;
+ V v(std::in_place_type<int>, -1);
+ // default emplace a value
+ v.emplace<long>();
+ assert(std::get<1>(v) == 0);
+ v.emplace<const void *>(&x);
+ assert(std::get<2>(v) == &x);
+ // emplace with multiple args
+ v.emplace<std::string>(3, 'a');
+ assert(std::get<4>(v) == "aaa");
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ {
+ using V = std::variant<int, long, const int &, int &&, TestTypes::NoCtors,
+ std::string>;
+ const int x = 100;
+ int y = 42;
+ int z = 43;
+ V v(std::in_place_index<0>, -1);
+ // default emplace a value
+ v.emplace<long>();
+ assert(std::get<long>(v) == 0);
+ // emplace a reference
+ v.emplace<const int &>(x);
+ assert(&std::get<const int &>(v) == &x);
+ // emplace an rvalue reference
+ v.emplace<int &&>(std::move(y));
+ assert(&std::get<int &&>(v) == &y);
+ // re-emplace a new reference over the active member
+ v.emplace<int &&>(std::move(z));
+ assert(&std::get<int &&>(v) == &z);
+ // emplace with multiple args
+ v.emplace<std::string>(3, 'a');
+ assert(std::get<std::string>(v) == "aaa");
+ }
+#endif
+}
+
+int main() {
+ test_basic();
+ test_emplace_sfinae();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp
new file mode 100644
index 000000000000..b2be8ac5b3fd
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// template <class T, class U, class ...Args>
+// void emplace(initializer_list<U> il,Args&&... args);
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "archetypes.hpp"
+#include "test_convertible.hpp"
+#include "test_macros.h"
+
+struct InitList {
+ std::size_t size;
+ constexpr InitList(std::initializer_list<int> il) : size(il.size()) {}
+};
+
+struct InitListArg {
+ std::size_t size;
+ int value;
+ constexpr InitListArg(std::initializer_list<int> il, int v)
+ : size(il.size()), value(v) {}
+};
+
+template <class Var, class T, class... Args>
+constexpr auto test_emplace_exists_imp(int) -> decltype(
+ std::declval<Var>().template emplace<T>(std::declval<Args>()...), true) {
+ return true;
+}
+
+template <class, class, class...>
+constexpr auto test_emplace_exists_imp(long) -> bool {
+ return false;
+}
+
+template <class... Args> constexpr bool emplace_exists() {
+ return test_emplace_exists_imp<Args...>(0);
+}
+
+void test_emplace_sfinae() {
+ using V =
+ std::variant<int, TestTypes::NoCtors, InitList, InitListArg, long, long>;
+ using IL = std::initializer_list<int>;
+ static_assert(emplace_exists<V, InitList, IL>(), "");
+ static_assert(!emplace_exists<V, InitList, int>(), "args don't match");
+ static_assert(!emplace_exists<V, InitList, IL, int>(), "too many args");
+ static_assert(emplace_exists<V, InitListArg, IL, int>(), "");
+ static_assert(!emplace_exists<V, InitListArg, int>(), "args don't match");
+ static_assert(!emplace_exists<V, InitListArg, IL>(), "too few args");
+ static_assert(!emplace_exists<V, InitListArg, IL, int, int>(),
+ "too many args");
+}
+
+void test_basic() {
+ using V = std::variant<int, InitList, InitListArg, TestTypes::NoCtors>;
+ V v;
+ v.emplace<InitList>({1, 2, 3});
+ assert(std::get<InitList>(v).size == 3);
+ v.emplace<InitListArg>({1, 2, 3, 4}, 42);
+ assert(std::get<InitListArg>(v).size == 4);
+ assert(std::get<InitListArg>(v).value == 42);
+ v.emplace<InitList>({1});
+ assert(std::get<InitList>(v).size == 1);
+}
+
+int main() {
+ test_basic();
+ test_emplace_sfinae();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp b/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp
new file mode 100644
index 000000000000..4b30188ce6ff
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// Clang 3.8 doesn't allow constexpr variables of non-literal type
+// XFAIL: clang-3.8, apple-clang-7, apple-clang-8
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// constexpr size_t index() const noexcept;
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "archetypes.hpp"
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+int main() {
+ {
+ using V = std::variant<int, ConstexprTestTypes::NoCtors>;
+ constexpr V v;
+ static_assert(v.index() == 0, "");
+ }
+ {
+ using V = std::variant<int, long>;
+ constexpr V v(std::in_place_index<1>);
+ static_assert(v.index() == 1, "");
+ }
+ {
+ using V = std::variant<int, std::string>;
+ V v("abc");
+ assert(v.index() == 1);
+ v = 42;
+ assert(v.index() == 0);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ using V = std::variant<int, MakeEmptyT>;
+ V v;
+ assert(v.index() == 0);
+ makeEmpty(v);
+ assert(v.index() == std::variant_npos);
+ }
+#endif
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp b/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp
new file mode 100644
index 000000000000..8546beb1319c
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// Clang 3.8 doesn't allow constexpr variables of non-literal type
+// XFAIL: clang-3.8, apple-clang-7, apple-clang-8
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// constexpr bool valueless_by_exception() const noexcept;
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "archetypes.hpp"
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+int main() {
+ {
+ using V = std::variant<int, ConstexprTestTypes::NoCtors>;
+ constexpr V v;
+ static_assert(!v.valueless_by_exception(), "");
+ }
+ {
+ using V = std::variant<int, long, std::string>;
+ const V v("abc");
+ assert(!v.valueless_by_exception());
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ using V = std::variant<int, MakeEmptyT>;
+ V v;
+ assert(!v.valueless_by_exception());
+ makeEmpty(v);
+ assert(v.valueless_by_exception());
+ }
+#endif
+}
diff --git a/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp b/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
new file mode 100644
index 000000000000..416c6b4e334d
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
@@ -0,0 +1,591 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// void swap(variant& rhs) noexcept(see below)
+
+#include <cassert>
+#include <string>
+#include <type_traits>
+#include <variant>
+
+#include "test_convertible.hpp"
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+struct NotSwappable {};
+void swap(NotSwappable &, NotSwappable &) = delete;
+
+struct NotCopyable {
+ NotCopyable() = default;
+ NotCopyable(const NotCopyable &) = delete;
+ NotCopyable &operator=(const NotCopyable &) = delete;
+};
+
+struct NotCopyableWithSwap {
+ NotCopyableWithSwap() = default;
+ NotCopyableWithSwap(const NotCopyableWithSwap &) = delete;
+ NotCopyableWithSwap &operator=(const NotCopyableWithSwap &) = delete;
+};
+void swap(NotCopyableWithSwap &, NotCopyableWithSwap) {}
+
+struct NotMoveAssignable {
+ NotMoveAssignable() = default;
+ NotMoveAssignable(NotMoveAssignable &&) = default;
+ NotMoveAssignable &operator=(NotMoveAssignable &&) = delete;
+};
+
+struct NotMoveAssignableWithSwap {
+ NotMoveAssignableWithSwap() = default;
+ NotMoveAssignableWithSwap(NotMoveAssignableWithSwap &&) = default;
+ NotMoveAssignableWithSwap &operator=(NotMoveAssignableWithSwap &&) = delete;
+};
+void swap(NotMoveAssignableWithSwap &, NotMoveAssignableWithSwap &) noexcept {}
+
+template <bool Throws> void do_throw() {}
+
+template <> void do_throw<true>() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ throw 42;
+#else
+ std::abort();
+#endif
+}
+
+template <bool NT_Copy, bool NT_Move, bool NT_CopyAssign, bool NT_MoveAssign,
+ bool NT_Swap, bool EnableSwap = true>
+struct NothrowTypeImp {
+ static int move_called;
+ static int move_assign_called;
+ static int swap_called;
+ static void reset() { move_called = move_assign_called = swap_called = 0; }
+ NothrowTypeImp() = default;
+ explicit NothrowTypeImp(int v) : value(v) {}
+ NothrowTypeImp(const NothrowTypeImp &o) noexcept(NT_Copy) : value(o.value) {
+ assert(false);
+ } // never called by test
+ NothrowTypeImp(NothrowTypeImp &&o) noexcept(NT_Move) : value(o.value) {
+ ++move_called;
+ do_throw<!NT_Move>();
+ o.value = -1;
+ }
+ NothrowTypeImp &operator=(const NothrowTypeImp &) noexcept(NT_CopyAssign) {
+ assert(false);
+ return *this;
+ } // never called by the tests
+ NothrowTypeImp &operator=(NothrowTypeImp &&o) noexcept(NT_MoveAssign) {
+ ++move_assign_called;
+ do_throw<!NT_MoveAssign>();
+ value = o.value;
+ o.value = -1;
+ return *this;
+ }
+ int value;
+};
+template <bool NT_Copy, bool NT_Move, bool NT_CopyAssign, bool NT_MoveAssign,
+ bool NT_Swap, bool EnableSwap>
+int NothrowTypeImp<NT_Copy, NT_Move, NT_CopyAssign, NT_MoveAssign, NT_Swap,
+ EnableSwap>::move_called = 0;
+template <bool NT_Copy, bool NT_Move, bool NT_CopyAssign, bool NT_MoveAssign,
+ bool NT_Swap, bool EnableSwap>
+int NothrowTypeImp<NT_Copy, NT_Move, NT_CopyAssign, NT_MoveAssign, NT_Swap,
+ EnableSwap>::move_assign_called = 0;
+template <bool NT_Copy, bool NT_Move, bool NT_CopyAssign, bool NT_MoveAssign,
+ bool NT_Swap, bool EnableSwap>
+int NothrowTypeImp<NT_Copy, NT_Move, NT_CopyAssign, NT_MoveAssign, NT_Swap,
+ EnableSwap>::swap_called = 0;
+
+template <bool NT_Copy, bool NT_Move, bool NT_CopyAssign, bool NT_MoveAssign,
+ bool NT_Swap>
+void swap(NothrowTypeImp<NT_Copy, NT_Move, NT_CopyAssign, NT_MoveAssign,
+ NT_Swap, true> &lhs,
+ NothrowTypeImp<NT_Copy, NT_Move, NT_CopyAssign, NT_MoveAssign,
+ NT_Swap, true> &rhs) noexcept(NT_Swap) {
+ lhs.swap_called++;
+ do_throw<!NT_Swap>();
+ int tmp = lhs.value;
+ lhs.value = rhs.value;
+ rhs.value = tmp;
+}
+
+// throwing copy, nothrow move ctor/assign, no swap provided
+using NothrowMoveable = NothrowTypeImp<false, true, false, true, false, false>;
+// throwing copy and move assign, nothrow move ctor, no swap provided
+using NothrowMoveCtor = NothrowTypeImp<false, true, false, false, false, false>;
+// nothrow move ctor, throwing move assignment, swap provided
+using NothrowMoveCtorWithThrowingSwap =
+ NothrowTypeImp<false, true, false, false, false, true>;
+// throwing move ctor, nothrow move assignment, no swap provided
+using ThrowingMoveCtor =
+ NothrowTypeImp<false, false, false, true, false, false>;
+// throwing special members, nothrowing swap
+using ThrowingTypeWithNothrowSwap =
+ NothrowTypeImp<false, false, false, false, true, true>;
+using NothrowTypeWithThrowingSwap =
+ NothrowTypeImp<true, true, true, true, false, true>;
+// throwing move assign with nothrow move and nothrow swap
+using ThrowingMoveAssignNothrowMoveCtorWithSwap =
+ NothrowTypeImp<false, true, false, false, true, true>;
+// throwing move assign with nothrow move but no swap.
+using ThrowingMoveAssignNothrowMoveCtor =
+ NothrowTypeImp<false, true, false, false, false, false>;
+
+struct NonThrowingNonNoexceptType {
+ static int move_called;
+ static void reset() { move_called = 0; }
+ NonThrowingNonNoexceptType() = default;
+ NonThrowingNonNoexceptType(int v) : value(v) {}
+ NonThrowingNonNoexceptType(NonThrowingNonNoexceptType &&o) noexcept(false)
+ : value(o.value) {
+ ++move_called;
+ o.value = -1;
+ }
+ NonThrowingNonNoexceptType &
+ operator=(NonThrowingNonNoexceptType &&) noexcept(false) {
+ assert(false); // never called by the tests.
+ return *this;
+ }
+ int value;
+};
+int NonThrowingNonNoexceptType::move_called = 0;
+
+struct ThrowsOnSecondMove {
+ int value;
+ int move_count;
+ ThrowsOnSecondMove(int v) : value(v), move_count(0) {}
+ ThrowsOnSecondMove(ThrowsOnSecondMove &&o) noexcept(false)
+ : value(o.value), move_count(o.move_count + 1) {
+ if (move_count == 2)
+ do_throw<true>();
+ o.value = -1;
+ }
+ ThrowsOnSecondMove &operator=(ThrowsOnSecondMove &&) {
+ assert(false); // not called by test
+ return *this;
+ }
+};
+
+void test_swap_valueless_by_exception() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ using V = std::variant<int, MakeEmptyT>;
+ { // both empty
+ V v1;
+ makeEmpty(v1);
+ V v2;
+ makeEmpty(v2);
+ assert(MakeEmptyT::alive == 0);
+ { // member swap
+ v1.swap(v2);
+ assert(v1.valueless_by_exception());
+ assert(v2.valueless_by_exception());
+ assert(MakeEmptyT::alive == 0);
+ }
+ { // non-member swap
+ swap(v1, v2);
+ assert(v1.valueless_by_exception());
+ assert(v2.valueless_by_exception());
+ assert(MakeEmptyT::alive == 0);
+ }
+ }
+ { // only one empty
+ V v1(42);
+ V v2;
+ makeEmpty(v2);
+ { // member swap
+ v1.swap(v2);
+ assert(v1.valueless_by_exception());
+ assert(std::get<0>(v2) == 42);
+ // swap again
+ v2.swap(v1);
+ assert(v2.valueless_by_exception());
+ assert(std::get<0>(v1) == 42);
+ }
+ { // non-member swap
+ swap(v1, v2);
+ assert(v1.valueless_by_exception());
+ assert(std::get<0>(v2) == 42);
+ // swap again
+ swap(v1, v2);
+ assert(v2.valueless_by_exception());
+ assert(std::get<0>(v1) == 42);
+ }
+ }
+#endif
+}
+
+void test_swap_same_alternative() {
+ {
+ using T = ThrowingTypeWithNothrowSwap;
+ using V = std::variant<T, int>;
+ T::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<0>, 100);
+ v1.swap(v2);
+ assert(T::swap_called == 1);
+ assert(std::get<0>(v1).value == 100);
+ assert(std::get<0>(v2).value == 42);
+ swap(v1, v2);
+ assert(T::swap_called == 2);
+ assert(std::get<0>(v1).value == 42);
+ assert(std::get<0>(v2).value == 100);
+ }
+ {
+ using T = NothrowMoveable;
+ using V = std::variant<T, int>;
+ T::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<0>, 100);
+ v1.swap(v2);
+ assert(T::swap_called == 0);
+ assert(T::move_called == 1);
+ assert(T::move_assign_called == 2);
+ assert(std::get<0>(v1).value == 100);
+ assert(std::get<0>(v2).value == 42);
+ T::reset();
+ swap(v1, v2);
+ assert(T::swap_called == 0);
+ assert(T::move_called == 1);
+ assert(T::move_assign_called == 2);
+ assert(std::get<0>(v1).value == 42);
+ assert(std::get<0>(v2).value == 100);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ using T = NothrowTypeWithThrowingSwap;
+ using V = std::variant<T, int>;
+ T::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<0>, 100);
+ try {
+ v1.swap(v2);
+ assert(false);
+ } catch (int) {
+ }
+ assert(T::swap_called == 1);
+ assert(T::move_called == 0);
+ assert(T::move_assign_called == 0);
+ assert(std::get<0>(v1).value == 42);
+ assert(std::get<0>(v2).value == 100);
+ }
+ {
+ using T = ThrowingMoveCtor;
+ using V = std::variant<T, int>;
+ T::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<0>, 100);
+ try {
+ v1.swap(v2);
+ assert(false);
+ } catch (int) {
+ }
+ assert(T::move_called == 1); // call threw
+ assert(T::move_assign_called == 0);
+ assert(std::get<0>(v1).value ==
+ 42); // throw happened before v1 was moved from
+ assert(std::get<0>(v2).value == 100);
+ }
+ {
+ using T = ThrowingMoveAssignNothrowMoveCtor;
+ using V = std::variant<T, int>;
+ T::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<0>, 100);
+ try {
+ v1.swap(v2);
+ assert(false);
+ } catch (int) {
+ }
+ assert(T::move_called == 1);
+ assert(T::move_assign_called == 1); // call threw and didn't complete
+ assert(std::get<0>(v1).value == -1); // v1 was moved from
+ assert(std::get<0>(v2).value == 100);
+ }
+#endif
+}
+
+void test_swap_different_alternatives() {
+ {
+ using T = NothrowMoveCtorWithThrowingSwap;
+ using V = std::variant<T, int>;
+ T::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<1>, 100);
+ v1.swap(v2);
+ assert(T::swap_called == 0);
+ // The libc++ implementation double copies the argument, and not
+ // the variant swap is called on.
+ LIBCPP_ASSERT(T::move_called == 1);
+ assert(T::move_called <= 2);
+ assert(T::move_assign_called == 0);
+ assert(std::get<1>(v1) == 100);
+ assert(std::get<0>(v2).value == 42);
+ T::reset();
+ swap(v1, v2);
+ assert(T::swap_called == 0);
+ LIBCPP_ASSERT(T::move_called == 2);
+ assert(T::move_called <= 2);
+ assert(T::move_assign_called == 0);
+ assert(std::get<0>(v1).value == 42);
+ assert(std::get<1>(v2) == 100);
+ }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ {
+ using T1 = ThrowingTypeWithNothrowSwap;
+ using T2 = NonThrowingNonNoexceptType;
+ using V = std::variant<T1, T2>;
+ T1::reset();
+ T2::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<1>, 100);
+ try {
+ v1.swap(v2);
+ assert(false);
+ } catch (int) {
+ }
+ assert(T1::swap_called == 0);
+ assert(T1::move_called == 1); // throws
+ assert(T1::move_assign_called == 0);
+ // FIXME: libc++ shouldn't move from T2 here.
+ LIBCPP_ASSERT(T2::move_called == 1);
+ assert(T2::move_called <= 1);
+ assert(std::get<0>(v1).value == 42);
+ if (T2::move_called != 0)
+ assert(v2.valueless_by_exception());
+ else
+ assert(std::get<1>(v2).value == 100);
+ }
+ {
+ using T1 = NonThrowingNonNoexceptType;
+ using T2 = ThrowingTypeWithNothrowSwap;
+ using V = std::variant<T1, T2>;
+ T1::reset();
+ T2::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<1>, 100);
+ try {
+ v1.swap(v2);
+ assert(false);
+ } catch (int) {
+ }
+ LIBCPP_ASSERT(T1::move_called == 0);
+ assert(T1::move_called <= 1);
+ assert(T2::swap_called == 0);
+ assert(T2::move_called == 1); // throws
+ assert(T2::move_assign_called == 0);
+ if (T1::move_called != 0)
+ assert(v1.valueless_by_exception());
+ else
+ assert(std::get<0>(v1).value == 42);
+ assert(std::get<1>(v2).value == 100);
+ }
+// FIXME: The tests below are just very libc++ specific
+#ifdef _LIBCPP_VERSION
+ {
+ using T1 = ThrowsOnSecondMove;
+ using T2 = NonThrowingNonNoexceptType;
+ using V = std::variant<T1, T2>;
+ T2::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<1>, 100);
+ v1.swap(v2);
+ assert(T2::move_called == 2);
+ assert(std::get<1>(v1).value == 100);
+ assert(std::get<0>(v2).value == 42);
+ assert(std::get<0>(v2).move_count == 1);
+ }
+ {
+ using T1 = NonThrowingNonNoexceptType;
+ using T2 = ThrowsOnSecondMove;
+ using V = std::variant<T1, T2>;
+ T1::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<1>, 100);
+ try {
+ v1.swap(v2);
+ assert(false);
+ } catch (int) {
+ }
+ assert(T1::move_called == 1);
+ assert(v1.valueless_by_exception());
+ assert(std::get<0>(v2).value == 42);
+ }
+#endif
+// testing libc++ extension. If either variant stores a nothrow move
+// constructible type v1.swap(v2) provides the strong exception safety
+// guarantee.
+#ifdef _LIBCPP_VERSION
+ {
+
+ using T1 = ThrowingTypeWithNothrowSwap;
+ using T2 = NothrowMoveable;
+ using V = std::variant<T1, T2>;
+ T1::reset();
+ T2::reset();
+ V v1(std::in_place_index<0>, 42);
+ V v2(std::in_place_index<1>, 100);
+ try {
+ v1.swap(v2);
+ assert(false);
+ } catch (int) {
+ }
+ assert(T1::swap_called == 0);
+ assert(T1::move_called == 1);
+ assert(T1::move_assign_called == 0);
+ assert(T2::swap_called == 0);
+ assert(T2::move_called == 2);
+ assert(T2::move_assign_called == 0);
+ assert(std::get<0>(v1).value == 42);
+ assert(std::get<1>(v2).value == 100);
+ // swap again, but call v2's swap.
+ T1::reset();
+ T2::reset();
+ try {
+ v2.swap(v1);
+ assert(false);
+ } catch (int) {
+ }
+ assert(T1::swap_called == 0);
+ assert(T1::move_called == 1);
+ assert(T1::move_assign_called == 0);
+ assert(T2::swap_called == 0);
+ assert(T2::move_called == 2);
+ assert(T2::move_assign_called == 0);
+ assert(std::get<0>(v1).value == 42);
+ assert(std::get<1>(v2).value == 100);
+ }
+#endif // _LIBCPP_VERSION
+#endif
+}
+
+template <class Var>
+constexpr auto has_swap_member_imp(int)
+ -> decltype(std::declval<Var &>().swap(std::declval<Var &>()), true) {
+ return true;
+}
+
+template <class Var> constexpr auto has_swap_member_imp(long) -> bool {
+ return false;
+}
+
+template <class Var> constexpr bool has_swap_member() {
+ return has_swap_member_imp<Var>(0);
+}
+
+void test_swap_sfinae() {
+ {
+ // This variant type does not provide either a member or non-member swap
+ // but is still swappable via the generic swap algorithm, since the
+ // variant is move constructible and move assignable.
+ using V = std::variant<int, NotSwappable>;
+ LIBCPP_STATIC_ASSERT(!has_swap_member<V>());
+ static_assert(std::is_swappable_v<V>, "");
+ }
+ {
+ using V = std::variant<int, NotCopyable>;
+ LIBCPP_STATIC_ASSERT(!has_swap_member<V>(), "");
+ static_assert(!std::is_swappable_v<V>, "");
+ }
+ {
+ using V = std::variant<int, NotCopyableWithSwap>;
+ LIBCPP_STATIC_ASSERT(!has_swap_member<V>(), "");
+ static_assert(!std::is_swappable_v<V>, "");
+ }
+ {
+ using V = std::variant<int, NotMoveAssignable>;
+ LIBCPP_STATIC_ASSERT(!has_swap_member<V>(), "");
+ static_assert(!std::is_swappable_v<V>, "");
+ }
+}
+
+void test_swap_noexcept() {
+ {
+ using V = std::variant<int, NothrowMoveable>;
+ static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
+ static_assert(std::is_nothrow_swappable_v<V>, "");
+ // instantiate swap
+ V v1, v2;
+ v1.swap(v2);
+ swap(v1, v2);
+ }
+ {
+ using V = std::variant<int, NothrowMoveCtor>;
+ static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
+ static_assert(!std::is_nothrow_swappable_v<V>, "");
+ // instantiate swap
+ V v1, v2;
+ v1.swap(v2);
+ swap(v1, v2);
+ }
+ {
+ using V = std::variant<int, ThrowingTypeWithNothrowSwap>;
+ static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
+ static_assert(!std::is_nothrow_swappable_v<V>, "");
+ // instantiate swap
+ V v1, v2;
+ v1.swap(v2);
+ swap(v1, v2);
+ }
+ {
+ using V = std::variant<int, ThrowingMoveAssignNothrowMoveCtor>;
+ static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
+ static_assert(!std::is_nothrow_swappable_v<V>, "");
+ // instantiate swap
+ V v1, v2;
+ v1.swap(v2);
+ swap(v1, v2);
+ }
+ {
+ using V = std::variant<int, ThrowingMoveAssignNothrowMoveCtorWithSwap>;
+ static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
+ static_assert(std::is_nothrow_swappable_v<V>, "");
+ // instantiate swap
+ V v1, v2;
+ v1.swap(v2);
+ swap(v1, v2);
+ }
+ {
+ using V = std::variant<int, NotMoveAssignableWithSwap>;
+ static_assert(std::is_swappable_v<V> && has_swap_member<V>(), "");
+ static_assert(std::is_nothrow_swappable_v<V>, "");
+ // instantiate swap
+ V v1, v2;
+ v1.swap(v2);
+ swap(v1, v2);
+ }
+ {
+ // This variant type does not provide either a member or non-member swap
+ // but is still swappable via the generic swap algorithm, since the
+ // variant is move constructible and move assignable.
+ using V = std::variant<int, NotSwappable>;
+ LIBCPP_STATIC_ASSERT(!has_swap_member<V>());
+ static_assert(std::is_swappable_v<V>, "");
+ static_assert(std::is_nothrow_swappable_v<V>, "");
+ V v1, v2;
+ swap(v1, v2);
+ }
+}
+
+#ifdef _LIBCPP_VERSION
+// This is why variant should SFINAE member swap. :-)
+template class std::variant<int, NotSwappable>;
+#endif
+
+int main() {
+ test_swap_valueless_by_exception();
+ test_swap_same_alternative();
+ test_swap_different_alternatives();
+ test_swap_sfinae();
+ test_swap_noexcept();
+}
diff --git a/test/std/utilities/variant/variant.variant/variant_array.fail.cpp b/test/std/utilities/variant/variant.variant/variant_array.fail.cpp
new file mode 100644
index 000000000000..11ee332e216e
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant_array.fail.cpp
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+
+#include <variant>
+#include <type_traits>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+#include "test_convertible.hpp"
+
+int main()
+{
+ // expected-error@variant:* 3 {{static_assert failed}}
+ std::variant<int, int[]> v; // expected-note {{requested here}}
+ std::variant<int, int[42]> v2; // expected-note {{requested here}}
+ std::variant<int, int[][42]> v3; // expected-note {{requested here}}
+}
diff --git a/test/std/utilities/variant/variant.variant/variant_empty.fail.cpp b/test/std/utilities/variant/variant.variant/variant_empty.fail.cpp
new file mode 100644
index 000000000000..2d8cc0b3da0f
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant_empty.fail.cpp
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+#include <variant>
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+int main()
+{
+ // expected-error@variant:* 1 {{static_assert failed}}
+ std::variant<> v; // expected-note {{requested here}}
+}
diff --git a/test/std/utilities/variant/variant.variant/variant_reference.fail.cpp b/test/std/utilities/variant/variant.variant/variant_reference.fail.cpp
new file mode 100644
index 000000000000..bda27f0e5eba
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant_reference.fail.cpp
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+#include <variant>
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+
+int main()
+{
+ // expected-error@variant:* 3 {{static_assert failed}}
+ std::variant<int, int&> v; // expected-note {{requested here}}
+ std::variant<int, const int &> v2; // expected-note {{requested here}}
+ std::variant<int, int&&> v3; // expected-note {{requested here}}
+}
diff --git a/test/std/utilities/variant/variant.variant/variant_void.fail.cpp b/test/std/utilities/variant/variant.variant/variant_void.fail.cpp
new file mode 100644
index 000000000000..3d0da5620b50
--- /dev/null
+++ b/test/std/utilities/variant/variant.variant/variant_void.fail.cpp
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+
+#include <variant>
+#include <type_traits>
+#include <string>
+#include <cassert>
+
+#include "test_macros.h"
+#include "variant_test_helpers.hpp"
+#include "test_convertible.hpp"
+
+int main()
+{
+ // expected-error@variant:* 3 {{static_assert failed}}
+ std::variant<int, void> v; // expected-note {{requested here}}
+ std::variant<int, const void> v2; // expected-note {{requested here}}
+ std::variant<const volatile void, int> v3; // expected-note {{requested here}}
+}
diff --git a/test/std/utilities/variant/variant.visit/visit.pass.cpp b/test/std/utilities/variant/variant.visit/visit.pass.cpp
new file mode 100644
index 000000000000..46d225883ae9
--- /dev/null
+++ b/test/std/utilities/variant/variant.visit/visit.pass.cpp
@@ -0,0 +1,291 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+// template <class Visitor, class... Variants>
+// constexpr see below visit(Visitor&& vis, Variants&&... vars);
+
+#include <cassert>
+#include <memory>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+
+#include "test_macros.h"
+#include "type_id.h"
+#include "variant_test_helpers.hpp"
+
+enum CallType : unsigned {
+ CT_None,
+ CT_NonConst = 1,
+ CT_Const = 2,
+ CT_LValue = 4,
+ CT_RValue = 8
+};
+
+inline constexpr CallType operator|(CallType LHS, CallType RHS) {
+ return static_cast<CallType>(static_cast<unsigned>(LHS) |
+ static_cast<unsigned>(RHS));
+}
+
+struct ForwardingCallObject {
+
+ template <class... Args> bool operator()(Args &&...) & {
+ set_call<Args &&...>(CT_NonConst | CT_LValue);
+ return true;
+ }
+
+ template <class... Args> bool operator()(Args &&...) const & {
+ set_call<Args &&...>(CT_Const | CT_LValue);
+ return true;
+ }
+
+ // Don't allow the call operator to be invoked as an rvalue.
+ template <class... Args> bool operator()(Args &&...) && {
+ set_call<Args &&...>(CT_NonConst | CT_RValue);
+ return true;
+ }
+
+ template <class... Args> bool operator()(Args &&...) const && {
+ set_call<Args &&...>(CT_Const | CT_RValue);
+ return true;
+ }
+
+ template <class... Args> static void set_call(CallType type) {
+ assert(last_call_type == CT_None);
+ assert(last_call_args == nullptr);
+ last_call_type = type;
+ last_call_args = std::addressof(makeArgumentID<Args...>());
+ }
+
+ template <class... Args> static bool check_call(CallType type) {
+ bool result = last_call_type == type && last_call_args &&
+ *last_call_args == makeArgumentID<Args...>();
+ last_call_type = CT_None;
+ last_call_args = nullptr;
+ return result;
+ }
+
+ static CallType last_call_type;
+ static const TypeID *last_call_args;
+};
+
+CallType ForwardingCallObject::last_call_type = CT_None;
+const TypeID *ForwardingCallObject::last_call_args = nullptr;
+
+void test_call_operator_forwarding() {
+ using Fn = ForwardingCallObject;
+ Fn obj{};
+ const Fn &cobj = obj;
+ { // test call operator forwarding - single variant, single arg
+ using V = std::variant<int>;
+ V v(42);
+ std::visit(obj, v);
+ assert(Fn::check_call<int &>(CT_NonConst | CT_LValue));
+ std::visit(cobj, v);
+ assert(Fn::check_call<int &>(CT_Const | CT_LValue));
+ std::visit(std::move(obj), v);
+ assert(Fn::check_call<int &>(CT_NonConst | CT_RValue));
+ std::visit(std::move(cobj), v);
+ assert(Fn::check_call<int &>(CT_Const | CT_RValue));
+ }
+ { // test call operator forwarding - single variant, multi arg
+ using V = std::variant<int, long, double>;
+ V v(42l);
+ std::visit(obj, v);
+ assert(Fn::check_call<long &>(CT_NonConst | CT_LValue));
+ std::visit(cobj, v);
+ assert(Fn::check_call<long &>(CT_Const | CT_LValue));
+ std::visit(std::move(obj), v);
+ assert(Fn::check_call<long &>(CT_NonConst | CT_RValue));
+ std::visit(std::move(cobj), v);
+ assert(Fn::check_call<long &>(CT_Const | CT_RValue));
+ }
+ { // test call operator forwarding - multi variant, multi arg
+ using V = std::variant<int, long, double>;
+ using V2 = std::variant<int *, std::string>;
+ V v(42l);
+ V2 v2("hello");
+ std::visit(obj, v, v2);
+ assert((Fn::check_call<long &, std::string &>(CT_NonConst | CT_LValue)));
+ std::visit(cobj, v, v2);
+ assert((Fn::check_call<long &, std::string &>(CT_Const | CT_LValue)));
+ std::visit(std::move(obj), v, v2);
+ assert((Fn::check_call<long &, std::string &>(CT_NonConst | CT_RValue)));
+ std::visit(std::move(cobj), v, v2);
+ assert((Fn::check_call<long &, std::string &>(CT_Const | CT_RValue)));
+ }
+}
+
+void test_argument_forwarding() {
+ using Fn = ForwardingCallObject;
+ Fn obj{};
+ const auto Val = CT_LValue | CT_NonConst;
+ { // single argument - value type
+ using V = std::variant<int>;
+ V v(42);
+ const V &cv = v;
+ std::visit(obj, v);
+ assert(Fn::check_call<int &>(Val));
+ std::visit(obj, cv);
+ assert(Fn::check_call<const int &>(Val));
+ std::visit(obj, std::move(v));
+ assert(Fn::check_call<int &&>(Val));
+ std::visit(obj, std::move(cv));
+ assert(Fn::check_call<const int &&>(Val));
+ }
+#if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
+ { // single argument - lvalue reference
+ using V = std::variant<int &>;
+ int x = 42;
+ V v(x);
+ const V &cv = v;
+ std::visit(obj, v);
+ assert(Fn::check_call<int &>(Val));
+ std::visit(obj, cv);
+ assert(Fn::check_call<int &>(Val));
+ std::visit(obj, std::move(v));
+ assert(Fn::check_call<int &>(Val));
+ std::visit(obj, std::move(cv));
+ assert(Fn::check_call<int &>(Val));
+ }
+ { // single argument - rvalue reference
+ using V = std::variant<int &&>;
+ int x = 42;
+ V v(std::move(x));
+ const V &cv = v;
+ std::visit(obj, v);
+ assert(Fn::check_call<int &>(Val));
+ std::visit(obj, cv);
+ assert(Fn::check_call<int &>(Val));
+ std::visit(obj, std::move(v));
+ assert(Fn::check_call<int &&>(Val));
+ std::visit(obj, std::move(cv));
+ assert(Fn::check_call<int &&>(Val));
+ }
+ { // multi argument - multi variant
+ using S = const std::string &;
+ using V = std::variant<int, S, long &&>;
+ const std::string str = "hello";
+ long l = 43;
+ V v1(42);
+ const V &cv1 = v1;
+ V v2(str);
+ const V &cv2 = v2;
+ V v3(std::move(l));
+ const V &cv3 = v3;
+ std::visit(obj, v1, v2, v3);
+ assert((Fn::check_call<int &, S, long &>(Val)));
+ std::visit(obj, cv1, cv2, std::move(v3));
+ assert((Fn::check_call<const int &, S, long &&>(Val)));
+ }
+#endif
+}
+
+struct ReturnFirst {
+ template <class... Args> constexpr int operator()(int f, Args &&...) const {
+ return f;
+ }
+};
+
+struct ReturnArity {
+ template <class... Args> constexpr int operator()(Args &&...) const {
+ return sizeof...(Args);
+ }
+};
+
+void test_constexpr() {
+ constexpr ReturnFirst obj{};
+ constexpr ReturnArity aobj{};
+ {
+ using V = std::variant<int>;
+ constexpr V v(42);
+ static_assert(std::visit(obj, v) == 42, "");
+ }
+ {
+ using V = std::variant<short, long, char>;
+ constexpr V v(42l);
+ static_assert(std::visit(obj, v) == 42, "");
+ }
+ {
+ using V1 = std::variant<int>;
+ using V2 = std::variant<int, char *, long long>;
+ using V3 = std::variant<bool, int, int>;
+ constexpr V1 v1;
+ constexpr V2 v2(nullptr);
+ constexpr V3 v3;
+ static_assert(std::visit(aobj, v1, v2, v3) == 3, "");
+ }
+ {
+ using V1 = std::variant<int>;
+ using V2 = std::variant<int, char *, long long>;
+ using V3 = std::variant<void *, int, int>;
+ constexpr V1 v1;
+ constexpr V2 v2(nullptr);
+ constexpr V3 v3;
+ static_assert(std::visit(aobj, v1, v2, v3) == 3, "");
+ }
+}
+
+void test_exceptions() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ ReturnArity obj{};
+ auto test = [&](auto &&... args) {
+ try {
+ std::visit(obj, args...);
+ } catch (const std::bad_variant_access &) {
+ return true;
+ } catch (...) {
+ }
+ return false;
+ };
+ {
+ using V = std::variant<int, MakeEmptyT>;
+ V v;
+ makeEmpty(v);
+ assert(test(v));
+ }
+ {
+ using V = std::variant<int, MakeEmptyT>;
+ using V2 = std::variant<long, std::string, void *>;
+ V v;
+ makeEmpty(v);
+ V2 v2("hello");
+ assert(test(v, v2));
+ }
+ {
+ using V = std::variant<int, MakeEmptyT>;
+ using V2 = std::variant<long, std::string, void *>;
+ V v;
+ makeEmpty(v);
+ V2 v2("hello");
+ assert(test(v2, v));
+ }
+ {
+ using V = std::variant<int, MakeEmptyT>;
+ using V2 = std::variant<long, std::string, void *, MakeEmptyT>;
+ V v;
+ makeEmpty(v);
+ V2 v2;
+ makeEmpty(v2);
+ assert(test(v, v2));
+ }
+#endif
+}
+
+int main() {
+ test_call_operator_forwarding();
+ test_argument_forwarding();
+ test_constexpr();
+ test_exceptions();
+}
diff --git a/test/support/any_helpers.h b/test/support/any_helpers.h
index bb1ad175c1f2..a720ecd7c82f 100644
--- a/test/support/any_helpers.h
+++ b/test/support/any_helpers.h
@@ -9,12 +9,14 @@
#ifndef ANY_HELPERS_H
#define ANY_HELPERS_H
-#include <experimental/any>
#include <typeinfo>
#include <type_traits>
#include <cassert>
+namespace std { namespace experimental {} }
+
#include "test_macros.h"
+#include "type_id.h"
#if !defined(TEST_HAS_NO_RTTI)
#define RTTI_ASSERT(X) assert(X)
@@ -32,42 +34,64 @@ template <class _Tp>
>
{};
+template <class T>
+bool containsType(std::any const& a) {
+#if !defined(TEST_HAS_NO_RTTI)
+ return a.type() == typeid(T);
+#else
+ return a.has_value() && std::any_cast<T>(&a) != nullptr;
+#endif
+}
// Return 'true' if 'Type' will be considered a small type by 'any'
template <class Type>
bool isSmallType() {
-#if defined(_LIBCPP_VERSION)
- return std::experimental::__any_imp::_IsSmallObject<Type>::value;
-#else
return IsSmallObject<Type>::value;
-#endif
-
}
// Assert that an object is empty. If the object used to contain an object
// of type 'LastType' check that it can no longer be accessed.
template <class LastType = int>
-void assertEmpty(std::experimental::any const& a) {
- assert(a.empty());
+void assertEmpty(std::any const& a) {
+ using namespace std;
+ assert(!a.has_value());
RTTI_ASSERT(a.type() == typeid(void));
- assert(std::experimental::any_cast<LastType const>(&a) == nullptr);
+ assert(any_cast<LastType const>(&a) == nullptr);
}
+template <class Type>
+constexpr auto has_value_member(int) -> decltype(std::declval<Type&>().value, true)
+{ return true; }
+template <class> constexpr bool has_value_member(long) { return false; }
+
+
// Assert that an 'any' object stores the specified 'Type' and 'value'.
template <class Type>
-void assertContains(std::experimental::any const& a, int value = 1) {
- assert(!a.empty());
- RTTI_ASSERT(a.type() == typeid(Type));
- assert(std::experimental::any_cast<Type const &>(a).value == value);
+std::enable_if_t<has_value_member<Type>(0)>
+assertContains(std::any const& a, int value) {
+ assert(a.has_value());
+ assert(containsType<Type>(a));
+ assert(std::any_cast<Type const &>(a).value == value);
+}
+
+template <class Type, class Value>
+std::enable_if_t<!has_value_member<Type>(0)>
+assertContains(std::any const& a, Value value) {
+ assert(a.has_value());
+ assert(containsType<Type>(a));
+ assert(std::any_cast<Type const &>(a) == value);
}
+
// Modify the value of a "test type" stored within an any to the specified
// 'value'.
template <class Type>
-void modifyValue(std::experimental::any& a, int value) {
- assert(!a.empty());
- RTTI_ASSERT(a.type() == typeid(Type));
- std::experimental::any_cast<Type&>(a).value = value;
+void modifyValue(std::any& a, int value) {
+ using namespace std;
+ using namespace std::experimental;
+ assert(a.has_value());
+ assert(containsType<Type>(a));
+ any_cast<Type&>(a).value = value;
}
// A test type that will trigger the small object optimization within 'any'.
@@ -89,25 +113,31 @@ struct small_type
int value;
- explicit small_type(int val) : value(val) {
+ explicit small_type(int val = 0) : value(val) {
+ ++count;
+ }
+ explicit small_type(int, int val, int) : value(val) {
+ ++count;
+ }
+ small_type(std::initializer_list<int> il) : value(*il.begin()) {
++count;
}
- small_type(small_type const & other) throw() {
+ small_type(small_type const & other) noexcept {
value = other.value;
++count;
++copied;
++const_copied;
}
- small_type(small_type& other) throw() {
+ small_type(small_type& other) noexcept {
value = other.value;
++count;
++copied;
++non_const_copied;
}
- small_type(small_type && other) throw() {
+ small_type(small_type && other) noexcept {
value = other.value;
other.value = 0;
++count;
@@ -163,11 +193,17 @@ struct large_type
int value;
- large_type(int val) : value(val) {
+ large_type(int val = 0) : value(val) {
++count;
data[0] = 0;
}
-
+ large_type(int, int val, int) : value(val) {
+ ++count;
+ data[0] = 0;
+ }
+ large_type(std::initializer_list<int> il) : value(*il.begin()) {
+ ++count;
+ }
large_type(large_type const & other) {
value = other.value;
++count;
@@ -236,19 +272,24 @@ void throwMyAnyExpression() {
struct small_throws_on_copy
{
static int count;
+ static int copied;
+ static int moved;
+ static void reset() { count = copied = moved = 0; }
int value;
explicit small_throws_on_copy(int val = 0) : value(val) {
++count;
}
-
+ explicit small_throws_on_copy(int, int val, int) : value(val) {
+ ++count;
+ }
small_throws_on_copy(small_throws_on_copy const &) {
throwMyAnyExpression();
}
small_throws_on_copy(small_throws_on_copy && other) throw() {
value = other.value;
- ++count;
+ ++count; ++moved;
}
~small_throws_on_copy() {
@@ -260,26 +301,35 @@ private:
};
int small_throws_on_copy::count = 0;
+int small_throws_on_copy::copied = 0;
+int small_throws_on_copy::moved = 0;
+
// A test type that will NOT trigger the small object optimization within 'any'.
// this type throws if it is copied.
struct large_throws_on_copy
{
static int count;
+ static int copied;
+ static int moved;
+ static void reset() { count = copied = moved = 0; }
int value = 0;
explicit large_throws_on_copy(int val = 0) : value(val) {
data[0] = 0;
++count;
}
-
+ explicit large_throws_on_copy(int, int val, int) : value(val) {
+ data[0] = 0;
+ ++count;
+ }
large_throws_on_copy(large_throws_on_copy const &) {
throwMyAnyExpression();
}
large_throws_on_copy(large_throws_on_copy && other) throw() {
value = other.value;
- ++count;
+ ++count; ++moved;
}
~large_throws_on_copy() {
@@ -293,19 +343,24 @@ private:
};
int large_throws_on_copy::count = 0;
+int large_throws_on_copy::copied = 0;
+int large_throws_on_copy::moved = 0;
// A test type that throws when it is moved. This object will NOT trigger
// the small object optimization in 'any'.
struct throws_on_move
{
static int count;
+ static int copied;
+ static int moved;
+ static void reset() { count = copied = moved = 0; }
int value;
explicit throws_on_move(int val = 0) : value(val) { ++count; }
-
+ explicit throws_on_move(int, int val, int) : value(val) { ++count; }
throws_on_move(throws_on_move const & other) {
value = other.value;
- ++count;
+ ++count; ++copied;
}
throws_on_move(throws_on_move &&) {
@@ -321,6 +376,56 @@ private:
};
int throws_on_move::count = 0;
+int throws_on_move::copied = 0;
+int throws_on_move::moved = 0;
+
+struct small_tracked_t {
+ small_tracked_t()
+ : arg_types(&makeArgumentID<>()) {}
+ small_tracked_t(small_tracked_t const&) noexcept
+ : arg_types(&makeArgumentID<small_tracked_t const&>()) {}
+ small_tracked_t(small_tracked_t &&) noexcept
+ : arg_types(&makeArgumentID<small_tracked_t &&>()) {}
+ template <class ...Args>
+ explicit small_tracked_t(Args&&...)
+ : arg_types(&makeArgumentID<Args...>()) {}
+ template <class ...Args>
+ explicit small_tracked_t(std::initializer_list<int>, Args&&...)
+ : arg_types(&makeArgumentID<std::initializer_list<int>, Args...>()) {}
+
+ TypeID const* arg_types;
+};
+static_assert(IsSmallObject<small_tracked_t>::value, "must be small");
+
+struct large_tracked_t {
+ large_tracked_t()
+ : arg_types(&makeArgumentID<>()) { dummy[0] = 42; }
+ large_tracked_t(large_tracked_t const&) noexcept
+ : arg_types(&makeArgumentID<large_tracked_t const&>()) {}
+ large_tracked_t(large_tracked_t &&) noexcept
+ : arg_types(&makeArgumentID<large_tracked_t &&>()) {}
+ template <class ...Args>
+ explicit large_tracked_t(Args&&...)
+ : arg_types(&makeArgumentID<Args...>()) {}
+ template <class ...Args>
+ explicit large_tracked_t(std::initializer_list<int>, Args&&...)
+ : arg_types(&makeArgumentID<std::initializer_list<int>, Args...>()) {}
+
+ TypeID const* arg_types;
+ int dummy[10];
+};
+
+static_assert(!IsSmallObject<large_tracked_t>::value, "must be small");
+
+
+template <class Type, class ...Args>
+void assertArgsMatch(std::any const& a) {
+ using namespace std;
+ using namespace std::experimental;
+ assert(a.has_value());
+ assert(containsType<Type>(a));
+ assert(any_cast<Type const &>(a).arg_types == &makeArgumentID<Args...>());
+};
#endif
diff --git a/test/support/archetypes.hpp b/test/support/archetypes.hpp
new file mode 100644
index 000000000000..f442b592a26f
--- /dev/null
+++ b/test/support/archetypes.hpp
@@ -0,0 +1,379 @@
+#ifndef TEST_SUPPORT_ARCHETYPES_HPP
+#define TEST_SUPPORT_ARCHETYPES_HPP
+
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+#if TEST_STD_VER >= 11
+
+namespace ArchetypeBases {
+
+template <bool, class T>
+struct DepType : T {};
+
+struct NullBase {
+protected:
+ NullBase() = default;
+ NullBase(NullBase const&) = default;
+ NullBase& operator=(NullBase const&) = default;
+ NullBase(NullBase &&) = default;
+ NullBase& operator=(NullBase &&) = default;
+};
+
+template <class Derived, bool Explicit = false>
+struct TestBase {
+ static int alive;
+ static int constructed;
+ static int value_constructed;
+ static int default_constructed;
+ static int copy_constructed;
+ static int move_constructed;
+ static int assigned;
+ static int value_assigned;
+ static int copy_assigned;
+ static int move_assigned;
+ static int destroyed;
+
+ static void reset() {
+ assert(alive == 0);
+ alive = 0;
+ reset_constructors();
+ }
+
+ static void reset_constructors() {
+ constructed = value_constructed = default_constructed =
+ copy_constructed = move_constructed = 0;
+ assigned = value_assigned = copy_assigned = move_assigned = destroyed = 0;
+ }
+
+ TestBase() noexcept : value(0) {
+ ++alive; ++constructed; ++default_constructed;
+ }
+ template <bool Dummy = true, typename std::enable_if<Dummy && Explicit, bool>::type = true>
+ explicit TestBase(int x) noexcept : value(x) {
+ ++alive; ++constructed; ++value_constructed;
+ }
+ template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
+ TestBase(int x) noexcept : value(x) {
+ ++alive; ++constructed; ++value_constructed;
+ }
+ template <bool Dummy = true, typename std::enable_if<Dummy && Explicit, bool>::type = true>
+ explicit TestBase(int, int y) noexcept : value(y) {
+ ++alive; ++constructed; ++value_constructed;
+ }
+ template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
+ TestBase(int, int y) noexcept : value(y) {
+ ++alive; ++constructed; ++value_constructed;
+ }
+ template <bool Dummy = true, typename std::enable_if<Dummy && Explicit, bool>::type = true>
+ explicit TestBase(std::initializer_list<int>& il, int = 0) noexcept
+ : value(static_cast<int>(il.size())) {
+ ++alive; ++constructed; ++value_constructed;
+ }
+ template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
+ explicit TestBase(std::initializer_list<int>& il, int = 0) noexcept : value(static_cast<int>(il.size())) {
+ ++alive; ++constructed; ++value_constructed;
+ }
+ TestBase& operator=(int xvalue) noexcept {
+ value = xvalue;
+ ++assigned; ++value_assigned;
+ return *this;
+ }
+protected:
+ ~TestBase() {
+ assert(value != -999); assert(alive > 0);
+ --alive; ++destroyed; value = -999;
+ }
+ explicit TestBase(TestBase const& o) noexcept : value(o.value) {
+ assert(o.value != -1); assert(o.value != -999);
+ ++alive; ++constructed; ++copy_constructed;
+ }
+ explicit TestBase(TestBase && o) noexcept : value(o.value) {
+ assert(o.value != -1); assert(o.value != -999);
+ ++alive; ++constructed; ++move_constructed;
+ o.value = -1;
+ }
+ TestBase& operator=(TestBase const& o) noexcept {
+ assert(o.value != -1); assert(o.value != -999);
+ ++assigned; ++copy_assigned;
+ value = o.value;
+ return *this;
+ }
+ TestBase& operator=(TestBase&& o) noexcept {
+ assert(o.value != -1); assert(o.value != -999);
+ ++assigned; ++move_assigned;
+ value = o.value;
+ o.value = -1;
+ return *this;
+ }
+public:
+ int value;
+};
+
+template <class D, bool E> int TestBase<D, E>::alive = 0;
+template <class D, bool E> int TestBase<D, E>::constructed = 0;
+template <class D, bool E> int TestBase<D, E>::value_constructed = 0;
+template <class D, bool E> int TestBase<D, E>::default_constructed = 0;
+template <class D, bool E> int TestBase<D, E>::copy_constructed = 0;
+template <class D, bool E> int TestBase<D, E>::move_constructed = 0;
+template <class D, bool E> int TestBase<D, E>::assigned = 0;
+template <class D, bool E> int TestBase<D, E>::value_assigned = 0;
+template <class D, bool E> int TestBase<D, E>::copy_assigned = 0;
+template <class D, bool E> int TestBase<D, E>::move_assigned = 0;
+template <class D, bool E> int TestBase<D, E>::destroyed = 0;
+
+template <bool Explicit = false>
+struct ValueBase {
+ template <bool Dummy = true, typename std::enable_if<Dummy && Explicit, bool>::type = true>
+ explicit constexpr ValueBase(int x) : value(x) {}
+ template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
+ constexpr ValueBase(int x) : value(x) {}
+ template <bool Dummy = true, typename std::enable_if<Dummy && Explicit, bool>::type = true>
+ explicit constexpr ValueBase(int, int y) : value(y) {}
+ template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
+ constexpr ValueBase(int, int y) : value(y) {}
+ template <bool Dummy = true, typename std::enable_if<Dummy && Explicit, bool>::type = true>
+ explicit constexpr ValueBase(std::initializer_list<int>& il, int = 0) : value(static_cast<int>(il.size())) {}
+ template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
+ constexpr ValueBase(std::initializer_list<int>& il, int = 0) : value(static_cast<int>(il.size())) {}
+ TEST_CONSTEXPR_CXX14 ValueBase& operator=(int xvalue) noexcept {
+ value = xvalue;
+ return *this;
+ }
+ //~ValueBase() { assert(value != -999); value = -999; }
+ int value;
+protected:
+ constexpr static int check_value(int const& val) {
+#if TEST_STD_VER < 14
+ return val == -1 || val == 999 ? (TEST_THROW(42), 0) : val;
+#else
+ assert(val != -1); assert(val != 999);
+ return val;
+#endif
+ }
+ constexpr static int check_value(int& val, int val_cp = 0) {
+#if TEST_STD_VER < 14
+ return val_cp = val, val = -1, (val_cp == -1 || val_cp == 999 ? (TEST_THROW(42), 0) : val_cp);
+#else
+ assert(val != -1); assert(val != 999);
+ val_cp = val;
+ val = -1;
+ return val_cp;
+#endif
+ }
+ constexpr ValueBase() noexcept : value(0) {}
+ constexpr ValueBase(ValueBase const& o) noexcept : value(check_value(o.value)) {
+ }
+ constexpr ValueBase(ValueBase && o) noexcept : value(check_value(o.value)) {
+ }
+ TEST_CONSTEXPR_CXX14 ValueBase& operator=(ValueBase const& o) noexcept {
+ assert(o.value != -1); assert(o.value != -999);
+ value = o.value;
+ return *this;
+ }
+ TEST_CONSTEXPR_CXX14 ValueBase& operator=(ValueBase&& o) noexcept {
+ assert(o.value != -1); assert(o.value != -999);
+ value = o.value;
+ o.value = -1;
+ return *this;
+ }
+};
+
+
+template <bool Explicit = false>
+struct TrivialValueBase {
+ template <bool Dummy = true, typename std::enable_if<Dummy && Explicit, bool>::type = true>
+ explicit constexpr TrivialValueBase(int x) : value(x) {}
+ template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
+ constexpr TrivialValueBase(int x) : value(x) {}
+ template <bool Dummy = true, typename std::enable_if<Dummy && Explicit, bool>::type = true>
+ explicit constexpr TrivialValueBase(int, int y) : value(y) {}
+ template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
+ constexpr TrivialValueBase(int, int y) : value(y) {}
+ template <bool Dummy = true, typename std::enable_if<Dummy && Explicit, bool>::type = true>
+ explicit constexpr TrivialValueBase(std::initializer_list<int>& il, int = 0) : value(static_cast<int>(il.size())) {}
+ template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
+ constexpr TrivialValueBase(std::initializer_list<int>& il, int = 0) : value(static_cast<int>(il.size())) {}
+ int value;
+protected:
+ constexpr TrivialValueBase() noexcept : value(0) {}
+};
+
+}
+
+//============================================================================//
+// Trivial Implicit Test Types
+namespace ImplicitTypes {
+#include "archetypes.ipp"
+}
+
+//============================================================================//
+// Trivial Explicit Test Types
+namespace ExplicitTypes {
+#define DEFINE_EXPLICIT explicit
+#include "archetypes.ipp"
+}
+
+
+//============================================================================//
+//
+namespace NonConstexprTypes {
+#define DEFINE_CONSTEXPR
+#include "archetypes.ipp"
+}
+
+//============================================================================//
+// Non-literal implicit test types
+namespace NonLiteralTypes {
+#define DEFINE_ASSIGN_CONSTEXPR
+#define DEFINE_DTOR(Name) ~Name() {}
+#include "archetypes.ipp"
+}
+
+//============================================================================//
+// Non-Trivially Copyable Implicit Test Types
+namespace NonTrivialTypes {
+#define DEFINE_CTOR {}
+#define DEFINE_ASSIGN { return *this; }
+#define DEFINE_DEFAULT_CTOR = default
+#include "archetypes.ipp"
+}
+
+//============================================================================//
+// Implicit counting types
+namespace TestTypes {
+#define DEFINE_CONSTEXPR
+#define DEFINE_BASE(Name) ::ArchetypeBases::TestBase<Name>
+#include "archetypes.ipp"
+
+using TestType = AllCtors;
+
+// Add equality operators
+template <class Tp>
+constexpr bool operator==(Tp const& L, Tp const& R) noexcept {
+ return L.value == R.value;
+}
+
+template <class Tp>
+constexpr bool operator!=(Tp const& L, Tp const& R) noexcept {
+ return L.value != R.value;
+}
+
+}
+
+//============================================================================//
+// Implicit counting types
+namespace ExplicitTestTypes {
+#define DEFINE_CONSTEXPR
+#define DEFINE_EXPLICIT explicit
+#define DEFINE_BASE(Name) ::ArchetypeBases::TestBase<Name, true>
+#include "archetypes.ipp"
+
+using TestType = AllCtors;
+
+// Add equality operators
+template <class Tp>
+constexpr bool operator==(Tp const& L, Tp const& R) noexcept {
+ return L.value == R.value;
+}
+
+template <class Tp>
+constexpr bool operator!=(Tp const& L, Tp const& R) noexcept {
+ return L.value != R.value;
+}
+
+}
+
+//============================================================================//
+// Implicit value types
+namespace ConstexprTestTypes {
+#define DEFINE_BASE(Name) ::ArchetypeBases::ValueBase<>
+#include "archetypes.ipp"
+
+using TestType = AllCtors;
+
+// Add equality operators
+template <class Tp>
+constexpr bool operator==(Tp const& L, Tp const& R) noexcept {
+ return L.value == R.value;
+}
+
+template <class Tp>
+constexpr bool operator!=(Tp const& L, Tp const& R) noexcept {
+ return L.value != R.value;
+}
+
+} // end namespace ValueTypes
+
+
+//============================================================================//
+//
+namespace ExplicitConstexprTestTypes {
+#define DEFINE_EXPLICIT explicit
+#define DEFINE_BASE(Name) ::ArchetypeBases::ValueBase<true>
+#include "archetypes.ipp"
+
+using TestType = AllCtors;
+
+// Add equality operators
+template <class Tp>
+constexpr bool operator==(Tp const& L, Tp const& R) noexcept {
+ return L.value == R.value;
+}
+
+template <class Tp>
+constexpr bool operator!=(Tp const& L, Tp const& R) noexcept {
+ return L.value != R.value;
+}
+
+} // end namespace ValueTypes
+
+
+//============================================================================//
+//
+namespace TrivialTestTypes {
+#define DEFINE_BASE(Name) ::ArchetypeBases::TrivialValueBase<false>
+#include "archetypes.ipp"
+
+using TestType = AllCtors;
+
+// Add equality operators
+template <class Tp>
+constexpr bool operator==(Tp const& L, Tp const& R) noexcept {
+ return L.value == R.value;
+}
+
+template <class Tp>
+constexpr bool operator!=(Tp const& L, Tp const& R) noexcept {
+ return L.value != R.value;
+}
+
+} // end namespace TrivialValueTypes
+
+//============================================================================//
+//
+namespace ExplicitTrivialTestTypes {
+#define DEFINE_EXPLICIT explicit
+#define DEFINE_BASE(Name) ::ArchetypeBases::TrivialValueBase<true>
+#include "archetypes.ipp"
+
+using TestType = AllCtors;
+
+// Add equality operators
+template <class Tp>
+constexpr bool operator==(Tp const& L, Tp const& R) noexcept {
+ return L.value == R.value;
+}
+
+template <class Tp>
+constexpr bool operator!=(Tp const& L, Tp const& R) noexcept {
+ return L.value != R.value;
+}
+
+} // end namespace ExplicitTrivialTestTypes
+
+#endif // TEST_STD_VER >= 11
+
+#endif // TEST_SUPPORT_ARCHETYPES_HPP
diff --git a/test/support/archetypes.ipp b/test/support/archetypes.ipp
new file mode 100644
index 000000000000..d8d1e5a9330b
--- /dev/null
+++ b/test/support/archetypes.ipp
@@ -0,0 +1,169 @@
+
+#ifndef DEFINE_BASE
+#define DEFINE_BASE(Name) ::ArchetypeBases::NullBase
+#endif
+#ifndef DEFINE_EXPLICIT
+#define DEFINE_EXPLICIT
+#endif
+#ifndef DEFINE_CONSTEXPR
+#define DEFINE_CONSTEXPR constexpr
+#endif
+#ifndef DEFINE_ASSIGN_CONSTEXPR
+#if TEST_STD_VER >= 14
+#define DEFINE_ASSIGN_CONSTEXPR DEFINE_CONSTEXPR
+#else
+#define DEFINE_ASSIGN_CONSTEXPR
+#endif
+#endif
+#ifndef DEFINE_CTOR
+#define DEFINE_CTOR = default
+#endif
+#ifndef DEFINE_DEFAULT_CTOR
+#define DEFINE_DEFAULT_CTOR DEFINE_CTOR
+#endif
+#ifndef DEFINE_ASSIGN
+#define DEFINE_ASSIGN = default
+#endif
+#ifndef DEFINE_DTOR
+#define DEFINE_DTOR(Name)
+#endif
+
+struct AllCtors : DEFINE_BASE(AllCtors) {
+ using Base = DEFINE_BASE(AllCtors);
+ using Base::Base;
+ using Base::operator=;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR AllCtors() DEFINE_DEFAULT_CTOR;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR AllCtors(AllCtors const&) DEFINE_CTOR;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR AllCtors(AllCtors &&) DEFINE_CTOR;
+ DEFINE_ASSIGN_CONSTEXPR AllCtors& operator=(AllCtors const&) DEFINE_ASSIGN;
+ DEFINE_ASSIGN_CONSTEXPR AllCtors& operator=(AllCtors &&) DEFINE_ASSIGN;
+ DEFINE_DTOR(AllCtors)
+};
+
+struct NoCtors : DEFINE_BASE(NoCtors) {
+ using Base = DEFINE_BASE(NoCtors);
+ DEFINE_EXPLICIT NoCtors() = delete;
+ DEFINE_EXPLICIT NoCtors(NoCtors const&) = delete;
+ NoCtors& operator=(NoCtors const&) = delete;
+ DEFINE_DTOR(NoCtors)
+};
+
+struct NoDefault : DEFINE_BASE(NoDefault) {
+ using Base = DEFINE_BASE(NoDefault);
+ using Base::Base;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR NoDefault() = delete;
+ DEFINE_DTOR(NoDefault)
+};
+
+struct DefaultOnly : DEFINE_BASE(DefaultOnly) {
+ using Base = DEFINE_BASE(DefaultOnly);
+ using Base::Base;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR DefaultOnly() DEFINE_DEFAULT_CTOR;
+ DefaultOnly(DefaultOnly const&) = delete;
+ DefaultOnly& operator=(DefaultOnly const&) = delete;
+ DEFINE_DTOR(DefaultOnly)
+};
+
+struct Copyable : DEFINE_BASE(Copyable) {
+ using Base = DEFINE_BASE(Copyable);
+ using Base::Base;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR Copyable() DEFINE_DEFAULT_CTOR;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR Copyable(Copyable const &) DEFINE_CTOR;
+ Copyable &operator=(Copyable const &) DEFINE_ASSIGN;
+ DEFINE_DTOR(Copyable)
+};
+
+struct CopyOnly : DEFINE_BASE(CopyOnly) {
+ using Base = DEFINE_BASE(CopyOnly);
+ using Base::Base;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR CopyOnly() DEFINE_DEFAULT_CTOR;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR CopyOnly(CopyOnly const &) DEFINE_CTOR;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR CopyOnly(CopyOnly &&) = delete;
+ CopyOnly &operator=(CopyOnly const &) DEFINE_ASSIGN;
+ CopyOnly &operator=(CopyOnly &&) = delete;
+ DEFINE_DTOR(CopyOnly)
+};
+
+struct NonCopyable : DEFINE_BASE(NonCopyable) {
+ using Base = DEFINE_BASE(NonCopyable);
+ using Base::Base;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR NonCopyable() DEFINE_DEFAULT_CTOR;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR NonCopyable(NonCopyable const &) = delete;
+ NonCopyable &operator=(NonCopyable const &) = delete;
+ DEFINE_DTOR(NonCopyable)
+};
+
+struct MoveOnly : DEFINE_BASE(MoveOnly) {
+ using Base = DEFINE_BASE(MoveOnly);
+ using Base::Base;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR MoveOnly() DEFINE_DEFAULT_CTOR;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR MoveOnly(MoveOnly &&) DEFINE_CTOR;
+ MoveOnly &operator=(MoveOnly &&) DEFINE_ASSIGN;
+ DEFINE_DTOR(MoveOnly)
+};
+
+struct CopyAssignable : DEFINE_BASE(CopyAssignable) {
+ using Base = DEFINE_BASE(CopyAssignable);
+ using Base::Base;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR CopyAssignable() = delete;
+ CopyAssignable& operator=(CopyAssignable const&) DEFINE_ASSIGN;
+ DEFINE_DTOR(CopyAssignable)
+};
+
+struct CopyAssignOnly : DEFINE_BASE(CopyAssignOnly) {
+ using Base = DEFINE_BASE(CopyAssignOnly);
+ using Base::Base;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR CopyAssignOnly() = delete;
+ CopyAssignOnly& operator=(CopyAssignOnly const&) DEFINE_ASSIGN;
+ CopyAssignOnly& operator=(CopyAssignOnly &&) = delete;
+ DEFINE_DTOR(CopyAssignOnly)
+};
+
+struct MoveAssignOnly : DEFINE_BASE(MoveAssignOnly) {
+ using Base = DEFINE_BASE(MoveAssignOnly);
+ using Base::Base;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR MoveAssignOnly() = delete;
+ MoveAssignOnly& operator=(MoveAssignOnly const&) = delete;
+ MoveAssignOnly& operator=(MoveAssignOnly &&) DEFINE_ASSIGN;
+ DEFINE_DTOR(MoveAssignOnly)
+};
+
+struct ConvertingType : DEFINE_BASE(ConvertingType) {
+ using Base = DEFINE_BASE(ConvertingType);
+ using Base::Base;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR ConvertingType() DEFINE_DEFAULT_CTOR;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR ConvertingType(ConvertingType const&) DEFINE_CTOR;
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR ConvertingType(ConvertingType &&) DEFINE_CTOR;
+ ConvertingType& operator=(ConvertingType const&) DEFINE_ASSIGN;
+ ConvertingType& operator=(ConvertingType &&) DEFINE_ASSIGN;
+ template <class ...Args>
+ DEFINE_EXPLICIT DEFINE_CONSTEXPR ConvertingType(Args&&...) {}
+ template <class Arg>
+ ConvertingType& operator=(Arg&&) { return *this; }
+ DEFINE_DTOR(ConvertingType)
+};
+
+template <template <class...> class List>
+using ApplyTypes = List<
+ AllCtors,
+ NoCtors,
+ NoDefault,
+ DefaultOnly,
+ Copyable,
+ CopyOnly,
+ NonCopyable,
+ MoveOnly,
+ CopyAssignable,
+ CopyAssignOnly,
+ MoveAssignOnly,
+ ConvertingType
+ >;
+
+#undef DEFINE_BASE
+#undef DEFINE_EXPLICIT
+#undef DEFINE_CONSTEXPR
+#undef DEFINE_ASSIGN_CONSTEXPR
+#undef DEFINE_CTOR
+#undef DEFINE_DEFAULT_CTOR
+#undef DEFINE_ASSIGN
+#undef DEFINE_DTOR
diff --git a/test/support/container_test_types.h b/test/support/container_test_types.h
index 0b97f2e94e75..c17ce9139484 100644
--- a/test/support/container_test_types.h
+++ b/test/support/container_test_types.h
@@ -371,7 +371,7 @@ struct CopyInsertable {
template <class ...Args>
- CopyInsertable(Args&&... args) {
+ CopyInsertable(Args&&...) {
assert(false);
}
diff --git a/test/support/controlled_allocators.hpp b/test/support/controlled_allocators.hpp
new file mode 100644
index 000000000000..280aaa564c69
--- /dev/null
+++ b/test/support/controlled_allocators.hpp
@@ -0,0 +1,502 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 SUPPORT_CONTROLLED_ALLOCATORS_HPP
+#define SUPPORT_CONTROLLED_ALLOCATORS_HPP
+
+#include <memory>
+#include <type_traits>
+#include <cstddef>
+#include <cstdlib>
+#include <cstring>
+#include <cstdint>
+#include <cassert>
+#include "test_macros.h"
+#include "type_id.h"
+
+#if TEST_STD_VER < 11
+#error This header requires C++11 or greater
+#endif
+
+struct AllocController;
+ // 'AllocController' is a concrete type that instruments and controls the
+ // behavior of of test allocators.
+
+template <class T, size_t ID = 0>
+class CountingAllocator;
+ // 'CountingAllocator' is an basic implementation of the 'Allocator'
+ // requirements that use the 'AllocController' interface.
+
+template <class T>
+class MinAlignAllocator;
+ // 'MinAlignAllocator' is an instrumented test type which implements the
+ // 'Allocator' requirements. 'MinAlignAllocator' ensures that it *never*
+ // returns a pointer to over-aligned storage. For example
+ // 'MinAlignPointer<char>{}.allocate(...)' will never a 2-byte aligned
+ // pointer.
+
+template <class T>
+class NullAllocator;
+ // 'NullAllocator' is an instrumented test type which implements the
+ // 'Allocator' requirements except that 'allocator' and 'deallocate' are
+ // nops.
+
+
+#define DISALLOW_COPY(Type) \
+ Type(Type const&) = delete; \
+ Type& operator=(Type const&) = delete
+
+constexpr std::size_t MaxAlignV = alignof(std::max_align_t);
+
+struct TestException {};
+
+struct AllocController {
+ int copy_constructed = 0;
+ int move_constructed = 0;
+
+ int alive = 0;
+ int alloc_count = 0;
+ int dealloc_count = 0;
+ int is_equal_count = 0;
+
+ std::size_t alive_size;
+ std::size_t allocated_size;
+ std::size_t deallocated_size;
+
+ std::size_t last_size = 0;
+ std::size_t last_align = 0;
+ void * last_pointer = 0;
+
+ std::size_t last_alloc_size = 0;
+ std::size_t last_alloc_align = 0;
+ void * last_alloc_pointer = nullptr;
+
+ std::size_t last_dealloc_size = 0;
+ std::size_t last_dealloc_align = 0;
+ void * last_dealloc_pointer = nullptr;
+
+ bool throw_on_alloc = false;
+
+ int construct_called = 0;
+ void *last_construct_pointer = nullptr;
+ TypeID const* last_construct_alloc = nullptr;
+ TypeID const* last_construct_type = nullptr;
+ TypeID const* last_construct_args = nullptr;
+
+ int destroy_called = 0;
+ void *last_destroy_pointer = nullptr;
+ TypeID const* last_destroy_alloc = nullptr;
+ TypeID const* last_destroy_type = nullptr;
+
+ AllocController() = default;
+
+ void countAlloc(void* p, size_t s, size_t a) {
+ ++alive;
+ ++alloc_count;
+ alive_size += s;
+ allocated_size += s;
+ last_pointer = last_alloc_pointer = p;
+ last_size = last_alloc_size = s;
+ last_align = last_alloc_align = a;
+ }
+
+ void countDealloc(void* p, size_t s, size_t a) {
+ --alive;
+ ++dealloc_count;
+ alive_size -= s;
+ deallocated_size += s;
+ last_pointer = last_dealloc_pointer = p;
+ last_size = last_dealloc_size = s;
+ last_align = last_dealloc_align = a;
+ }
+
+ template <class ...Args, class Alloc, class Tp>
+ void countConstruct(Alloc const&, Tp *p) {
+ ++construct_called;
+ last_construct_pointer = p;
+ last_construct_alloc = &makeTypeID<Alloc>();
+ last_construct_type = &makeTypeID<Tp>();
+ last_construct_args = &makeArgumentID<Args...>();
+ }
+
+ template <class Alloc, class Tp>
+ void countDestroy(Alloc const&, Tp *p) {
+ ++destroy_called;
+ last_destroy_alloc = &makeTypeID<Alloc>();
+ last_destroy_type = &makeTypeID<Tp>();
+ last_destroy_pointer = p;
+ }
+
+ void reset() { std::memset(this, 0, sizeof(*this)); }
+ void resetConstructDestroy() {
+ construct_called = 0;
+ last_construct_pointer = nullptr;
+ last_construct_alloc = last_construct_args = last_construct_type = nullptr;
+ destroy_called = 0;
+ last_destroy_alloc = nullptr;
+ last_destroy_pointer = nullptr;
+ }
+public:
+ bool checkAlloc(void* p, size_t s, size_t a) const {
+ return p == last_alloc_pointer &&
+ s == last_alloc_size &&
+ a == last_alloc_align;
+ }
+
+ bool checkAlloc(void* p, size_t s) const {
+ return p == last_alloc_pointer &&
+ s == last_alloc_size;
+ }
+
+ bool checkAllocAtLeast(void* p, size_t s, size_t a) const {
+ return p == last_alloc_pointer &&
+ s <= last_alloc_size &&
+ a <= last_alloc_align;
+ }
+
+ bool checkAllocAtLeast(void* p, size_t s) const {
+ return p == last_alloc_pointer &&
+ s <= last_alloc_size;
+ }
+
+ bool checkDealloc(void* p, size_t s, size_t a) const {
+ return p == last_dealloc_pointer &&
+ s == last_dealloc_size &&
+ a == last_dealloc_align;
+ }
+
+ bool checkDealloc(void* p, size_t s) const {
+ return p == last_dealloc_pointer &&
+ s == last_dealloc_size;
+ }
+
+ bool checkDeallocMatchesAlloc() const {
+ return last_dealloc_pointer == last_alloc_pointer &&
+ last_dealloc_size == last_alloc_size &&
+ last_dealloc_align == last_alloc_align;
+ }
+
+ template <class ...Args, class Alloc, class Tp>
+ bool checkConstruct(Alloc const&, Tp *p) const {
+ auto expectAlloc = &makeTypeID<Alloc>();
+ auto expectTp = &makeTypeID<Tp>();
+ auto expectArgs = &makeArgumentID<Args...>();
+ return last_construct_pointer == p &&
+ COMPARE_TYPEID(last_construct_alloc, expectAlloc) &&
+ COMPARE_TYPEID(last_construct_type, expectTp) &&
+ COMPARE_TYPEID(last_construct_args, expectArgs);
+ }
+
+ template <class Alloc, class Tp>
+ bool checkDestroy(Alloc const&, Tp *p) const {
+ return last_destroy_pointer == p &&
+ last_destroy_alloc == &makeTypeID<Alloc>() &&
+ last_destroy_type == &makeTypeID<Tp>();
+ }
+
+ bool checkDestroyMatchesConstruct() const {
+ return last_destroy_pointer == last_construct_pointer &&
+ last_destroy_type == last_construct_type;
+ }
+
+ void countIsEqual() {
+ ++is_equal_count;
+ }
+
+ bool checkIsEqualCalledEq(int n) const {
+ return is_equal_count == n;
+ }
+private:
+ DISALLOW_COPY(AllocController);
+};
+
+template <class T, size_t ID>
+class CountingAllocator
+{
+public:
+ typedef T value_type;
+ typedef T* pointer;
+
+ template <class U>
+ struct rebind { using other = CountingAllocator<U, ID>; };
+
+ CountingAllocator() = delete;
+ explicit CountingAllocator(AllocController& PP) : P(&PP) {}
+
+ CountingAllocator(CountingAllocator const& other) : P(other.P) {
+ P->copy_constructed += 1;
+ }
+
+ CountingAllocator(CountingAllocator&& other) : P(other.P) {
+ P->move_constructed += 1;
+ }
+
+ template <class U>
+ CountingAllocator(CountingAllocator<U, ID> const& other) TEST_NOEXCEPT : P(other.P) {
+ P->copy_constructed += 1;
+ }
+
+ template <class U>
+ CountingAllocator(CountingAllocator<U, ID>&& other) TEST_NOEXCEPT : P(other.P) {
+ P->move_constructed += 1;
+ }
+
+ T* allocate(std::size_t n)
+ {
+ void* ret = ::operator new(n*sizeof(T));
+ P->countAlloc(ret, n*sizeof(T), alignof(T));
+ return static_cast<T*>(ret);
+ }
+
+ void deallocate(T* p, std::size_t n)
+ {
+ void* vp = static_cast<void*>(p);
+ P->countDealloc(vp, n*sizeof(T), alignof(T));
+ ::operator delete(vp);
+ }
+
+ template <class U, class ...Args>
+ void construct(U *p, Args&&... args) {
+ ::new ((void*)p) U(std::forward<Args>(args)...);
+ P->countConstruct<Args&&...>(*this, p);
+ }
+
+ template <class U>
+ void destroy(U* p) {
+ p->~U();
+ P->countDestroy(*this, p);
+ }
+
+ AllocController& getController() const { return *P; }
+
+private:
+ template <class Tp, size_t XID> friend class CountingAllocator;
+ AllocController *P;
+};
+
+
+template <size_t ID>
+class CountingAllocator<void, ID>
+{
+public:
+ typedef void* pointer;
+ typedef const void* const_pointer;
+ typedef void value_type;
+
+ template <class U>
+ struct rebind { using other = CountingAllocator<U, ID>; };
+
+ CountingAllocator() = delete;
+ explicit CountingAllocator(AllocController& PP) : P(&PP) {}
+
+ CountingAllocator(CountingAllocator const& other) : P(other.P) {
+ P->copy_constructed += 1;
+ }
+
+ CountingAllocator(CountingAllocator&& other) : P(other.P) {
+ P->move_constructed += 1;
+ }
+
+ template <class U>
+ CountingAllocator(CountingAllocator<U, ID> const& other) TEST_NOEXCEPT : P(other.P) {
+ P->copy_constructed += 1;
+ }
+
+ template <class U>
+ CountingAllocator(CountingAllocator<U, ID>&& other) TEST_NOEXCEPT : P(other.P) {
+ P->move_constructed += 1;
+ }
+
+ void construct(...) = delete;
+ void destroy(void*) = delete;
+
+ AllocController& getController() const { return *P; }
+
+private:
+ template <class Tp, size_t> friend class CountingAllocator;
+ AllocController *P;
+};
+
+template <class T, class U, size_t ID>
+inline bool operator==(CountingAllocator<T, ID> const& x,
+ CountingAllocator<U, ID> const& y) {
+ return &x.getController() == &y.getController();
+}
+
+template <class T, class U, size_t ID>
+inline bool operator!=(CountingAllocator<T, ID> const& x,
+ CountingAllocator<U, ID> const& y) {
+ return !(x == y);
+}
+
+template <class T>
+class MinAlignedAllocator
+{
+public:
+ typedef T value_type;
+ typedef T* pointer;
+
+ MinAlignedAllocator() = delete;
+
+ explicit MinAlignedAllocator(AllocController& R) : P(&R) {}
+
+ MinAlignedAllocator(MinAlignedAllocator const& other) : P(other.P) {
+ P->copy_constructed += 1;
+ }
+
+ MinAlignedAllocator(MinAlignedAllocator&& other) : P(other.P) {
+ P->move_constructed += 1;
+ }
+
+ template <class U>
+ MinAlignedAllocator(MinAlignedAllocator<U> const& other) TEST_NOEXCEPT : P(other.P) {
+ P->copy_constructed += 1;
+ }
+
+ template <class U>
+ MinAlignedAllocator(MinAlignedAllocator<U>&& other) TEST_NOEXCEPT : P(other.P) {
+ P->move_constructed += 1;
+ }
+
+ T* allocate(std::size_t n) {
+ char* aligned_ptr = (char*)::operator new(alloc_size(n*sizeof(T)));
+ assert(is_max_aligned(aligned_ptr));
+
+ char* unaligned_ptr = aligned_ptr + alignof(T);
+ assert(is_min_aligned(unaligned_ptr));
+
+ P->countAlloc(unaligned_ptr, n * sizeof(T), alignof(T));
+
+ return ((T*)unaligned_ptr);
+ }
+
+ void deallocate(T* p, std::size_t n) {
+ assert(is_min_aligned(p));
+
+ char* aligned_ptr = ((char*)p) - alignof(T);
+ assert(is_max_aligned(aligned_ptr));
+
+ P->countDealloc(p, n*sizeof(T), alignof(T));
+
+ return ::operator delete(static_cast<void*>(aligned_ptr));
+ }
+
+ template <class U, class ...Args>
+ void construct(U *p, Args&&... args) {
+ auto *c = ::new ((void*)p) U(std::forward<Args>(args)...);
+ P->countConstruct<Args&&...>(*this, p);
+ }
+
+ template <class U>
+ void destroy(U* p) {
+ p->~U();
+ P->countDestroy(*this, p);
+ }
+
+ AllocController& getController() const { return *P; }
+
+private:
+ static const std::size_t BlockSize = alignof(std::max_align_t);
+
+ static std::size_t alloc_size(std::size_t s) {
+ std::size_t bytes = (s + BlockSize - 1) & ~(BlockSize - 1);
+ bytes += BlockSize;
+ assert(bytes % BlockSize == 0);
+ return bytes;
+ }
+
+ static bool is_max_aligned(void* p) {
+ return reinterpret_cast<std::uintptr_t>(p) % BlockSize == 0;
+ }
+
+ static bool is_min_aligned(void* p) {
+ if (alignof(T) == BlockSize) {
+ return is_max_aligned(p);
+ } else {
+ return reinterpret_cast<std::uintptr_t>(p) % BlockSize == alignof(T);
+ }
+ }
+
+ template <class Tp> friend class MinAlignedAllocator;
+ mutable AllocController *P;
+};
+
+
+template <class T, class U>
+inline bool operator==(MinAlignedAllocator<T> const& x,
+ MinAlignedAllocator<U> const& y) {
+ return &x.getController() == &y.getController();
+}
+
+template <class T, class U>
+inline bool operator!=(MinAlignedAllocator<T> const& x,
+ MinAlignedAllocator<U> const& y) {
+ return !(x == y);
+}
+
+template <class T>
+class NullAllocator
+{
+public:
+ typedef T value_type;
+ typedef T* pointer;
+ NullAllocator() = delete;
+ explicit NullAllocator(AllocController& PP) : P(&PP) {}
+
+ NullAllocator(NullAllocator const& other) : P(other.P) {
+ P->copy_constructed += 1;
+ }
+
+ NullAllocator(NullAllocator&& other) : P(other.P) {
+ P->move_constructed += 1;
+ }
+
+ template <class U>
+ NullAllocator(NullAllocator<U> const& other) TEST_NOEXCEPT : P(other.P) {
+ P->copy_constructed += 1;
+ }
+
+ template <class U>
+ NullAllocator(NullAllocator<U>&& other) TEST_NOEXCEPT : P(other.P) {
+ P->move_constructed += 1;
+ }
+
+ T* allocate(std::size_t n)
+ {
+ P->countAlloc(nullptr, n*sizeof(T), alignof(T));
+ return nullptr;
+ }
+
+ void deallocate(T* p, std::size_t n)
+ {
+ void* vp = static_cast<void*>(p);
+ P->countDealloc(vp, n*sizeof(T), alignof(T));
+ }
+
+ AllocController& getController() const { return *P; }
+
+private:
+ template <class Tp> friend class NullAllocator;
+ AllocController *P;
+};
+
+template <class T, class U>
+inline bool operator==(NullAllocator<T> const& x,
+ NullAllocator<U> const& y) {
+ return &x.getController() == &y.getController();
+}
+
+template <class T, class U>
+inline bool operator!=(NullAllocator<T> const& x,
+ NullAllocator<U> const& y) {
+ return !(x == y);
+}
+
+
+#endif /* SUPPORT_CONTROLLED_ALLOCATORS_HPP */
diff --git a/test/support/count_new.hpp b/test/support/count_new.hpp
index 923e49513487..1b05fe35e948 100644
--- a/test/support/count_new.hpp
+++ b/test/support/count_new.hpp
@@ -59,12 +59,12 @@ public:
int outstanding_new;
int new_called;
int delete_called;
- int last_new_size;
+ std::size_t last_new_size;
int outstanding_array_new;
int new_array_called;
int delete_array_called;
- int last_new_array_size;
+ std::size_t last_new_array_size;
public:
void newCalled(std::size_t s)
@@ -174,12 +174,12 @@ public:
return disable_checking || n != delete_called;
}
- bool checkLastNewSizeEq(int n) const
+ bool checkLastNewSizeEq(std::size_t n) const
{
return disable_checking || n == last_new_size;
}
- bool checkLastNewSizeNotEq(int n) const
+ bool checkLastNewSizeNotEq(std::size_t n) const
{
return disable_checking || n != last_new_size;
}
@@ -214,12 +214,12 @@ public:
return disable_checking || n != delete_array_called;
}
- bool checkLastNewArraySizeEq(int n) const
+ bool checkLastNewArraySizeEq(std::size_t n) const
{
return disable_checking || n == last_new_array_size;
}
- bool checkLastNewArraySizeNotEq(int n) const
+ bool checkLastNewArraySizeNotEq(std::size_t n) const
{
return disable_checking || n != last_new_array_size;
}
@@ -234,7 +234,7 @@ public:
MemCounter globalMemCounter((MemCounter::MemCounterCtorArg_()));
#ifndef DISABLE_NEW_COUNT
-void* operator new(std::size_t s) throw(std::bad_alloc)
+void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
globalMemCounter.newCalled(s);
void* ret = std::malloc(s);
@@ -243,21 +243,21 @@ void* operator new(std::size_t s) throw(std::bad_alloc)
return ret;
}
-void operator delete(void* p) throw()
+void operator delete(void* p) TEST_NOEXCEPT
{
globalMemCounter.deleteCalled(p);
std::free(p);
}
-void* operator new[](std::size_t s) throw(std::bad_alloc)
+void* operator new[](std::size_t s) TEST_THROW_SPEC(std::bad_alloc)
{
globalMemCounter.newArrayCalled(s);
return operator new(s);
}
-void operator delete[](void* p) throw()
+void operator delete[](void* p) TEST_NOEXCEPT
{
globalMemCounter.deleteArrayCalled(p);
operator delete(p);
@@ -304,10 +304,10 @@ struct RequireAllocationGuard {
void requireExactly(std::size_t N) { m_req_alloc = N; m_exactly = true; }
~RequireAllocationGuard() {
- assert(globalMemCounter.checkOutstandingNewEq(m_outstanding_new_on_init));
+ assert(globalMemCounter.checkOutstandingNewEq(static_cast<int>(m_outstanding_new_on_init)));
std::size_t Expect = m_new_count_on_init + m_req_alloc;
- assert(globalMemCounter.checkNewCalledEq(Expect) ||
- (!m_exactly && globalMemCounter.checkNewCalledGreaterThan(Expect)));
+ assert(globalMemCounter.checkNewCalledEq(static_cast<int>(Expect)) ||
+ (!m_exactly && globalMemCounter.checkNewCalledGreaterThan(static_cast<int>(Expect))));
}
private:
diff --git a/test/support/debug_mode_helper.h b/test/support/debug_mode_helper.h
new file mode 100644
index 000000000000..0c6170589c2e
--- /dev/null
+++ b/test/support/debug_mode_helper.h
@@ -0,0 +1,382 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 TEST_SUPPORT_DEBUG_MODE_HELPER_H
+#define TEST_SUPPORT_DEBUG_MODE_HELPER_H
+
+#ifndef _LIBCPP_DEBUG
+#error _LIBCPP_DEBUG must be defined before including this header
+#endif
+#ifndef _LIBCPP_DEBUG_USE_EXCEPTIONS
+#error _LIBCPP_DEBUG_USE_EXCEPTIONS must be defined before including this header
+#endif
+
+#include <ciso646>
+#ifndef _LIBCPP_VERSION
+#error This header may only be used for libc++ tests"
+#endif
+
+#include <__debug>
+#include <utility>
+#include <cstddef>
+#include <cstdlib>
+#include <cassert>
+
+#include "test_macros.h"
+#include "assert_checkpoint.h"
+#include "test_allocator.h"
+
+// These test make use of 'if constexpr'.
+#if TEST_STD_VER <= 14
+#error This header may only be used in C++17 and greater
+#endif
+#ifdef TEST_HAS_NO_EXCEPTIONS
+#error These tests require exceptions
+#endif
+
+#ifndef __cpp_if_constexpr
+#error These tests require if constexpr
+#endif
+
+/// Assert that the specified expression throws a libc++ debug exception.
+#define CHECK_DEBUG_THROWS(...) assert((CheckDebugThrows( [&]() { __VA_ARGS__; } )))
+
+template <class Func>
+inline bool CheckDebugThrows(Func&& func) {
+ try {
+ func();
+ } catch (std::__libcpp_debug_exception const&) {
+ return true;
+ }
+ return false;
+}
+
+namespace IteratorDebugChecks {
+
+enum ContainerType {
+ CT_None,
+ CT_String,
+ CT_Vector,
+ CT_VectorBool,
+ CT_List,
+ CT_Deque,
+ CT_ForwardList,
+ CT_Map,
+ CT_Set,
+ CT_MultiMap,
+ CT_MultiSet,
+ CT_UnorderedMap,
+ CT_UnorderedSet,
+ CT_UnorderedMultiMap,
+ CT_UnorderedMultiSet
+};
+
+constexpr bool isSequential(ContainerType CT) {
+ return CT_Vector >= CT && CT_ForwardList <= CT;
+}
+
+constexpr bool isAssociative(ContainerType CT) {
+ return CT_Map >= CT && CT_MultiSet <= CT;
+}
+
+constexpr bool isUnordered(ContainerType CT) {
+ return CT_UnorderedMap >= CT && CT_UnorderedMultiSet <= CT;
+}
+
+constexpr bool isSet(ContainerType CT) {
+ return CT == CT_Set
+ || CT == CT_MultiSet
+ || CT == CT_UnorderedSet
+ || CT == CT_UnorderedMultiSet;
+}
+
+constexpr bool isMap(ContainerType CT) {
+ return CT == CT_Map
+ || CT == CT_MultiMap
+ || CT == CT_UnorderedMap
+ || CT == CT_UnorderedMultiMap;
+}
+
+constexpr bool isMulti(ContainerType CT) {
+ return CT == CT_MultiMap
+ || CT == CT_MultiSet
+ || CT == CT_UnorderedMultiMap
+ || CT == CT_UnorderedMultiSet;
+}
+
+template <class Container, class ValueType = typename Container::value_type>
+struct ContainerDebugHelper {
+ static_assert(std::is_constructible<ValueType, int>::value,
+ "must be constructible from int");
+
+ static ValueType makeValueType(int val = 0, int = 0) {
+ return ValueType(val);
+ }
+};
+
+template <class Container>
+struct ContainerDebugHelper<Container, char> {
+ static char makeValueType(int = 0, int = 0) {
+ return 'A';
+ }
+};
+
+template <class Container, class Key, class Value>
+struct ContainerDebugHelper<Container, std::pair<const Key, Value> > {
+ using ValueType = std::pair<const Key, Value>;
+ static_assert(std::is_constructible<Key, int>::value,
+ "must be constructible from int");
+ static_assert(std::is_constructible<Value, int>::value,
+ "must be constructible from int");
+
+ static ValueType makeValueType(int key = 0, int val = 0) {
+ return ValueType(key, val);
+ }
+};
+
+template <class Container, ContainerType CT,
+ class Helper = ContainerDebugHelper<Container> >
+struct BasicContainerChecks {
+ using value_type = typename Container::value_type;
+ using iterator = typename Container::iterator;
+ using const_iterator = typename Container::const_iterator;
+ using allocator_type = typename Container::allocator_type;
+ using traits = std::iterator_traits<iterator>;
+ using category = typename traits::iterator_category;
+
+ static_assert(std::is_same<test_allocator<value_type>, allocator_type>::value,
+ "the container must use a test allocator");
+
+ static constexpr bool IsBiDir =
+ std::is_convertible<category, std::bidirectional_iterator_tag>::value;
+
+public:
+ static void run() {
+ run_iterator_tests();
+ run_container_tests();
+ run_allocator_aware_tests();
+ }
+
+ static void run_iterator_tests() {
+ try {
+ TestNullIterators<iterator>();
+ TestNullIterators<const_iterator>();
+ if constexpr (IsBiDir) { DecrementBegin(); }
+ IncrementEnd();
+ DerefEndIterator();
+ } catch (...) {
+ assert(false && "uncaught debug exception");
+ }
+ }
+
+ static void run_container_tests() {
+ try {
+ CopyInvalidatesIterators();
+ MoveInvalidatesIterators();
+ if constexpr (CT != CT_ForwardList) {
+ EraseIter();
+ EraseIterIter();
+ }
+ } catch (...) {
+ assert(false && "uncaught debug exception");
+ }
+ }
+
+ static void run_allocator_aware_tests() {
+ try {
+ SwapNonEqualAllocators();
+ if constexpr (CT != CT_ForwardList) {
+ SwapInvalidatesIterators(); // FIXME: This should work
+ }
+ } catch (...) {
+ assert(false && "uncaught debug exception");
+ }
+ }
+
+ static Container makeContainer(int size, allocator_type A = allocator_type()) {
+ Container C(A);
+ if constexpr (CT == CT_ForwardList) {
+ for (int i = 0; i < size; ++i)
+ C.insert_after(C.before_begin(), Helper::makeValueType(i));
+ } else {
+ for (int i = 0; i < size; ++i)
+ C.insert(C.end(), Helper::makeValueType(i));
+ assert(C.size() == static_cast<std::size_t>(size));
+ }
+ return C;
+ }
+
+ static value_type makeValueType(int value) {
+ return Helper::makeValueType(value);
+ }
+
+private:
+ // Iterator tests
+ template <class Iter>
+ static void TestNullIterators() {
+ CHECKPOINT("testing null iterator");
+ Iter it;
+ CHECK_DEBUG_THROWS( ++it );
+ CHECK_DEBUG_THROWS( it++ );
+ CHECK_DEBUG_THROWS( *it );
+ if constexpr (CT != CT_VectorBool) {
+ CHECK_DEBUG_THROWS( it.operator->() );
+ }
+ if constexpr (IsBiDir) {
+ CHECK_DEBUG_THROWS( --it );
+ CHECK_DEBUG_THROWS( it-- );
+ }
+ }
+
+ static void DecrementBegin() {
+ CHECKPOINT("testing decrement on begin");
+ Container C = makeContainer(1);
+ iterator i = C.end();
+ const_iterator ci = C.cend();
+ --i;
+ --ci;
+ assert(i == C.begin());
+ CHECK_DEBUG_THROWS( --i );
+ CHECK_DEBUG_THROWS( i-- );
+ CHECK_DEBUG_THROWS( --ci );
+ CHECK_DEBUG_THROWS( ci-- );
+ }
+
+ static void IncrementEnd() {
+ CHECKPOINT("testing increment on end");
+ Container C = makeContainer(1);
+ iterator i = C.begin();
+ const_iterator ci = C.begin();
+ ++i;
+ ++ci;
+ assert(i == C.end());
+ CHECK_DEBUG_THROWS( ++i );
+ CHECK_DEBUG_THROWS( i++ );
+ CHECK_DEBUG_THROWS( ++ci );
+ CHECK_DEBUG_THROWS( ci++ );
+ }
+
+ static void DerefEndIterator() {
+ CHECKPOINT("testing deref end iterator");
+ Container C = makeContainer(1);
+ iterator i = C.begin();
+ const_iterator ci = C.cbegin();
+ (void)*i; (void)*ci;
+ if constexpr (CT != CT_VectorBool) {
+ i.operator->();
+ ci.operator->();
+ }
+ ++i; ++ci;
+ assert(i == C.end());
+ CHECK_DEBUG_THROWS( *i );
+ CHECK_DEBUG_THROWS( *ci );
+ if constexpr (CT != CT_VectorBool) {
+ CHECK_DEBUG_THROWS( i.operator->() );
+ CHECK_DEBUG_THROWS( ci.operator->() );
+ }
+ }
+
+ // Container tests
+ static void CopyInvalidatesIterators() {
+ CHECKPOINT("copy invalidates iterators");
+ Container C1 = makeContainer(3);
+ iterator i = C1.begin();
+ Container C2 = C1;
+ if constexpr (CT == CT_ForwardList) {
+ iterator i_next = i;
+ ++i_next;
+ (void)*i_next;
+ CHECK_DEBUG_THROWS( C2.erase_after(i) );
+ C1.erase_after(i);
+ CHECK_DEBUG_THROWS( *i_next );
+ } else {
+ CHECK_DEBUG_THROWS( C2.erase(i) );
+ (void)*i;
+ C1.erase(i);
+ CHECK_DEBUG_THROWS( *i );
+ }
+ }
+
+ static void MoveInvalidatesIterators() {
+ CHECKPOINT("copy move invalidates iterators");
+ Container C1 = makeContainer(3);
+ iterator i = C1.begin();
+ Container C2 = std::move(C1);
+ (void) *i;
+ if constexpr (CT == CT_ForwardList) {
+ CHECK_DEBUG_THROWS( C1.erase_after(i) );
+ C2.erase_after(i);
+ } else {
+ CHECK_DEBUG_THROWS( C1.erase(i) );
+ C2.erase(i);
+ CHECK_DEBUG_THROWS(*i);
+ }
+ }
+
+ static void EraseIter() {
+ CHECKPOINT("testing erase invalidation");
+ Container C1 = makeContainer(2);
+ iterator it1 = C1.begin();
+ iterator it1_next = it1;
+ ++it1_next;
+ Container C2 = C1;
+ CHECK_DEBUG_THROWS( C2.erase(it1) ); // wrong container
+ CHECK_DEBUG_THROWS( C2.erase(C2.end()) ); // erase with end
+ C1.erase(it1_next);
+ CHECK_DEBUG_THROWS( C1.erase(it1_next) ); // invalidated iterator
+ C1.erase(it1);
+ CHECK_DEBUG_THROWS( C1.erase(it1) ); // invalidated iterator
+ }
+
+ static void EraseIterIter() {
+ CHECKPOINT("testing erase iter iter invalidation");
+ Container C1 = makeContainer(2);
+ iterator it1 = C1.begin();
+ iterator it1_next = it1;
+ ++it1_next;
+ Container C2 = C1;
+ iterator it2 = C2.begin();
+ iterator it2_next = it2;
+ ++it2_next;
+ CHECK_DEBUG_THROWS( C2.erase(it1, it1_next) ); // begin from wrong container
+ CHECK_DEBUG_THROWS( C2.erase(it1, it2_next) ); // end from wrong container
+ CHECK_DEBUG_THROWS( C2.erase(it2, it1_next) ); // both from wrong container
+ C2.erase(it2, it2_next);
+ }
+
+ // Allocator aware tests
+ static void SwapInvalidatesIterators() {
+ CHECKPOINT("testing swap invalidates iterators");
+ Container C1 = makeContainer(3);
+ Container C2 = makeContainer(3);
+ iterator it1 = C1.begin();
+ iterator it2 = C2.begin();
+ swap(C1, C2);
+ CHECK_DEBUG_THROWS( C1.erase(it1) );
+ C1.erase(it2);
+ //C2.erase(it1);
+ CHECK_DEBUG_THROWS( C1.erase(it1) );
+ }
+
+ static void SwapNonEqualAllocators() {
+ CHECKPOINT("testing swap with non-equal allocators");
+ Container C1 = makeContainer(3, allocator_type(1));
+ Container C2 = makeContainer(1, allocator_type(2));
+ Container C3 = makeContainer(2, allocator_type(2));
+ swap(C2, C3);
+ CHECK_DEBUG_THROWS( swap(C1, C2) );
+ }
+
+private:
+ BasicContainerChecks() = delete;
+};
+
+} // namespace IteratorDebugChecks
+
+#endif // TEST_SUPPORT_DEBUG_MODE_HELPER_H
diff --git a/test/support/demangle.h b/test/support/demangle.h
new file mode 100644
index 000000000000..2a9757d80454
--- /dev/null
+++ b/test/support/demangle.h
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#ifndef SUPPORT_DEMANGLE_H
+#define SUPPORT_DEMANGLE_H
+
+#include "test_macros.h"
+#include <string>
+#include <cstdlib>
+
+#if !defined(TEST_HAS_NO_DEMANGLE)
+# if defined(__GNUC__) || defined(__clang__)
+# if __has_include("cxxabi.h")
+# include "cxxabi.h"
+# else
+# define TEST_HAS_NO_DEMANGLE
+# endif
+# else
+# define TEST_HAS_NO_DEMANGLE
+# endif
+#endif
+
+#if defined(TEST_HAS_NO_DEMANGLE)
+inline std::string demangle(const char* mangled_name) {
+ return mangled_name;
+}
+#else
+template <size_t N> struct Printer;
+inline std::string demangle(const char* mangled_name) {
+ int status = 0;
+ std::string input(mangled_name);
+ input.insert(0, "_Z");
+ char* out = __cxxabiv1::__cxa_demangle(input.c_str(), nullptr, nullptr, &status);
+ if (out != nullptr) {
+ std::string res(out);
+ std::free(out);
+ return res;
+ }
+ return mangled_name;
+}
+#endif
+
+#endif // SUPPORT_DEMANGLE_H
diff --git a/test/support/experimental_any_helpers.h b/test/support/experimental_any_helpers.h
new file mode 100644
index 000000000000..50bd6d68fba5
--- /dev/null
+++ b/test/support/experimental_any_helpers.h
@@ -0,0 +1,326 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 EXPERIMENTAL_ANY_HELPERS_H
+#define EXPERIMENTAL_ANY_HELPERS_H
+
+#include <experimental/any>
+#include <typeinfo>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+#if !defined(TEST_HAS_NO_RTTI)
+#define RTTI_ASSERT(X) assert(X)
+#else
+#define RTTI_ASSERT(X)
+#endif
+
+template <class _Tp>
+ struct IsSmallObject
+ : public std::integral_constant<bool
+ , sizeof(_Tp) <= (sizeof(void*)*3)
+ && std::alignment_of<void*>::value
+ % std::alignment_of<_Tp>::value == 0
+ && std::is_nothrow_move_constructible<_Tp>::value
+ >
+ {};
+
+
+// Return 'true' if 'Type' will be considered a small type by 'any'
+template <class Type>
+bool isSmallType() {
+#if defined(_LIBCPP_VERSION)
+ return std::experimental::__any_imp::_IsSmallObject<Type>::value;
+#else
+ return IsSmallObject<Type>::value;
+#endif
+
+}
+
+// Assert that an object is empty. If the object used to contain an object
+// of type 'LastType' check that it can no longer be accessed.
+template <class LastType = int>
+void assertEmpty(std::experimental::any const& a) {
+ assert(a.empty());
+ RTTI_ASSERT(a.type() == typeid(void));
+ assert(std::experimental::any_cast<LastType const>(&a) == nullptr);
+}
+
+// Assert that an 'any' object stores the specified 'Type' and 'value'.
+template <class Type>
+void assertContains(std::experimental::any const& a, int value = 1) {
+ assert(!a.empty());
+ RTTI_ASSERT(a.type() == typeid(Type));
+ assert(std::experimental::any_cast<Type const &>(a).value == value);
+}
+
+// Modify the value of a "test type" stored within an any to the specified
+// 'value'.
+template <class Type>
+void modifyValue(std::experimental::any& a, int value) {
+ assert(!a.empty());
+ RTTI_ASSERT(a.type() == typeid(Type));
+ std::experimental::any_cast<Type&>(a).value = value;
+}
+
+// A test type that will trigger the small object optimization within 'any'.
+template <int Dummy = 0>
+struct small_type
+{
+ static int count;
+ static int copied;
+ static int moved;
+ static int const_copied;
+ static int non_const_copied;
+
+ static void reset() {
+ small_type::copied = 0;
+ small_type::moved = 0;
+ small_type::const_copied = 0;
+ small_type::non_const_copied = 0;
+ }
+
+ int value;
+
+ explicit small_type(int val) : value(val) {
+ ++count;
+ }
+
+ small_type(small_type const & other) throw() {
+ value = other.value;
+ ++count;
+ ++copied;
+ ++const_copied;
+ }
+
+ small_type(small_type& other) throw() {
+ value = other.value;
+ ++count;
+ ++copied;
+ ++non_const_copied;
+ }
+
+ small_type(small_type && other) throw() {
+ value = other.value;
+ other.value = 0;
+ ++count;
+ ++moved;
+ }
+
+ ~small_type() {
+ value = -1;
+ --count;
+ }
+
+private:
+ small_type& operator=(small_type const&) = delete;
+ small_type& operator=(small_type&&) = delete;
+};
+
+template <int Dummy>
+int small_type<Dummy>::count = 0;
+
+template <int Dummy>
+int small_type<Dummy>::copied = 0;
+
+template <int Dummy>
+int small_type<Dummy>::moved = 0;
+
+template <int Dummy>
+int small_type<Dummy>::const_copied = 0;
+
+template <int Dummy>
+int small_type<Dummy>::non_const_copied = 0;
+
+typedef small_type<> small;
+typedef small_type<1> small1;
+typedef small_type<2> small2;
+
+
+// A test type that will NOT trigger the small object optimization in any.
+template <int Dummy = 0>
+struct large_type
+{
+ static int count;
+ static int copied;
+ static int moved;
+ static int const_copied;
+ static int non_const_copied;
+
+ static void reset() {
+ large_type::copied = 0;
+ large_type::moved = 0;
+ large_type::const_copied = 0;
+ large_type::non_const_copied = 0;
+ }
+
+ int value;
+
+ large_type(int val) : value(val) {
+ ++count;
+ data[0] = 0;
+ }
+
+ large_type(large_type const & other) {
+ value = other.value;
+ ++count;
+ ++copied;
+ ++const_copied;
+ }
+
+ large_type(large_type & other) {
+ value = other.value;
+ ++count;
+ ++copied;
+ ++non_const_copied;
+ }
+
+ large_type(large_type && other) {
+ value = other.value;
+ other.value = 0;
+ ++count;
+ ++moved;
+ }
+
+ ~large_type() {
+ value = 0;
+ --count;
+ }
+
+private:
+ large_type& operator=(large_type const&) = delete;
+ large_type& operator=(large_type &&) = delete;
+ int data[10];
+};
+
+template <int Dummy>
+int large_type<Dummy>::count = 0;
+
+template <int Dummy>
+int large_type<Dummy>::copied = 0;
+
+template <int Dummy>
+int large_type<Dummy>::moved = 0;
+
+template <int Dummy>
+int large_type<Dummy>::const_copied = 0;
+
+template <int Dummy>
+int large_type<Dummy>::non_const_copied = 0;
+
+typedef large_type<> large;
+typedef large_type<1> large1;
+typedef large_type<2> large2;
+
+// The exception type thrown by 'small_throws_on_copy', 'large_throws_on_copy'
+// and 'throws_on_move'.
+struct my_any_exception {};
+
+void throwMyAnyExpression() {
+#if !defined(TEST_HAS_NO_EXCEPTIONS)
+ throw my_any_exception();
+#else
+ assert(false && "Exceptions are disabled");
+#endif
+}
+
+// A test type that will trigger the small object optimization within 'any'.
+// this type throws if it is copied.
+struct small_throws_on_copy
+{
+ static int count;
+ int value;
+
+ explicit small_throws_on_copy(int val = 0) : value(val) {
+ ++count;
+ }
+
+ small_throws_on_copy(small_throws_on_copy const &) {
+ throwMyAnyExpression();
+ }
+
+ small_throws_on_copy(small_throws_on_copy && other) throw() {
+ value = other.value;
+ ++count;
+ }
+
+ ~small_throws_on_copy() {
+ --count;
+ }
+private:
+ small_throws_on_copy& operator=(small_throws_on_copy const&) = delete;
+ small_throws_on_copy& operator=(small_throws_on_copy &&) = delete;
+};
+
+int small_throws_on_copy::count = 0;
+
+// A test type that will NOT trigger the small object optimization within 'any'.
+// this type throws if it is copied.
+struct large_throws_on_copy
+{
+ static int count;
+ int value = 0;
+
+ explicit large_throws_on_copy(int val = 0) : value(val) {
+ data[0] = 0;
+ ++count;
+ }
+
+ large_throws_on_copy(large_throws_on_copy const &) {
+ throwMyAnyExpression();
+ }
+
+ large_throws_on_copy(large_throws_on_copy && other) throw() {
+ value = other.value;
+ ++count;
+ }
+
+ ~large_throws_on_copy() {
+ --count;
+ }
+
+private:
+ large_throws_on_copy& operator=(large_throws_on_copy const&) = delete;
+ large_throws_on_copy& operator=(large_throws_on_copy &&) = delete;
+ int data[10];
+};
+
+int large_throws_on_copy::count = 0;
+
+// A test type that throws when it is moved. This object will NOT trigger
+// the small object optimization in 'any'.
+struct throws_on_move
+{
+ static int count;
+ int value;
+
+ explicit throws_on_move(int val = 0) : value(val) { ++count; }
+
+ throws_on_move(throws_on_move const & other) {
+ value = other.value;
+ ++count;
+ }
+
+ throws_on_move(throws_on_move &&) {
+ throwMyAnyExpression();
+ }
+
+ ~throws_on_move() {
+ --count;
+ }
+private:
+ throws_on_move& operator=(throws_on_move const&) = delete;
+ throws_on_move& operator=(throws_on_move &&) = delete;
+};
+
+int throws_on_move::count = 0;
+
+
+#endif
diff --git a/test/support/external_threads.cpp b/test/support/external_threads.cpp
new file mode 100644
index 000000000000..381ec651eefc
--- /dev/null
+++ b/test/support/external_threads.cpp
@@ -0,0 +1,10 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+#define _LIBCPP_BUILDING_EXTERNAL_THREADS
+#include <__threading_support>
diff --git a/test/support/filesystem_test_helper.hpp b/test/support/filesystem_test_helper.hpp
index 7150f79739b6..c2e41fca09c8 100644
--- a/test/support/filesystem_test_helper.hpp
+++ b/test/support/filesystem_test_helper.hpp
@@ -230,6 +230,7 @@ private:
// check that the fs test root in the enviroment matches what we were
// compiled with.
static bool checked = checkDynamicTestRoot();
+ ((void)checked);
std::string cmd = LIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER;
cmd += " \"" + raw_cmd + "\"";
int ret = std::system(cmd.c_str());
diff --git a/test/support/is_transparent.h b/test/support/is_transparent.h
index d76b00536b52..541689314b8b 100644
--- a/test/support/is_transparent.h
+++ b/test/support/is_transparent.h
@@ -10,8 +10,10 @@
#ifndef TRANSPARENT_H
#define TRANSPARENT_H
+#include "test_macros.h"
+
// testing transparent
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
struct transparent_less
{
diff --git a/test/support/min_allocator.h b/test/support/min_allocator.h
index 8e0afab47634..d518e4a6d77c 100644
--- a/test/support/min_allocator.h
+++ b/test/support/min_allocator.h
@@ -42,6 +42,44 @@ public:
friend bool operator!=(bare_allocator x, bare_allocator y) {return !(x == y);}
};
+
+template <class T>
+class no_default_allocator
+{
+#if TEST_STD_VER >= 11
+ no_default_allocator() = delete;
+#else
+ no_default_allocator();
+#endif
+ struct construct_tag {};
+ explicit no_default_allocator(construct_tag) {}
+
+public:
+ static no_default_allocator create() {
+ construct_tag tag;
+ return no_default_allocator(tag);
+ }
+
+public:
+ typedef T value_type;
+
+ template <class U>
+ no_default_allocator(no_default_allocator<U>) TEST_NOEXCEPT {}
+
+ T* allocate(std::size_t n)
+ {
+ return static_cast<T*>(::operator new(n*sizeof(T)));
+ }
+
+ void deallocate(T* p, std::size_t)
+ {
+ return ::operator delete(static_cast<void*>(p));
+ }
+
+ friend bool operator==(no_default_allocator, no_default_allocator) {return true;}
+ friend bool operator!=(no_default_allocator x, no_default_allocator y) {return !(x == y);}
+};
+
struct malloc_allocator_base {
static size_t alloc_count;
static size_t dealloc_count;
diff --git a/test/support/nasty_containers.hpp b/test/support/nasty_containers.hpp
index b571469227d4..dcad6c259ff6 100644
--- a/test/support/nasty_containers.hpp
+++ b/test/support/nasty_containers.hpp
@@ -14,6 +14,8 @@
#include <vector>
#include <list>
+#include "test_macros.h"
+
template <class T>
class nasty_vector
{
@@ -49,27 +51,27 @@ public:
void assign(std::initializer_list<value_type> il) { v_.assign(il); }
#endif
- iterator begin() _NOEXCEPT { return v_.begin(); }
- const_iterator begin() const _NOEXCEPT { return v_.begin(); }
- iterator end() _NOEXCEPT { return v_.end(); }
- const_iterator end() const _NOEXCEPT { return v_.end(); }
-
- reverse_iterator rbegin() _NOEXCEPT { return v_.rbegin(); }
- const_reverse_iterator rbegin() const _NOEXCEPT { return v_.rbegin(); }
- reverse_iterator rend() _NOEXCEPT { return v_.rend(); }
- const_reverse_iterator rend() const _NOEXCEPT { return v_.rend(); }
-
- const_iterator cbegin() const _NOEXCEPT { return v_.cbegin(); }
- const_iterator cend() const _NOEXCEPT { return v_.cend(); }
- const_reverse_iterator crbegin() const _NOEXCEPT { return v_.crbegin(); }
- const_reverse_iterator crend() const _NOEXCEPT { return v_.crend(); }
-
- size_type size() const _NOEXCEPT { return v_.size(); }
- size_type max_size() const _NOEXCEPT { return v_.max_size(); }
- size_type capacity() const _NOEXCEPT { return v_.capacity(); }
- bool empty() const _NOEXCEPT { return v_.empty(); }
+ iterator begin() TEST_NOEXCEPT { return v_.begin(); }
+ const_iterator begin() const TEST_NOEXCEPT { return v_.begin(); }
+ iterator end() TEST_NOEXCEPT { return v_.end(); }
+ const_iterator end() const TEST_NOEXCEPT { return v_.end(); }
+
+ reverse_iterator rbegin() TEST_NOEXCEPT { return v_.rbegin(); }
+ const_reverse_iterator rbegin() const TEST_NOEXCEPT { return v_.rbegin(); }
+ reverse_iterator rend() TEST_NOEXCEPT { return v_.rend(); }
+ const_reverse_iterator rend() const TEST_NOEXCEPT { return v_.rend(); }
+
+ const_iterator cbegin() const TEST_NOEXCEPT { return v_.cbegin(); }
+ const_iterator cend() const TEST_NOEXCEPT { return v_.cend(); }
+ const_reverse_iterator crbegin() const TEST_NOEXCEPT { return v_.crbegin(); }
+ const_reverse_iterator crend() const TEST_NOEXCEPT { return v_.crend(); }
+
+ size_type size() const TEST_NOEXCEPT { return v_.size(); }
+ size_type max_size() const TEST_NOEXCEPT { return v_.max_size(); }
+ size_type capacity() const TEST_NOEXCEPT { return v_.capacity(); }
+ bool empty() const TEST_NOEXCEPT { return v_.empty(); }
void reserve(size_type n) { v_.reserve(n); };
- void shrink_to_fit() _NOEXCEPT { v_.shrink_to_fit(); }
+ void shrink_to_fit() TEST_NOEXCEPT { v_.shrink_to_fit(); }
reference operator[](size_type n) { return v_[n]; }
const_reference operator[](size_type n) const { return v_[n]; }
@@ -81,8 +83,8 @@ public:
reference back() { return v_.back(); }
const_reference back() const { return v_.back(); }
- value_type* data() _NOEXCEPT { return v_.data(); }
- const value_type* data() const _NOEXCEPT { return v_.data(); }
+ value_type* data() TEST_NOEXCEPT { return v_.data(); }
+ const value_type* data() const TEST_NOEXCEPT { return v_.data(); }
void push_back(const value_type& x) { v_.push_back(x); }
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -117,12 +119,17 @@ public:
iterator erase(const_iterator pos) { return v_.erase(pos); }
iterator erase(const_iterator first, const_iterator last) { return v_.erase(first, last); }
- void clear() _NOEXCEPT { v_.clear(); }
+ void clear() TEST_NOEXCEPT { v_.clear(); }
void resize(size_type sz) { v_.resize(sz); }
void resize(size_type sz, const value_type& c) { v_.resize(sz, c); }
- void swap(nasty_vector &nv) _NOEXCEPT_(std::__is_nothrow_swappable<nested_container>::value)
+ void swap(nasty_vector &nv)
+#if TEST_STD_VER > 14
+ noexcept(std::is_nothrow_swappable<nested_container>::value)
+#elif defined(_LIBCPP_VERSION)
+ TEST_NOEXCEPT_COND(std::__is_nothrow_swappable<nested_container>::value)
+#endif
{ v_.swap(nv.v_); }
nasty_vector *operator &() { assert(false); return nullptr; } // nasty
@@ -176,29 +183,29 @@ public:
#endif
- iterator begin() _NOEXCEPT { return l_.begin(); }
- const_iterator begin() const _NOEXCEPT { return l_.begin(); }
- iterator end() _NOEXCEPT { return l_.end(); }
- const_iterator end() const _NOEXCEPT { return l_.end(); }
+ iterator begin() TEST_NOEXCEPT { return l_.begin(); }
+ const_iterator begin() const TEST_NOEXCEPT { return l_.begin(); }
+ iterator end() TEST_NOEXCEPT { return l_.end(); }
+ const_iterator end() const TEST_NOEXCEPT { return l_.end(); }
- reverse_iterator rbegin() _NOEXCEPT { return l_.rbegin(); }
- const_reverse_iterator rbegin() const _NOEXCEPT { return l_.rbegin(); }
- reverse_iterator rend() _NOEXCEPT { return l_.rend(); }
- const_reverse_iterator rend() const _NOEXCEPT { return l_.rend(); }
+ reverse_iterator rbegin() TEST_NOEXCEPT { return l_.rbegin(); }
+ const_reverse_iterator rbegin() const TEST_NOEXCEPT { return l_.rbegin(); }
+ reverse_iterator rend() TEST_NOEXCEPT { return l_.rend(); }
+ const_reverse_iterator rend() const TEST_NOEXCEPT { return l_.rend(); }
- const_iterator cbegin() const _NOEXCEPT { return l_.cbegin(); }
- const_iterator cend() const _NOEXCEPT { return l_.cend(); }
- const_reverse_iterator crbegin() const _NOEXCEPT { return l_.crbegin(); }
- const_reverse_iterator crend() const _NOEXCEPT { return l_.crend(); }
+ const_iterator cbegin() const TEST_NOEXCEPT { return l_.cbegin(); }
+ const_iterator cend() const TEST_NOEXCEPT { return l_.cend(); }
+ const_reverse_iterator crbegin() const TEST_NOEXCEPT { return l_.crbegin(); }
+ const_reverse_iterator crend() const TEST_NOEXCEPT { return l_.crend(); }
reference front() { return l_.front(); }
const_reference front() const { return l_.front(); }
reference back() { return l_.back(); }
const_reference back() const { return l_.back(); }
- size_type size() const _NOEXCEPT { return l_.size(); }
- size_type max_size() const _NOEXCEPT { return l_.max_size(); }
- bool empty() const _NOEXCEPT { return l_.empty(); }
+ size_type size() const TEST_NOEXCEPT { return l_.size(); }
+ size_type max_size() const TEST_NOEXCEPT { return l_.max_size(); }
+ bool empty() const TEST_NOEXCEPT { return l_.empty(); }
void push_front(const value_type& x) { l_.push_front(x); }
void push_back(const value_type& x) { l_.push_back(x); }
@@ -238,13 +245,18 @@ public:
iterator erase(const_iterator pos) { return l_.erase(pos); }
iterator erase(const_iterator pos, const_iterator last) { return l_.erase(pos, last); }
- void resize(size_type sz) { l_.resize(); }
- void resize(size_type sz, const value_type& c) { l_.resize(c); }
+ void resize(size_type) { l_.resize(); }
+ void resize(size_type, const value_type& c) { l_.resize(c); }
- void swap(nasty_list &nl) _NOEXCEPT_(std::__is_nothrow_swappable<nested_container>::value)
+ void swap(nasty_list &nl)
+#if TEST_STD_VER > 14
+ noexcept(std::is_nothrow_swappable<nested_container>::value)
+#elif defined(_LIBCPP_VERSION)
+ TEST_NOEXCEPT_COND(std::__is_nothrow_swappable<nested_container>::value)
+#endif
{ l_.swap(nl.l_); }
- void clear() _NOEXCEPT { l_.clear(); }
+ void clear() TEST_NOEXCEPT { l_.clear(); }
// void splice(const_iterator position, list& x);
// void splice(const_iterator position, list&& x);
@@ -284,7 +296,7 @@ bool operator==(const nasty_list<T>& x, const nasty_list<T>& y) { return x.l_ ==
class nasty_mutex
{
public:
- nasty_mutex() _NOEXCEPT {}
+ nasty_mutex() TEST_NOEXCEPT {}
~nasty_mutex() {}
nasty_mutex *operator& () { assert(false); return nullptr; }
@@ -297,8 +309,8 @@ private:
public:
void lock() {}
- bool try_lock() _NOEXCEPT { return true; }
- void unlock() _NOEXCEPT {}
+ bool try_lock() TEST_NOEXCEPT { return true; }
+ void unlock() TEST_NOEXCEPT {}
// Shared ownership
void lock_shared() {}
diff --git a/test/support/test.support/test_demangle.pass.cpp b/test/support/test.support/test_demangle.pass.cpp
new file mode 100644
index 000000000000..c924246e8c0b
--- /dev/null
+++ b/test/support/test.support/test_demangle.pass.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#include "demangle.h"
+#include <typeinfo>
+#include <cassert>
+
+struct MyType {};
+
+template <class T, class U> struct ArgumentListID {};
+
+int main() {
+ struct {
+ const char* raw;
+ const char* expect;
+ } TestCases[] = {
+ {typeid(int).name(), "i"}, // FIXME
+ {typeid(MyType).name(), "MyType"},
+ {typeid(ArgumentListID<int, MyType>).name(), "ArgumentListID<int, MyType>"}
+ };
+ const size_t size = sizeof(TestCases) / sizeof(TestCases[0]);
+ for (size_t i=0; i < size; ++i) {
+ const char* raw = TestCases[i].raw;
+ const char* expect = TestCases[i].expect;
+#ifdef TEST_HAS_NO_DEMANGLE
+ assert(demangle(raw) == raw);
+ ((void)expect);
+#else
+ assert(demangle(raw) == expect);
+#endif
+ }
+}
diff --git a/test/support/test.support/test_macros_header_rtti.pass.cpp b/test/support/test.support/test_macros_header_rtti.pass.cpp
index d189a0efc2fc..dee1a049457e 100644
--- a/test/support/test.support/test_macros_header_rtti.pass.cpp
+++ b/test/support/test.support/test_macros_header_rtti.pass.cpp
@@ -25,4 +25,5 @@ struct B : A {};
int main() {
A* ptr = new B;
(void)dynamic_cast<B*>(ptr);
+ delete ptr;
}
diff --git a/test/support/test_allocator.h b/test/support/test_allocator.h
index 466c7fabc66d..e77796b676e7 100644
--- a/test/support/test_allocator.h
+++ b/test/support/test_allocator.h
@@ -10,15 +10,24 @@
#ifndef TEST_ALLOCATOR_H
#define TEST_ALLOCATOR_H
-#include <cstddef>
#include <type_traits>
-#include <cstdlib>
#include <new>
+#include <memory>
+#include <utility>
+#include <cstddef>
+#include <cstdlib>
#include <climits>
#include <cassert>
#include "test_macros.h"
+template <class Alloc>
+inline typename std::allocator_traits<Alloc>::size_type
+alloc_max_size(Alloc const &a) {
+ typedef std::allocator_traits<Alloc> AT;
+ return AT::max_size(a);
+}
+
class test_alloc_base
{
protected:
@@ -38,8 +47,8 @@ template <class T>
class test_allocator
: public test_alloc_base
{
- int data_;
-
+ int data_; // participates in equality
+ int id_; // unique identifier, doesn't participate in equality
template <class U> friend class test_allocator;
public:
@@ -53,20 +62,24 @@ public:
template <class U> struct rebind {typedef test_allocator<U> other;};
- test_allocator() throw() : data_(0) {++count;}
- explicit test_allocator(int i) throw() : data_(i) {++count;}
- test_allocator(const test_allocator& a) throw()
- : data_(a.data_) {++count;}
- template <class U> test_allocator(const test_allocator<U>& a) throw()
- : data_(a.data_) {++count;}
- ~test_allocator() throw() {assert(data_ >= 0); --count; data_ = -1;}
+ test_allocator() TEST_NOEXCEPT : data_(0), id_(0) {++count;}
+ explicit test_allocator(int i, int id = 0) TEST_NOEXCEPT : data_(i), id_(id)
+ {++count;}
+ test_allocator(const test_allocator& a) TEST_NOEXCEPT
+ : data_(a.data_), id_(a.id_) {++count;}
+ template <class U> test_allocator(const test_allocator<U>& a) TEST_NOEXCEPT
+ : data_(a.data_), id_(a.id_) {++count;}
+ ~test_allocator() TEST_NOEXCEPT {
+ assert(data_ >= 0); assert(id_ >= 0);
+ --count; data_ = -1; id_ = -1;
+ }
pointer address(reference x) const {return &x;}
const_pointer address(const_reference x) const {return &x;}
pointer allocate(size_type n, const void* = 0)
{
assert(data_ >= 0);
if (time_to_throw >= throw_after) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef TEST_HAS_NO_EXCEPTIONS
throw std::bad_alloc();
#else
std::terminate();
@@ -78,7 +91,7 @@ public:
}
void deallocate(pointer p, size_type)
{assert(data_ >= 0); --alloc_count; ::operator delete((void*)p);}
- size_type max_size() const throw()
+ size_type max_size() const TEST_NOEXCEPT
{return UINT_MAX / sizeof(T);}
#if TEST_STD_VER < 11
void construct(pointer p, const T& val)
@@ -88,14 +101,14 @@ public:
{::new(static_cast<void*>(p)) T(std::forward<U>(val));}
#endif
void destroy(pointer p)
- {
- p->~T();
- ((void)p); // Prevent MSVC's spurious unused warning
- }
+ {p->~T();}
friend bool operator==(const test_allocator& x, const test_allocator& y)
{return x.data_ == y.data_;}
friend bool operator!=(const test_allocator& x, const test_allocator& y)
{return !(x == y);}
+
+ int get_data() const { return data_; }
+ int get_id() const { return id_; }
};
template <class T>
@@ -117,20 +130,20 @@ public:
template <class U> struct rebind {typedef non_default_test_allocator<U> other;};
-// non_default_test_allocator() throw() : data_(0) {++count;}
- explicit non_default_test_allocator(int i) throw() : data_(i) {++count;}
- non_default_test_allocator(const non_default_test_allocator& a) throw()
+// non_default_test_allocator() TEST_NOEXCEPT : data_(0) {++count;}
+ explicit non_default_test_allocator(int i) TEST_NOEXCEPT : data_(i) {++count;}
+ non_default_test_allocator(const non_default_test_allocator& a) TEST_NOEXCEPT
: data_(a.data_) {++count;}
- template <class U> non_default_test_allocator(const non_default_test_allocator<U>& a) throw()
+ template <class U> non_default_test_allocator(const non_default_test_allocator<U>& a) TEST_NOEXCEPT
: data_(a.data_) {++count;}
- ~non_default_test_allocator() throw() {assert(data_ >= 0); --count; data_ = -1;}
+ ~non_default_test_allocator() TEST_NOEXCEPT {assert(data_ >= 0); --count; data_ = -1;}
pointer address(reference x) const {return &x;}
const_pointer address(const_reference x) const {return &x;}
pointer allocate(size_type n, const void* = 0)
{
assert(data_ >= 0);
if (time_to_throw >= throw_after) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef TEST_HAS_NO_EXCEPTIONS
throw std::bad_alloc();
#else
std::terminate();
@@ -142,7 +155,7 @@ public:
}
void deallocate(pointer p, size_type)
{assert(data_ >= 0); --alloc_count; ::operator delete((void*)p); }
- size_type max_size() const throw()
+ size_type max_size() const TEST_NOEXCEPT
{return UINT_MAX / sizeof(T);}
#if TEST_STD_VER < 11
void construct(pointer p, const T& val)
@@ -164,6 +177,7 @@ class test_allocator<void>
: public test_alloc_base
{
int data_;
+ int id_;
template <class U> friend class test_allocator;
public:
@@ -176,13 +190,16 @@ public:
template <class U> struct rebind {typedef test_allocator<U> other;};
- test_allocator() throw() : data_(0) {}
- explicit test_allocator(int i) throw() : data_(i) {}
- test_allocator(const test_allocator& a) throw()
- : data_(a.data_) {}
- template <class U> test_allocator(const test_allocator<U>& a) throw()
- : data_(a.data_) {}
- ~test_allocator() throw() {data_ = -1;}
+ test_allocator() TEST_NOEXCEPT : data_(0), id_(0) {}
+ explicit test_allocator(int i, int id = 0) TEST_NOEXCEPT : data_(i), id_(id) {}
+ test_allocator(const test_allocator& a) TEST_NOEXCEPT
+ : data_(a.data_), id_(a.id_) {}
+ template <class U> test_allocator(const test_allocator<U>& a) TEST_NOEXCEPT
+ : data_(a.data_), id_(a.id_) {}
+ ~test_allocator() TEST_NOEXCEPT {data_ = -1; id_ = -1; }
+
+ int get_id() const { return id_; }
+ int get_data() const { return data_; }
friend bool operator==(const test_allocator& x, const test_allocator& y)
{return x.data_ == y.data_;}
@@ -221,10 +238,10 @@ public:
typedef std::true_type propagate_on_container_move_assignment;
typedef std::true_type propagate_on_container_swap;
-#ifdef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if TEST_STD_VER < 11
std::size_t max_size() const
{return UINT_MAX / sizeof(T);}
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif
};
@@ -305,5 +322,79 @@ operator!=(const TaggingAllocator<T>&, const TaggingAllocator<U>&)
{ return false; }
#endif
+template <std::size_t MaxAllocs>
+struct limited_alloc_handle {
+ std::size_t outstanding_;
+ void* last_alloc_;
+
+ limited_alloc_handle() : outstanding_(0), last_alloc_(nullptr) {}
+
+ template <class T>
+ T *allocate(std::size_t N) {
+ if (N + outstanding_ > MaxAllocs)
+ TEST_THROW(std::bad_alloc());
+ last_alloc_ = ::operator new(N*sizeof(T));
+ outstanding_ += N;
+ return static_cast<T*>(last_alloc_);
+ }
+
+ void deallocate(void* ptr, std::size_t N) {
+ if (ptr == last_alloc_) {
+ last_alloc_ = nullptr;
+ assert(outstanding_ >= N);
+ outstanding_ -= N;
+ }
+ ::operator delete(ptr);
+ }
+};
+
+template <class T, std::size_t N>
+class limited_allocator
+{
+ template <class U, std::size_t UN> friend class limited_allocator;
+ typedef limited_alloc_handle<N> BuffT;
+ std::shared_ptr<BuffT> handle_;
+public:
+ typedef T value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ template <class U> struct rebind { typedef limited_allocator<U, N> other; };
+
+ limited_allocator() : handle_(new BuffT) {}
+
+ limited_allocator(limited_allocator const& other) : handle_(other.handle_) {}
+
+ template <class U>
+ explicit limited_allocator(limited_allocator<U, N> const& other)
+ : handle_(other.handle_) {}
+
+private:
+ limited_allocator& operator=(const limited_allocator&);// = delete;
+
+public:
+ pointer allocate(size_type n) { return handle_->template allocate<T>(n); }
+ void deallocate(pointer p, size_type n) { handle_->deallocate(p, n); }
+ size_type max_size() const {return N;}
+
+ BuffT* getHandle() const { return handle_.get(); }
+};
+
+template <class T, class U, std::size_t N>
+inline bool operator==(limited_allocator<T, N> const& LHS,
+ limited_allocator<U, N> const& RHS) {
+ return LHS.getHandle() == RHS.getHandle();
+}
+
+template <class T, class U, std::size_t N>
+inline bool operator!=(limited_allocator<T, N> const& LHS,
+ limited_allocator<U, N> const& RHS) {
+ return !(LHS == RHS);
+}
+
#endif // TEST_ALLOCATOR_H
diff --git a/test/support/test_iterators.h b/test/support/test_iterators.h
index d4a079971b15..379933eb51b4 100644
--- a/test/support/test_iterators.h
+++ b/test/support/test_iterators.h
@@ -53,25 +53,27 @@ public:
void operator,(T const &) DELETE_FUNCTION;
};
-template <class It>
+template <class It,
+ class ItTraits = It>
class input_iterator
{
+ typedef std::iterator_traits<ItTraits> Traits;
It it_;
- template <class U> friend class input_iterator;
+ template <class U, class T> friend class input_iterator;
public:
typedef std::input_iterator_tag iterator_category;
- typedef typename std::iterator_traits<It>::value_type value_type;
- typedef typename std::iterator_traits<It>::difference_type difference_type;
+ typedef typename Traits::value_type value_type;
+ typedef typename Traits::difference_type difference_type;
typedef It pointer;
- typedef typename std::iterator_traits<It>::reference reference;
+ typedef typename Traits::reference reference;
It base() const {return it_;}
input_iterator() : it_() {}
explicit input_iterator(It it) : it_(it) {}
- template <class U>
- input_iterator(const input_iterator<U>& u) :it_(u.it_) {}
+ template <class U, class T>
+ input_iterator(const input_iterator<U, T>& u) :it_(u.it_) {}
reference operator*() const {return *it_;}
pointer operator->() const {return it_;}
@@ -89,18 +91,18 @@ public:
void operator,(T const &) DELETE_FUNCTION;
};
-template <class T, class U>
+template <class T, class TV, class U, class UV>
inline
bool
-operator==(const input_iterator<T>& x, const input_iterator<U>& y)
+operator==(const input_iterator<T, TV>& x, const input_iterator<U, UV>& y)
{
return x.base() == y.base();
}
-template <class T, class U>
+template <class T, class TV, class U, class UV>
inline
bool
-operator!=(const input_iterator<T>& x, const input_iterator<U>& y)
+operator!=(const input_iterator<T, TV>& x, const input_iterator<U, UV>& y)
{
return !(x == y);
}
diff --git a/test/support/test_macros.h b/test/support/test_macros.h
index a072e31b77b7..40d366ab19dd 100644
--- a/test/support/test_macros.h
+++ b/test/support/test_macros.h
@@ -22,6 +22,12 @@
#define TEST_HAS_FEATURE(X) 0
#endif
+#ifdef __has_include
+#define TEST_HAS_INCLUDE(X) __has_include(X)
+#else
+#define TEST_HAS_INCLUDE(X) 0
+#endif
+
#ifdef __has_extension
#define TEST_HAS_EXTENSION(X) __has_extension(X)
#else
@@ -33,6 +39,21 @@
#else
#define TEST_HAS_BUILTIN(X) 0
#endif
+#ifdef __is_identifier
+// '__is_identifier' returns '0' if '__x' is a reserved identifier provided by
+// the compiler and '1' otherwise.
+#define TEST_HAS_BUILTIN_IDENTIFIER(X) !__is_identifier(X)
+#else
+#define TEST_HAS_BUILTIN_IDENTIFIER(X) 0
+#endif
+
+#if defined(__apple_build_version__)
+#define TEST_APPLE_CLANG_VER (__clang_major__ * 100) + __clang_minor__
+#elif defined(__clang_major__)
+#define TEST_CLANG_VER (__clang_major__ * 100) + __clang_minor__
+#elif defined(__GNUC__)
+#define TEST_GCC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
+#endif
/* Make a nice name for the standard version */
#ifndef TEST_STD_VER
@@ -47,6 +68,13 @@
#endif
#endif
+// Attempt to deduce GCC version
+#if defined(_LIBCPP_VERSION) && TEST_HAS_INCLUDE(<features.h>)
+#include <features.h>
+#define TEST_HAS_GLIBC
+#define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor)
+#endif
+
/* Features that were introduced in C++14 */
#if TEST_STD_VER >= 14
#define TEST_HAS_EXTENDED_CONSTEXPR
@@ -58,19 +86,33 @@
#endif
#if TEST_STD_VER >= 11
+#define TEST_ALIGNOF(...) alignof(__VA_ARGS__)
+#define TEST_ALIGNAS(...) alignas(__VA_ARGS__)
#define TEST_CONSTEXPR constexpr
#define TEST_NOEXCEPT noexcept
+#define TEST_NOEXCEPT_COND(...) noexcept(__VA_ARGS__)
# if TEST_STD_VER >= 14
# define TEST_CONSTEXPR_CXX14 constexpr
# else
# define TEST_CONSTEXPR_CXX14
# endif
+# if TEST_STD_VER > 14
+# define TEST_THROW_SPEC(...)
+# else
+# define TEST_THROW_SPEC(...) throw(__VA_ARGS__)
+# endif
#else
+#define TEST_ALIGNOF(...) __alignof(__VA_ARGS__)
+#define TEST_ALIGNAS(...) __attribute__((__aligned__(__VA_ARGS__)))
#define TEST_CONSTEXPR
#define TEST_CONSTEXPR_CXX14
-#define TEST_NOEXCEPT
+#define TEST_NOEXCEPT throw()
+#define TEST_NOEXCEPT_COND(...)
+#define TEST_THROW_SPEC(...) throw(__VA_ARGS__)
#endif
+#define TEST_ALIGNAS_TYPE(...) TEST_ALIGNAS(TEST_ALIGNOF(__VA_ARGS__))
+
#if !TEST_HAS_FEATURE(cxx_rtti) && !defined(__cpp_rtti) \
&& !defined(__GXX_RTTI)
#define TEST_HAS_NO_RTTI
@@ -92,21 +134,27 @@
#define TEST_NORETURN [[noreturn]]
#endif
+#define ASSERT_NOEXCEPT(...) \
+ static_assert(noexcept(__VA_ARGS__), "Operation must be noexcept")
+
+#define ASSERT_NOT_NOEXCEPT(...) \
+ static_assert(!noexcept(__VA_ARGS__), "Operation must NOT be noexcept")
+
/* Macros for testing libc++ specific behavior and extensions */
#if defined(_LIBCPP_VERSION)
#define LIBCPP_ASSERT(...) assert(__VA_ARGS__)
#define LIBCPP_STATIC_ASSERT(...) static_assert(__VA_ARGS__)
+#define LIBCPP_ASSERT_NOEXCEPT(...) ASSERT_NOEXCEPT(__VA_ARGS__)
+#define LIBCPP_ASSERT_NOT_NOEXCEPT(...) ASSERT_NOT_NOEXCEPT(__VA_ARGS__)
+#define LIBCPP_ONLY(...) __VA_ARGS__
#else
#define LIBCPP_ASSERT(...) ((void)0)
#define LIBCPP_STATIC_ASSERT(...) ((void)0)
+#define LIBCPP_ASSERT_NOEXCEPT(...) ((void)0)
+#define LIBCPP_ASSERT_NOT_NOEXCEPT(...) ((void)0)
+#define LIBCPP_ONLY(...) ((void)0)
#endif
-#define ASSERT_NOEXCEPT(...) \
- static_assert(noexcept(__VA_ARGS__), "Operation must be noexcept")
-
-#define ASSERT_NOT_NOEXCEPT(...) \
- static_assert(!noexcept(__VA_ARGS__), "Operation must NOT be noexcept")
-
namespace test_macros_detail {
template <class T, class U>
struct is_same { enum { value = 0};} ;
@@ -118,4 +166,15 @@ struct is_same<T, T> { enum {value = 1}; };
static_assert(test_macros_detail::is_same<__VA_ARGS__>::value, \
"Types differ uexpectedly")
+#ifndef TEST_HAS_NO_EXCEPTIONS
+#define TEST_THROW(...) throw __VA_ARGS__
+#else
+#if defined(__GNUC__)
+#define TEST_THROW(...) __builtin_abort()
+#else
+#include <stdlib.h>
+#define TEST_THROW(...) ::abort()
+#endif
+#endif
+
#endif // SUPPORT_TEST_MACROS_HPP
diff --git a/test/support/test_memory_resource.hpp b/test/support/test_memory_resource.hpp
index e7b067cf631d..49dc1739a962 100644
--- a/test/support/test_memory_resource.hpp
+++ b/test/support/test_memory_resource.hpp
@@ -11,6 +11,7 @@
#define SUPPORT_TEST_MEMORY_RESOURCE_HPP
#include <experimental/memory_resource>
+#include <experimental/utility>
#include <memory>
#include <type_traits>
#include <cstddef>
@@ -19,354 +20,17 @@
#include <cstdint>
#include <cassert>
#include "test_macros.h"
-
-struct AllocController;
- // 'AllocController' is a concrete type that instruments and controls the
- // behavior of of test allocators.
-
-template <class T>
-class CountingAllocator;
- // 'CountingAllocator' is an basic implementation of the 'Allocator'
- // requirements that use the 'AllocController' interface.
-
-template <class T>
-class MinAlignAllocator;
- // 'MinAlignAllocator' is an instrumented test type which implements the
- // 'Allocator' requirements. 'MinAlignAllocator' ensures that it *never*
- // returns a pointer to over-aligned storage. For example
- // 'MinAlignPointer<char>{}.allocate(...)' will never a 2-byte aligned
- // pointer.
-
-template <class T>
-class NullAllocator;
- // 'NullAllocator' is an instrumented test type which implements the
- // 'Allocator' requirements except that 'allocator' and 'deallocate' are
- // nops.
-
-
-#define DISALLOW_COPY(Type) \
- Type(Type const&) = delete; \
- Type& operator=(Type const&) = delete
-
-constexpr std::size_t MaxAlignV = alignof(std::max_align_t);
-
-struct TestException {};
-
-struct AllocController {
- int copy_constructed = 0;
- int move_constructed = 0;
-
- int alive = 0;
- int alloc_count = 0;
- int dealloc_count = 0;
- int is_equal_count = 0;
-
- std::size_t alive_size;
- std::size_t allocated_size;
- std::size_t deallocated_size;
-
- std::size_t last_size = 0;
- std::size_t last_align = 0;
- void * last_pointer = 0;
-
- std::size_t last_alloc_size = 0;
- std::size_t last_alloc_align = 0;
- void * last_alloc_pointer = nullptr;
-
- std::size_t last_dealloc_size = 0;
- std::size_t last_dealloc_align = 0;
- void * last_dealloc_pointer = nullptr;
-
- bool throw_on_alloc = false;
-
- AllocController() = default;
-
- void countAlloc(void* p, size_t s, size_t a) {
- ++alive;
- ++alloc_count;
- alive_size += s;
- allocated_size += s;
- last_pointer = last_alloc_pointer = p;
- last_size = last_alloc_size = s;
- last_align = last_alloc_align = a;
- }
-
- void countDealloc(void* p, size_t s, size_t a) {
- --alive;
- ++dealloc_count;
- alive_size -= s;
- deallocated_size += s;
- last_pointer = last_dealloc_pointer = p;
- last_size = last_dealloc_size = s;
- last_align = last_dealloc_align = a;
- }
-
- void reset() { std::memset(this, 0, sizeof(*this)); }
-
-public:
- bool checkAlloc(void* p, size_t s, size_t a) const {
- return p == last_alloc_pointer &&
- s == last_alloc_size &&
- a == last_alloc_align;
- }
-
- bool checkAlloc(void* p, size_t s) const {
- return p == last_alloc_pointer &&
- s == last_alloc_size;
- }
-
- bool checkAllocAtLeast(void* p, size_t s, size_t a) const {
- return p == last_alloc_pointer &&
- s <= last_alloc_size &&
- a <= last_alloc_align;
- }
-
- bool checkAllocAtLeast(void* p, size_t s) const {
- return p == last_alloc_pointer &&
- s <= last_alloc_size;
- }
-
- bool checkDealloc(void* p, size_t s, size_t a) const {
- return p == last_dealloc_pointer &&
- s == last_dealloc_size &&
- a == last_dealloc_align;
- }
-
- bool checkDealloc(void* p, size_t s) const {
- return p == last_dealloc_pointer &&
- s == last_dealloc_size;
- }
-
- bool checkDeallocMatchesAlloc() const {
- return last_dealloc_pointer == last_alloc_pointer &&
- last_dealloc_size == last_alloc_size &&
- last_dealloc_align == last_alloc_align;
- }
-
- void countIsEqual() {
- ++is_equal_count;
- }
-
- bool checkIsEqualCalledEq(int n) const {
- return is_equal_count == n;
- }
-private:
- DISALLOW_COPY(AllocController);
+#include "controlled_allocators.hpp"
+#include "uses_alloc_types.hpp"
+
+// FIXME: This is a hack to allow uses_allocator_types.hpp to work with
+// erased_type. However we can't define that behavior directly in the header
+// because it con't include <experimental/memory_resource>
+template <>
+struct TransformErasedTypeAlloc<std::experimental::erased_type> {
+ using type = std::experimental::pmr::memory_resource*;
};
-template <class T>
-class CountingAllocator
-{
-public:
- typedef T value_type;
- typedef T* pointer;
- CountingAllocator() = delete;
- explicit CountingAllocator(AllocController& PP) : P(&PP) {}
-
- CountingAllocator(CountingAllocator const& other) : P(other.P) {
- P->copy_constructed += 1;
- }
-
- CountingAllocator(CountingAllocator&& other) : P(other.P) {
- P->move_constructed += 1;
- }
-
- template <class U>
- CountingAllocator(CountingAllocator<U> const& other) TEST_NOEXCEPT : P(other.P) {
- P->copy_constructed += 1;
- }
-
- template <class U>
- CountingAllocator(CountingAllocator<U>&& other) TEST_NOEXCEPT : P(other.P) {
- P->move_constructed += 1;
- }
-
- T* allocate(std::size_t n)
- {
- void* ret = ::operator new(n*sizeof(T));
- P->countAlloc(ret, n*sizeof(T), alignof(T));
- return static_cast<T*>(ret);
- }
-
- void deallocate(T* p, std::size_t n)
- {
- void* vp = static_cast<void*>(p);
- P->countDealloc(vp, n*sizeof(T), alignof(T));
- ::operator delete(vp);
- }
-
- AllocController& getController() const { return *P; }
-
-private:
- template <class Tp> friend class CountingAllocator;
- AllocController *P;
-};
-
-template <class T, class U>
-inline bool operator==(CountingAllocator<T> const& x,
- CountingAllocator<U> const& y) {
- return &x.getController() == &y.getController();
-}
-
-template <class T, class U>
-inline bool operator!=(CountingAllocator<T> const& x,
- CountingAllocator<U> const& y) {
- return !(x == y);
-}
-
-template <class T>
-class MinAlignedAllocator
-{
-public:
- typedef T value_type;
- typedef T* pointer;
-
- MinAlignedAllocator() = delete;
-
- explicit MinAlignedAllocator(AllocController& R) : P(&R) {}
-
- MinAlignedAllocator(MinAlignedAllocator const& other) : P(other.P) {
- P->copy_constructed += 1;
- }
-
- MinAlignedAllocator(MinAlignedAllocator&& other) : P(other.P) {
- P->move_constructed += 1;
- }
-
- template <class U>
- MinAlignedAllocator(MinAlignedAllocator<U> const& other) TEST_NOEXCEPT : P(other.P) {
- P->copy_constructed += 1;
- }
-
- template <class U>
- MinAlignedAllocator(MinAlignedAllocator<U>&& other) TEST_NOEXCEPT : P(other.P) {
- P->move_constructed += 1;
- }
-
- T* allocate(std::size_t n) {
- char* aligned_ptr = (char*)::operator new(alloc_size(n*sizeof(T)));
- assert(is_max_aligned(aligned_ptr));
-
- char* unaligned_ptr = aligned_ptr + alignof(T);
- assert(is_min_aligned(unaligned_ptr));
-
- P->countAlloc(unaligned_ptr, n * sizeof(T), alignof(T));
-
- return ((T*)unaligned_ptr);
- }
-
- void deallocate(T* p, std::size_t n) {
- assert(is_min_aligned(p));
-
- char* aligned_ptr = ((char*)p) - alignof(T);
- assert(is_max_aligned(aligned_ptr));
-
- P->countDealloc(p, n*sizeof(T), alignof(T));
-
- return ::operator delete(static_cast<void*>(aligned_ptr));
- }
-
- AllocController& getController() const { return *P; }
-
-private:
- static const std::size_t BlockSize = alignof(std::max_align_t);
-
- static std::size_t alloc_size(std::size_t s) {
- std::size_t bytes = (s + BlockSize - 1) & ~(BlockSize - 1);
- bytes += BlockSize;
- assert(bytes % BlockSize == 0);
- return bytes;
- }
-
- static bool is_max_aligned(void* p) {
- return reinterpret_cast<std::uintptr_t>(p) % BlockSize == 0;
- }
-
- static bool is_min_aligned(void* p) {
- if (alignof(T) == BlockSize) {
- return is_max_aligned(p);
- } else {
- return reinterpret_cast<std::uintptr_t>(p) % BlockSize == alignof(T);
- }
- }
-
- template <class Tp> friend class MinAlignedAllocator;
- mutable AllocController *P;
-};
-
-
-template <class T, class U>
-inline bool operator==(MinAlignedAllocator<T> const& x,
- MinAlignedAllocator<U> const& y) {
- return &x.getController() == &y.getController();
-}
-
-template <class T, class U>
-inline bool operator!=(MinAlignedAllocator<T> const& x,
- MinAlignedAllocator<U> const& y) {
- return !(x == y);
-}
-
-template <class T>
-class NullAllocator
-{
-public:
- typedef T value_type;
- typedef T* pointer;
- NullAllocator() = delete;
- explicit NullAllocator(AllocController& PP) : P(&PP) {}
-
- NullAllocator(NullAllocator const& other) : P(other.P) {
- P->copy_constructed += 1;
- }
-
- NullAllocator(NullAllocator&& other) : P(other.P) {
- P->move_constructed += 1;
- }
-
- template <class U>
- NullAllocator(NullAllocator<U> const& other) TEST_NOEXCEPT : P(other.P) {
- P->copy_constructed += 1;
- }
-
- template <class U>
- NullAllocator(NullAllocator<U>&& other) TEST_NOEXCEPT : P(other.P) {
- P->move_constructed += 1;
- }
-
- T* allocate(std::size_t n)
- {
- P->countAlloc(nullptr, n*sizeof(T), alignof(T));
- return nullptr;
- }
-
- void deallocate(T* p, std::size_t n)
- {
- void* vp = static_cast<void*>(p);
- P->countDealloc(vp, n*sizeof(T), alignof(T));
- }
-
- AllocController& getController() const { return *P; }
-
-private:
- template <class Tp> friend class NullAllocator;
- AllocController *P;
-};
-
-template <class T, class U>
-inline bool operator==(NullAllocator<T> const& x,
- NullAllocator<U> const& y) {
- return &x.getController() == &y.getController();
-}
-
-template <class T, class U>
-inline bool operator!=(NullAllocator<T> const& x,
- NullAllocator<U> const& y) {
- return !(x == y);
-}
-
-
-
template <class ProviderT, int = 0>
class TestResourceImp : public std::experimental::pmr::memory_resource
{
diff --git a/test/support/type_id.h b/test/support/type_id.h
index 309f0884e4a7..0463365388fc 100644
--- a/test/support/type_id.h
+++ b/test/support/type_id.h
@@ -10,9 +10,13 @@
#define SUPPORT_TYPE_ID_H
#include <functional>
+#include <typeinfo>
+#include <string>
+#include <cstdio>
#include <cassert>
#include "test_macros.h"
+#include "demangle.h"
#if TEST_STD_VER < 11
#error This header requires C++11 or greater
@@ -25,25 +29,41 @@ struct TypeID {
{return LHS.m_id == RHS.m_id; }
friend bool operator!=(TypeID const& LHS, TypeID const& RHS)
{return LHS.m_id != RHS.m_id; }
+
+ std::string name() const {
+ return demangle(m_id);
+ }
+
+ void dump() const {
+ std::string s = name();
+ std::printf("TypeID: %s\n", s.c_str());
+ }
+
private:
- explicit constexpr TypeID(const int* xid) : m_id(xid) {}
+ explicit constexpr TypeID(const char* xid) : m_id(xid) {}
TypeID(const TypeID&) = delete;
TypeID& operator=(TypeID const&) = delete;
- const int* const m_id;
- template <class T> friend TypeID const& makeTypeID();
-
+ const char* const m_id;
+ template <class T> friend TypeID const& makeTypeIDImp();
};
// makeTypeID - Return the TypeID for the specified type 'T'.
template <class T>
-inline TypeID const& makeTypeID() {
- static int dummy;
- static const TypeID id(&dummy);
+inline TypeID const& makeTypeIDImp() {
+ static const TypeID id(typeid(T).name());
return id;
}
+template <class T>
+struct TypeWrapper {};
+
+template <class T>
+inline TypeID const& makeTypeID() {
+ return makeTypeIDImp<TypeWrapper<T>>();
+}
+
template <class ...Args>
struct ArgumentListID {};
@@ -51,7 +71,23 @@ struct ArgumentListID {};
// of arguments.
template <class ...Args>
inline TypeID const& makeArgumentID() {
- return makeTypeID<ArgumentListID<Args...>>();
+ return makeTypeIDImp<ArgumentListID<Args...>>();
+}
+
+
+// COMPARE_TYPEID(...) is a utility macro for generating diagnostics when
+// two typeid's are expected to be equal
+#define COMPARE_TYPEID(LHS, RHS) CompareTypeIDVerbose(#LHS, LHS, #RHS, RHS)
+
+inline bool CompareTypeIDVerbose(const char* LHSString, TypeID const* LHS,
+ const char* RHSString, TypeID const* RHS) {
+ if (*LHS == *RHS)
+ return true;
+ std::printf("TypeID's not equal:\n");
+ std::printf("%s: %s\n----------\n%s: %s\n",
+ LHSString, LHS->name().c_str(),
+ RHSString, RHS->name().c_str());
+ return false;
}
#endif // SUPPORT_TYPE_ID_H
diff --git a/test/support/uses_alloc_types.hpp b/test/support/uses_alloc_types.hpp
index 834e57729a7a..8422f809ba76 100644
--- a/test/support/uses_alloc_types.hpp
+++ b/test/support/uses_alloc_types.hpp
@@ -10,12 +10,11 @@
#ifndef USES_ALLOC_TYPES_HPP
#define USES_ALLOC_TYPES_HPP
-# include <experimental/memory_resource>
-# include <experimental/utility>
# include <memory>
# include <cassert>
+#include <cstdlib>
-#include "test_memory_resource.hpp"
+#include "test_macros.h"
#include "type_id.h"
// There are two forms of uses-allocator construction:
@@ -31,6 +30,30 @@ constexpr UsesAllocatorType UA_None = UsesAllocatorType::UA_None;
constexpr UsesAllocatorType UA_AllocArg = UsesAllocatorType::UA_AllocArg;
constexpr UsesAllocatorType UA_AllocLast = UsesAllocatorType::UA_AllocLast;
+inline const char* toString(UsesAllocatorType UA) {
+ switch (UA) {
+ case UA_None:
+ return "UA_None";
+ case UA_AllocArg:
+ return "UA_AllocArg";
+ case UA_AllocLast:
+ return "UA_AllocLast";
+ default:
+ std::abort();
+ }
+}
+
+#define COMPARE_ALLOC_TYPE(LHS, RHS) CompareVerbose(#LHS, LHS, #RHS, RHS)
+
+inline bool CompareVerbose(const char* LHSString, UsesAllocatorType LHS,
+ const char* RHSString, UsesAllocatorType RHS) {
+ if (LHS == RHS)
+ return true;
+ std::printf("UsesAllocatorType's don't match:\n%s %s\n----------\n%s %s\n",
+ LHSString, toString(LHS), RHSString, toString(RHS));
+ return false;
+}
+
template <class Alloc, std::size_t N>
class UsesAllocatorV1;
// Implements form (1) of uses-allocator construction from the specified
@@ -115,56 +138,107 @@ using EnableIfB = typename std::enable_if<Value, bool>::type;
} // end namespace detail
+// FIXME: UsesAllocatorTestBase needs some special logic to deal with
+// polymorphic allocators. However we don't want to include
+// <experimental/memory_resource> in this header. Therefore in order
+// to inject this behavior later we use a trait.
+// See test_memory_resource.hpp for more info.
+template <class Alloc>
+struct TransformErasedTypeAlloc {
+ using type = Alloc;
+};
+
using detail::EnableIfB;
struct AllocLastTag {};
+template <class Alloc, bool = std::is_default_constructible<Alloc>::value>
+struct UsesAllocatorTestBaseStorage {
+ Alloc allocator;
+ UsesAllocatorTestBaseStorage() = default;
+ UsesAllocatorTestBaseStorage(Alloc const& a) : allocator(a) {}
+ const Alloc* get_allocator() const { return &allocator; }
+};
+
template <class Alloc>
+struct UsesAllocatorTestBaseStorage<Alloc, false> {
+ union {
+ char dummy;
+ Alloc alloc;
+ };
+ bool has_alloc = false;
+
+ UsesAllocatorTestBaseStorage() : dummy(), has_alloc(false) {}
+ UsesAllocatorTestBaseStorage(Alloc const& a) : alloc(a), has_alloc(true) {}
+ ~UsesAllocatorTestBaseStorage() {
+ if (has_alloc)
+ alloc.~Alloc();
+ }
+
+ Alloc const* get_allocator() const {
+ if (!has_alloc)
+ return nullptr;
+ return &alloc;
+ }
+};
+
+template <class Self, class Alloc>
struct UsesAllocatorTestBase {
public:
- using CtorAlloc = typename std::conditional<
- std::is_same<Alloc, std::experimental::erased_type>::value,
- std::experimental::pmr::memory_resource*,
- Alloc
- >::type;
+ using CtorAlloc = typename TransformErasedTypeAlloc<Alloc>::type;
template <class ...ArgTypes>
bool checkConstruct(UsesAllocatorType expectType) const {
- return expectType == constructor_called &&
- makeArgumentID<ArgTypes...>() == *args_id;
+ auto expectArgs = &makeArgumentID<ArgTypes...>();
+ return COMPARE_ALLOC_TYPE(expectType, constructor_called) &&
+ COMPARE_TYPEID(args_id, expectArgs);
}
template <class ...ArgTypes>
bool checkConstruct(UsesAllocatorType expectType,
CtorAlloc const& expectAlloc) const {
- return expectType == constructor_called &&
- makeArgumentID<ArgTypes...>() == *args_id &&
- expectAlloc == allocator;
+ auto ExpectID = &makeArgumentID<ArgTypes...>() ;
+ return COMPARE_ALLOC_TYPE(expectType, constructor_called) &&
+ COMPARE_TYPEID(args_id, ExpectID) &&
+ has_alloc() && expectAlloc == *get_alloc();
+
}
bool checkConstructEquiv(UsesAllocatorTestBase& O) const {
- return constructor_called == O.constructor_called
- && *args_id == *O.args_id
- && allocator == O.allocator;
+ if (has_alloc() != O.has_alloc())
+ return false;
+ return COMPARE_ALLOC_TYPE(constructor_called, O.constructor_called)
+ && COMPARE_TYPEID(args_id, O.args_id)
+ && (!has_alloc() || *get_alloc() == *O.get_alloc());
}
protected:
explicit UsesAllocatorTestBase(const TypeID* aid)
- : args_id(aid), constructor_called(UA_None), allocator()
+ : args_id(aid), constructor_called(UA_None), alloc_store()
+ {}
+
+ UsesAllocatorTestBase(UsesAllocatorTestBase const&)
+ : args_id(&makeArgumentID<Self const&>()), constructor_called(UA_None),
+ alloc_store()
+ {}
+
+ UsesAllocatorTestBase(UsesAllocatorTestBase&&)
+ : args_id(&makeArgumentID<Self&&>()), constructor_called(UA_None),
+ alloc_store()
{}
template <class ...Args>
UsesAllocatorTestBase(std::allocator_arg_t, CtorAlloc const& a, Args&&...)
: args_id(&makeArgumentID<Args&&...>()),
constructor_called(UA_AllocArg),
- allocator(a)
+ alloc_store(a)
{}
template <class ...Args, class ArgsIDL = detail::TakeNArgs<sizeof...(Args) - 1, Args&&...>>
UsesAllocatorTestBase(AllocLastTag, Args&&... args)
- : args_id(&makeTypeID<typename ArgsIDL::type>()),
+ : args_id(&makeTypeIDImp<typename ArgsIDL::type>()),
constructor_called(UA_AllocLast),
- allocator(getAllocatorFromPack(
+ alloc_store(UsesAllocatorTestBase::getAllocatorFromPack(
typename ArgsIDL::type{},
std::forward<Args>(args)...))
{
@@ -173,7 +247,7 @@ protected:
private:
template <class ...LArgs, class ...Args>
static CtorAlloc getAllocatorFromPack(ArgumentListID<LArgs...>, Args&&... args) {
- return getAllocatorFromPackImp<LArgs const&...>(args...);
+ return UsesAllocatorTestBase::getAllocatorFromPackImp<LArgs const&...>(args...);
}
template <class ...LArgs>
@@ -182,25 +256,32 @@ private:
return alloc;
}
+ bool has_alloc() const { return alloc_store.get_allocator() != nullptr; }
+ const CtorAlloc *get_alloc() const { return alloc_store.get_allocator(); }
+public:
const TypeID* args_id;
UsesAllocatorType constructor_called = UA_None;
- CtorAlloc allocator;
+ UsesAllocatorTestBaseStorage<CtorAlloc> alloc_store;
};
template <class Alloc, size_t Arity>
-class UsesAllocatorV1 : public UsesAllocatorTestBase<Alloc>
+class UsesAllocatorV1 : public UsesAllocatorTestBase<UsesAllocatorV1<Alloc, Arity>, Alloc>
{
public:
typedef Alloc allocator_type;
- using Base = UsesAllocatorTestBase<Alloc>;
+ using Base = UsesAllocatorTestBase<UsesAllocatorV1, Alloc>;
using CtorAlloc = typename Base::CtorAlloc;
UsesAllocatorV1() : Base(&makeArgumentID<>()) {}
+ UsesAllocatorV1(UsesAllocatorV1 const&)
+ : Base(&makeArgumentID<UsesAllocatorV1 const&>()) {}
+ UsesAllocatorV1(UsesAllocatorV1 &&)
+ : Base(&makeArgumentID<UsesAllocatorV1 &&>()) {}
// Non-Uses Allocator Ctor
template <class ...Args, EnableIfB<sizeof...(Args) == Arity> = false>
- UsesAllocatorV1(Args&&... args) : Base(&makeArgumentID<Args&&...>()) {};
+ UsesAllocatorV1(Args&&...) : Base(&makeArgumentID<Args&&...>()) {}
// Uses Allocator Arg Ctor
template <class ...Args>
@@ -209,28 +290,32 @@ public:
{ }
// BLOWS UP: Uses Allocator Last Ctor
- template <class _First, class ...Args, EnableIfB<sizeof...(Args) == Arity> _Dummy = false>
- constexpr UsesAllocatorV1(_First&& __first, Args&&... args)
+ template <class First, class ...Args, EnableIfB<sizeof...(Args) == Arity> Dummy = false>
+ constexpr UsesAllocatorV1(First&&, Args&&...)
{
- static_assert(!std::is_same<_First, _First>::value, "");
+ static_assert(!std::is_same<First, First>::value, "");
}
};
template <class Alloc, size_t Arity>
-class UsesAllocatorV2 : public UsesAllocatorTestBase<Alloc>
+class UsesAllocatorV2 : public UsesAllocatorTestBase<UsesAllocatorV2<Alloc, Arity>, Alloc>
{
public:
typedef Alloc allocator_type;
- using Base = UsesAllocatorTestBase<Alloc>;
+ using Base = UsesAllocatorTestBase<UsesAllocatorV2, Alloc>;
using CtorAlloc = typename Base::CtorAlloc;
UsesAllocatorV2() : Base(&makeArgumentID<>()) {}
+ UsesAllocatorV2(UsesAllocatorV2 const&)
+ : Base(&makeArgumentID<UsesAllocatorV2 const&>()) {}
+ UsesAllocatorV2(UsesAllocatorV2 &&)
+ : Base(&makeArgumentID<UsesAllocatorV2 &&>()) {}
// Non-Uses Allocator Ctor
template <class ...Args, EnableIfB<sizeof...(Args) == Arity> = false>
- UsesAllocatorV2(Args&&... args) : Base(&makeArgumentID<Args&&...>()) {};
+ UsesAllocatorV2(Args&&...) : Base(&makeArgumentID<Args&&...>()) {}
// Uses Allocator Last Ctor
template <class ...Args, EnableIfB<sizeof...(Args) == Arity + 1> = false>
@@ -240,19 +325,23 @@ public:
};
template <class Alloc, size_t Arity>
-class UsesAllocatorV3 : public UsesAllocatorTestBase<Alloc>
+class UsesAllocatorV3 : public UsesAllocatorTestBase<UsesAllocatorV3<Alloc, Arity>, Alloc>
{
public:
typedef Alloc allocator_type;
- using Base = UsesAllocatorTestBase<Alloc>;
+ using Base = UsesAllocatorTestBase<UsesAllocatorV3, Alloc>;
using CtorAlloc = typename Base::CtorAlloc;
UsesAllocatorV3() : Base(&makeArgumentID<>()) {}
+ UsesAllocatorV3(UsesAllocatorV3 const&)
+ : Base(&makeArgumentID<UsesAllocatorV3 const&>()) {}
+ UsesAllocatorV3(UsesAllocatorV3 &&)
+ : Base(&makeArgumentID<UsesAllocatorV3 &&>()) {}
// Non-Uses Allocator Ctor
template <class ...Args, EnableIfB<sizeof...(Args) == Arity> = false>
- UsesAllocatorV3(Args&&... args) : Base(&makeArgumentID<Args&&...>()) {};
+ UsesAllocatorV3(Args&&...) : Base(&makeArgumentID<Args&&...>()) {}
// Uses Allocator Arg Ctor
template <class ...Args>
@@ -268,19 +357,22 @@ public:
};
template <class Alloc, size_t Arity>
-class NotUsesAllocator : public UsesAllocatorTestBase<Alloc>
+class NotUsesAllocator : public UsesAllocatorTestBase<NotUsesAllocator<Alloc, Arity>, Alloc>
{
public:
// no allocator_type typedef provided
- using Base = UsesAllocatorTestBase<Alloc>;
+ using Base = UsesAllocatorTestBase<NotUsesAllocator, Alloc>;
using CtorAlloc = typename Base::CtorAlloc;
NotUsesAllocator() : Base(&makeArgumentID<>()) {}
-
+ NotUsesAllocator(NotUsesAllocator const&)
+ : Base(&makeArgumentID<NotUsesAllocator const&>()) {}
+ NotUsesAllocator(NotUsesAllocator &&)
+ : Base(&makeArgumentID<NotUsesAllocator &&>()) {}
// Non-Uses Allocator Ctor
template <class ...Args, EnableIfB<sizeof...(Args) == Arity> = false>
- NotUsesAllocator(Args&&... args) : Base(&makeArgumentID<Args&&...>()) {};
+ NotUsesAllocator(Args&&...) : Base(&makeArgumentID<Args&&...>()) {}
// Uses Allocator Arg Ctor
template <class ...Args>
diff --git a/test/support/variant_test_helpers.hpp b/test/support/variant_test_helpers.hpp
new file mode 100644
index 000000000000..277167233714
--- /dev/null
+++ b/test/support/variant_test_helpers.hpp
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#ifndef SUPPORT_VARIANT_TEST_HELPERS_HPP
+#define SUPPORT_VARIANT_TEST_HELPERS_HPP
+
+#include <type_traits>
+#include <utility>
+#include <cassert>
+
+#include "test_macros.h"
+
+#if TEST_STD_VER <= 14
+#error This file requires C++17
+#endif
+
+// FIXME: Currently the variant<T&> tests are disabled using this macro.
+#define TEST_VARIANT_HAS_NO_REFERENCES
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+struct CopyThrows {
+ CopyThrows() = default;
+ CopyThrows(CopyThrows const&) { throw 42; }
+ CopyThrows& operator=(CopyThrows const&) { throw 42; }
+};
+
+struct MoveThrows {
+ static int alive;
+ MoveThrows() { ++alive; }
+ MoveThrows(MoveThrows const&) {++alive;}
+ MoveThrows(MoveThrows&&) { throw 42; }
+ MoveThrows& operator=(MoveThrows const&) { return *this; }
+ MoveThrows& operator=(MoveThrows&&) { throw 42; }
+ ~MoveThrows() { --alive; }
+};
+
+int MoveThrows::alive = 0;
+
+struct MakeEmptyT {
+ static int alive;
+ MakeEmptyT() { ++alive; }
+ MakeEmptyT(MakeEmptyT const&) {
+ ++alive;
+ // Don't throw from the copy constructor since variant's assignment
+ // operator performs a copy before committing to the assignment.
+ }
+ MakeEmptyT(MakeEmptyT &&) {
+ throw 42;
+ }
+ MakeEmptyT& operator=(MakeEmptyT const&) {
+ throw 42;
+ }
+ MakeEmptyT& operator=(MakeEmptyT&&) {
+ throw 42;
+ }
+ ~MakeEmptyT() { --alive; }
+};
+static_assert(std::is_swappable_v<MakeEmptyT>, ""); // required for test
+
+int MakeEmptyT::alive = 0;
+
+template <class Variant>
+void makeEmpty(Variant& v) {
+ Variant v2(std::in_place_type<MakeEmptyT>);
+ try {
+ v = v2;
+ assert(false);
+ } catch (...) {
+ assert(v.valueless_by_exception());
+ }
+}
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+
+#endif // SUPPORT_VARIANT_TEST_HELPERS_HPP
diff --git a/test/ubsan_blacklist.txt b/test/ubsan_blacklist.txt
deleted file mode 100644
index 8331d7f41f63..000000000000
--- a/test/ubsan_blacklist.txt
+++ /dev/null
@@ -1 +0,0 @@
-fun:*__hash_table*
diff --git a/utils/gen_link_script/gen_link_script.py b/utils/gen_link_script/gen_link_script.py
index 9f1f0b771fc1..24fe5ce9904e 100755
--- a/utils/gen_link_script/gen_link_script.py
+++ b/utils/gen_link_script/gen_link_script.py
@@ -16,13 +16,13 @@ def print_and_exit(msg):
sys.exit(1)
def usage_and_exit():
- print_and_exit("Usage: ./gen_link_script.py [--help] [--dryrun] <path/to/libcxx.so> <abi_libname>")
+ print_and_exit("Usage: ./gen_link_script.py [--help] [--dryrun] <path/to/libcxx.so> <public_libs>...")
def help_and_exit():
help_msg = \
"""Usage
- gen_link_script.py [--help] [--dryrun] <path/to/libcxx.so> <abi_libname>
+ gen_link_script.py [--help] [--dryrun] <path/to/libcxx.so> <public_libs>...
Generate a linker script that links libc++ to the proper ABI library.
The script replaces the specified libc++ symlink.
@@ -31,8 +31,7 @@ def help_and_exit():
Arguments
<path/to/libcxx.so> - The top level symlink to the versioned libc++ shared
library. This file is replaced with a linker script.
- <abi_libname> - The name of the ABI library to use in the linker script.
- The name must be one of [c++abi, stdc++, supc++, cxxrt].
+ <public_libs> - List of library names to include in linker script.
Exit Status:
0 if OK,
@@ -50,14 +49,14 @@ def parse_args():
dryrun = '--dryrun' == args[0]
if dryrun:
del args[0]
- if len(args) != 2:
+ if len(args) < 2:
usage_and_exit()
symlink_file = args[0]
- abi_libname = args[1]
- return dryrun, symlink_file, abi_libname
+ public_libs = args[1:]
+ return dryrun, symlink_file, public_libs
def main():
- dryrun, symlink_file, abi_libname = parse_args()
+ dryrun, symlink_file, public_libs = parse_args()
# Check that the given libc++.so file is a valid symlink.
if not os.path.islink(symlink_file):
@@ -66,15 +65,12 @@ def main():
# Read the symlink so we know what libc++ to link to in the linker script.
linked_libcxx = os.readlink(symlink_file)
- # Check that the abi_libname is one of the supported values.
- supported_abi_list = ['c++abi', 'stdc++', 'supc++', 'cxxrt']
- if abi_libname not in supported_abi_list:
- print_and_exit("abi name '%s' is not supported: Use one of %r" %
- (abi_libname, supported_abi_list))
+ # Prepare the list of public libraries to link.
+ public_libs = ['-l%s' % l for l in public_libs]
# Generate the linker script contents and print the script and destination
# information.
- contents = "INPUT(%s -l%s)" % (linked_libcxx, abi_libname)
+ contents = "INPUT(%s %s)" % (linked_libcxx, ' '.join(public_libs))
print("GENERATING SCRIPT: '%s' as file %s" % (contents, symlink_file))
# Remove the existing libc++ symlink and replace it with the script.
diff --git a/utils/google-benchmark/.gitignore b/utils/google-benchmark/.gitignore
new file mode 100644
index 000000000000..3c1b4f2183ed
--- /dev/null
+++ b/utils/google-benchmark/.gitignore
@@ -0,0 +1,46 @@
+*.a
+*.so
+*.so.?*
+*.dll
+*.exe
+*.dylib
+*.cmake
+!/cmake/*.cmake
+*~
+*.pyc
+__pycache__
+
+# lcov
+*.lcov
+/lcov
+
+# cmake files.
+/Testing
+CMakeCache.txt
+CMakeFiles/
+cmake_install.cmake
+
+# makefiles.
+Makefile
+
+# in-source build.
+bin/
+lib/
+/test/*_test
+
+# exuberant ctags.
+tags
+
+# YouCompleteMe configuration.
+.ycm_extra_conf.pyc
+
+# ninja generated files.
+.ninja_deps
+.ninja_log
+build.ninja
+install_manifest.txt
+rules.ninja
+
+# out-of-source build top-level folders.
+build/
+_build/
diff --git a/utils/google-benchmark/AUTHORS b/utils/google-benchmark/AUTHORS
new file mode 100644
index 000000000000..5a545fa5bec2
--- /dev/null
+++ b/utils/google-benchmark/AUTHORS
@@ -0,0 +1,35 @@
+# This is the official list of benchmark authors for copyright purposes.
+# This file is distinct from the CONTRIBUTORS files.
+# See the latter for an explanation.
+#
+# Names should be added to this file as:
+# Name or Organization <email address>
+# The email address is not required for organizations.
+#
+# Please keep the list sorted.
+
+Albert Pretorius <pretoalb@gmail.com>
+Arne Beer <arne@twobeer.de>
+Christopher Seymour <chris.j.seymour@hotmail.com>
+David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
+Dominic Hamon <dma@stripysock.com>
+Eric Fiselier <eric@efcs.ca>
+Eugene Zhuk <eugene.zhuk@gmail.com>
+Evgeny Safronov <division494@gmail.com>
+Felix Homann <linuxaudio@showlabor.de>
+Google Inc.
+Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
+JianXiong Zhou <zhoujianxiong2@gmail.com>
+Jussi Knuuttila <jussi.knuuttila@gmail.com>
+Kaito Udagawa <umireon@gmail.com>
+Lei Xu <eddyxu@gmail.com>
+Matt Clarkson <mattyclarkson@gmail.com>
+Nick Hutchinson <nshutchinson@gmail.com>
+Oleksandr Sochka <sasha.sochka@gmail.com>
+Paul Redmond <paul.redmond@gmail.com>
+Radoslav Yovchev <radoslav.tm@gmail.com>
+Shuo Chen <chenshuo@chenshuo.com>
+Yusuke Suzuki <utatane.tea@gmail.com>
+Dirac Research
+Zbigniew Skowron <zbychs@gmail.com>
+Dominik Czarnota <dominik.b.czarnota@gmail.com>
diff --git a/utils/google-benchmark/CMakeLists.txt b/utils/google-benchmark/CMakeLists.txt
new file mode 100644
index 000000000000..8bfd21b190ab
--- /dev/null
+++ b/utils/google-benchmark/CMakeLists.txt
@@ -0,0 +1,179 @@
+cmake_minimum_required (VERSION 2.8.11)
+project (benchmark)
+
+foreach(p
+ CMP0054 # CMake 3.1
+ CMP0056 # export EXE_LINKER_FLAGS to try_run
+ )
+ if(POLICY ${p})
+ cmake_policy(SET ${p} NEW)
+ endif()
+endforeach()
+
+option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON)
+option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF)
+option(BENCHMARK_USE_LIBCXX "Build and test using libc++ as the standard library." OFF)
+# Make sure we can import out CMake functions
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+
+# Read the git tags to determine the project version
+include(GetGitVersion)
+get_git_version(GIT_VERSION)
+
+# Tell the user what versions we are using
+string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION ${GIT_VERSION})
+message("-- Version: ${VERSION}")
+
+# The version of the libraries
+set(GENERIC_LIB_VERSION ${VERSION})
+string(SUBSTRING ${VERSION} 0 1 GENERIC_LIB_SOVERSION)
+
+# Import our CMake modules
+include(CheckCXXCompilerFlag)
+include(AddCXXCompilerFlag)
+include(CXXFeatureCheck)
+
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ # Turn compiler warnings up to 11
+ string(REGEX REPLACE "[-/]W[1-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+
+ # Link time optimisation
+ if (BENCHMARK_ENABLE_LTO)
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
+ set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
+ set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
+ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
+
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /GL")
+ string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO}")
+ set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
+ string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}")
+ set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
+ string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
+ set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
+
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /GL")
+ set(CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL "${CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL} /LTCG")
+ set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} /LTCG")
+ set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /LTCG")
+ endif()
+else()
+ # Try and enable C++11. Don't use C++14 because it doesn't work in some
+ # configurations.
+ add_cxx_compiler_flag(-std=c++11)
+ if (NOT HAVE_CXX_FLAG_STD_CXX11)
+ add_cxx_compiler_flag(-std=c++0x)
+ endif()
+
+ # Turn compiler warnings up to 11
+ add_cxx_compiler_flag(-Wall)
+
+ add_cxx_compiler_flag(-Wextra)
+ add_cxx_compiler_flag(-Wshadow)
+ add_cxx_compiler_flag(-Werror RELEASE)
+ add_cxx_compiler_flag(-Werror RELWITHDEBINFO)
+ add_cxx_compiler_flag(-Werror MINSIZEREL)
+ add_cxx_compiler_flag(-pedantic)
+ add_cxx_compiler_flag(-pedantic-errors)
+ add_cxx_compiler_flag(-Wshorten-64-to-32)
+ add_cxx_compiler_flag(-Wfloat-equal)
+ add_cxx_compiler_flag(-fstrict-aliasing)
+ if (NOT BENCHMARK_USE_LIBCXX)
+ add_cxx_compiler_flag(-Wzero-as-null-pointer-constant)
+ endif()
+ if (HAVE_CXX_FLAG_FSTRICT_ALIASING)
+ add_cxx_compiler_flag(-Wstrict-aliasing)
+ endif()
+ add_cxx_compiler_flag(-Wthread-safety)
+ if (HAVE_CXX_FLAG_WTHREAD_SAFETY)
+ cxx_feature_check(THREAD_SAFETY_ATTRIBUTES)
+ endif()
+
+ # On most UNIX like platforms g++ and clang++ define _GNU_SOURCE as a
+ # predefined macro, which turns on all of the wonderful libc extensions.
+ # However g++ doesn't do this in Cygwin so we have to define it ourselfs
+ # since we depend on GNU/POSIX/BSD extensions.
+ if (CYGWIN)
+ add_definitions(-D_GNU_SOURCE=1)
+ endif()
+
+ # Link time optimisation
+ if (BENCHMARK_ENABLE_LTO)
+ add_cxx_compiler_flag(-flto)
+ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+ find_program(GCC_AR gcc-ar)
+ if (GCC_AR)
+ set(CMAKE_AR ${GCC_AR})
+ endif()
+ find_program(GCC_RANLIB gcc-ranlib)
+ if (GCC_RANLIB)
+ set(CMAKE_RANLIB ${GCC_RANLIB})
+ endif()
+ endif()
+ endif()
+
+ # Coverage build type
+ set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
+ "Flags used by the C++ compiler during coverage builds."
+ FORCE)
+ set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
+ "Flags used for linking binaries during coverage builds."
+ FORCE)
+ set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+ "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
+ "Flags used by the shared libraries linker during coverage builds."
+ FORCE)
+ mark_as_advanced(
+ CMAKE_CXX_FLAGS_COVERAGE
+ CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
+ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
+ "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage."
+ FORCE)
+ add_cxx_compiler_flag(--coverage COVERAGE)
+endif()
+
+if (BENCHMARK_USE_LIBCXX)
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_cxx_compiler_flag(-stdlib=libc++)
+ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
+ add_cxx_compiler_flag(-nostdinc++)
+ message("libc++ header path must be manually specified using CMAKE_CXX_FLAGS")
+ # Adding -nodefaultlibs directly to CMAKE_<TYPE>_LINKER_FLAGS will break
+ # configuration checks such as 'find_package(Threads)'
+ list(APPEND BENCHMARK_CXX_LINKER_FLAGS -nodefaultlibs)
+ # -lc++ cannot be added directly to CMAKE_<TYPE>_LINKER_FLAGS because
+ # linker flags appear before all linker inputs and -lc++ must appear after.
+ list(APPEND BENCHMARK_CXX_LIBRARIES c++)
+ else()
+ message(FATAL "-DBENCHMARK_USE_LIBCXX:BOOL=ON is not supported for compiler")
+ endif()
+endif(BENCHMARK_USE_LIBCXX)
+
+# C++ feature checks
+# Determine the correct regular expression engine to use
+cxx_feature_check(STD_REGEX)
+cxx_feature_check(GNU_POSIX_REGEX)
+cxx_feature_check(POSIX_REGEX)
+if(NOT HAVE_STD_REGEX AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
+ message(FATAL_ERROR "Failed to determine the source files for the regular expression backend")
+endif()
+
+cxx_feature_check(STEADY_CLOCK)
+# Ensure we have pthreads
+find_package(Threads REQUIRED)
+
+# Set up directories
+include_directories(${PROJECT_SOURCE_DIR}/include)
+
+# Build the targets
+add_subdirectory(src)
+
+if (BENCHMARK_ENABLE_TESTING)
+ enable_testing()
+ add_subdirectory(test)
+endif()
diff --git a/utils/google-benchmark/CONTRIBUTING.md b/utils/google-benchmark/CONTRIBUTING.md
new file mode 100644
index 000000000000..43de4c9d4709
--- /dev/null
+++ b/utils/google-benchmark/CONTRIBUTING.md
@@ -0,0 +1,58 @@
+# How to contribute #
+
+We'd love to accept your patches and contributions to this project. There are
+a just a few small guidelines you need to follow.
+
+
+## Contributor License Agreement ##
+
+Contributions to any Google project must be accompanied by a Contributor
+License Agreement. This is not a copyright **assignment**, it simply gives
+Google permission to use and redistribute your contributions as part of the
+project.
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual
+ CLA][].
+
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA][].
+
+You generally only need to submit a CLA once, so if you've already submitted
+one (even if it was for a different project), you probably don't need to do it
+again.
+
+[individual CLA]: https://developers.google.com/open-source/cla/individual
+[corporate CLA]: https://developers.google.com/open-source/cla/corporate
+
+Once your CLA is submitted (or if you already submitted one for
+another Google project), make a commit adding yourself to the
+[AUTHORS][] and [CONTRIBUTORS][] files. This commit can be part
+of your first [pull request][].
+
+[AUTHORS]: AUTHORS
+[CONTRIBUTORS]: CONTRIBUTORS
+
+
+## Submitting a patch ##
+
+ 1. It's generally best to start by opening a new issue describing the bug or
+ feature you're intending to fix. Even if you think it's relatively minor,
+ it's helpful to know what people are working on. Mention in the initial
+ issue that you are planning to work on that bug or feature so that it can
+ be assigned to you.
+
+ 1. Follow the normal process of [forking][] the project, and setup a new
+ branch to work in. It's important that each group of changes be done in
+ separate branches in order to ensure that a pull request only includes the
+ commits related to that bug or feature.
+
+ 1. Do your best to have [well-formed commit messages][] for each change.
+ This provides consistency throughout the project, and ensures that commit
+ messages are able to be formatted properly by various git tools.
+
+ 1. Finally, push the commits to your fork and submit a [pull request][].
+
+[forking]: https://help.github.com/articles/fork-a-repo
+[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
+[pull request]: https://help.github.com/articles/creating-a-pull-request
diff --git a/utils/google-benchmark/CONTRIBUTORS b/utils/google-benchmark/CONTRIBUTORS
new file mode 100644
index 000000000000..33cd941ffed7
--- /dev/null
+++ b/utils/google-benchmark/CONTRIBUTORS
@@ -0,0 +1,53 @@
+# People who have agreed to one of the CLAs and can contribute patches.
+# The AUTHORS file lists the copyright holders; this file
+# lists people. For example, Google employees are listed here
+# but not in AUTHORS, because Google holds the copyright.
+#
+# Names should be added to this file only after verifying that
+# the individual or the individual's organization has agreed to
+# the appropriate Contributor License Agreement, found here:
+#
+# https://developers.google.com/open-source/cla/individual
+# https://developers.google.com/open-source/cla/corporate
+#
+# The agreement for individuals can be filled out on the web.
+#
+# When adding J Random Contributor's name to this file,
+# either J's name or J's organization's name should be
+# added to the AUTHORS file, depending on whether the
+# individual or corporate CLA was used.
+#
+# Names should be added to this file as:
+# Name <email address>
+#
+# Please keep the list sorted.
+
+Albert Pretorius <pretoalb@gmail.com>
+Arne Beer <arne@twobeer.de>
+Billy Robert O'Neal III <billy.oneal@gmail.com> <bion@microsoft.com>
+Chris Kennelly <ckennelly@google.com> <ckennelly@ckennelly.com>
+Christopher Seymour <chris.j.seymour@hotmail.com>
+David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
+Dominic Hamon <dma@stripysock.com>
+Eric Fiselier <eric@efcs.ca>
+Eugene Zhuk <eugene.zhuk@gmail.com>
+Evgeny Safronov <division494@gmail.com>
+Felix Homann <linuxaudio@showlabor.de>
+Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
+JianXiong Zhou <zhoujianxiong2@gmail.com>
+Jussi Knuuttila <jussi.knuuttila@gmail.com>
+Kaito Udagawa <umireon@gmail.com>
+Kai Wolf <kai.wolf@gmail.com>
+Lei Xu <eddyxu@gmail.com>
+Matt Clarkson <mattyclarkson@gmail.com>
+Nick Hutchinson <nshutchinson@gmail.com>
+Oleksandr Sochka <sasha.sochka@gmail.com>
+Pascal Leroy <phl@google.com>
+Paul Redmond <paul.redmond@gmail.com>
+Pierre Phaneuf <pphaneuf@google.com>
+Radoslav Yovchev <radoslav.tm@gmail.com>
+Shuo Chen <chenshuo@chenshuo.com>
+Yusuke Suzuki <utatane.tea@gmail.com>
+Tobias Ulvgård <tobias.ulvgard@dirac.se>
+Zbigniew Skowron <zbychs@gmail.com>
+Dominik Czarnota <dominik.b.czarnota@gmail.com>
diff --git a/utils/google-benchmark/LICENSE b/utils/google-benchmark/LICENSE
new file mode 100644
index 000000000000..d64569567334
--- /dev/null
+++ b/utils/google-benchmark/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/utils/google-benchmark/README.LLVM b/utils/google-benchmark/README.LLVM
new file mode 100644
index 000000000000..e51e2571bf62
--- /dev/null
+++ b/utils/google-benchmark/README.LLVM
@@ -0,0 +1,6 @@
+LLVM notes
+----------
+
+This directory contains the Google Benchmark source code with some unnecessary
+files removed. Note that this directory is under a different license than
+libc++.
diff --git a/utils/google-benchmark/README.md b/utils/google-benchmark/README.md
new file mode 100644
index 000000000000..9109430984ce
--- /dev/null
+++ b/utils/google-benchmark/README.md
@@ -0,0 +1,597 @@
+# benchmark
+[![Build Status](https://travis-ci.org/google/benchmark.svg?branch=master)](https://travis-ci.org/google/benchmark)
+[![Build status](https://ci.appveyor.com/api/projects/status/u0qsyp7t1tk7cpxs/branch/master?svg=true)](https://ci.appveyor.com/project/google/benchmark/branch/master)
+[![Coverage Status](https://coveralls.io/repos/google/benchmark/badge.svg)](https://coveralls.io/r/google/benchmark)
+
+A library to support the benchmarking of functions, similar to unit-tests.
+
+Discussion group: https://groups.google.com/d/forum/benchmark-discuss
+
+IRC channel: https://freenode.net #googlebenchmark
+
+[Known issues and common problems](#known-issues)
+
+## Example usage
+### Basic usage
+Define a function that executes the code to be measured.
+
+```c++
+static void BM_StringCreation(benchmark::State& state) {
+ while (state.KeepRunning())
+ std::string empty_string;
+}
+// Register the function as a benchmark
+BENCHMARK(BM_StringCreation);
+
+// Define another benchmark
+static void BM_StringCopy(benchmark::State& state) {
+ std::string x = "hello";
+ while (state.KeepRunning())
+ std::string copy(x);
+}
+BENCHMARK(BM_StringCopy);
+
+BENCHMARK_MAIN();
+```
+
+### Passing arguments
+Sometimes a family of benchmarks can be implemented with just one routine that
+takes an extra argument to specify which one of the family of benchmarks to
+run. For example, the following code defines a family of benchmarks for
+measuring the speed of `memcpy()` calls of different lengths:
+
+```c++
+static void BM_memcpy(benchmark::State& state) {
+ char* src = new char[state.range(0)];
+ char* dst = new char[state.range(0)];
+ memset(src, 'x', state.range(0));
+ while (state.KeepRunning())
+ memcpy(dst, src, state.range(0));
+ state.SetBytesProcessed(int64_t(state.iterations()) *
+ int64_t(state.range(0)));
+ delete[] src;
+ delete[] dst;
+}
+BENCHMARK(BM_memcpy)->Arg(8)->Arg(64)->Arg(512)->Arg(1<<10)->Arg(8<<10);
+```
+
+The preceding code is quite repetitive, and can be replaced with the following
+short-hand. The following invocation will pick a few appropriate arguments in
+the specified range and will generate a benchmark for each such argument.
+
+```c++
+BENCHMARK(BM_memcpy)->Range(8, 8<<10);
+```
+
+By default the arguments in the range are generated in multiples of eight and
+the command above selects [ 8, 64, 512, 4k, 8k ]. In the following code the
+range multiplier is changed to multiples of two.
+
+```c++
+BENCHMARK(BM_memcpy)->RangeMultiplier(2)->Range(8, 8<<10);
+```
+Now arguments generated are [ 8, 16, 32, 64, 128, 256, 512, 1024, 2k, 4k, 8k ].
+
+You might have a benchmark that depends on two or more inputs. For example, the
+following code defines a family of benchmarks for measuring the speed of set
+insertion.
+
+```c++
+static void BM_SetInsert(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ state.PauseTiming();
+ std::set<int> data = ConstructRandomSet(state.range(0));
+ state.ResumeTiming();
+ for (int j = 0; j < state.range(1); ++j)
+ data.insert(RandomNumber());
+ }
+}
+BENCHMARK(BM_SetInsert)
+ ->Args({1<<10, 1})
+ ->Args({1<<10, 8})
+ ->Args({1<<10, 64})
+ ->Args({1<<10, 512})
+ ->Args({8<<10, 1})
+ ->Args({8<<10, 8})
+ ->Args({8<<10, 64})
+ ->Args({8<<10, 512});
+```
+
+The preceding code is quite repetitive, and can be replaced with the following
+short-hand. The following macro will pick a few appropriate arguments in the
+product of the two specified ranges and will generate a benchmark for each such
+pair.
+
+```c++
+BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {1, 512}});
+```
+
+For more complex patterns of inputs, passing a custom function to `Apply` allows
+programmatic specification of an arbitrary set of arguments on which to run the
+benchmark. The following example enumerates a dense range on one parameter,
+and a sparse range on the second.
+
+```c++
+static void CustomArguments(benchmark::internal::Benchmark* b) {
+ for (int i = 0; i <= 10; ++i)
+ for (int j = 32; j <= 1024*1024; j *= 8)
+ b->Args({i, j});
+}
+BENCHMARK(BM_SetInsert)->Apply(CustomArguments);
+```
+
+### Calculate asymptotic complexity (Big O)
+Asymptotic complexity might be calculated for a family of benchmarks. The
+following code will calculate the coefficient for the high-order term in the
+running time and the normalized root-mean square error of string comparison.
+
+```c++
+static void BM_StringCompare(benchmark::State& state) {
+ std::string s1(state.range(0), '-');
+ std::string s2(state.range(0), '-');
+ while (state.KeepRunning()) {
+ benchmark::DoNotOptimize(s1.compare(s2));
+ }
+ state.SetComplexityN(state.range(0));
+}
+BENCHMARK(BM_StringCompare)
+ ->RangeMultiplier(2)->Range(1<<10, 1<<18)->Complexity(benchmark::oN);
+```
+
+As shown in the following invocation, asymptotic complexity might also be
+calculated automatically.
+
+```c++
+BENCHMARK(BM_StringCompare)
+ ->RangeMultiplier(2)->Range(1<<10, 1<<18)->Complexity();
+```
+
+The following code will specify asymptotic complexity with a lambda function,
+that might be used to customize high-order term calculation.
+
+```c++
+BENCHMARK(BM_StringCompare)->RangeMultiplier(2)
+ ->Range(1<<10, 1<<18)->Complexity([](int n)->double{return n; });
+```
+
+### Templated benchmarks
+Templated benchmarks work the same way: This example produces and consumes
+messages of size `sizeof(v)` `range_x` times. It also outputs throughput in the
+absence of multiprogramming.
+
+```c++
+template <class Q> int BM_Sequential(benchmark::State& state) {
+ Q q;
+ typename Q::value_type v;
+ while (state.KeepRunning()) {
+ for (int i = state.range(0); i--; )
+ q.push(v);
+ for (int e = state.range(0); e--; )
+ q.Wait(&v);
+ }
+ // actually messages, not bytes:
+ state.SetBytesProcessed(
+ static_cast<int64_t>(state.iterations())*state.range(0));
+}
+BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue<int>)->Range(1<<0, 1<<10);
+```
+
+Three macros are provided for adding benchmark templates.
+
+```c++
+#if __cplusplus >= 201103L // C++11 and greater.
+#define BENCHMARK_TEMPLATE(func, ...) // Takes any number of parameters.
+#else // C++ < C++11
+#define BENCHMARK_TEMPLATE(func, arg1)
+#endif
+#define BENCHMARK_TEMPLATE1(func, arg1)
+#define BENCHMARK_TEMPLATE2(func, arg1, arg2)
+```
+
+## Passing arbitrary arguments to a benchmark
+In C++11 it is possible to define a benchmark that takes an arbitrary number
+of extra arguments. The `BENCHMARK_CAPTURE(func, test_case_name, ...args)`
+macro creates a benchmark that invokes `func` with the `benchmark::State` as
+the first argument followed by the specified `args...`.
+The `test_case_name` is appended to the name of the benchmark and
+should describe the values passed.
+
+```c++
+template <class ...ExtraArgs>`
+void BM_takes_args(benchmark::State& state, ExtraArgs&&... extra_args) {
+ [...]
+}
+// Registers a benchmark named "BM_takes_args/int_string_test` that passes
+// the specified values to `extra_args`.
+BENCHMARK_CAPTURE(BM_takes_args, int_string_test, 42, std::string("abc"));
+```
+Note that elements of `...args` may refer to global variables. Users should
+avoid modifying global state inside of a benchmark.
+
+## Using RegisterBenchmark(name, fn, args...)
+
+The `RegisterBenchmark(name, func, args...)` function provides an alternative
+way to create and register benchmarks.
+`RegisterBenchmark(name, func, args...)` creates, registers, and returns a
+pointer to a new benchmark with the specified `name` that invokes
+`func(st, args...)` where `st` is a `benchmark::State` object.
+
+Unlike the `BENCHMARK` registration macros, which can only be used at the global
+scope, the `RegisterBenchmark` can be called anywhere. This allows for
+benchmark tests to be registered programmatically.
+
+Additionally `RegisterBenchmark` allows any callable object to be registered
+as a benchmark. Including capturing lambdas and function objects. This
+allows the creation
+
+For Example:
+```c++
+auto BM_test = [](benchmark::State& st, auto Inputs) { /* ... */ };
+
+int main(int argc, char** argv) {
+ for (auto& test_input : { /* ... */ })
+ benchmark::RegisterBenchmark(test_input.name(), BM_test, test_input);
+ benchmark::Initialize(&argc, argv);
+ benchmark::RunSpecifiedBenchmarks();
+}
+```
+
+### Multithreaded benchmarks
+In a multithreaded test (benchmark invoked by multiple threads simultaneously),
+it is guaranteed that none of the threads will start until all have called
+`KeepRunning`, and all will have finished before KeepRunning returns false. As
+such, any global setup or teardown can be wrapped in a check against the thread
+index:
+
+```c++
+static void BM_MultiThreaded(benchmark::State& state) {
+ if (state.thread_index == 0) {
+ // Setup code here.
+ }
+ while (state.KeepRunning()) {
+ // Run the test as normal.
+ }
+ if (state.thread_index == 0) {
+ // Teardown code here.
+ }
+}
+BENCHMARK(BM_MultiThreaded)->Threads(2);
+```
+
+If the benchmarked code itself uses threads and you want to compare it to
+single-threaded code, you may want to use real-time ("wallclock") measurements
+for latency comparisons:
+
+```c++
+BENCHMARK(BM_test)->Range(8, 8<<10)->UseRealTime();
+```
+
+Without `UseRealTime`, CPU time is used by default.
+
+
+## Manual timing
+For benchmarking something for which neither CPU time nor real-time are
+correct or accurate enough, completely manual timing is supported using
+the `UseManualTime` function.
+
+When `UseManualTime` is used, the benchmarked code must call
+`SetIterationTime` once per iteration of the `KeepRunning` loop to
+report the manually measured time.
+
+An example use case for this is benchmarking GPU execution (e.g. OpenCL
+or CUDA kernels, OpenGL or Vulkan or Direct3D draw calls), which cannot
+be accurately measured using CPU time or real-time. Instead, they can be
+measured accurately using a dedicated API, and these measurement results
+can be reported back with `SetIterationTime`.
+
+```c++
+static void BM_ManualTiming(benchmark::State& state) {
+ int microseconds = state.range(0);
+ std::chrono::duration<double, std::micro> sleep_duration {
+ static_cast<double>(microseconds)
+ };
+
+ while (state.KeepRunning()) {
+ auto start = std::chrono::high_resolution_clock::now();
+ // Simulate some useful workload with a sleep
+ std::this_thread::sleep_for(sleep_duration);
+ auto end = std::chrono::high_resolution_clock::now();
+
+ auto elapsed_seconds =
+ std::chrono::duration_cast<std::chrono::duration<double>>(
+ end - start);
+
+ state.SetIterationTime(elapsed_seconds.count());
+ }
+}
+BENCHMARK(BM_ManualTiming)->Range(1, 1<<17)->UseManualTime();
+```
+
+### Preventing optimisation
+To prevent a value or expression from being optimized away by the compiler
+the `benchmark::DoNotOptimize(...)` and `benchmark::ClobberMemory()`
+functions can be used.
+
+```c++
+static void BM_test(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ int x = 0;
+ for (int i=0; i < 64; ++i) {
+ benchmark::DoNotOptimize(x += i);
+ }
+ }
+}
+```
+
+`DoNotOptimize(<expr>)` forces the *result* of `<expr>` to be stored in either
+memory or a register. For GNU based compilers it acts as read/write barrier
+for global memory. More specifically it forces the compiler to flush pending
+writes to memory and reload any other values as necessary.
+
+Note that `DoNotOptimize(<expr>)` does not prevent optimizations on `<expr>`
+in any way. `<expr>` may even be removed entirely when the result is already
+known. For example:
+
+```c++
+ /* Example 1: `<expr>` is removed entirely. */
+ int foo(int x) { return x + 42; }
+ while (...) DoNotOptimize(foo(0)); // Optimized to DoNotOptimize(42);
+
+ /* Example 2: Result of '<expr>' is only reused */
+ int bar(int) __attribute__((const));
+ while (...) DoNotOptimize(bar(0)); // Optimized to:
+ // int __result__ = bar(0);
+ // while (...) DoNotOptimize(__result__);
+```
+
+The second tool for preventing optimizations is `ClobberMemory()`. In essence
+`ClobberMemory()` forces the compiler to perform all pending writes to global
+memory. Memory managed by block scope objects must be "escaped" using
+`DoNotOptimize(...)` before it can be clobbered. In the below example
+`ClobberMemory()` prevents the call to `v.push_back(42)` from being optimized
+away.
+
+```c++
+static void BM_vector_push_back(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ std::vector<int> v;
+ v.reserve(1);
+ benchmark::DoNotOptimize(v.data()); // Allow v.data() to be clobbered.
+ v.push_back(42);
+ benchmark::ClobberMemory(); // Force 42 to be written to memory.
+ }
+}
+```
+
+Note that `ClobberMemory()` is only available for GNU based compilers.
+
+### Set time unit manually
+If a benchmark runs a few milliseconds it may be hard to visually compare the
+measured times, since the output data is given in nanoseconds per default. In
+order to manually set the time unit, you can specify it manually:
+
+```c++
+BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
+```
+
+## Controlling number of iterations
+In all cases, the number of iterations for which the benchmark is run is
+governed by the amount of time the benchmark takes. Concretely, the number of
+iterations is at least one, not more than 1e9, until CPU time is greater than
+the minimum time, or the wallclock time is 5x minimum time. The minimum time is
+set as a flag `--benchmark_min_time` or per benchmark by calling `MinTime` on
+the registered benchmark object.
+
+## Reporting the mean and standard devation by repeated benchmarks
+By default each benchmark is run once and that single result is reported.
+However benchmarks are often noisy and a single result may not be representative
+of the overall behavior. For this reason it's possible to repeatedly rerun the
+benchmark.
+
+The number of runs of each benchmark is specified globally by the
+`--benchmark_repetitions` flag or on a per benchmark basis by calling
+`Repetitions` on the registered benchmark object. When a benchmark is run
+more than once the mean and standard deviation of the runs will be reported.
+
+Additionally the `--benchmark_report_aggregates_only={true|false}` flag or
+`ReportAggregatesOnly(bool)` function can be used to change how repeated tests
+are reported. By default the result of each repeated run is reported. When this
+option is 'true' only the mean and standard deviation of the runs is reported.
+Calling `ReportAggregatesOnly(bool)` on a registered benchmark object overrides
+the value of the flag for that benchmark.
+
+## Fixtures
+Fixture tests are created by
+first defining a type that derives from ::benchmark::Fixture and then
+creating/registering the tests using the following macros:
+
+* `BENCHMARK_F(ClassName, Method)`
+* `BENCHMARK_DEFINE_F(ClassName, Method)`
+* `BENCHMARK_REGISTER_F(ClassName, Method)`
+
+For Example:
+
+```c++
+class MyFixture : public benchmark::Fixture {};
+
+BENCHMARK_F(MyFixture, FooTest)(benchmark::State& st) {
+ while (st.KeepRunning()) {
+ ...
+ }
+}
+
+BENCHMARK_DEFINE_F(MyFixture, BarTest)(benchmark::State& st) {
+ while (st.KeepRunning()) {
+ ...
+ }
+}
+/* BarTest is NOT registered */
+BENCHMARK_REGISTER_F(MyFixture, BarTest)->Threads(2);
+/* BarTest is now registered */
+```
+
+## Exiting Benchmarks in Error
+
+When errors caused by external influences, such as file I/O and network
+communication, occur within a benchmark the
+`State::SkipWithError(const char* msg)` function can be used to skip that run
+of benchmark and report the error. Note that only future iterations of the
+`KeepRunning()` are skipped. Users may explicitly return to exit the
+benchmark immediately.
+
+The `SkipWithError(...)` function may be used at any point within the benchmark,
+including before and after the `KeepRunning()` loop.
+
+For example:
+
+```c++
+static void BM_test(benchmark::State& state) {
+ auto resource = GetResource();
+ if (!resource.good()) {
+ state.SkipWithError("Resource is not good!");
+ // KeepRunning() loop will not be entered.
+ }
+ while (state.KeepRunning()) {
+ auto data = resource.read_data();
+ if (!resource.good()) {
+ state.SkipWithError("Failed to read data!");
+ break; // Needed to skip the rest of the iteration.
+ }
+ do_stuff(data);
+ }
+}
+```
+
+## Running a subset of the benchmarks
+
+The `--benchmark_filter=<regex>` option can be used to only run the benchmarks
+which match the specified `<regex>`. For example:
+
+```bash
+$ ./run_benchmarks.x --benchmark_filter=BM_memcpy/32
+Run on (1 X 2300 MHz CPU )
+2016-06-25 19:34:24
+Benchmark Time CPU Iterations
+----------------------------------------------------
+BM_memcpy/32 11 ns 11 ns 79545455
+BM_memcpy/32k 2181 ns 2185 ns 324074
+BM_memcpy/32 12 ns 12 ns 54687500
+BM_memcpy/32k 1834 ns 1837 ns 357143
+```
+
+
+## Output Formats
+The library supports multiple output formats. Use the
+`--benchmark_format=<console|json|csv>` flag to set the format type. `console`
+is the default format.
+
+The Console format is intended to be a human readable format. By default
+the format generates color output. Context is output on stderr and the
+tabular data on stdout. Example tabular output looks like:
+```
+Benchmark Time(ns) CPU(ns) Iterations
+----------------------------------------------------------------------
+BM_SetInsert/1024/1 28928 29349 23853 133.097kB/s 33.2742k items/s
+BM_SetInsert/1024/8 32065 32913 21375 949.487kB/s 237.372k items/s
+BM_SetInsert/1024/10 33157 33648 21431 1.13369MB/s 290.225k items/s
+```
+
+The JSON format outputs human readable json split into two top level attributes.
+The `context` attribute contains information about the run in general, including
+information about the CPU and the date.
+The `benchmarks` attribute contains a list of ever benchmark run. Example json
+output looks like:
+``` json
+{
+ "context": {
+ "date": "2015/03/17-18:40:25",
+ "num_cpus": 40,
+ "mhz_per_cpu": 2801,
+ "cpu_scaling_enabled": false,
+ "build_type": "debug"
+ },
+ "benchmarks": [
+ {
+ "name": "BM_SetInsert/1024/1",
+ "iterations": 94877,
+ "real_time": 29275,
+ "cpu_time": 29836,
+ "bytes_per_second": 134066,
+ "items_per_second": 33516
+ },
+ {
+ "name": "BM_SetInsert/1024/8",
+ "iterations": 21609,
+ "real_time": 32317,
+ "cpu_time": 32429,
+ "bytes_per_second": 986770,
+ "items_per_second": 246693
+ },
+ {
+ "name": "BM_SetInsert/1024/10",
+ "iterations": 21393,
+ "real_time": 32724,
+ "cpu_time": 33355,
+ "bytes_per_second": 1199226,
+ "items_per_second": 299807
+ }
+ ]
+}
+```
+
+The CSV format outputs comma-separated values. The `context` is output on stderr
+and the CSV itself on stdout. Example CSV output looks like:
+```
+name,iterations,real_time,cpu_time,bytes_per_second,items_per_second,label
+"BM_SetInsert/1024/1",65465,17890.7,8407.45,475768,118942,
+"BM_SetInsert/1024/8",116606,18810.1,9766.64,3.27646e+06,819115,
+"BM_SetInsert/1024/10",106365,17238.4,8421.53,4.74973e+06,1.18743e+06,
+```
+
+## Output Files
+The library supports writing the output of the benchmark to a file specified
+by `--benchmark_out=<filename>`. The format of the output can be specified
+using `--benchmark_out_format={json|console|csv}`. Specifying
+`--benchmark_out` does not suppress the console output.
+
+## Debug vs Release
+By default, benchmark builds as a debug library. You will see a warning in the output when this is the case. To build it as a release library instead, use:
+
+```
+cmake -DCMAKE_BUILD_TYPE=Release
+```
+
+To enable link-time optimisation, use
+
+```
+cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_LTO=true
+```
+
+## Linking against the library
+When using gcc, it is necessary to link against pthread to avoid runtime exceptions.
+This is due to how gcc implements std::thread.
+See [issue #67](https://github.com/google/benchmark/issues/67) for more details.
+
+## Compiler Support
+
+Google Benchmark uses C++11 when building the library. As such we require
+a modern C++ toolchain, both compiler and standard library.
+
+The following minimum versions are strongly recommended build the library:
+
+* GCC 4.8
+* Clang 3.4
+* Visual Studio 2013
+
+Anything older *may* work.
+
+Note: Using the library and its headers in C++03 is supported. C++11 is only
+required to build the library.
+
+# Known Issues
+
+### Windows
+
+* Users must manually link `shlwapi.lib`. Failure to do so may result
+in unresolved symbols.
+
diff --git a/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake b/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake
new file mode 100644
index 000000000000..9afde84be11e
--- /dev/null
+++ b/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake
@@ -0,0 +1,37 @@
+# - Adds a compiler flag if it is supported by the compiler
+#
+# This function checks that the supplied compiler flag is supported and then
+# adds it to the corresponding compiler flags
+#
+# add_cxx_compiler_flag(<FLAG> [<VARIANT>])
+#
+# - Example
+#
+# include(AddCXXCompilerFlag)
+# add_cxx_compiler_flag(-Wall)
+# add_cxx_compiler_flag(-no-strict-aliasing RELEASE)
+# Requires CMake 2.6+
+
+if(__add_cxx_compiler_flag)
+ return()
+endif()
+set(__add_cxx_compiler_flag INCLUDED)
+
+include(CheckCXXCompilerFlag)
+
+function(add_cxx_compiler_flag FLAG)
+ string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG)
+ string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
+ string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
+ string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
+ set(CMAKE_REQUIRED_FLAGS "${FLAG}")
+ check_cxx_compiler_flag("${FLAG}" ${SANITIZED_FLAG})
+ if(${SANITIZED_FLAG})
+ set(VARIANT ${ARGV1})
+ if(ARGV1)
+ string(TOUPPER "_${VARIANT}" VARIANT)
+ endif()
+ set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
+ endif()
+endfunction()
+
diff --git a/utils/google-benchmark/cmake/CXXFeatureCheck.cmake b/utils/google-benchmark/cmake/CXXFeatureCheck.cmake
new file mode 100644
index 000000000000..b106f32b6393
--- /dev/null
+++ b/utils/google-benchmark/cmake/CXXFeatureCheck.cmake
@@ -0,0 +1,44 @@
+# - Compile and run code to check for C++ features
+#
+# This functions compiles a source file under the `cmake` folder
+# and adds the corresponding `HAVE_[FILENAME]` flag to the CMake
+# environment
+#
+# cxx_feature_check(<FLAG> [<VARIANT>])
+#
+# - Example
+#
+# include(CXXFeatureCheck)
+# cxx_feature_check(STD_REGEX)
+# Requires CMake 2.6+
+
+if(__cxx_feature_check)
+ return()
+endif()
+set(__cxx_feature_check INCLUDED)
+
+function(cxx_feature_check FILE)
+ string(TOLOWER ${FILE} FILE)
+ string(TOUPPER ${FILE} VAR)
+ string(TOUPPER "HAVE_${VAR}" FEATURE)
+ if (DEFINED HAVE_${VAR})
+ return()
+ endif()
+ message("-- Performing Test ${FEATURE}")
+ try_run(RUN_${FEATURE} COMPILE_${FEATURE}
+ ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp
+ CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS}
+ LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES})
+ if(RUN_${FEATURE} EQUAL 0)
+ message("-- Performing Test ${FEATURE} -- success")
+ set(HAVE_${VAR} 1 CACHE INTERNAL "Feature test for ${FILE}" PARENT_SCOPE)
+ add_definitions(-DHAVE_${VAR})
+ else()
+ if(NOT COMPILE_${FEATURE})
+ message("-- Performing Test ${FEATURE} -- failed to compile")
+ else()
+ message("-- Performing Test ${FEATURE} -- compiled but failed to run")
+ endif()
+ endif()
+endfunction()
+
diff --git a/utils/google-benchmark/cmake/GetGitVersion.cmake b/utils/google-benchmark/cmake/GetGitVersion.cmake
new file mode 100644
index 000000000000..8dd948004597
--- /dev/null
+++ b/utils/google-benchmark/cmake/GetGitVersion.cmake
@@ -0,0 +1,51 @@
+# - Returns a version string from Git tags
+#
+# This function inspects the annotated git tags for the project and returns a string
+# into a CMake variable
+#
+# get_git_version(<var>)
+#
+# - Example
+#
+# include(GetGitVersion)
+# get_git_version(GIT_VERSION)
+#
+# Requires CMake 2.8.11+
+find_package(Git)
+
+if(__get_git_version)
+ return()
+endif()
+set(__get_git_version INCLUDED)
+
+function(get_git_version var)
+ if(GIT_EXECUTABLE)
+ execute_process(COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8
+ RESULT_VARIABLE status
+ OUTPUT_VARIABLE GIT_VERSION
+ ERROR_QUIET)
+ if(${status})
+ set(GIT_VERSION "v0.0.0")
+ else()
+ string(STRIP ${GIT_VERSION} GIT_VERSION)
+ string(REGEX REPLACE "-[0-9]+-g" "-" GIT_VERSION ${GIT_VERSION})
+ endif()
+
+ # Work out if the repository is dirty
+ execute_process(COMMAND ${GIT_EXECUTABLE} update-index -q --refresh
+ OUTPUT_QUIET
+ ERROR_QUIET)
+ execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD --
+ OUTPUT_VARIABLE GIT_DIFF_INDEX
+ ERROR_QUIET)
+ string(COMPARE NOTEQUAL "${GIT_DIFF_INDEX}" "" GIT_DIRTY)
+ if (${GIT_DIRTY})
+ set(GIT_VERSION "${GIT_VERSION}-dirty")
+ endif()
+ else()
+ set(GIT_VERSION "v0.0.0")
+ endif()
+
+ message("-- git Version: ${GIT_VERSION}")
+ set(${var} ${GIT_VERSION} PARENT_SCOPE)
+endfunction()
diff --git a/utils/google-benchmark/cmake/gnu_posix_regex.cpp b/utils/google-benchmark/cmake/gnu_posix_regex.cpp
new file mode 100644
index 000000000000..b5b91cdab7c2
--- /dev/null
+++ b/utils/google-benchmark/cmake/gnu_posix_regex.cpp
@@ -0,0 +1,12 @@
+#include <gnuregex.h>
+#include <string>
+int main() {
+ std::string str = "test0159";
+ regex_t re;
+ int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB);
+ if (ec != 0) {
+ return ec;
+ }
+ return regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0;
+}
+
diff --git a/utils/google-benchmark/cmake/posix_regex.cpp b/utils/google-benchmark/cmake/posix_regex.cpp
new file mode 100644
index 000000000000..466dc62560a2
--- /dev/null
+++ b/utils/google-benchmark/cmake/posix_regex.cpp
@@ -0,0 +1,14 @@
+#include <regex.h>
+#include <string>
+int main() {
+ std::string str = "test0159";
+ regex_t re;
+ int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB);
+ if (ec != 0) {
+ return ec;
+ }
+ int ret = regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0;
+ regfree(&re);
+ return ret;
+}
+
diff --git a/utils/google-benchmark/cmake/std_regex.cpp b/utils/google-benchmark/cmake/std_regex.cpp
new file mode 100644
index 000000000000..696f2a26bce0
--- /dev/null
+++ b/utils/google-benchmark/cmake/std_regex.cpp
@@ -0,0 +1,10 @@
+#include <regex>
+#include <string>
+int main() {
+ const std::string str = "test0159";
+ std::regex re;
+ re = std::regex("^[a-z]+[0-9]+$",
+ std::regex_constants::extended | std::regex_constants::nosubs);
+ return std::regex_search(str, re) ? 0 : -1;
+}
+
diff --git a/utils/google-benchmark/cmake/steady_clock.cpp b/utils/google-benchmark/cmake/steady_clock.cpp
new file mode 100644
index 000000000000..66d50d17e9e6
--- /dev/null
+++ b/utils/google-benchmark/cmake/steady_clock.cpp
@@ -0,0 +1,7 @@
+#include <chrono>
+
+int main() {
+ typedef std::chrono::steady_clock Clock;
+ Clock::time_point tp = Clock::now();
+ ((void)tp);
+}
diff --git a/utils/google-benchmark/cmake/thread_safety_attributes.cpp b/utils/google-benchmark/cmake/thread_safety_attributes.cpp
new file mode 100644
index 000000000000..46161babdb10
--- /dev/null
+++ b/utils/google-benchmark/cmake/thread_safety_attributes.cpp
@@ -0,0 +1,4 @@
+#define HAVE_THREAD_SAFETY_ATTRIBUTES
+#include "../src/mutex.h"
+
+int main() {}
diff --git a/utils/google-benchmark/include/benchmark/benchmark.h b/utils/google-benchmark/include/benchmark/benchmark.h
new file mode 100644
index 000000000000..b3b0a8e947fb
--- /dev/null
+++ b/utils/google-benchmark/include/benchmark/benchmark.h
@@ -0,0 +1,21 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef BENCHMARK_BENCHMARK_H_
+#define BENCHMARK_BENCHMARK_H_
+
+#include "benchmark_api.h"
+#include "macros.h"
+#include "reporter.h"
+
+#endif // BENCHMARK_BENCHMARK_H_
diff --git a/utils/google-benchmark/include/benchmark/benchmark_api.h b/utils/google-benchmark/include/benchmark/benchmark_api.h
new file mode 100644
index 000000000000..28baa587a9e1
--- /dev/null
+++ b/utils/google-benchmark/include/benchmark/benchmark_api.h
@@ -0,0 +1,864 @@
+// Support for registering benchmarks for functions.
+
+/* Example usage:
+// Define a function that executes the code to be measured a
+// specified number of times:
+static void BM_StringCreation(benchmark::State& state) {
+ while (state.KeepRunning())
+ std::string empty_string;
+}
+
+// Register the function as a benchmark
+BENCHMARK(BM_StringCreation);
+
+// Define another benchmark
+static void BM_StringCopy(benchmark::State& state) {
+ std::string x = "hello";
+ while (state.KeepRunning())
+ std::string copy(x);
+}
+BENCHMARK(BM_StringCopy);
+
+// Augment the main() program to invoke benchmarks if specified
+// via the --benchmarks command line flag. E.g.,
+// my_unittest --benchmark_filter=all
+// my_unittest --benchmark_filter=BM_StringCreation
+// my_unittest --benchmark_filter=String
+// my_unittest --benchmark_filter='Copy|Creation'
+int main(int argc, char** argv) {
+ benchmark::Initialize(&argc, argv);
+ benchmark::RunSpecifiedBenchmarks();
+ return 0;
+}
+
+// Sometimes a family of microbenchmarks can be implemented with
+// just one routine that takes an extra argument to specify which
+// one of the family of benchmarks to run. For example, the following
+// code defines a family of microbenchmarks for measuring the speed
+// of memcpy() calls of different lengths:
+
+static void BM_memcpy(benchmark::State& state) {
+ char* src = new char[state.range(0)]; char* dst = new char[state.range(0)];
+ memset(src, 'x', state.range(0));
+ while (state.KeepRunning())
+ memcpy(dst, src, state.range(0));
+ state.SetBytesProcessed(int64_t(state.iterations()) *
+ int64_t(state.range(0)));
+ delete[] src; delete[] dst;
+}
+BENCHMARK(BM_memcpy)->Arg(8)->Arg(64)->Arg(512)->Arg(1<<10)->Arg(8<<10);
+
+// The preceding code is quite repetitive, and can be replaced with the
+// following short-hand. The following invocation will pick a few
+// appropriate arguments in the specified range and will generate a
+// microbenchmark for each such argument.
+BENCHMARK(BM_memcpy)->Range(8, 8<<10);
+
+// You might have a microbenchmark that depends on two inputs. For
+// example, the following code defines a family of microbenchmarks for
+// measuring the speed of set insertion.
+static void BM_SetInsert(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ state.PauseTiming();
+ set<int> data = ConstructRandomSet(state.range(0));
+ state.ResumeTiming();
+ for (int j = 0; j < state.range(1); ++j)
+ data.insert(RandomNumber());
+ }
+}
+BENCHMARK(BM_SetInsert)
+ ->Args({1<<10, 1})
+ ->Args({1<<10, 8})
+ ->Args({1<<10, 64})
+ ->Args({1<<10, 512})
+ ->Args({8<<10, 1})
+ ->Args({8<<10, 8})
+ ->Args({8<<10, 64})
+ ->Args({8<<10, 512});
+
+// The preceding code is quite repetitive, and can be replaced with
+// the following short-hand. The following macro will pick a few
+// appropriate arguments in the product of the two specified ranges
+// and will generate a microbenchmark for each such pair.
+BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {1, 512}});
+
+// For more complex patterns of inputs, passing a custom function
+// to Apply allows programmatic specification of an
+// arbitrary set of arguments to run the microbenchmark on.
+// The following example enumerates a dense range on
+// one parameter, and a sparse range on the second.
+static void CustomArguments(benchmark::internal::Benchmark* b) {
+ for (int i = 0; i <= 10; ++i)
+ for (int j = 32; j <= 1024*1024; j *= 8)
+ b->Args({i, j});
+}
+BENCHMARK(BM_SetInsert)->Apply(CustomArguments);
+
+// Templated microbenchmarks work the same way:
+// Produce then consume 'size' messages 'iters' times
+// Measures throughput in the absence of multiprogramming.
+template <class Q> int BM_Sequential(benchmark::State& state) {
+ Q q;
+ typename Q::value_type v;
+ while (state.KeepRunning()) {
+ for (int i = state.range(0); i--; )
+ q.push(v);
+ for (int e = state.range(0); e--; )
+ q.Wait(&v);
+ }
+ // actually messages, not bytes:
+ state.SetBytesProcessed(
+ static_cast<int64_t>(state.iterations())*state.range(0));
+}
+BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue<int>)->Range(1<<0, 1<<10);
+
+Use `Benchmark::MinTime(double t)` to set the minimum time used to run the
+benchmark. This option overrides the `benchmark_min_time` flag.
+
+void BM_test(benchmark::State& state) {
+ ... body ...
+}
+BENCHMARK(BM_test)->MinTime(2.0); // Run for at least 2 seconds.
+
+In a multithreaded test, it is guaranteed that none of the threads will start
+until all have called KeepRunning, and all will have finished before KeepRunning
+returns false. As such, any global setup or teardown you want to do can be
+wrapped in a check against the thread index:
+
+static void BM_MultiThreaded(benchmark::State& state) {
+ if (state.thread_index == 0) {
+ // Setup code here.
+ }
+ while (state.KeepRunning()) {
+ // Run the test as normal.
+ }
+ if (state.thread_index == 0) {
+ // Teardown code here.
+ }
+}
+BENCHMARK(BM_MultiThreaded)->Threads(4);
+
+
+If a benchmark runs a few milliseconds it may be hard to visually compare the
+measured times, since the output data is given in nanoseconds per default. In
+order to manually set the time unit, you can specify it manually:
+
+BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
+*/
+
+#ifndef BENCHMARK_BENCHMARK_API_H_
+#define BENCHMARK_BENCHMARK_API_H_
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <string>
+#include <vector>
+
+#include "macros.h"
+
+#if defined(BENCHMARK_HAS_CXX11)
+#include <type_traits>
+#include <utility>
+#endif
+
+namespace benchmark {
+class BenchmarkReporter;
+
+void Initialize(int* argc, char** argv);
+
+// Generate a list of benchmarks matching the specified --benchmark_filter flag
+// and if --benchmark_list_tests is specified return after printing the name
+// of each matching benchmark. Otherwise run each matching benchmark and
+// report the results.
+//
+// The second and third overload use the specified 'console_reporter' and
+// 'file_reporter' respectively. 'file_reporter' will write to the file
+// specified
+// by '--benchmark_output'. If '--benchmark_output' is not given the
+// 'file_reporter' is ignored.
+//
+// RETURNS: The number of matching benchmarks.
+size_t RunSpecifiedBenchmarks();
+size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter);
+size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter,
+ BenchmarkReporter* file_reporter);
+
+// If this routine is called, peak memory allocation past this point in the
+// benchmark is reported at the end of the benchmark report line. (It is
+// computed by running the benchmark once with a single iteration and a memory
+// tracer.)
+// TODO(dominic)
+// void MemoryUsage();
+
+namespace internal {
+class Benchmark;
+class BenchmarkImp;
+class BenchmarkFamilies;
+
+template <class T>
+struct Voider {
+ typedef void type;
+};
+
+template <class T, class = void>
+struct EnableIfString {};
+
+template <class T>
+struct EnableIfString<T, typename Voider<typename T::basic_string>::type> {
+ typedef int type;
+};
+
+void UseCharPointer(char const volatile*);
+
+// Take ownership of the pointer and register the benchmark. Return the
+// registered benchmark.
+Benchmark* RegisterBenchmarkInternal(Benchmark*);
+
+// Ensure that the standard streams are properly initialized in every TU.
+int InitializeStreams();
+BENCHMARK_UNUSED static int stream_init_anchor = InitializeStreams();
+
+} // end namespace internal
+
+// The DoNotOptimize(...) function can be used to prevent a value or
+// expression from being optimized away by the compiler. This function is
+// intended to add little to no overhead.
+// See: https://youtu.be/nXaxk27zwlk?t=2441
+#if defined(__GNUC__)
+template <class Tp>
+inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
+ asm volatile("" : : "g"(value) : "memory");
+}
+// Force the compiler to flush pending writes to global memory. Acts as an
+// effective read/write barrier
+inline BENCHMARK_ALWAYS_INLINE void ClobberMemory() {
+ asm volatile("" : : : "memory");
+}
+#else
+template <class Tp>
+inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
+ internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value));
+}
+// FIXME Add ClobberMemory() for non-gnu compilers
+#endif
+
+// TimeUnit is passed to a benchmark in order to specify the order of magnitude
+// for the measured time.
+enum TimeUnit { kNanosecond, kMicrosecond, kMillisecond };
+
+// BigO is passed to a benchmark in order to specify the asymptotic
+// computational
+// complexity for the benchmark. In case oAuto is selected, complexity will be
+// calculated automatically to the best fit.
+enum BigO { oNone, o1, oN, oNSquared, oNCubed, oLogN, oNLogN, oAuto, oLambda };
+
+// BigOFunc is passed to a benchmark in order to specify the asymptotic
+// computational complexity for the benchmark.
+typedef double(BigOFunc)(int);
+
+namespace internal {
+class ThreadTimer;
+class ThreadManager;
+
+#if defined(BENCHMARK_HAS_CXX11)
+enum ReportMode : unsigned {
+#else
+enum ReportMode {
+#endif
+ RM_Unspecified, // The mode has not been manually specified
+ RM_Default, // The mode is user-specified as default.
+ RM_ReportAggregatesOnly
+};
+}
+
+// State is passed to a running Benchmark and contains state for the
+// benchmark to use.
+class State {
+ public:
+ // Returns true if the benchmark should continue through another iteration.
+ // NOTE: A benchmark may not return from the test until KeepRunning() has
+ // returned false.
+ bool KeepRunning() {
+ if (BENCHMARK_BUILTIN_EXPECT(!started_, false)) {
+ StartKeepRunning();
+ }
+ bool const res = total_iterations_++ < max_iterations;
+ if (BENCHMARK_BUILTIN_EXPECT(!res, false)) {
+ FinishKeepRunning();
+ }
+ return res;
+ }
+
+ // REQUIRES: timer is running and 'SkipWithError(...)' has not been called
+ // by the current thread.
+ // Stop the benchmark timer. If not called, the timer will be
+ // automatically stopped after KeepRunning() returns false for the first time.
+ //
+ // For threaded benchmarks the PauseTiming() function only pauses the timing
+ // for the current thread.
+ //
+ // NOTE: The "real time" measurement is per-thread. If different threads
+ // report different measurements the largest one is reported.
+ //
+ // NOTE: PauseTiming()/ResumeTiming() are relatively
+ // heavyweight, and so their use should generally be avoided
+ // within each benchmark iteration, if possible.
+ void PauseTiming();
+
+ // REQUIRES: timer is not running and 'SkipWithError(...)' has not been called
+ // by the current thread.
+ // Start the benchmark timer. The timer is NOT running on entrance to the
+ // benchmark function. It begins running after the first call to KeepRunning()
+ //
+ // NOTE: PauseTiming()/ResumeTiming() are relatively
+ // heavyweight, and so their use should generally be avoided
+ // within each benchmark iteration, if possible.
+ void ResumeTiming();
+
+ // REQUIRES: 'SkipWithError(...)' has not been called previously by the
+ // current thread.
+ // Skip any future iterations of the 'KeepRunning()' loop in the current
+ // thread and report an error with the specified 'msg'. After this call
+ // the user may explicitly 'return' from the benchmark.
+ //
+ // For threaded benchmarks only the current thread stops executing and future
+ // calls to `KeepRunning()` will block until all threads have completed
+ // the `KeepRunning()` loop. If multiple threads report an error only the
+ // first error message is used.
+ //
+ // NOTE: Calling 'SkipWithError(...)' does not cause the benchmark to exit
+ // the current scope immediately. If the function is called from within
+ // the 'KeepRunning()' loop the current iteration will finish. It is the users
+ // responsibility to exit the scope as needed.
+ void SkipWithError(const char* msg);
+
+ // REQUIRES: called exactly once per iteration of the KeepRunning loop.
+ // Set the manually measured time for this benchmark iteration, which
+ // is used instead of automatically measured time if UseManualTime() was
+ // specified.
+ //
+ // For threaded benchmarks the final value will be set to the largest
+ // reported values.
+ void SetIterationTime(double seconds);
+
+ // Set the number of bytes processed by the current benchmark
+ // execution. This routine is typically called once at the end of a
+ // throughput oriented benchmark. If this routine is called with a
+ // value > 0, the report is printed in MB/sec instead of nanoseconds
+ // per iteration.
+ //
+ // REQUIRES: a benchmark has exited its KeepRunning loop.
+ BENCHMARK_ALWAYS_INLINE
+ void SetBytesProcessed(size_t bytes) { bytes_processed_ = bytes; }
+
+ BENCHMARK_ALWAYS_INLINE
+ size_t bytes_processed() const { return bytes_processed_; }
+
+ // If this routine is called with complexity_n > 0 and complexity report is
+ // requested for the
+ // family benchmark, then current benchmark will be part of the computation
+ // and complexity_n will
+ // represent the length of N.
+ BENCHMARK_ALWAYS_INLINE
+ void SetComplexityN(int complexity_n) { complexity_n_ = complexity_n; }
+
+ BENCHMARK_ALWAYS_INLINE
+ int complexity_length_n() { return complexity_n_; }
+
+ // If this routine is called with items > 0, then an items/s
+ // label is printed on the benchmark report line for the currently
+ // executing benchmark. It is typically called at the end of a processing
+ // benchmark where a processing items/second output is desired.
+ //
+ // REQUIRES: a benchmark has exited its KeepRunning loop.
+ BENCHMARK_ALWAYS_INLINE
+ void SetItemsProcessed(size_t items) { items_processed_ = items; }
+
+ BENCHMARK_ALWAYS_INLINE
+ size_t items_processed() const { return items_processed_; }
+
+ // If this routine is called, the specified label is printed at the
+ // end of the benchmark report line for the currently executing
+ // benchmark. Example:
+ // static void BM_Compress(benchmark::State& state) {
+ // ...
+ // double compress = input_size / output_size;
+ // state.SetLabel(StringPrintf("compress:%.1f%%", 100.0*compression));
+ // }
+ // Produces output that looks like:
+ // BM_Compress 50 50 14115038 compress:27.3%
+ //
+ // REQUIRES: a benchmark has exited its KeepRunning loop.
+ void SetLabel(const char* label);
+
+ // Allow the use of std::string without actually including <string>.
+ // This function does not participate in overload resolution unless StringType
+ // has the nested typename `basic_string`. This typename should be provided
+ // as an injected class name in the case of std::string.
+ template <class StringType>
+ void SetLabel(StringType const& str,
+ typename internal::EnableIfString<StringType>::type = 1) {
+ this->SetLabel(str.c_str());
+ }
+
+ // Range arguments for this run. CHECKs if the argument has been set.
+ BENCHMARK_ALWAYS_INLINE
+ int range(std::size_t pos = 0) const {
+ assert(range_.size() > pos);
+ return range_[pos];
+ }
+
+ BENCHMARK_DEPRECATED_MSG("use 'range(0)' instead")
+ int range_x() const { return range(0); }
+
+ BENCHMARK_DEPRECATED_MSG("use 'range(1)' instead")
+ int range_y() const { return range(1); }
+
+ BENCHMARK_ALWAYS_INLINE
+ size_t iterations() const { return total_iterations_; }
+
+ private:
+ bool started_;
+ bool finished_;
+ size_t total_iterations_;
+
+ std::vector<int> range_;
+
+ size_t bytes_processed_;
+ size_t items_processed_;
+
+ int complexity_n_;
+
+ bool error_occurred_;
+
+ public:
+ // Index of the executing thread. Values from [0, threads).
+ const int thread_index;
+ // Number of threads concurrently executing the benchmark.
+ const int threads;
+ const size_t max_iterations;
+
+ // TODO make me private
+ State(size_t max_iters, const std::vector<int>& ranges, int thread_i,
+ int n_threads, internal::ThreadTimer* timer,
+ internal::ThreadManager* manager);
+
+ private:
+ void StartKeepRunning();
+ void FinishKeepRunning();
+ internal::ThreadTimer* timer_;
+ internal::ThreadManager* manager_;
+ BENCHMARK_DISALLOW_COPY_AND_ASSIGN(State);
+};
+
+namespace internal {
+
+typedef void(Function)(State&);
+
+// ------------------------------------------------------
+// Benchmark registration object. The BENCHMARK() macro expands
+// into an internal::Benchmark* object. Various methods can
+// be called on this object to change the properties of the benchmark.
+// Each method returns "this" so that multiple method calls can
+// chained into one expression.
+class Benchmark {
+ public:
+ virtual ~Benchmark();
+
+ // Note: the following methods all return "this" so that multiple
+ // method calls can be chained together in one expression.
+
+ // Run this benchmark once with "x" as the extra argument passed
+ // to the function.
+ // REQUIRES: The function passed to the constructor must accept an arg1.
+ Benchmark* Arg(int x);
+
+ // Run this benchmark with the given time unit for the generated output report
+ Benchmark* Unit(TimeUnit unit);
+
+ // Run this benchmark once for a number of values picked from the
+ // range [start..limit]. (start and limit are always picked.)
+ // REQUIRES: The function passed to the constructor must accept an arg1.
+ Benchmark* Range(int start, int limit);
+
+ // Run this benchmark once for all values in the range [start..limit] with
+ // specific step
+ // REQUIRES: The function passed to the constructor must accept an arg1.
+ Benchmark* DenseRange(int start, int limit, int step = 1);
+
+ // Run this benchmark once with "args" as the extra arguments passed
+ // to the function.
+ // REQUIRES: The function passed to the constructor must accept arg1, arg2 ...
+ Benchmark* Args(const std::vector<int>& args);
+
+ // Equivalent to Args({x, y})
+ // NOTE: This is a legacy C++03 interface provided for compatibility only.
+ // New code should use 'Args'.
+ Benchmark* ArgPair(int x, int y) {
+ std::vector<int> args;
+ args.push_back(x);
+ args.push_back(y);
+ return Args(args);
+ }
+
+ // Run this benchmark once for a number of values picked from the
+ // ranges [start..limit]. (starts and limits are always picked.)
+ // REQUIRES: The function passed to the constructor must accept arg1, arg2 ...
+ Benchmark* Ranges(const std::vector<std::pair<int, int> >& ranges);
+
+ // Equivalent to ArgNames({name})
+ Benchmark* ArgName(const std::string& name);
+
+ // Set the argument names to display in the benchmark name. If not called,
+ // only argument values will be shown.
+ Benchmark* ArgNames(const std::vector<std::string>& names);
+
+ // Equivalent to Ranges({{lo1, hi1}, {lo2, hi2}}).
+ // NOTE: This is a legacy C++03 interface provided for compatibility only.
+ // New code should use 'Ranges'.
+ Benchmark* RangePair(int lo1, int hi1, int lo2, int hi2) {
+ std::vector<std::pair<int, int> > ranges;
+ ranges.push_back(std::make_pair(lo1, hi1));
+ ranges.push_back(std::make_pair(lo2, hi2));
+ return Ranges(ranges);
+ }
+
+ // Pass this benchmark object to *func, which can customize
+ // the benchmark by calling various methods like Arg, Args,
+ // Threads, etc.
+ Benchmark* Apply(void (*func)(Benchmark* benchmark));
+
+ // Set the range multiplier for non-dense range. If not called, the range
+ // multiplier kRangeMultiplier will be used.
+ Benchmark* RangeMultiplier(int multiplier);
+
+ // Set the minimum amount of time to use when running this benchmark. This
+ // option overrides the `benchmark_min_time` flag.
+ // REQUIRES: `t > 0`
+ Benchmark* MinTime(double t);
+
+ // Specify the amount of times to repeat this benchmark. This option overrides
+ // the `benchmark_repetitions` flag.
+ // REQUIRES: `n > 0`
+ Benchmark* Repetitions(int n);
+
+ // Specify if each repetition of the benchmark should be reported separately
+ // or if only the final statistics should be reported. If the benchmark
+ // is not repeated then the single result is always reported.
+ Benchmark* ReportAggregatesOnly(bool v = true);
+
+ // If a particular benchmark is I/O bound, runs multiple threads internally or
+ // if for some reason CPU timings are not representative, call this method. If
+ // called, the elapsed time will be used to control how many iterations are
+ // run, and in the printing of items/second or MB/seconds values. If not
+ // called, the cpu time used by the benchmark will be used.
+ Benchmark* UseRealTime();
+
+ // If a benchmark must measure time manually (e.g. if GPU execution time is
+ // being
+ // measured), call this method. If called, each benchmark iteration should
+ // call
+ // SetIterationTime(seconds) to report the measured time, which will be used
+ // to control how many iterations are run, and in the printing of items/second
+ // or MB/second values.
+ Benchmark* UseManualTime();
+
+ // Set the asymptotic computational complexity for the benchmark. If called
+ // the asymptotic computational complexity will be shown on the output.
+ Benchmark* Complexity(BigO complexity = benchmark::oAuto);
+
+ // Set the asymptotic computational complexity for the benchmark. If called
+ // the asymptotic computational complexity will be shown on the output.
+ Benchmark* Complexity(BigOFunc* complexity);
+
+ // Support for running multiple copies of the same benchmark concurrently
+ // in multiple threads. This may be useful when measuring the scaling
+ // of some piece of code.
+
+ // Run one instance of this benchmark concurrently in t threads.
+ Benchmark* Threads(int t);
+
+ // Pick a set of values T from [min_threads,max_threads].
+ // min_threads and max_threads are always included in T. Run this
+ // benchmark once for each value in T. The benchmark run for a
+ // particular value t consists of t threads running the benchmark
+ // function concurrently. For example, consider:
+ // BENCHMARK(Foo)->ThreadRange(1,16);
+ // This will run the following benchmarks:
+ // Foo in 1 thread
+ // Foo in 2 threads
+ // Foo in 4 threads
+ // Foo in 8 threads
+ // Foo in 16 threads
+ Benchmark* ThreadRange(int min_threads, int max_threads);
+
+ // For each value n in the range, run this benchmark once using n threads.
+ // min_threads and max_threads are always included in the range.
+ // stride specifies the increment. E.g. DenseThreadRange(1, 8, 3) starts
+ // a benchmark with 1, 4, 7 and 8 threads.
+ Benchmark* DenseThreadRange(int min_threads, int max_threads, int stride = 1);
+
+ // Equivalent to ThreadRange(NumCPUs(), NumCPUs())
+ Benchmark* ThreadPerCpu();
+
+ virtual void Run(State& state) = 0;
+
+ // Used inside the benchmark implementation
+ struct Instance;
+
+ protected:
+ explicit Benchmark(const char* name);
+ Benchmark(Benchmark const&);
+ void SetName(const char* name);
+
+ int ArgsCnt() const;
+
+ static void AddRange(std::vector<int>* dst, int lo, int hi, int mult);
+
+ private:
+ friend class BenchmarkFamilies;
+
+ std::string name_;
+ ReportMode report_mode_;
+ std::vector<std::string> arg_names_; // Args for all benchmark runs
+ std::vector<std::vector<int> > args_; // Args for all benchmark runs
+ TimeUnit time_unit_;
+ int range_multiplier_;
+ double min_time_;
+ int repetitions_;
+ bool use_real_time_;
+ bool use_manual_time_;
+ BigO complexity_;
+ BigOFunc* complexity_lambda_;
+ std::vector<int> thread_counts_;
+
+ Benchmark& operator=(Benchmark const&);
+};
+
+} // namespace internal
+
+// Create and register a benchmark with the specified 'name' that invokes
+// the specified functor 'fn'.
+//
+// RETURNS: A pointer to the registered benchmark.
+internal::Benchmark* RegisterBenchmark(const char* name,
+ internal::Function* fn);
+
+#if defined(BENCHMARK_HAS_CXX11)
+template <class Lambda>
+internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn);
+#endif
+
+namespace internal {
+// The class used to hold all Benchmarks created from static function.
+// (ie those created using the BENCHMARK(...) macros.
+class FunctionBenchmark : public Benchmark {
+ public:
+ FunctionBenchmark(const char* name, Function* func)
+ : Benchmark(name), func_(func) {}
+
+ virtual void Run(State& st);
+
+ private:
+ Function* func_;
+};
+
+#ifdef BENCHMARK_HAS_CXX11
+template <class Lambda>
+class LambdaBenchmark : public Benchmark {
+ public:
+ virtual void Run(State& st) { lambda_(st); }
+
+ private:
+ template <class OLambda>
+ LambdaBenchmark(const char* name, OLambda&& lam)
+ : Benchmark(name), lambda_(std::forward<OLambda>(lam)) {}
+
+ LambdaBenchmark(LambdaBenchmark const&) = delete;
+
+ private:
+ template <class Lam>
+ friend Benchmark* ::benchmark::RegisterBenchmark(const char*, Lam&&);
+
+ Lambda lambda_;
+};
+#endif
+
+} // end namespace internal
+
+inline internal::Benchmark* RegisterBenchmark(const char* name,
+ internal::Function* fn) {
+ return internal::RegisterBenchmarkInternal(
+ ::new internal::FunctionBenchmark(name, fn));
+}
+
+#ifdef BENCHMARK_HAS_CXX11
+template <class Lambda>
+internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn) {
+ using BenchType =
+ internal::LambdaBenchmark<typename std::decay<Lambda>::type>;
+ return internal::RegisterBenchmarkInternal(
+ ::new BenchType(name, std::forward<Lambda>(fn)));
+}
+#endif
+
+#if defined(BENCHMARK_HAS_CXX11) && \
+ (!defined(BENCHMARK_GCC_VERSION) || BENCHMARK_GCC_VERSION >= 409)
+template <class Lambda, class... Args>
+internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn,
+ Args&&... args) {
+ return benchmark::RegisterBenchmark(
+ name, [=](benchmark::State& st) { fn(st, args...); });
+}
+#else
+#define BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK
+#endif
+
+// The base class for all fixture tests.
+class Fixture : public internal::Benchmark {
+ public:
+ Fixture() : internal::Benchmark("") {}
+
+ virtual void Run(State& st) {
+ this->SetUp(st);
+ this->BenchmarkCase(st);
+ this->TearDown(st);
+ }
+
+ // These will be deprecated ...
+ virtual void SetUp(const State&) {}
+ virtual void TearDown(const State&) {}
+ // ... In favor of these.
+ virtual void SetUp(State& st) { SetUp(const_cast<const State&>(st)); }
+ virtual void TearDown(State& st) { TearDown(const_cast<const State&>(st)); }
+
+ protected:
+ virtual void BenchmarkCase(State&) = 0;
+};
+
+} // end namespace benchmark
+
+// ------------------------------------------------------
+// Macro to register benchmarks
+
+// Check that __COUNTER__ is defined and that __COUNTER__ increases by 1
+// every time it is expanded. X + 1 == X + 0 is used in case X is defined to be
+// empty. If X is empty the expression becomes (+1 == +0).
+#if defined(__COUNTER__) && (__COUNTER__ + 1 == __COUNTER__ + 0)
+#define BENCHMARK_PRIVATE_UNIQUE_ID __COUNTER__
+#else
+#define BENCHMARK_PRIVATE_UNIQUE_ID __LINE__
+#endif
+
+// Helpers for generating unique variable names
+#define BENCHMARK_PRIVATE_NAME(n) \
+ BENCHMARK_PRIVATE_CONCAT(_benchmark_, BENCHMARK_PRIVATE_UNIQUE_ID, n)
+#define BENCHMARK_PRIVATE_CONCAT(a, b, c) BENCHMARK_PRIVATE_CONCAT2(a, b, c)
+#define BENCHMARK_PRIVATE_CONCAT2(a, b, c) a##b##c
+
+#define BENCHMARK_PRIVATE_DECLARE(n) \
+ static ::benchmark::internal::Benchmark* BENCHMARK_PRIVATE_NAME(n) \
+ BENCHMARK_UNUSED
+
+#define BENCHMARK(n) \
+ BENCHMARK_PRIVATE_DECLARE(n) = \
+ (::benchmark::internal::RegisterBenchmarkInternal( \
+ new ::benchmark::internal::FunctionBenchmark(#n, n)))
+
+// Old-style macros
+#define BENCHMARK_WITH_ARG(n, a) BENCHMARK(n)->Arg((a))
+#define BENCHMARK_WITH_ARG2(n, a1, a2) BENCHMARK(n)->Args({(a1), (a2)})
+#define BENCHMARK_WITH_UNIT(n, t) BENCHMARK(n)->Unit((t))
+#define BENCHMARK_RANGE(n, lo, hi) BENCHMARK(n)->Range((lo), (hi))
+#define BENCHMARK_RANGE2(n, l1, h1, l2, h2) \
+ BENCHMARK(n)->RangePair({{(l1), (h1)}, {(l2), (h2)}})
+
+#if __cplusplus >= 201103L
+
+// Register a benchmark which invokes the function specified by `func`
+// with the additional arguments specified by `...`.
+//
+// For example:
+//
+// template <class ...ExtraArgs>`
+// void BM_takes_args(benchmark::State& state, ExtraArgs&&... extra_args) {
+// [...]
+//}
+// /* Registers a benchmark named "BM_takes_args/int_string_test` */
+// BENCHMARK_CAPTURE(BM_takes_args, int_string_test, 42, std::string("abc"));
+#define BENCHMARK_CAPTURE(func, test_case_name, ...) \
+ BENCHMARK_PRIVATE_DECLARE(func) = \
+ (::benchmark::internal::RegisterBenchmarkInternal( \
+ new ::benchmark::internal::FunctionBenchmark( \
+ #func "/" #test_case_name, \
+ [](::benchmark::State& st) { func(st, __VA_ARGS__); })))
+
+#endif // __cplusplus >= 11
+
+// This will register a benchmark for a templatized function. For example:
+//
+// template<int arg>
+// void BM_Foo(int iters);
+//
+// BENCHMARK_TEMPLATE(BM_Foo, 1);
+//
+// will register BM_Foo<1> as a benchmark.
+#define BENCHMARK_TEMPLATE1(n, a) \
+ BENCHMARK_PRIVATE_DECLARE(n) = \
+ (::benchmark::internal::RegisterBenchmarkInternal( \
+ new ::benchmark::internal::FunctionBenchmark(#n "<" #a ">", n<a>)))
+
+#define BENCHMARK_TEMPLATE2(n, a, b) \
+ BENCHMARK_PRIVATE_DECLARE(n) = \
+ (::benchmark::internal::RegisterBenchmarkInternal( \
+ new ::benchmark::internal::FunctionBenchmark(#n "<" #a "," #b ">", \
+ n<a, b>)))
+
+#if __cplusplus >= 201103L
+#define BENCHMARK_TEMPLATE(n, ...) \
+ BENCHMARK_PRIVATE_DECLARE(n) = \
+ (::benchmark::internal::RegisterBenchmarkInternal( \
+ new ::benchmark::internal::FunctionBenchmark( \
+ #n "<" #__VA_ARGS__ ">", n<__VA_ARGS__>)))
+#else
+#define BENCHMARK_TEMPLATE(n, a) BENCHMARK_TEMPLATE1(n, a)
+#endif
+
+#define BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
+ class BaseClass##_##Method##_Benchmark : public BaseClass { \
+ public: \
+ BaseClass##_##Method##_Benchmark() : BaseClass() { \
+ this->SetName(#BaseClass "/" #Method); \
+ } \
+ \
+ protected: \
+ virtual void BenchmarkCase(::benchmark::State&); \
+ };
+
+#define BENCHMARK_DEFINE_F(BaseClass, Method) \
+ BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
+ void BaseClass##_##Method##_Benchmark::BenchmarkCase
+
+#define BENCHMARK_REGISTER_F(BaseClass, Method) \
+ BENCHMARK_PRIVATE_REGISTER_F(BaseClass##_##Method##_Benchmark)
+
+#define BENCHMARK_PRIVATE_REGISTER_F(TestName) \
+ BENCHMARK_PRIVATE_DECLARE(TestName) = \
+ (::benchmark::internal::RegisterBenchmarkInternal(new TestName()))
+
+// This macro will define and register a benchmark within a fixture class.
+#define BENCHMARK_F(BaseClass, Method) \
+ BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
+ BENCHMARK_REGISTER_F(BaseClass, Method); \
+ void BaseClass##_##Method##_Benchmark::BenchmarkCase
+
+// Helper macro to create a main routine in a test that runs the benchmarks
+#define BENCHMARK_MAIN() \
+ int main(int argc, char** argv) { \
+ ::benchmark::Initialize(&argc, argv); \
+ ::benchmark::RunSpecifiedBenchmarks(); \
+ }
+
+#endif // BENCHMARK_BENCHMARK_API_H_
diff --git a/utils/google-benchmark/include/benchmark/macros.h b/utils/google-benchmark/include/benchmark/macros.h
new file mode 100644
index 000000000000..2466fd3fad06
--- /dev/null
+++ b/utils/google-benchmark/include/benchmark/macros.h
@@ -0,0 +1,66 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef BENCHMARK_MACROS_H_
+#define BENCHMARK_MACROS_H_
+
+#if __cplusplus >= 201103L
+#define BENCHMARK_HAS_CXX11
+#endif
+
+#ifndef BENCHMARK_HAS_CXX11
+#define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ TypeName& operator=(const TypeName&)
+#else
+#define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&) = delete; \
+ TypeName& operator=(const TypeName&) = delete
+#endif
+
+#if defined(__GNUC__)
+#define BENCHMARK_UNUSED __attribute__((unused))
+#define BENCHMARK_ALWAYS_INLINE __attribute__((always_inline))
+#define BENCHMARK_NOEXCEPT noexcept
+#define BENCHMARK_NOEXCEPT_OP(x) noexcept(x)
+#elif defined(_MSC_VER) && !defined(__clang__)
+#define BENCHMARK_UNUSED
+#define BENCHMARK_ALWAYS_INLINE __forceinline
+#if _MSC_VER >= 1900
+#define BENCHMARK_NOEXCEPT noexcept
+#define BENCHMARK_NOEXCEPT_OP(x) noexcept(x)
+#else
+#define BENCHMARK_NOEXCEPT
+#define BENCHMARK_NOEXCEPT_OP(x)
+#endif
+#define __func__ __FUNCTION__
+#else
+#define BENCHMARK_UNUSED
+#define BENCHMARK_ALWAYS_INLINE
+#define BENCHMARK_NOEXCEPT
+#define BENCHMARK_NOEXCEPT_OP(x)
+#endif
+
+#if defined(__GNUC__)
+#define BENCHMARK_BUILTIN_EXPECT(x, y) __builtin_expect(x, y)
+#define BENCHMARK_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
+#else
+#define BENCHMARK_BUILTIN_EXPECT(x, y) x
+#define BENCHMARK_DEPRECATED_MSG(msg)
+#endif
+
+#if defined(__GNUC__) && !defined(__clang__)
+#define BENCHMARK_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+#endif
+
+#endif // BENCHMARK_MACROS_H_
diff --git a/utils/google-benchmark/include/benchmark/reporter.h b/utils/google-benchmark/include/benchmark/reporter.h
new file mode 100644
index 000000000000..8c39e7f7fa6b
--- /dev/null
+++ b/utils/google-benchmark/include/benchmark/reporter.h
@@ -0,0 +1,219 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef BENCHMARK_REPORTER_H_
+#define BENCHMARK_REPORTER_H_
+
+#include <cassert>
+#include <iosfwd>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "benchmark_api.h" // For forward declaration of BenchmarkReporter
+
+namespace benchmark {
+
+// Interface for custom benchmark result printers.
+// By default, benchmark reports are printed to stdout. However an application
+// can control the destination of the reports by calling
+// RunSpecifiedBenchmarks and passing it a custom reporter object.
+// The reporter object must implement the following interface.
+class BenchmarkReporter {
+ public:
+ struct Context {
+ int num_cpus;
+ double mhz_per_cpu;
+ bool cpu_scaling_enabled;
+
+ // The number of chars in the longest benchmark name.
+ size_t name_field_width;
+ };
+
+ struct Run {
+ Run()
+ : error_occurred(false),
+ iterations(1),
+ time_unit(kNanosecond),
+ real_accumulated_time(0),
+ cpu_accumulated_time(0),
+ bytes_per_second(0),
+ items_per_second(0),
+ max_heapbytes_used(0),
+ complexity(oNone),
+ complexity_lambda(),
+ complexity_n(0),
+ report_big_o(false),
+ report_rms(false) {}
+
+ std::string benchmark_name;
+ std::string report_label; // Empty if not set by benchmark.
+ bool error_occurred;
+ std::string error_message;
+
+ int64_t iterations;
+ TimeUnit time_unit;
+ double real_accumulated_time;
+ double cpu_accumulated_time;
+
+ // Return a value representing the real time per iteration in the unit
+ // specified by 'time_unit'.
+ // NOTE: If 'iterations' is zero the returned value represents the
+ // accumulated time.
+ double GetAdjustedRealTime() const;
+
+ // Return a value representing the cpu time per iteration in the unit
+ // specified by 'time_unit'.
+ // NOTE: If 'iterations' is zero the returned value represents the
+ // accumulated time.
+ double GetAdjustedCPUTime() const;
+
+ // Zero if not set by benchmark.
+ double bytes_per_second;
+ double items_per_second;
+
+ // This is set to 0.0 if memory tracing is not enabled.
+ double max_heapbytes_used;
+
+ // Keep track of arguments to compute asymptotic complexity
+ BigO complexity;
+ BigOFunc* complexity_lambda;
+ int complexity_n;
+
+ // Inform print function whether the current run is a complexity report
+ bool report_big_o;
+ bool report_rms;
+ };
+
+ // Construct a BenchmarkReporter with the output stream set to 'std::cout'
+ // and the error stream set to 'std::cerr'
+ BenchmarkReporter();
+
+ // Called once for every suite of benchmarks run.
+ // The parameter "context" contains information that the
+ // reporter may wish to use when generating its report, for example the
+ // platform under which the benchmarks are running. The benchmark run is
+ // never started if this function returns false, allowing the reporter
+ // to skip runs based on the context information.
+ virtual bool ReportContext(const Context& context) = 0;
+
+ // Called once for each group of benchmark runs, gives information about
+ // cpu-time and heap memory usage during the benchmark run. If the group
+ // of runs contained more than two entries then 'report' contains additional
+ // elements representing the mean and standard deviation of those runs.
+ // Additionally if this group of runs was the last in a family of benchmarks
+ // 'reports' contains additional entries representing the asymptotic
+ // complexity and RMS of that benchmark family.
+ virtual void ReportRuns(const std::vector<Run>& report) = 0;
+
+ // Called once and only once after ever group of benchmarks is run and
+ // reported.
+ virtual void Finalize() {}
+
+ // REQUIRES: The object referenced by 'out' is valid for the lifetime
+ // of the reporter.
+ void SetOutputStream(std::ostream* out) {
+ assert(out);
+ output_stream_ = out;
+ }
+
+ // REQUIRES: The object referenced by 'err' is valid for the lifetime
+ // of the reporter.
+ void SetErrorStream(std::ostream* err) {
+ assert(err);
+ error_stream_ = err;
+ }
+
+ std::ostream& GetOutputStream() const { return *output_stream_; }
+
+ std::ostream& GetErrorStream() const { return *error_stream_; }
+
+ virtual ~BenchmarkReporter();
+
+ // Write a human readable string to 'out' representing the specified
+ // 'context'.
+ // REQUIRES: 'out' is non-null.
+ static void PrintBasicContext(std::ostream* out, Context const& context);
+
+ private:
+ std::ostream* output_stream_;
+ std::ostream* error_stream_;
+};
+
+// Simple reporter that outputs benchmark data to the console. This is the
+// default reporter used by RunSpecifiedBenchmarks().
+class ConsoleReporter : public BenchmarkReporter {
+ public:
+ enum OutputOptions { OO_None, OO_Color };
+ explicit ConsoleReporter(OutputOptions color_output = OO_Color)
+ : name_field_width_(0), color_output_(color_output == OO_Color) {}
+
+ virtual bool ReportContext(const Context& context);
+ virtual void ReportRuns(const std::vector<Run>& reports);
+
+ protected:
+ virtual void PrintRunData(const Run& report);
+ size_t name_field_width_;
+
+ private:
+ bool color_output_;
+};
+
+class JSONReporter : public BenchmarkReporter {
+ public:
+ JSONReporter() : first_report_(true) {}
+ virtual bool ReportContext(const Context& context);
+ virtual void ReportRuns(const std::vector<Run>& reports);
+ virtual void Finalize();
+
+ private:
+ void PrintRunData(const Run& report);
+
+ bool first_report_;
+};
+
+class CSVReporter : public BenchmarkReporter {
+ public:
+ virtual bool ReportContext(const Context& context);
+ virtual void ReportRuns(const std::vector<Run>& reports);
+
+ private:
+ void PrintRunData(const Run& report);
+};
+
+inline const char* GetTimeUnitString(TimeUnit unit) {
+ switch (unit) {
+ case kMillisecond:
+ return "ms";
+ case kMicrosecond:
+ return "us";
+ case kNanosecond:
+ default:
+ return "ns";
+ }
+}
+
+inline double GetTimeUnitMultiplier(TimeUnit unit) {
+ switch (unit) {
+ case kMillisecond:
+ return 1e3;
+ case kMicrosecond:
+ return 1e6;
+ case kNanosecond:
+ default:
+ return 1e9;
+ }
+}
+
+} // end namespace benchmark
+#endif // BENCHMARK_REPORTER_H_
diff --git a/utils/google-benchmark/src/CMakeLists.txt b/utils/google-benchmark/src/CMakeLists.txt
new file mode 100644
index 000000000000..403887517797
--- /dev/null
+++ b/utils/google-benchmark/src/CMakeLists.txt
@@ -0,0 +1,44 @@
+# Allow the source files to find headers in src/
+include_directories(${PROJECT_SOURCE_DIR}/src)
+
+if (DEFINED BENCHMARK_CXX_LINKER_FLAGS)
+ list(APPEND CMAKE_SHARED_LINKER_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS})
+ list(APPEND CMAKE_MODULE_LINKER_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS})
+endif()
+
+file(GLOB
+ SOURCE_FILES
+ *.cc
+ ${PROJECT_SOURCE_DIR}/include/benchmark/*.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
+
+add_library(benchmark ${SOURCE_FILES})
+set_target_properties(benchmark PROPERTIES
+ OUTPUT_NAME "benchmark"
+ VERSION ${GENERIC_LIB_VERSION}
+ SOVERSION ${GENERIC_LIB_SOVERSION}
+)
+
+# Link threads.
+target_link_libraries(benchmark ${BENCHMARK_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+
+# We need extra libraries on Windows
+if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+ target_link_libraries(benchmark Shlwapi)
+endif()
+
+# Expose public API
+target_include_directories(benchmark PUBLIC ${PROJECT_SOURCE_DIR}/include)
+
+# Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable)
+install(
+ TARGETS benchmark
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
+ COMPONENT library)
+
+install(
+ DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark"
+ DESTINATION include
+ FILES_MATCHING PATTERN "*.*h")
diff --git a/utils/google-benchmark/src/arraysize.h b/utils/google-benchmark/src/arraysize.h
new file mode 100644
index 000000000000..51a50f2dff27
--- /dev/null
+++ b/utils/google-benchmark/src/arraysize.h
@@ -0,0 +1,33 @@
+#ifndef BENCHMARK_ARRAYSIZE_H_
+#define BENCHMARK_ARRAYSIZE_H_
+
+#include "internal_macros.h"
+
+namespace benchmark {
+namespace internal {
+// The arraysize(arr) macro returns the # of elements in an array arr.
+// The expression is a compile-time constant, and therefore can be
+// used in defining new arrays, for example. If you use arraysize on
+// a pointer by mistake, you will get a compile-time error.
+//
+
+// This template function declaration is used in defining arraysize.
+// Note that the function doesn't need an implementation, as we only
+// use its type.
+template <typename T, size_t N>
+char (&ArraySizeHelper(T (&array)[N]))[N];
+
+// That gcc wants both of these prototypes seems mysterious. VC, for
+// its part, can't decide which to use (another mystery). Matching of
+// template overloads: the final frontier.
+#ifndef COMPILER_MSVC
+template <typename T, size_t N>
+char (&ArraySizeHelper(const T (&array)[N]))[N];
+#endif
+
+#define arraysize(array) (sizeof(::benchmark::internal::ArraySizeHelper(array)))
+
+} // end namespace internal
+} // end namespace benchmark
+
+#endif // BENCHMARK_ARRAYSIZE_H_
diff --git a/utils/google-benchmark/src/benchmark.cc b/utils/google-benchmark/src/benchmark.cc
new file mode 100644
index 000000000000..95f6a25b7563
--- /dev/null
+++ b/utils/google-benchmark/src/benchmark.cc
@@ -0,0 +1,667 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/benchmark.h"
+#include "benchmark_api_internal.h"
+#include "internal_macros.h"
+
+#ifndef BENCHMARK_OS_WINDOWS
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#include <algorithm>
+#include <atomic>
+#include <condition_variable>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <fstream>
+#include <iostream>
+#include <memory>
+#include <thread>
+
+#include "check.h"
+#include "colorprint.h"
+#include "commandlineflags.h"
+#include "complexity.h"
+#include "log.h"
+#include "mutex.h"
+#include "re.h"
+#include "stat.h"
+#include "string_util.h"
+#include "sysinfo.h"
+#include "timers.h"
+
+DEFINE_bool(benchmark_list_tests, false,
+ "Print a list of benchmarks. This option overrides all other "
+ "options.");
+
+DEFINE_string(benchmark_filter, ".",
+ "A regular expression that specifies the set of benchmarks "
+ "to execute. If this flag is empty, no benchmarks are run. "
+ "If this flag is the string \"all\", all benchmarks linked "
+ "into the process are run.");
+
+DEFINE_double(benchmark_min_time, 0.5,
+ "Minimum number of seconds we should run benchmark before "
+ "results are considered significant. For cpu-time based "
+ "tests, this is the lower bound on the total cpu time "
+ "used by all threads that make up the test. For real-time "
+ "based tests, this is the lower bound on the elapsed time "
+ "of the benchmark execution, regardless of number of "
+ "threads.");
+
+DEFINE_int32(benchmark_repetitions, 1,
+ "The number of runs of each benchmark. If greater than 1, the "
+ "mean and standard deviation of the runs will be reported.");
+
+DEFINE_bool(benchmark_report_aggregates_only, false,
+ "Report the result of each benchmark repetitions. When 'true' is "
+ "specified only the mean, standard deviation, and other statistics "
+ "are reported for repeated benchmarks.");
+
+DEFINE_string(benchmark_format, "console",
+ "The format to use for console output. Valid values are "
+ "'console', 'json', or 'csv'.");
+
+DEFINE_string(benchmark_out_format, "json",
+ "The format to use for file output. Valid values are "
+ "'console', 'json', or 'csv'.");
+
+DEFINE_string(benchmark_out, "", "The file to write additonal output to");
+
+DEFINE_string(benchmark_color, "auto",
+ "Whether to use colors in the output. Valid values: "
+ "'true'/'yes'/1, 'false'/'no'/0, and 'auto'. 'auto' means to use "
+ "colors if the output is being sent to a terminal and the TERM "
+ "environment variable is set to a terminal type that supports "
+ "colors.");
+
+DEFINE_int32(v, 0, "The level of verbose logging to output");
+
+namespace benchmark {
+namespace internal {
+
+void UseCharPointer(char const volatile*) {}
+
+} // end namespace internal
+
+namespace {
+
+static const size_t kMaxIterations = 1000000000;
+
+} // end namespace
+
+namespace internal {
+
+class ThreadManager {
+ public:
+ ThreadManager(int num_threads)
+ : alive_threads_(num_threads), start_stop_barrier_(num_threads) {}
+
+ Mutex& GetBenchmarkMutex() const RETURN_CAPABILITY(benchmark_mutex_) {
+ return benchmark_mutex_;
+ }
+
+ bool StartStopBarrier() EXCLUDES(end_cond_mutex_) {
+ return start_stop_barrier_.wait();
+ }
+
+ void NotifyThreadComplete() EXCLUDES(end_cond_mutex_) {
+ start_stop_barrier_.removeThread();
+ if (--alive_threads_ == 0) {
+ MutexLock lock(end_cond_mutex_);
+ end_condition_.notify_all();
+ }
+ }
+
+ void WaitForAllThreads() EXCLUDES(end_cond_mutex_) {
+ MutexLock lock(end_cond_mutex_);
+ end_condition_.wait(lock.native_handle(),
+ [this]() { return alive_threads_ == 0; });
+ }
+
+ public:
+ struct Result {
+ double real_time_used = 0;
+ double cpu_time_used = 0;
+ double manual_time_used = 0;
+ int64_t bytes_processed = 0;
+ int64_t items_processed = 0;
+ int complexity_n = 0;
+ std::string report_label_;
+ std::string error_message_;
+ bool has_error_ = false;
+ };
+ GUARDED_BY(GetBenchmarkMutex()) Result results;
+
+ private:
+ mutable Mutex benchmark_mutex_;
+ std::atomic<int> alive_threads_;
+ Barrier start_stop_barrier_;
+ Mutex end_cond_mutex_;
+ Condition end_condition_;
+};
+
+// Timer management class
+class ThreadTimer {
+ public:
+ ThreadTimer() = default;
+
+ // Called by each thread
+ void StartTimer() {
+ running_ = true;
+ start_real_time_ = ChronoClockNow();
+ start_cpu_time_ = ThreadCPUUsage();
+ }
+
+ // Called by each thread
+ void StopTimer() {
+ CHECK(running_);
+ running_ = false;
+ real_time_used_ += ChronoClockNow() - start_real_time_;
+ cpu_time_used_ += ThreadCPUUsage() - start_cpu_time_;
+ }
+
+ // Called by each thread
+ void SetIterationTime(double seconds) { manual_time_used_ += seconds; }
+
+ bool running() const { return running_; }
+
+ // REQUIRES: timer is not running
+ double real_time_used() {
+ CHECK(!running_);
+ return real_time_used_;
+ }
+
+ // REQUIRES: timer is not running
+ double cpu_time_used() {
+ CHECK(!running_);
+ return cpu_time_used_;
+ }
+
+ // REQUIRES: timer is not running
+ double manual_time_used() {
+ CHECK(!running_);
+ return manual_time_used_;
+ }
+
+ private:
+ bool running_ = false; // Is the timer running
+ double start_real_time_ = 0; // If running_
+ double start_cpu_time_ = 0; // If running_
+
+ // Accumulated time so far (does not contain current slice if running_)
+ double real_time_used_ = 0;
+ double cpu_time_used_ = 0;
+ // Manually set iteration time. User sets this with SetIterationTime(seconds).
+ double manual_time_used_ = 0;
+};
+
+namespace {
+
+BenchmarkReporter::Run CreateRunReport(
+ const benchmark::internal::Benchmark::Instance& b,
+ const internal::ThreadManager::Result& results, size_t iters,
+ double seconds) {
+ // Create report about this benchmark run.
+ BenchmarkReporter::Run report;
+
+ report.benchmark_name = b.name;
+ report.error_occurred = results.has_error_;
+ report.error_message = results.error_message_;
+ report.report_label = results.report_label_;
+ // Report the total iterations across all threads.
+ report.iterations = static_cast<int64_t>(iters) * b.threads;
+ report.time_unit = b.time_unit;
+
+ if (!report.error_occurred) {
+ double bytes_per_second = 0;
+ if (results.bytes_processed > 0 && seconds > 0.0) {
+ bytes_per_second = (results.bytes_processed / seconds);
+ }
+ double items_per_second = 0;
+ if (results.items_processed > 0 && seconds > 0.0) {
+ items_per_second = (results.items_processed / seconds);
+ }
+
+ if (b.use_manual_time) {
+ report.real_accumulated_time = results.manual_time_used;
+ } else {
+ report.real_accumulated_time = results.real_time_used;
+ }
+ report.cpu_accumulated_time = results.cpu_time_used;
+ report.bytes_per_second = bytes_per_second;
+ report.items_per_second = items_per_second;
+ report.complexity_n = results.complexity_n;
+ report.complexity = b.complexity;
+ report.complexity_lambda = b.complexity_lambda;
+ }
+ return report;
+}
+
+// Execute one thread of benchmark b for the specified number of iterations.
+// Adds the stats collected for the thread into *total.
+void RunInThread(const benchmark::internal::Benchmark::Instance* b,
+ size_t iters, int thread_id,
+ internal::ThreadManager* manager) {
+ internal::ThreadTimer timer;
+ State st(iters, b->arg, thread_id, b->threads, &timer, manager);
+ b->benchmark->Run(st);
+ CHECK(st.iterations() == st.max_iterations)
+ << "Benchmark returned before State::KeepRunning() returned false!";
+ {
+ MutexLock l(manager->GetBenchmarkMutex());
+ internal::ThreadManager::Result& results = manager->results;
+ results.cpu_time_used += timer.cpu_time_used();
+ results.real_time_used += timer.real_time_used();
+ results.manual_time_used += timer.manual_time_used();
+ results.bytes_processed += st.bytes_processed();
+ results.items_processed += st.items_processed();
+ results.complexity_n += st.complexity_length_n();
+ }
+ manager->NotifyThreadComplete();
+}
+
+std::vector<BenchmarkReporter::Run> RunBenchmark(
+ const benchmark::internal::Benchmark::Instance& b,
+ std::vector<BenchmarkReporter::Run>* complexity_reports) {
+ std::vector<BenchmarkReporter::Run> reports; // return value
+
+ size_t iters = 1;
+ std::unique_ptr<internal::ThreadManager> manager;
+ std::vector<std::thread> pool(b.threads - 1);
+ const int repeats =
+ b.repetitions != 0 ? b.repetitions : FLAGS_benchmark_repetitions;
+ const bool report_aggregates_only =
+ repeats != 1 &&
+ (b.report_mode == internal::RM_Unspecified
+ ? FLAGS_benchmark_report_aggregates_only
+ : b.report_mode == internal::RM_ReportAggregatesOnly);
+ for (int i = 0; i < repeats; i++) {
+ for (;;) {
+ // Try benchmark
+ VLOG(2) << "Running " << b.name << " for " << iters << "\n";
+
+ manager.reset(new internal::ThreadManager(b.threads));
+ for (std::size_t ti = 0; ti < pool.size(); ++ti) {
+ pool[ti] = std::thread(&RunInThread, &b, iters,
+ static_cast<int>(ti + 1), manager.get());
+ }
+ RunInThread(&b, iters, 0, manager.get());
+ manager->WaitForAllThreads();
+ for (std::thread& thread : pool) thread.join();
+ internal::ThreadManager::Result results;
+ {
+ MutexLock l(manager->GetBenchmarkMutex());
+ results = manager->results;
+ }
+ manager.reset();
+ // Adjust real/manual time stats since they were reported per thread.
+ results.real_time_used /= b.threads;
+ results.manual_time_used /= b.threads;
+
+ VLOG(2) << "Ran in " << results.cpu_time_used << "/"
+ << results.real_time_used << "\n";
+
+ // Base decisions off of real time if requested by this benchmark.
+ double seconds = results.cpu_time_used;
+ if (b.use_manual_time) {
+ seconds = results.manual_time_used;
+ } else if (b.use_real_time) {
+ seconds = results.real_time_used;
+ }
+
+ const double min_time =
+ !IsZero(b.min_time) ? b.min_time : FLAGS_benchmark_min_time;
+ // If this was the first run, was elapsed time or cpu time large enough?
+ // If this is not the first run, go with the current value of iter.
+ if ((i > 0) || results.has_error_ || (iters >= kMaxIterations) ||
+ (seconds >= min_time) || (results.real_time_used >= 5 * min_time)) {
+ BenchmarkReporter::Run report =
+ CreateRunReport(b, results, iters, seconds);
+ if (!report.error_occurred && b.complexity != oNone)
+ complexity_reports->push_back(report);
+ reports.push_back(report);
+ break;
+ }
+
+ // See how much iterations should be increased by
+ // Note: Avoid division by zero with max(seconds, 1ns).
+ double multiplier = min_time * 1.4 / std::max(seconds, 1e-9);
+ // If our last run was at least 10% of FLAGS_benchmark_min_time then we
+ // use the multiplier directly. Otherwise we use at most 10 times
+ // expansion.
+ // NOTE: When the last run was at least 10% of the min time the max
+ // expansion should be 14x.
+ bool is_significant = (seconds / min_time) > 0.1;
+ multiplier = is_significant ? multiplier : std::min(10.0, multiplier);
+ if (multiplier <= 1.0) multiplier = 2.0;
+ double next_iters = std::max(multiplier * iters, iters + 1.0);
+ if (next_iters > kMaxIterations) {
+ next_iters = kMaxIterations;
+ }
+ VLOG(3) << "Next iters: " << next_iters << ", " << multiplier << "\n";
+ iters = static_cast<int>(next_iters + 0.5);
+ }
+ }
+ // Calculate additional statistics
+ auto stat_reports = ComputeStats(reports);
+ if ((b.complexity != oNone) && b.last_benchmark_instance) {
+ auto additional_run_stats = ComputeBigO(*complexity_reports);
+ stat_reports.insert(stat_reports.end(), additional_run_stats.begin(),
+ additional_run_stats.end());
+ complexity_reports->clear();
+ }
+
+ if (report_aggregates_only) reports.clear();
+ reports.insert(reports.end(), stat_reports.begin(), stat_reports.end());
+ return reports;
+}
+
+} // namespace
+} // namespace internal
+
+State::State(size_t max_iters, const std::vector<int>& ranges, int thread_i,
+ int n_threads, internal::ThreadTimer* timer,
+ internal::ThreadManager* manager)
+ : started_(false),
+ finished_(false),
+ total_iterations_(0),
+ range_(ranges),
+ bytes_processed_(0),
+ items_processed_(0),
+ complexity_n_(0),
+ error_occurred_(false),
+ thread_index(thread_i),
+ threads(n_threads),
+ max_iterations(max_iters),
+ timer_(timer),
+ manager_(manager) {
+ CHECK(max_iterations != 0) << "At least one iteration must be run";
+ CHECK_LT(thread_index, threads) << "thread_index must be less than threads";
+}
+
+void State::PauseTiming() {
+ // Add in time accumulated so far
+ CHECK(started_ && !finished_ && !error_occurred_);
+ timer_->StopTimer();
+}
+
+void State::ResumeTiming() {
+ CHECK(started_ && !finished_ && !error_occurred_);
+ timer_->StartTimer();
+}
+
+void State::SkipWithError(const char* msg) {
+ CHECK(msg);
+ error_occurred_ = true;
+ {
+ MutexLock l(manager_->GetBenchmarkMutex());
+ if (manager_->results.has_error_ == false) {
+ manager_->results.error_message_ = msg;
+ manager_->results.has_error_ = true;
+ }
+ }
+ total_iterations_ = max_iterations;
+ if (timer_->running()) timer_->StopTimer();
+}
+
+void State::SetIterationTime(double seconds) {
+ timer_->SetIterationTime(seconds);
+}
+
+void State::SetLabel(const char* label) {
+ MutexLock l(manager_->GetBenchmarkMutex());
+ manager_->results.report_label_ = label;
+}
+
+void State::StartKeepRunning() {
+ CHECK(!started_ && !finished_);
+ started_ = true;
+ manager_->StartStopBarrier();
+ if (!error_occurred_) ResumeTiming();
+}
+
+void State::FinishKeepRunning() {
+ CHECK(started_ && (!finished_ || error_occurred_));
+ if (!error_occurred_) {
+ PauseTiming();
+ }
+ // Total iterations now is one greater than max iterations. Fix this.
+ total_iterations_ = max_iterations;
+ finished_ = true;
+ manager_->StartStopBarrier();
+}
+
+namespace internal {
+namespace {
+
+void RunBenchmarks(const std::vector<Benchmark::Instance>& benchmarks,
+ BenchmarkReporter* console_reporter,
+ BenchmarkReporter* file_reporter) {
+ // Note the file_reporter can be null.
+ CHECK(console_reporter != nullptr);
+
+ // Determine the width of the name field using a minimum width of 10.
+ bool has_repetitions = FLAGS_benchmark_repetitions > 1;
+ size_t name_field_width = 10;
+ for (const Benchmark::Instance& benchmark : benchmarks) {
+ name_field_width =
+ std::max<size_t>(name_field_width, benchmark.name.size());
+ has_repetitions |= benchmark.repetitions > 1;
+ }
+ if (has_repetitions) name_field_width += std::strlen("_stddev");
+
+ // Print header here
+ BenchmarkReporter::Context context;
+ context.num_cpus = NumCPUs();
+ context.mhz_per_cpu = CyclesPerSecond() / 1000000.0f;
+
+ context.cpu_scaling_enabled = CpuScalingEnabled();
+ context.name_field_width = name_field_width;
+
+ // Keep track of runing times of all instances of current benchmark
+ std::vector<BenchmarkReporter::Run> complexity_reports;
+
+ // We flush streams after invoking reporter methods that write to them. This
+ // ensures users get timely updates even when streams are not line-buffered.
+ auto flushStreams = [](BenchmarkReporter* reporter) {
+ if (!reporter) return;
+ std::flush(reporter->GetOutputStream());
+ std::flush(reporter->GetErrorStream());
+ };
+
+ if (console_reporter->ReportContext(context) &&
+ (!file_reporter || file_reporter->ReportContext(context))) {
+ flushStreams(console_reporter);
+ flushStreams(file_reporter);
+ for (const auto& benchmark : benchmarks) {
+ std::vector<BenchmarkReporter::Run> reports =
+ RunBenchmark(benchmark, &complexity_reports);
+ console_reporter->ReportRuns(reports);
+ if (file_reporter) file_reporter->ReportRuns(reports);
+ flushStreams(console_reporter);
+ flushStreams(file_reporter);
+ }
+ }
+ console_reporter->Finalize();
+ if (file_reporter) file_reporter->Finalize();
+ flushStreams(console_reporter);
+ flushStreams(file_reporter);
+}
+
+std::unique_ptr<BenchmarkReporter> CreateReporter(
+ std::string const& name, ConsoleReporter::OutputOptions allow_color) {
+ typedef std::unique_ptr<BenchmarkReporter> PtrType;
+ if (name == "console") {
+ return PtrType(new ConsoleReporter(allow_color));
+ } else if (name == "json") {
+ return PtrType(new JSONReporter);
+ } else if (name == "csv") {
+ return PtrType(new CSVReporter);
+ } else {
+ std::cerr << "Unexpected format: '" << name << "'\n";
+ std::exit(1);
+ }
+}
+
+} // end namespace
+} // end namespace internal
+
+size_t RunSpecifiedBenchmarks() {
+ return RunSpecifiedBenchmarks(nullptr, nullptr);
+}
+
+size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter) {
+ return RunSpecifiedBenchmarks(console_reporter, nullptr);
+}
+
+size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter,
+ BenchmarkReporter* file_reporter) {
+ std::string spec = FLAGS_benchmark_filter;
+ if (spec.empty() || spec == "all")
+ spec = "."; // Regexp that matches all benchmarks
+
+ // Setup the reporters
+ std::ofstream output_file;
+ std::unique_ptr<BenchmarkReporter> default_console_reporter;
+ std::unique_ptr<BenchmarkReporter> default_file_reporter;
+ if (!console_reporter) {
+ auto output_opts = ConsoleReporter::OO_None;
+ if (FLAGS_benchmark_color == "auto")
+ output_opts = IsColorTerminal() ? ConsoleReporter::OO_Color
+ : ConsoleReporter::OO_None;
+ else
+ output_opts = IsTruthyFlagValue(FLAGS_benchmark_color)
+ ? ConsoleReporter::OO_Color
+ : ConsoleReporter::OO_None;
+ default_console_reporter =
+ internal::CreateReporter(FLAGS_benchmark_format, output_opts);
+ console_reporter = default_console_reporter.get();
+ }
+ auto& Out = console_reporter->GetOutputStream();
+ auto& Err = console_reporter->GetErrorStream();
+
+ std::string const& fname = FLAGS_benchmark_out;
+ if (fname == "" && file_reporter) {
+ Err << "A custom file reporter was provided but "
+ "--benchmark_out=<file> was not specified."
+ << std::endl;
+ std::exit(1);
+ }
+ if (fname != "") {
+ output_file.open(fname);
+ if (!output_file.is_open()) {
+ Err << "invalid file name: '" << fname << std::endl;
+ std::exit(1);
+ }
+ if (!file_reporter) {
+ default_file_reporter = internal::CreateReporter(
+ FLAGS_benchmark_out_format, ConsoleReporter::OO_None);
+ file_reporter = default_file_reporter.get();
+ }
+ file_reporter->SetOutputStream(&output_file);
+ file_reporter->SetErrorStream(&output_file);
+ }
+
+ std::vector<internal::Benchmark::Instance> benchmarks;
+ if (!FindBenchmarksInternal(spec, &benchmarks, &Err)) return 0;
+
+ if (benchmarks.empty()) {
+ Err << "Failed to match any benchmarks against regex: " << spec << "\n";
+ return 0;
+ }
+
+ if (FLAGS_benchmark_list_tests) {
+ for (auto const& benchmark : benchmarks) Out << benchmark.name << "\n";
+ } else {
+ internal::RunBenchmarks(benchmarks, console_reporter, file_reporter);
+ }
+
+ return benchmarks.size();
+}
+
+namespace internal {
+
+void PrintUsageAndExit() {
+ fprintf(stdout,
+ "benchmark"
+ " [--benchmark_list_tests={true|false}]\n"
+ " [--benchmark_filter=<regex>]\n"
+ " [--benchmark_min_time=<min_time>]\n"
+ " [--benchmark_repetitions=<num_repetitions>]\n"
+ " [--benchmark_report_aggregates_only={true|false}\n"
+ " [--benchmark_format=<console|json|csv>]\n"
+ " [--benchmark_out=<filename>]\n"
+ " [--benchmark_out_format=<json|console|csv>]\n"
+ " [--benchmark_color={auto|true|false}]\n"
+ " [--v=<verbosity>]\n");
+ exit(0);
+}
+
+void ParseCommandLineFlags(int* argc, char** argv) {
+ using namespace benchmark;
+ for (int i = 1; i < *argc; ++i) {
+ if (ParseBoolFlag(argv[i], "benchmark_list_tests",
+ &FLAGS_benchmark_list_tests) ||
+ ParseStringFlag(argv[i], "benchmark_filter", &FLAGS_benchmark_filter) ||
+ ParseDoubleFlag(argv[i], "benchmark_min_time",
+ &FLAGS_benchmark_min_time) ||
+ ParseInt32Flag(argv[i], "benchmark_repetitions",
+ &FLAGS_benchmark_repetitions) ||
+ ParseBoolFlag(argv[i], "benchmark_report_aggregates_only",
+ &FLAGS_benchmark_report_aggregates_only) ||
+ ParseStringFlag(argv[i], "benchmark_format", &FLAGS_benchmark_format) ||
+ ParseStringFlag(argv[i], "benchmark_out", &FLAGS_benchmark_out) ||
+ ParseStringFlag(argv[i], "benchmark_out_format",
+ &FLAGS_benchmark_out_format) ||
+ ParseStringFlag(argv[i], "benchmark_color", &FLAGS_benchmark_color) ||
+ // "color_print" is the deprecated name for "benchmark_color".
+ // TODO: Remove this.
+ ParseStringFlag(argv[i], "color_print", &FLAGS_benchmark_color) ||
+ ParseInt32Flag(argv[i], "v", &FLAGS_v)) {
+ for (int j = i; j != *argc; ++j) argv[j] = argv[j + 1];
+
+ --(*argc);
+ --i;
+ } else if (IsFlag(argv[i], "help")) {
+ PrintUsageAndExit();
+ }
+ }
+ for (auto const* flag :
+ {&FLAGS_benchmark_format, &FLAGS_benchmark_out_format})
+ if (*flag != "console" && *flag != "json" && *flag != "csv") {
+ PrintUsageAndExit();
+ }
+ if (FLAGS_benchmark_color.empty()) {
+ PrintUsageAndExit();
+ }
+}
+
+int InitializeStreams() {
+ static std::ios_base::Init init;
+ return 0;
+}
+
+} // end namespace internal
+
+void Initialize(int* argc, char** argv) {
+ internal::ParseCommandLineFlags(argc, argv);
+ internal::LogLevel() = FLAGS_v;
+}
+
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/benchmark_api_internal.h b/utils/google-benchmark/src/benchmark_api_internal.h
new file mode 100644
index 000000000000..8b97ce600873
--- /dev/null
+++ b/utils/google-benchmark/src/benchmark_api_internal.h
@@ -0,0 +1,47 @@
+#ifndef BENCHMARK_API_INTERNAL_H
+#define BENCHMARK_API_INTERNAL_H
+
+#include "benchmark/benchmark_api.h"
+
+#include <cmath>
+#include <iosfwd>
+#include <limits>
+#include <string>
+#include <vector>
+
+namespace benchmark {
+namespace internal {
+
+// Information kept per benchmark we may want to run
+struct Benchmark::Instance {
+ std::string name;
+ Benchmark* benchmark;
+ ReportMode report_mode;
+ std::vector<int> arg;
+ TimeUnit time_unit;
+ int range_multiplier;
+ bool use_real_time;
+ bool use_manual_time;
+ BigO complexity;
+ BigOFunc* complexity_lambda;
+ bool last_benchmark_instance;
+ int repetitions;
+ double min_time;
+ int threads; // Number of concurrent threads to us
+};
+
+bool FindBenchmarksInternal(const std::string& re,
+ std::vector<Benchmark::Instance>* benchmarks,
+ std::ostream* Err);
+
+namespace {
+
+bool IsZero(double n) {
+ return std::abs(n) < std::numeric_limits<double>::epsilon();
+}
+
+} // end namespace
+} // end namespace internal
+} // end namespace benchmark
+
+#endif // BENCHMARK_API_INTERNAL_H
diff --git a/utils/google-benchmark/src/benchmark_register.cc b/utils/google-benchmark/src/benchmark_register.cc
new file mode 100644
index 000000000000..4e580d8ea383
--- /dev/null
+++ b/utils/google-benchmark/src/benchmark_register.cc
@@ -0,0 +1,439 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/benchmark.h"
+#include "benchmark_api_internal.h"
+#include "internal_macros.h"
+
+#ifndef BENCHMARK_OS_WINDOWS
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#include <algorithm>
+#include <atomic>
+#include <condition_variable>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <fstream>
+#include <iostream>
+#include <memory>
+#include <thread>
+
+#include "check.h"
+#include "commandlineflags.h"
+#include "complexity.h"
+#include "log.h"
+#include "mutex.h"
+#include "re.h"
+#include "stat.h"
+#include "string_util.h"
+#include "sysinfo.h"
+#include "timers.h"
+
+namespace benchmark {
+
+namespace {
+// For non-dense Range, intermediate values are powers of kRangeMultiplier.
+static const int kRangeMultiplier = 8;
+// The size of a benchmark family determines is the number of inputs to repeat
+// the benchmark on. If this is "large" then warn the user during configuration.
+static const size_t kMaxFamilySize = 100;
+} // end namespace
+
+namespace internal {
+
+//=============================================================================//
+// BenchmarkFamilies
+//=============================================================================//
+
+// Class for managing registered benchmarks. Note that each registered
+// benchmark identifies a family of related benchmarks to run.
+class BenchmarkFamilies {
+ public:
+ static BenchmarkFamilies* GetInstance();
+
+ // Registers a benchmark family and returns the index assigned to it.
+ size_t AddBenchmark(std::unique_ptr<Benchmark> family);
+
+ // Extract the list of benchmark instances that match the specified
+ // regular expression.
+ bool FindBenchmarks(const std::string& re,
+ std::vector<Benchmark::Instance>* benchmarks,
+ std::ostream* Err);
+
+ private:
+ BenchmarkFamilies() {}
+
+ std::vector<std::unique_ptr<Benchmark>> families_;
+ Mutex mutex_;
+};
+
+BenchmarkFamilies* BenchmarkFamilies::GetInstance() {
+ static BenchmarkFamilies instance;
+ return &instance;
+}
+
+size_t BenchmarkFamilies::AddBenchmark(std::unique_ptr<Benchmark> family) {
+ MutexLock l(mutex_);
+ size_t index = families_.size();
+ families_.push_back(std::move(family));
+ return index;
+}
+
+bool BenchmarkFamilies::FindBenchmarks(
+ const std::string& spec, std::vector<Benchmark::Instance>* benchmarks,
+ std::ostream* ErrStream) {
+ CHECK(ErrStream);
+ auto& Err = *ErrStream;
+ // Make regular expression out of command-line flag
+ std::string error_msg;
+ Regex re;
+ if (!re.Init(spec, &error_msg)) {
+ Err << "Could not compile benchmark re: " << error_msg << std::endl;
+ return false;
+ }
+
+ // Special list of thread counts to use when none are specified
+ const std::vector<int> one_thread = {1};
+
+ MutexLock l(mutex_);
+ for (std::unique_ptr<Benchmark>& family : families_) {
+ // Family was deleted or benchmark doesn't match
+ if (!family) continue;
+
+ if (family->ArgsCnt() == -1) {
+ family->Args({});
+ }
+ const std::vector<int>* thread_counts =
+ (family->thread_counts_.empty()
+ ? &one_thread
+ : &static_cast<const std::vector<int>&>(family->thread_counts_));
+ const size_t family_size = family->args_.size() * thread_counts->size();
+ // The benchmark will be run at least 'family_size' different inputs.
+ // If 'family_size' is very large warn the user.
+ if (family_size > kMaxFamilySize) {
+ Err << "The number of inputs is very large. " << family->name_
+ << " will be repeated at least " << family_size << " times.\n";
+ }
+ // reserve in the special case the regex ".", since we know the final
+ // family size.
+ if (spec == ".") benchmarks->reserve(family_size);
+
+ for (auto const& args : family->args_) {
+ for (int num_threads : *thread_counts) {
+ Benchmark::Instance instance;
+ instance.name = family->name_;
+ instance.benchmark = family.get();
+ instance.report_mode = family->report_mode_;
+ instance.arg = args;
+ instance.time_unit = family->time_unit_;
+ instance.range_multiplier = family->range_multiplier_;
+ instance.min_time = family->min_time_;
+ instance.repetitions = family->repetitions_;
+ instance.use_real_time = family->use_real_time_;
+ instance.use_manual_time = family->use_manual_time_;
+ instance.complexity = family->complexity_;
+ instance.complexity_lambda = family->complexity_lambda_;
+ instance.threads = num_threads;
+
+ // Add arguments to instance name
+ size_t arg_i = 0;
+ for (auto const& arg : args) {
+ instance.name += "/";
+
+ if (arg_i < family->arg_names_.size()) {
+ const auto& arg_name = family->arg_names_[arg_i];
+ if (!arg_name.empty()) {
+ instance.name +=
+ StringPrintF("%s:", family->arg_names_[arg_i].c_str());
+ }
+ }
+
+ AppendHumanReadable(arg, &instance.name);
+ ++arg_i;
+ }
+
+ if (!IsZero(family->min_time_)) {
+ instance.name += StringPrintF("/min_time:%0.3f", family->min_time_);
+ }
+ if (family->repetitions_ != 0) {
+ instance.name += StringPrintF("/repeats:%d", family->repetitions_);
+ }
+ if (family->use_manual_time_) {
+ instance.name += "/manual_time";
+ } else if (family->use_real_time_) {
+ instance.name += "/real_time";
+ }
+
+ // Add the number of threads used to the name
+ if (!family->thread_counts_.empty()) {
+ instance.name += StringPrintF("/threads:%d", instance.threads);
+ }
+
+ if (re.Match(instance.name)) {
+ instance.last_benchmark_instance = (&args == &family->args_.back());
+ benchmarks->push_back(std::move(instance));
+ }
+ }
+ }
+ }
+ return true;
+}
+
+Benchmark* RegisterBenchmarkInternal(Benchmark* bench) {
+ std::unique_ptr<Benchmark> bench_ptr(bench);
+ BenchmarkFamilies* families = BenchmarkFamilies::GetInstance();
+ families->AddBenchmark(std::move(bench_ptr));
+ return bench;
+}
+
+// FIXME: This function is a hack so that benchmark.cc can access
+// `BenchmarkFamilies`
+bool FindBenchmarksInternal(const std::string& re,
+ std::vector<Benchmark::Instance>* benchmarks,
+ std::ostream* Err) {
+ return BenchmarkFamilies::GetInstance()->FindBenchmarks(re, benchmarks, Err);
+}
+
+//=============================================================================//
+// Benchmark
+//=============================================================================//
+
+Benchmark::Benchmark(const char* name)
+ : name_(name),
+ report_mode_(RM_Unspecified),
+ time_unit_(kNanosecond),
+ range_multiplier_(kRangeMultiplier),
+ min_time_(0),
+ repetitions_(0),
+ use_real_time_(false),
+ use_manual_time_(false),
+ complexity_(oNone),
+ complexity_lambda_(nullptr) {}
+
+Benchmark::~Benchmark() {}
+
+void Benchmark::AddRange(std::vector<int>* dst, int lo, int hi, int mult) {
+ CHECK_GE(lo, 0);
+ CHECK_GE(hi, lo);
+ CHECK_GE(mult, 2);
+
+ // Add "lo"
+ dst->push_back(lo);
+
+ static const int kint32max = std::numeric_limits<int32_t>::max();
+
+ // Now space out the benchmarks in multiples of "mult"
+ for (int32_t i = 1; i < kint32max / mult; i *= mult) {
+ if (i >= hi) break;
+ if (i > lo) {
+ dst->push_back(i);
+ }
+ }
+ // Add "hi" (if different from "lo")
+ if (hi != lo) {
+ dst->push_back(hi);
+ }
+}
+
+Benchmark* Benchmark::Arg(int x) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
+ args_.push_back({x});
+ return this;
+}
+
+Benchmark* Benchmark::Unit(TimeUnit unit) {
+ time_unit_ = unit;
+ return this;
+}
+
+Benchmark* Benchmark::Range(int start, int limit) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
+ std::vector<int> arglist;
+ AddRange(&arglist, start, limit, range_multiplier_);
+
+ for (int i : arglist) {
+ args_.push_back({i});
+ }
+ return this;
+}
+
+Benchmark* Benchmark::Ranges(const std::vector<std::pair<int, int>>& ranges) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(ranges.size()));
+ std::vector<std::vector<int>> arglists(ranges.size());
+ std::size_t total = 1;
+ for (std::size_t i = 0; i < ranges.size(); i++) {
+ AddRange(&arglists[i], ranges[i].first, ranges[i].second,
+ range_multiplier_);
+ total *= arglists[i].size();
+ }
+
+ std::vector<std::size_t> ctr(arglists.size(), 0);
+
+ for (std::size_t i = 0; i < total; i++) {
+ std::vector<int> tmp;
+ tmp.reserve(arglists.size());
+
+ for (std::size_t j = 0; j < arglists.size(); j++) {
+ tmp.push_back(arglists[j].at(ctr[j]));
+ }
+
+ args_.push_back(std::move(tmp));
+
+ for (std::size_t j = 0; j < arglists.size(); j++) {
+ if (ctr[j] + 1 < arglists[j].size()) {
+ ++ctr[j];
+ break;
+ }
+ ctr[j] = 0;
+ }
+ }
+ return this;
+}
+
+Benchmark* Benchmark::ArgName(const std::string& name) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
+ arg_names_ = {name};
+ return this;
+}
+
+Benchmark* Benchmark::ArgNames(const std::vector<std::string>& names) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(names.size()));
+ arg_names_ = names;
+ return this;
+}
+
+Benchmark* Benchmark::DenseRange(int start, int limit, int step) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
+ CHECK_GE(start, 0);
+ CHECK_LE(start, limit);
+ for (int arg = start; arg <= limit; arg += step) {
+ args_.push_back({arg});
+ }
+ return this;
+}
+
+Benchmark* Benchmark::Args(const std::vector<int>& args) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(args.size()));
+ args_.push_back(args);
+ return this;
+}
+
+Benchmark* Benchmark::Apply(void (*custom_arguments)(Benchmark* benchmark)) {
+ custom_arguments(this);
+ return this;
+}
+
+Benchmark* Benchmark::RangeMultiplier(int multiplier) {
+ CHECK(multiplier > 1);
+ range_multiplier_ = multiplier;
+ return this;
+}
+
+Benchmark* Benchmark::Repetitions(int n) {
+ CHECK(n > 0);
+ repetitions_ = n;
+ return this;
+}
+
+Benchmark* Benchmark::ReportAggregatesOnly(bool value) {
+ report_mode_ = value ? RM_ReportAggregatesOnly : RM_Default;
+ return this;
+}
+
+Benchmark* Benchmark::MinTime(double t) {
+ CHECK(t > 0.0);
+ min_time_ = t;
+ return this;
+}
+
+Benchmark* Benchmark::UseRealTime() {
+ CHECK(!use_manual_time_)
+ << "Cannot set UseRealTime and UseManualTime simultaneously.";
+ use_real_time_ = true;
+ return this;
+}
+
+Benchmark* Benchmark::UseManualTime() {
+ CHECK(!use_real_time_)
+ << "Cannot set UseRealTime and UseManualTime simultaneously.";
+ use_manual_time_ = true;
+ return this;
+}
+
+Benchmark* Benchmark::Complexity(BigO complexity) {
+ complexity_ = complexity;
+ return this;
+}
+
+Benchmark* Benchmark::Complexity(BigOFunc* complexity) {
+ complexity_lambda_ = complexity;
+ complexity_ = oLambda;
+ return this;
+}
+
+Benchmark* Benchmark::Threads(int t) {
+ CHECK_GT(t, 0);
+ thread_counts_.push_back(t);
+ return this;
+}
+
+Benchmark* Benchmark::ThreadRange(int min_threads, int max_threads) {
+ CHECK_GT(min_threads, 0);
+ CHECK_GE(max_threads, min_threads);
+
+ AddRange(&thread_counts_, min_threads, max_threads, 2);
+ return this;
+}
+
+Benchmark* Benchmark::DenseThreadRange(int min_threads, int max_threads,
+ int stride) {
+ CHECK_GT(min_threads, 0);
+ CHECK_GE(max_threads, min_threads);
+ CHECK_GE(stride, 1);
+
+ for (auto i = min_threads; i < max_threads; i += stride) {
+ thread_counts_.push_back(i);
+ }
+ thread_counts_.push_back(max_threads);
+ return this;
+}
+
+Benchmark* Benchmark::ThreadPerCpu() {
+ static int num_cpus = NumCPUs();
+ thread_counts_.push_back(num_cpus);
+ return this;
+}
+
+void Benchmark::SetName(const char* name) { name_ = name; }
+
+int Benchmark::ArgsCnt() const {
+ if (args_.empty()) {
+ if (arg_names_.empty()) return -1;
+ return static_cast<int>(arg_names_.size());
+ }
+ return static_cast<int>(args_.front().size());
+}
+
+//=============================================================================//
+// FunctionBenchmark
+//=============================================================================//
+
+void FunctionBenchmark::Run(State& st) { func_(st); }
+
+} // end namespace internal
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/check.h b/utils/google-benchmark/src/check.h
new file mode 100644
index 000000000000..6f1fe0cf860c
--- /dev/null
+++ b/utils/google-benchmark/src/check.h
@@ -0,0 +1,71 @@
+#ifndef CHECK_H_
+#define CHECK_H_
+
+#include <cstdlib>
+#include <ostream>
+
+#include "internal_macros.h"
+#include "log.h"
+
+namespace benchmark {
+namespace internal {
+
+typedef void(AbortHandlerT)();
+
+inline AbortHandlerT*& GetAbortHandler() {
+ static AbortHandlerT* handler = &std::abort;
+ return handler;
+}
+
+BENCHMARK_NORETURN inline void CallAbortHandler() {
+ GetAbortHandler()();
+ std::abort(); // fallback to enforce noreturn
+}
+
+// CheckHandler is the class constructed by failing CHECK macros. CheckHandler
+// will log information about the failures and abort when it is destructed.
+class CheckHandler {
+ public:
+ CheckHandler(const char* check, const char* file, const char* func, int line)
+ : log_(GetErrorLogInstance()) {
+ log_ << file << ":" << line << ": " << func << ": Check `" << check
+ << "' failed. ";
+ }
+
+ LogType& GetLog() { return log_; }
+
+ BENCHMARK_NORETURN ~CheckHandler() BENCHMARK_NOEXCEPT_OP(false) {
+ log_ << std::endl;
+ CallAbortHandler();
+ }
+
+ CheckHandler& operator=(const CheckHandler&) = delete;
+ CheckHandler(const CheckHandler&) = delete;
+ CheckHandler() = delete;
+
+ private:
+ LogType& log_;
+};
+
+} // end namespace internal
+} // end namespace benchmark
+
+// The CHECK macro returns a std::ostream object that can have extra information
+// written to it.
+#ifndef NDEBUG
+#define CHECK(b) \
+ (b ? ::benchmark::internal::GetNullLogInstance() \
+ : ::benchmark::internal::CheckHandler(#b, __FILE__, __func__, __LINE__) \
+ .GetLog())
+#else
+#define CHECK(b) ::benchmark::internal::GetNullLogInstance()
+#endif
+
+#define CHECK_EQ(a, b) CHECK((a) == (b))
+#define CHECK_NE(a, b) CHECK((a) != (b))
+#define CHECK_GE(a, b) CHECK((a) >= (b))
+#define CHECK_LE(a, b) CHECK((a) <= (b))
+#define CHECK_GT(a, b) CHECK((a) > (b))
+#define CHECK_LT(a, b) CHECK((a) < (b))
+
+#endif // CHECK_H_
diff --git a/utils/google-benchmark/src/colorprint.cc b/utils/google-benchmark/src/colorprint.cc
new file mode 100644
index 000000000000..513376b14b14
--- /dev/null
+++ b/utils/google-benchmark/src/colorprint.cc
@@ -0,0 +1,188 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "colorprint.h"
+
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <memory>
+#include <string>
+
+#include "check.h"
+#include "internal_macros.h"
+
+#ifdef BENCHMARK_OS_WINDOWS
+#include <Windows.h>
+#include <io.h>
+#else
+#include <unistd.h>
+#endif // BENCHMARK_OS_WINDOWS
+
+namespace benchmark {
+namespace {
+#ifdef BENCHMARK_OS_WINDOWS
+typedef WORD PlatformColorCode;
+#else
+typedef const char* PlatformColorCode;
+#endif
+
+PlatformColorCode GetPlatformColorCode(LogColor color) {
+#ifdef BENCHMARK_OS_WINDOWS
+ switch (color) {
+ case COLOR_RED:
+ return FOREGROUND_RED;
+ case COLOR_GREEN:
+ return FOREGROUND_GREEN;
+ case COLOR_YELLOW:
+ return FOREGROUND_RED | FOREGROUND_GREEN;
+ case COLOR_BLUE:
+ return FOREGROUND_BLUE;
+ case COLOR_MAGENTA:
+ return FOREGROUND_BLUE | FOREGROUND_RED;
+ case COLOR_CYAN:
+ return FOREGROUND_BLUE | FOREGROUND_GREEN;
+ case COLOR_WHITE: // fall through to default
+ default:
+ return 0;
+ }
+#else
+ switch (color) {
+ case COLOR_RED:
+ return "1";
+ case COLOR_GREEN:
+ return "2";
+ case COLOR_YELLOW:
+ return "3";
+ case COLOR_BLUE:
+ return "4";
+ case COLOR_MAGENTA:
+ return "5";
+ case COLOR_CYAN:
+ return "6";
+ case COLOR_WHITE:
+ return "7";
+ default:
+ return nullptr;
+ };
+#endif
+}
+
+} // end namespace
+
+std::string FormatString(const char* msg, va_list args) {
+ // we might need a second shot at this, so pre-emptivly make a copy
+ va_list args_cp;
+ va_copy(args_cp, args);
+
+ std::size_t size = 256;
+ char local_buff[256];
+ auto ret = std::vsnprintf(local_buff, size, msg, args_cp);
+
+ va_end(args_cp);
+
+ // currently there is no error handling for failure, so this is hack.
+ CHECK(ret >= 0);
+
+ if (ret == 0) // handle empty expansion
+ return {};
+ else if (static_cast<size_t>(ret) < size)
+ return local_buff;
+ else {
+ // we did not provide a long enough buffer on our first attempt.
+ size = (size_t)ret + 1; // + 1 for the null byte
+ std::unique_ptr<char[]> buff(new char[size]);
+ ret = std::vsnprintf(buff.get(), size, msg, args);
+ CHECK(ret > 0 && ((size_t)ret) < size);
+ return buff.get();
+ }
+}
+
+std::string FormatString(const char* msg, ...) {
+ va_list args;
+ va_start(args, msg);
+ auto tmp = FormatString(msg, args);
+ va_end(args);
+ return tmp;
+}
+
+void ColorPrintf(std::ostream& out, LogColor color, const char* fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ ColorPrintf(out, color, fmt, args);
+ va_end(args);
+}
+
+void ColorPrintf(std::ostream& out, LogColor color, const char* fmt,
+ va_list args) {
+#ifdef BENCHMARK_OS_WINDOWS
+ ((void)out); // suppress unused warning
+
+ const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
+
+ // Gets the current text color.
+ CONSOLE_SCREEN_BUFFER_INFO buffer_info;
+ GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
+ const WORD old_color_attrs = buffer_info.wAttributes;
+
+ // We need to flush the stream buffers into the console before each
+ // SetConsoleTextAttribute call lest it affect the text that is already
+ // printed but has not yet reached the console.
+ fflush(stdout);
+ SetConsoleTextAttribute(stdout_handle,
+ GetPlatformColorCode(color) | FOREGROUND_INTENSITY);
+ vprintf(fmt, args);
+
+ fflush(stdout);
+ // Restores the text color.
+ SetConsoleTextAttribute(stdout_handle, old_color_attrs);
+#else
+ const char* color_code = GetPlatformColorCode(color);
+ if (color_code) out << FormatString("\033[0;3%sm", color_code);
+ out << FormatString(fmt, args) << "\033[m";
+#endif
+}
+
+bool IsColorTerminal() {
+#if BENCHMARK_OS_WINDOWS
+ // On Windows the TERM variable is usually not set, but the
+ // console there does support colors.
+ return 0 != _isatty(_fileno(stdout));
+#else
+ // On non-Windows platforms, we rely on the TERM variable. This list of
+ // supported TERM values is copied from Google Test:
+ // <https://github.com/google/googletest/blob/master/googletest/src/gtest.cc#L2925>.
+ const char* const SUPPORTED_TERM_VALUES[] = {
+ "xterm", "xterm-color", "xterm-256color",
+ "screen", "screen-256color", "tmux",
+ "tmux-256color", "rxvt-unicode", "rxvt-unicode-256color",
+ "linux", "cygwin",
+ };
+
+ const char* const term = getenv("TERM");
+
+ bool term_supports_color = false;
+ for (const char* candidate : SUPPORTED_TERM_VALUES) {
+ if (term && 0 == strcmp(term, candidate)) {
+ term_supports_color = true;
+ break;
+ }
+ }
+
+ return 0 != isatty(fileno(stdout)) && term_supports_color;
+#endif // BENCHMARK_OS_WINDOWS
+}
+
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/colorprint.h b/utils/google-benchmark/src/colorprint.h
new file mode 100644
index 000000000000..9f6fab9b3422
--- /dev/null
+++ b/utils/google-benchmark/src/colorprint.h
@@ -0,0 +1,33 @@
+#ifndef BENCHMARK_COLORPRINT_H_
+#define BENCHMARK_COLORPRINT_H_
+
+#include <cstdarg>
+#include <iostream>
+#include <string>
+
+namespace benchmark {
+enum LogColor {
+ COLOR_DEFAULT,
+ COLOR_RED,
+ COLOR_GREEN,
+ COLOR_YELLOW,
+ COLOR_BLUE,
+ COLOR_MAGENTA,
+ COLOR_CYAN,
+ COLOR_WHITE
+};
+
+std::string FormatString(const char* msg, va_list args);
+std::string FormatString(const char* msg, ...);
+
+void ColorPrintf(std::ostream& out, LogColor color, const char* fmt,
+ va_list args);
+void ColorPrintf(std::ostream& out, LogColor color, const char* fmt, ...);
+
+// Returns true if stdout appears to be a terminal that supports colored
+// output, false otherwise.
+bool IsColorTerminal();
+
+} // end namespace benchmark
+
+#endif // BENCHMARK_COLORPRINT_H_
diff --git a/utils/google-benchmark/src/commandlineflags.cc b/utils/google-benchmark/src/commandlineflags.cc
new file mode 100644
index 000000000000..72534e022a8a
--- /dev/null
+++ b/utils/google-benchmark/src/commandlineflags.cc
@@ -0,0 +1,218 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "commandlineflags.h"
+
+#include <cctype>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <limits>
+
+namespace benchmark {
+// Parses 'str' for a 32-bit signed integer. If successful, writes
+// the result to *value and returns true; otherwise leaves *value
+// unchanged and returns false.
+bool ParseInt32(const std::string& src_text, const char* str, int32_t* value) {
+ // Parses the environment variable as a decimal integer.
+ char* end = nullptr;
+ const long long_value = strtol(str, &end, 10); // NOLINT
+
+ // Has strtol() consumed all characters in the string?
+ if (*end != '\0') {
+ // No - an invalid character was encountered.
+ std::cerr << src_text << " is expected to be a 32-bit integer, "
+ << "but actually has value \"" << str << "\".\n";
+ return false;
+ }
+
+ // Is the parsed value in the range of an Int32?
+ const int32_t result = static_cast<int32_t>(long_value);
+ if (long_value == std::numeric_limits<long>::max() ||
+ long_value == std::numeric_limits<long>::min() ||
+ // The parsed value overflows as a long. (strtol() returns
+ // LONG_MAX or LONG_MIN when the input overflows.)
+ result != long_value
+ // The parsed value overflows as an Int32.
+ ) {
+ std::cerr << src_text << " is expected to be a 32-bit integer, "
+ << "but actually has value \"" << str << "\", "
+ << "which overflows.\n";
+ return false;
+ }
+
+ *value = result;
+ return true;
+}
+
+// Parses 'str' for a double. If successful, writes the result to *value and
+// returns true; otherwise leaves *value unchanged and returns false.
+bool ParseDouble(const std::string& src_text, const char* str, double* value) {
+ // Parses the environment variable as a decimal integer.
+ char* end = nullptr;
+ const double double_value = strtod(str, &end); // NOLINT
+
+ // Has strtol() consumed all characters in the string?
+ if (*end != '\0') {
+ // No - an invalid character was encountered.
+ std::cerr << src_text << " is expected to be a double, "
+ << "but actually has value \"" << str << "\".\n";
+ return false;
+ }
+
+ *value = double_value;
+ return true;
+}
+
+// Returns the name of the environment variable corresponding to the
+// given flag. For example, FlagToEnvVar("foo") will return
+// "BENCHMARK_FOO" in the open-source version.
+static std::string FlagToEnvVar(const char* flag) {
+ const std::string flag_str(flag);
+
+ std::string env_var;
+ for (size_t i = 0; i != flag_str.length(); ++i)
+ env_var += static_cast<char>(::toupper(flag_str.c_str()[i]));
+
+ return "BENCHMARK_" + env_var;
+}
+
+// Reads and returns the Boolean environment variable corresponding to
+// the given flag; if it's not set, returns default_value.
+//
+// The value is considered true iff it's not "0".
+bool BoolFromEnv(const char* flag, bool default_value) {
+ const std::string env_var = FlagToEnvVar(flag);
+ const char* const string_value = getenv(env_var.c_str());
+ return string_value == nullptr ? default_value
+ : strcmp(string_value, "0") != 0;
+}
+
+// Reads and returns a 32-bit integer stored in the environment
+// variable corresponding to the given flag; if it isn't set or
+// doesn't represent a valid 32-bit integer, returns default_value.
+int32_t Int32FromEnv(const char* flag, int32_t default_value) {
+ const std::string env_var = FlagToEnvVar(flag);
+ const char* const string_value = getenv(env_var.c_str());
+ if (string_value == nullptr) {
+ // The environment variable is not set.
+ return default_value;
+ }
+
+ int32_t result = default_value;
+ if (!ParseInt32(std::string("Environment variable ") + env_var, string_value,
+ &result)) {
+ std::cout << "The default value " << default_value << " is used.\n";
+ return default_value;
+ }
+
+ return result;
+}
+
+// Reads and returns the string environment variable corresponding to
+// the given flag; if it's not set, returns default_value.
+const char* StringFromEnv(const char* flag, const char* default_value) {
+ const std::string env_var = FlagToEnvVar(flag);
+ const char* const value = getenv(env_var.c_str());
+ return value == nullptr ? default_value : value;
+}
+
+// Parses a string as a command line flag. The string should have
+// the format "--flag=value". When def_optional is true, the "=value"
+// part can be omitted.
+//
+// Returns the value of the flag, or nullptr if the parsing failed.
+const char* ParseFlagValue(const char* str, const char* flag,
+ bool def_optional) {
+ // str and flag must not be nullptr.
+ if (str == nullptr || flag == nullptr) return nullptr;
+
+ // The flag must start with "--".
+ const std::string flag_str = std::string("--") + std::string(flag);
+ const size_t flag_len = flag_str.length();
+ if (strncmp(str, flag_str.c_str(), flag_len) != 0) return nullptr;
+
+ // Skips the flag name.
+ const char* flag_end = str + flag_len;
+
+ // When def_optional is true, it's OK to not have a "=value" part.
+ if (def_optional && (flag_end[0] == '\0')) return flag_end;
+
+ // If def_optional is true and there are more characters after the
+ // flag name, or if def_optional is false, there must be a '=' after
+ // the flag name.
+ if (flag_end[0] != '=') return nullptr;
+
+ // Returns the string after "=".
+ return flag_end + 1;
+}
+
+bool ParseBoolFlag(const char* str, const char* flag, bool* value) {
+ // Gets the value of the flag as a string.
+ const char* const value_str = ParseFlagValue(str, flag, true);
+
+ // Aborts if the parsing failed.
+ if (value_str == nullptr) return false;
+
+ // Converts the string value to a bool.
+ *value = IsTruthyFlagValue(value_str);
+ return true;
+}
+
+bool ParseInt32Flag(const char* str, const char* flag, int32_t* value) {
+ // Gets the value of the flag as a string.
+ const char* const value_str = ParseFlagValue(str, flag, false);
+
+ // Aborts if the parsing failed.
+ if (value_str == nullptr) return false;
+
+ // Sets *value to the value of the flag.
+ return ParseInt32(std::string("The value of flag --") + flag, value_str,
+ value);
+}
+
+bool ParseDoubleFlag(const char* str, const char* flag, double* value) {
+ // Gets the value of the flag as a string.
+ const char* const value_str = ParseFlagValue(str, flag, false);
+
+ // Aborts if the parsing failed.
+ if (value_str == nullptr) return false;
+
+ // Sets *value to the value of the flag.
+ return ParseDouble(std::string("The value of flag --") + flag, value_str,
+ value);
+}
+
+bool ParseStringFlag(const char* str, const char* flag, std::string* value) {
+ // Gets the value of the flag as a string.
+ const char* const value_str = ParseFlagValue(str, flag, false);
+
+ // Aborts if the parsing failed.
+ if (value_str == nullptr) return false;
+
+ *value = value_str;
+ return true;
+}
+
+bool IsFlag(const char* str, const char* flag) {
+ return (ParseFlagValue(str, flag, true) != nullptr);
+}
+
+bool IsTruthyFlagValue(const std::string& str) {
+ if (str.empty()) return true;
+ char ch = str[0];
+ return isalnum(ch) &&
+ !(ch == '0' || ch == 'f' || ch == 'F' || ch == 'n' || ch == 'N');
+}
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/commandlineflags.h b/utils/google-benchmark/src/commandlineflags.h
new file mode 100644
index 000000000000..945c9a9fc4af
--- /dev/null
+++ b/utils/google-benchmark/src/commandlineflags.h
@@ -0,0 +1,79 @@
+#ifndef BENCHMARK_COMMANDLINEFLAGS_H_
+#define BENCHMARK_COMMANDLINEFLAGS_H_
+
+#include <cstdint>
+#include <string>
+
+// Macro for referencing flags.
+#define FLAG(name) FLAGS_##name
+
+// Macros for declaring flags.
+#define DECLARE_bool(name) extern bool FLAG(name)
+#define DECLARE_int32(name) extern int32_t FLAG(name)
+#define DECLARE_int64(name) extern int64_t FLAG(name)
+#define DECLARE_double(name) extern double FLAG(name)
+#define DECLARE_string(name) extern std::string FLAG(name)
+
+// Macros for defining flags.
+#define DEFINE_bool(name, default_val, doc) bool FLAG(name) = (default_val)
+#define DEFINE_int32(name, default_val, doc) int32_t FLAG(name) = (default_val)
+#define DEFINE_int64(name, default_val, doc) int64_t FLAG(name) = (default_val)
+#define DEFINE_double(name, default_val, doc) double FLAG(name) = (default_val)
+#define DEFINE_string(name, default_val, doc) \
+ std::string FLAG(name) = (default_val)
+
+namespace benchmark {
+// Parses 'str' for a 32-bit signed integer. If successful, writes the result
+// to *value and returns true; otherwise leaves *value unchanged and returns
+// false.
+bool ParseInt32(const std::string& src_text, const char* str, int32_t* value);
+
+// Parses a bool/Int32/string from the environment variable
+// corresponding to the given Google Test flag.
+bool BoolFromEnv(const char* flag, bool default_val);
+int32_t Int32FromEnv(const char* flag, int32_t default_val);
+double DoubleFromEnv(const char* flag, double default_val);
+const char* StringFromEnv(const char* flag, const char* default_val);
+
+// Parses a string for a bool flag, in the form of either
+// "--flag=value" or "--flag".
+//
+// In the former case, the value is taken as true if it passes IsTruthyValue().
+//
+// In the latter case, the value is taken as true.
+//
+// On success, stores the value of the flag in *value, and returns
+// true. On failure, returns false without changing *value.
+bool ParseBoolFlag(const char* str, const char* flag, bool* value);
+
+// Parses a string for an Int32 flag, in the form of
+// "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true. On failure, returns false without changing *value.
+bool ParseInt32Flag(const char* str, const char* flag, int32_t* value);
+
+// Parses a string for a Double flag, in the form of
+// "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true. On failure, returns false without changing *value.
+bool ParseDoubleFlag(const char* str, const char* flag, double* value);
+
+// Parses a string for a string flag, in the form of
+// "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true. On failure, returns false without changing *value.
+bool ParseStringFlag(const char* str, const char* flag, std::string* value);
+
+// Returns true if the string matches the flag.
+bool IsFlag(const char* str, const char* flag);
+
+// Returns true unless value starts with one of: '0', 'f', 'F', 'n' or 'N', or
+// some non-alphanumeric character. As a special case, also returns true if
+// value is the empty string.
+bool IsTruthyFlagValue(const std::string& value);
+} // end namespace benchmark
+
+#endif // BENCHMARK_COMMANDLINEFLAGS_H_
diff --git a/utils/google-benchmark/src/complexity.cc b/utils/google-benchmark/src/complexity.cc
new file mode 100644
index 000000000000..dfab791a3293
--- /dev/null
+++ b/utils/google-benchmark/src/complexity.cc
@@ -0,0 +1,284 @@
+// Copyright 2016 Ismael Jimenez Martinez. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Source project : https://github.com/ismaelJimenez/cpp.leastsq
+// Adapted to be used with google benchmark
+
+#include "benchmark/benchmark_api.h"
+
+#include <algorithm>
+#include <cmath>
+#include "check.h"
+#include "complexity.h"
+#include "stat.h"
+
+namespace benchmark {
+
+// Internal function to calculate the different scalability forms
+BigOFunc* FittingCurve(BigO complexity) {
+ switch (complexity) {
+ case oN:
+ return [](int n) -> double { return n; };
+ case oNSquared:
+ return [](int n) -> double { return std::pow(n, 2); };
+ case oNCubed:
+ return [](int n) -> double { return std::pow(n, 3); };
+ case oLogN:
+ return [](int n) { return std::log2(n); };
+ case oNLogN:
+ return [](int n) { return n * std::log2(n); };
+ case o1:
+ default:
+ return [](int) { return 1.0; };
+ }
+}
+
+// Function to return an string for the calculated complexity
+std::string GetBigOString(BigO complexity) {
+ switch (complexity) {
+ case oN:
+ return "N";
+ case oNSquared:
+ return "N^2";
+ case oNCubed:
+ return "N^3";
+ case oLogN:
+ return "lgN";
+ case oNLogN:
+ return "NlgN";
+ case o1:
+ return "(1)";
+ default:
+ return "f(N)";
+ }
+}
+
+// Find the coefficient for the high-order term in the running time, by
+// minimizing the sum of squares of relative error, for the fitting curve
+// given by the lambda expresion.
+// - n : Vector containing the size of the benchmark tests.
+// - time : Vector containing the times for the benchmark tests.
+// - fitting_curve : lambda expresion (e.g. [](int n) {return n; };).
+
+// For a deeper explanation on the algorithm logic, look the README file at
+// http://github.com/ismaelJimenez/Minimal-Cpp-Least-Squared-Fit
+
+LeastSq MinimalLeastSq(const std::vector<int>& n,
+ const std::vector<double>& time,
+ BigOFunc* fitting_curve) {
+ double sigma_gn = 0.0;
+ double sigma_gn_squared = 0.0;
+ double sigma_time = 0.0;
+ double sigma_time_gn = 0.0;
+
+ // Calculate least square fitting parameter
+ for (size_t i = 0; i < n.size(); ++i) {
+ double gn_i = fitting_curve(n[i]);
+ sigma_gn += gn_i;
+ sigma_gn_squared += gn_i * gn_i;
+ sigma_time += time[i];
+ sigma_time_gn += time[i] * gn_i;
+ }
+
+ LeastSq result;
+ result.complexity = oLambda;
+
+ // Calculate complexity.
+ result.coef = sigma_time_gn / sigma_gn_squared;
+
+ // Calculate RMS
+ double rms = 0.0;
+ for (size_t i = 0; i < n.size(); ++i) {
+ double fit = result.coef * fitting_curve(n[i]);
+ rms += pow((time[i] - fit), 2);
+ }
+
+ // Normalized RMS by the mean of the observed values
+ double mean = sigma_time / n.size();
+ result.rms = sqrt(rms / n.size()) / mean;
+
+ return result;
+}
+
+// Find the coefficient for the high-order term in the running time, by
+// minimizing the sum of squares of relative error.
+// - n : Vector containing the size of the benchmark tests.
+// - time : Vector containing the times for the benchmark tests.
+// - complexity : If different than oAuto, the fitting curve will stick to
+// this one. If it is oAuto, it will be calculated the best
+// fitting curve.
+LeastSq MinimalLeastSq(const std::vector<int>& n,
+ const std::vector<double>& time, const BigO complexity) {
+ CHECK_EQ(n.size(), time.size());
+ CHECK_GE(n.size(), 2); // Do not compute fitting curve is less than two
+ // benchmark runs are given
+ CHECK_NE(complexity, oNone);
+
+ LeastSq best_fit;
+
+ if (complexity == oAuto) {
+ std::vector<BigO> fit_curves = {oLogN, oN, oNLogN, oNSquared, oNCubed};
+
+ // Take o1 as default best fitting curve
+ best_fit = MinimalLeastSq(n, time, FittingCurve(o1));
+ best_fit.complexity = o1;
+
+ // Compute all possible fitting curves and stick to the best one
+ for (const auto& fit : fit_curves) {
+ LeastSq current_fit = MinimalLeastSq(n, time, FittingCurve(fit));
+ if (current_fit.rms < best_fit.rms) {
+ best_fit = current_fit;
+ best_fit.complexity = fit;
+ }
+ }
+ } else {
+ best_fit = MinimalLeastSq(n, time, FittingCurve(complexity));
+ best_fit.complexity = complexity;
+ }
+
+ return best_fit;
+}
+
+std::vector<BenchmarkReporter::Run> ComputeStats(
+ const std::vector<BenchmarkReporter::Run>& reports) {
+ typedef BenchmarkReporter::Run Run;
+ std::vector<Run> results;
+
+ auto error_count =
+ std::count_if(reports.begin(), reports.end(),
+ [](Run const& run) { return run.error_occurred; });
+
+ if (reports.size() - error_count < 2) {
+ // We don't report aggregated data if there was a single run.
+ return results;
+ }
+ // Accumulators.
+ Stat1_d real_accumulated_time_stat;
+ Stat1_d cpu_accumulated_time_stat;
+ Stat1_d bytes_per_second_stat;
+ Stat1_d items_per_second_stat;
+ // All repetitions should be run with the same number of iterations so we
+ // can take this information from the first benchmark.
+ int64_t const run_iterations = reports.front().iterations;
+
+ // Populate the accumulators.
+ for (Run const& run : reports) {
+ CHECK_EQ(reports[0].benchmark_name, run.benchmark_name);
+ CHECK_EQ(run_iterations, run.iterations);
+ if (run.error_occurred) continue;
+ real_accumulated_time_stat +=
+ Stat1_d(run.real_accumulated_time / run.iterations, run.iterations);
+ cpu_accumulated_time_stat +=
+ Stat1_d(run.cpu_accumulated_time / run.iterations, run.iterations);
+ items_per_second_stat += Stat1_d(run.items_per_second, run.iterations);
+ bytes_per_second_stat += Stat1_d(run.bytes_per_second, run.iterations);
+ }
+
+ // Get the data from the accumulator to BenchmarkReporter::Run's.
+ Run mean_data;
+ mean_data.benchmark_name = reports[0].benchmark_name + "_mean";
+ mean_data.iterations = run_iterations;
+ mean_data.real_accumulated_time =
+ real_accumulated_time_stat.Mean() * run_iterations;
+ mean_data.cpu_accumulated_time =
+ cpu_accumulated_time_stat.Mean() * run_iterations;
+ mean_data.bytes_per_second = bytes_per_second_stat.Mean();
+ mean_data.items_per_second = items_per_second_stat.Mean();
+ mean_data.time_unit = reports[0].time_unit;
+
+ // Only add label to mean/stddev if it is same for all runs
+ mean_data.report_label = reports[0].report_label;
+ for (std::size_t i = 1; i < reports.size(); i++) {
+ if (reports[i].report_label != reports[0].report_label) {
+ mean_data.report_label = "";
+ break;
+ }
+ }
+
+ Run stddev_data;
+ stddev_data.benchmark_name = reports[0].benchmark_name + "_stddev";
+ stddev_data.report_label = mean_data.report_label;
+ stddev_data.iterations = 0;
+ stddev_data.real_accumulated_time = real_accumulated_time_stat.StdDev();
+ stddev_data.cpu_accumulated_time = cpu_accumulated_time_stat.StdDev();
+ stddev_data.bytes_per_second = bytes_per_second_stat.StdDev();
+ stddev_data.items_per_second = items_per_second_stat.StdDev();
+ stddev_data.time_unit = reports[0].time_unit;
+
+ results.push_back(mean_data);
+ results.push_back(stddev_data);
+ return results;
+}
+
+std::vector<BenchmarkReporter::Run> ComputeBigO(
+ const std::vector<BenchmarkReporter::Run>& reports) {
+ typedef BenchmarkReporter::Run Run;
+ std::vector<Run> results;
+
+ if (reports.size() < 2) return results;
+
+ // Accumulators.
+ std::vector<int> n;
+ std::vector<double> real_time;
+ std::vector<double> cpu_time;
+
+ // Populate the accumulators.
+ for (const Run& run : reports) {
+ CHECK_GT(run.complexity_n, 0) << "Did you forget to call SetComplexityN?";
+ n.push_back(run.complexity_n);
+ real_time.push_back(run.real_accumulated_time / run.iterations);
+ cpu_time.push_back(run.cpu_accumulated_time / run.iterations);
+ }
+
+ LeastSq result_cpu;
+ LeastSq result_real;
+
+ if (reports[0].complexity == oLambda) {
+ result_cpu = MinimalLeastSq(n, cpu_time, reports[0].complexity_lambda);
+ result_real = MinimalLeastSq(n, real_time, reports[0].complexity_lambda);
+ } else {
+ result_cpu = MinimalLeastSq(n, cpu_time, reports[0].complexity);
+ result_real = MinimalLeastSq(n, real_time, result_cpu.complexity);
+ }
+ std::string benchmark_name =
+ reports[0].benchmark_name.substr(0, reports[0].benchmark_name.find('/'));
+
+ // Get the data from the accumulator to BenchmarkReporter::Run's.
+ Run big_o;
+ big_o.benchmark_name = benchmark_name + "_BigO";
+ big_o.iterations = 0;
+ big_o.real_accumulated_time = result_real.coef;
+ big_o.cpu_accumulated_time = result_cpu.coef;
+ big_o.report_big_o = true;
+ big_o.complexity = result_cpu.complexity;
+
+ double multiplier = GetTimeUnitMultiplier(reports[0].time_unit);
+
+ // Only add label to mean/stddev if it is same for all runs
+ Run rms;
+ big_o.report_label = reports[0].report_label;
+ rms.benchmark_name = benchmark_name + "_RMS";
+ rms.report_label = big_o.report_label;
+ rms.iterations = 0;
+ rms.real_accumulated_time = result_real.rms / multiplier;
+ rms.cpu_accumulated_time = result_cpu.rms / multiplier;
+ rms.report_rms = true;
+ rms.complexity = result_cpu.complexity;
+
+ results.push_back(big_o);
+ results.push_back(rms);
+ return results;
+}
+
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/complexity.h b/utils/google-benchmark/src/complexity.h
new file mode 100644
index 000000000000..23cd9bbc8c74
--- /dev/null
+++ b/utils/google-benchmark/src/complexity.h
@@ -0,0 +1,61 @@
+// Copyright 2016 Ismael Jimenez Martinez. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Source project : https://github.com/ismaelJimenez/cpp.leastsq
+// Adapted to be used with google benchmark
+
+#ifndef COMPLEXITY_H_
+#define COMPLEXITY_H_
+
+#include <string>
+#include <vector>
+
+#include "benchmark/benchmark_api.h"
+#include "benchmark/reporter.h"
+
+namespace benchmark {
+
+// Return a vector containing the mean and standard devation information for
+// the specified list of reports. If 'reports' contains less than two
+// non-errored runs an empty vector is returned
+std::vector<BenchmarkReporter::Run> ComputeStats(
+ const std::vector<BenchmarkReporter::Run>& reports);
+
+// Return a vector containing the bigO and RMS information for the specified
+// list of reports. If 'reports.size() < 2' an empty vector is returned.
+std::vector<BenchmarkReporter::Run> ComputeBigO(
+ const std::vector<BenchmarkReporter::Run>& reports);
+
+// This data structure will contain the result returned by MinimalLeastSq
+// - coef : Estimated coeficient for the high-order term as
+// interpolated from data.
+// - rms : Normalized Root Mean Squared Error.
+// - complexity : Scalability form (e.g. oN, oNLogN). In case a scalability
+// form has been provided to MinimalLeastSq this will return
+// the same value. In case BigO::oAuto has been selected, this
+// parameter will return the best fitting curve detected.
+
+struct LeastSq {
+ LeastSq() : coef(0.0), rms(0.0), complexity(oNone) {}
+
+ double coef;
+ double rms;
+ BigO complexity;
+};
+
+// Function to return an string for the calculated complexity
+std::string GetBigOString(BigO complexity);
+
+} // end namespace benchmark
+#endif // COMPLEXITY_H_
diff --git a/utils/google-benchmark/src/console_reporter.cc b/utils/google-benchmark/src/console_reporter.cc
new file mode 100644
index 000000000000..7e0cca3e3a0b
--- /dev/null
+++ b/utils/google-benchmark/src/console_reporter.cc
@@ -0,0 +1,132 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/reporter.h"
+#include "complexity.h"
+
+#include <algorithm>
+#include <cstdint>
+#include <cstdio>
+#include <iostream>
+#include <string>
+#include <tuple>
+#include <vector>
+
+#include "check.h"
+#include "colorprint.h"
+#include "commandlineflags.h"
+#include "internal_macros.h"
+#include "string_util.h"
+#include "timers.h"
+
+namespace benchmark {
+
+bool ConsoleReporter::ReportContext(const Context& context) {
+ name_field_width_ = context.name_field_width;
+
+ PrintBasicContext(&GetErrorStream(), context);
+
+#ifdef BENCHMARK_OS_WINDOWS
+ if (color_output_ && &std::cout != &GetOutputStream()) {
+ GetErrorStream()
+ << "Color printing is only supported for stdout on windows."
+ " Disabling color printing\n";
+ color_output_ = false;
+ }
+#endif
+ std::string str =
+ FormatString("%-*s %13s %13s %10s\n", static_cast<int>(name_field_width_),
+ "Benchmark", "Time", "CPU", "Iterations");
+ GetOutputStream() << str << std::string(str.length() - 1, '-') << "\n";
+
+ return true;
+}
+
+void ConsoleReporter::ReportRuns(const std::vector<Run>& reports) {
+ for (const auto& run : reports) PrintRunData(run);
+}
+
+static void IgnoreColorPrint(std::ostream& out, LogColor, const char* fmt,
+ ...) {
+ va_list args;
+ va_start(args, fmt);
+ out << FormatString(fmt, args);
+ va_end(args);
+}
+
+void ConsoleReporter::PrintRunData(const Run& result) {
+ typedef void(PrinterFn)(std::ostream&, LogColor, const char*, ...);
+ auto& Out = GetOutputStream();
+ PrinterFn* printer =
+ color_output_ ? (PrinterFn*)ColorPrintf : IgnoreColorPrint;
+ auto name_color =
+ (result.report_big_o || result.report_rms) ? COLOR_BLUE : COLOR_GREEN;
+ printer(Out, name_color, "%-*s ", name_field_width_,
+ result.benchmark_name.c_str());
+
+ if (result.error_occurred) {
+ printer(Out, COLOR_RED, "ERROR OCCURRED: \'%s\'",
+ result.error_message.c_str());
+ printer(Out, COLOR_DEFAULT, "\n");
+ return;
+ }
+ // Format bytes per second
+ std::string rate;
+ if (result.bytes_per_second > 0) {
+ rate = StrCat(" ", HumanReadableNumber(result.bytes_per_second), "B/s");
+ }
+
+ // Format items per second
+ std::string items;
+ if (result.items_per_second > 0) {
+ items =
+ StrCat(" ", HumanReadableNumber(result.items_per_second), " items/s");
+ }
+
+ const double real_time = result.GetAdjustedRealTime();
+ const double cpu_time = result.GetAdjustedCPUTime();
+
+ if (result.report_big_o) {
+ std::string big_o = GetBigOString(result.complexity);
+ printer(Out, COLOR_YELLOW, "%10.2f %s %10.2f %s ", real_time, big_o.c_str(),
+ cpu_time, big_o.c_str());
+ } else if (result.report_rms) {
+ printer(Out, COLOR_YELLOW, "%10.0f %% %10.0f %% ", real_time * 100,
+ cpu_time * 100);
+ } else {
+ const char* timeLabel = GetTimeUnitString(result.time_unit);
+ printer(Out, COLOR_YELLOW, "%10.0f %s %10.0f %s ", real_time, timeLabel,
+ cpu_time, timeLabel);
+ }
+
+ if (!result.report_big_o && !result.report_rms) {
+ printer(Out, COLOR_CYAN, "%10lld", result.iterations);
+ }
+
+ if (!rate.empty()) {
+ printer(Out, COLOR_DEFAULT, " %*s", 13, rate.c_str());
+ }
+
+ if (!items.empty()) {
+ printer(Out, COLOR_DEFAULT, " %*s", 18, items.c_str());
+ }
+
+ if (!result.report_label.empty()) {
+ printer(Out, COLOR_DEFAULT, " %s", result.report_label.c_str());
+ }
+
+ printer(Out, COLOR_DEFAULT, "\n");
+}
+
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/csv_reporter.cc b/utils/google-benchmark/src/csv_reporter.cc
new file mode 100644
index 000000000000..18ab3b668951
--- /dev/null
+++ b/utils/google-benchmark/src/csv_reporter.cc
@@ -0,0 +1,108 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/reporter.h"
+#include "complexity.h"
+
+#include <algorithm>
+#include <cstdint>
+#include <iostream>
+#include <string>
+#include <tuple>
+#include <vector>
+
+#include "string_util.h"
+#include "timers.h"
+
+// File format reference: http://edoceo.com/utilitas/csv-file-format.
+
+namespace benchmark {
+
+namespace {
+std::vector<std::string> elements = {
+ "name", "iterations", "real_time", "cpu_time",
+ "time_unit", "bytes_per_second", "items_per_second", "label",
+ "error_occurred", "error_message"};
+}
+
+bool CSVReporter::ReportContext(const Context& context) {
+ PrintBasicContext(&GetErrorStream(), context);
+
+ std::ostream& Out = GetOutputStream();
+ for (auto B = elements.begin(); B != elements.end();) {
+ Out << *B++;
+ if (B != elements.end()) Out << ",";
+ }
+ Out << "\n";
+ return true;
+}
+
+void CSVReporter::ReportRuns(const std::vector<Run>& reports) {
+ for (const auto& run : reports) PrintRunData(run);
+}
+
+void CSVReporter::PrintRunData(const Run& run) {
+ std::ostream& Out = GetOutputStream();
+
+ // Field with embedded double-quote characters must be doubled and the field
+ // delimited with double-quotes.
+ std::string name = run.benchmark_name;
+ ReplaceAll(&name, "\"", "\"\"");
+ Out << '"' << name << "\",";
+ if (run.error_occurred) {
+ Out << std::string(elements.size() - 3, ',');
+ Out << "true,";
+ std::string msg = run.error_message;
+ ReplaceAll(&msg, "\"", "\"\"");
+ Out << '"' << msg << "\"\n";
+ return;
+ }
+
+ // Do not print iteration on bigO and RMS report
+ if (!run.report_big_o && !run.report_rms) {
+ Out << run.iterations;
+ }
+ Out << ",";
+
+ Out << run.GetAdjustedRealTime() << ",";
+ Out << run.GetAdjustedCPUTime() << ",";
+
+ // Do not print timeLabel on bigO and RMS report
+ if (run.report_big_o) {
+ Out << GetBigOString(run.complexity);
+ } else if (!run.report_rms) {
+ Out << GetTimeUnitString(run.time_unit);
+ }
+ Out << ",";
+
+ if (run.bytes_per_second > 0.0) {
+ Out << run.bytes_per_second;
+ }
+ Out << ",";
+ if (run.items_per_second > 0.0) {
+ Out << run.items_per_second;
+ }
+ Out << ",";
+ if (!run.report_label.empty()) {
+ // Field with embedded double-quote characters must be doubled and the field
+ // delimited with double-quotes.
+ std::string label = run.report_label;
+ ReplaceAll(&label, "\"", "\"\"");
+ Out << "\"" << label << "\"";
+ }
+ Out << ",,"; // for error_occurred and error_message
+ Out << '\n';
+}
+
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/cycleclock.h b/utils/google-benchmark/src/cycleclock.h
new file mode 100644
index 000000000000..e4825d4ba244
--- /dev/null
+++ b/utils/google-benchmark/src/cycleclock.h
@@ -0,0 +1,145 @@
+// ----------------------------------------------------------------------
+// CycleClock
+// A CycleClock tells you the current time in Cycles. The "time"
+// is actually time since power-on. This is like time() but doesn't
+// involve a system call and is much more precise.
+//
+// NOTE: Not all cpu/platform/kernel combinations guarantee that this
+// clock increments at a constant rate or is synchronized across all logical
+// cpus in a system.
+//
+// If you need the above guarantees, please consider using a different
+// API. There are efforts to provide an interface which provides a millisecond
+// granularity and implemented as a memory read. A memory read is generally
+// cheaper than the CycleClock for many architectures.
+//
+// Also, in some out of order CPU implementations, the CycleClock is not
+// serializing. So if you're trying to count at cycles granularity, your
+// data might be inaccurate due to out of order instruction execution.
+// ----------------------------------------------------------------------
+
+#ifndef BENCHMARK_CYCLECLOCK_H_
+#define BENCHMARK_CYCLECLOCK_H_
+
+#include <cstdint>
+
+#include "benchmark/macros.h"
+#include "internal_macros.h"
+
+#if defined(BENCHMARK_OS_MACOSX)
+#include <mach/mach_time.h>
+#endif
+// For MSVC, we want to use '_asm rdtsc' when possible (since it works
+// with even ancient MSVC compilers), and when not possible the
+// __rdtsc intrinsic, declared in <intrin.h>. Unfortunately, in some
+// environments, <windows.h> and <intrin.h> have conflicting
+// declarations of some other intrinsics, breaking compilation.
+// Therefore, we simply declare __rdtsc ourselves. See also
+// http://connect.microsoft.com/VisualStudio/feedback/details/262047
+#if defined(COMPILER_MSVC) && !defined(_M_IX86)
+extern "C" uint64_t __rdtsc();
+#pragma intrinsic(__rdtsc)
+#endif
+
+#ifndef BENCHMARK_OS_WINDOWS
+#include <sys/time.h>
+#endif
+
+namespace benchmark {
+// NOTE: only i386 and x86_64 have been well tested.
+// PPC, sparc, alpha, and ia64 are based on
+// http://peter.kuscsik.com/wordpress/?p=14
+// with modifications by m3b. See also
+// https://setisvn.ssl.berkeley.edu/svn/lib/fftw-3.0.1/kernel/cycle.h
+namespace cycleclock {
+// This should return the number of cycles since power-on. Thread-safe.
+inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
+#if defined(BENCHMARK_OS_MACOSX)
+ // this goes at the top because we need ALL Macs, regardless of
+ // architecture, to return the number of "mach time units" that
+ // have passed since startup. See sysinfo.cc where
+ // InitializeSystemInfo() sets the supposed cpu clock frequency of
+ // macs to the number of mach time units per second, not actual
+ // CPU clock frequency (which can change in the face of CPU
+ // frequency scaling). Also note that when the Mac sleeps, this
+ // counter pauses; it does not continue counting, nor does it
+ // reset to zero.
+ return mach_absolute_time();
+#elif defined(__i386__)
+ int64_t ret;
+ __asm__ volatile("rdtsc" : "=A"(ret));
+ return ret;
+#elif defined(__x86_64__) || defined(__amd64__)
+ uint64_t low, high;
+ __asm__ volatile("rdtsc" : "=a"(low), "=d"(high));
+ return (high << 32) | low;
+#elif defined(__powerpc__) || defined(__ppc__)
+ // This returns a time-base, which is not always precisely a cycle-count.
+ int64_t tbl, tbu0, tbu1;
+ asm("mftbu %0" : "=r"(tbu0));
+ asm("mftb %0" : "=r"(tbl));
+ asm("mftbu %0" : "=r"(tbu1));
+ tbl &= -static_cast<int64>(tbu0 == tbu1);
+ // high 32 bits in tbu1; low 32 bits in tbl (tbu0 is garbage)
+ return (tbu1 << 32) | tbl;
+#elif defined(__sparc__)
+ int64_t tick;
+ asm(".byte 0x83, 0x41, 0x00, 0x00");
+ asm("mov %%g1, %0" : "=r"(tick));
+ return tick;
+#elif defined(__ia64__)
+ int64_t itc;
+ asm("mov %0 = ar.itc" : "=r"(itc));
+ return itc;
+#elif defined(COMPILER_MSVC) && defined(_M_IX86)
+ // Older MSVC compilers (like 7.x) don't seem to support the
+ // __rdtsc intrinsic properly, so I prefer to use _asm instead
+ // when I know it will work. Otherwise, I'll use __rdtsc and hope
+ // the code is being compiled with a non-ancient compiler.
+ _asm rdtsc
+#elif defined(COMPILER_MSVC)
+ return __rdtsc();
+#elif defined(__aarch64__)
+ // System timer of ARMv8 runs at a different frequency than the CPU's.
+ // The frequency is fixed, typically in the range 1-50MHz. It can be
+ // read at CNTFRQ special register. We assume the OS has set up
+ // the virtual timer properly.
+ int64_t virtual_timer_value;
+ asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
+ return virtual_timer_value;
+#elif defined(__ARM_ARCH)
+#if (__ARM_ARCH >= 6) // V6 is the earliest arch that has a standard cyclecount
+ uint32_t pmccntr;
+ uint32_t pmuseren;
+ uint32_t pmcntenset;
+ // Read the user mode perf monitor counter access permissions.
+ asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r"(pmuseren));
+ if (pmuseren & 1) { // Allows reading perfmon counters for user mode code.
+ asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcntenset));
+ if (pmcntenset & 0x80000000ul) { // Is it counting?
+ asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));
+ // The counter is set up to count every 64th cycle
+ return static_cast<int64_t>(pmccntr) * 64; // Should optimize to << 6
+ }
+ }
+#endif
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
+#elif defined(__mips__)
+ // mips apparently only allows rdtsc for superusers, so we fall
+ // back to gettimeofday. It's possible clock_gettime would be better.
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
+#else
+// The soft failover to a generic implementation is automatic only for ARM.
+// For other platforms the developer is expected to make an attempt to create
+// a fast implementation and use generic version if nothing better is available.
+#error You need to define CycleTimer for your OS and CPU
+#endif
+}
+} // end namespace cycleclock
+} // end namespace benchmark
+
+#endif // BENCHMARK_CYCLECLOCK_H_
diff --git a/utils/google-benchmark/src/internal_macros.h b/utils/google-benchmark/src/internal_macros.h
new file mode 100644
index 000000000000..e8efcbb39c18
--- /dev/null
+++ b/utils/google-benchmark/src/internal_macros.h
@@ -0,0 +1,42 @@
+#ifndef BENCHMARK_INTERNAL_MACROS_H_
+#define BENCHMARK_INTERNAL_MACROS_H_
+
+#include "benchmark/macros.h"
+
+#ifndef __has_feature
+#define __has_feature(x) 0
+#endif
+
+#if defined(__clang__)
+#define COMPILER_CLANG
+#elif defined(_MSC_VER)
+#define COMPILER_MSVC
+#elif defined(__GNUC__)
+#define COMPILER_GCC
+#endif
+
+#if __has_feature(cxx_attributes)
+#define BENCHMARK_NORETURN [[noreturn]]
+#elif defined(__GNUC__)
+#define BENCHMARK_NORETURN __attribute__((noreturn))
+#elif defined(COMPILER_MSVC)
+#define BENCHMARK_NORETURN __declspec(noreturn)
+#else
+#define BENCHMARK_NORETURN
+#endif
+
+#if defined(__CYGWIN__)
+#define BENCHMARK_OS_CYGWIN 1
+#elif defined(_WIN32)
+#define BENCHMARK_OS_WINDOWS 1
+#elif defined(__APPLE__)
+// TODO(ericwf) This doesn't actually check that it is a Mac OSX system. Just
+// that it is an apple system.
+#define BENCHMARK_OS_MACOSX 1
+#elif defined(__FreeBSD__)
+#define BENCHMARK_OS_FREEBSD 1
+#elif defined(__linux__)
+#define BENCHMARK_OS_LINUX 1
+#endif
+
+#endif // BENCHMARK_INTERNAL_MACROS_H_
diff --git a/utils/google-benchmark/src/json_reporter.cc b/utils/google-benchmark/src/json_reporter.cc
new file mode 100644
index 000000000000..cea5f9bfa1c9
--- /dev/null
+++ b/utils/google-benchmark/src/json_reporter.cc
@@ -0,0 +1,163 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/reporter.h"
+#include "complexity.h"
+
+#include <algorithm>
+#include <cstdint>
+#include <iostream>
+#include <string>
+#include <tuple>
+#include <vector>
+
+#include "string_util.h"
+#include "timers.h"
+
+namespace benchmark {
+
+namespace {
+
+std::string FormatKV(std::string const& key, std::string const& value) {
+ return StringPrintF("\"%s\": \"%s\"", key.c_str(), value.c_str());
+}
+
+std::string FormatKV(std::string const& key, const char* value) {
+ return StringPrintF("\"%s\": \"%s\"", key.c_str(), value);
+}
+
+std::string FormatKV(std::string const& key, bool value) {
+ return StringPrintF("\"%s\": %s", key.c_str(), value ? "true" : "false");
+}
+
+std::string FormatKV(std::string const& key, int64_t value) {
+ std::stringstream ss;
+ ss << '"' << key << "\": " << value;
+ return ss.str();
+}
+
+std::string FormatKV(std::string const& key, double value) {
+ return StringPrintF("\"%s\": %.2f", key.c_str(), value);
+}
+
+int64_t RoundDouble(double v) { return static_cast<int64_t>(v + 0.5); }
+
+} // end namespace
+
+bool JSONReporter::ReportContext(const Context& context) {
+ std::ostream& out = GetOutputStream();
+
+ out << "{\n";
+ std::string inner_indent(2, ' ');
+
+ // Open context block and print context information.
+ out << inner_indent << "\"context\": {\n";
+ std::string indent(4, ' ');
+
+ std::string walltime_value = LocalDateTimeString();
+ out << indent << FormatKV("date", walltime_value) << ",\n";
+
+ out << indent << FormatKV("num_cpus", static_cast<int64_t>(context.num_cpus))
+ << ",\n";
+ out << indent << FormatKV("mhz_per_cpu", RoundDouble(context.mhz_per_cpu))
+ << ",\n";
+ out << indent << FormatKV("cpu_scaling_enabled", context.cpu_scaling_enabled)
+ << ",\n";
+
+#if defined(NDEBUG)
+ const char build_type[] = "release";
+#else
+ const char build_type[] = "debug";
+#endif
+ out << indent << FormatKV("library_build_type", build_type) << "\n";
+ // Close context block and open the list of benchmarks.
+ out << inner_indent << "},\n";
+ out << inner_indent << "\"benchmarks\": [\n";
+ return true;
+}
+
+void JSONReporter::ReportRuns(std::vector<Run> const& reports) {
+ if (reports.empty()) {
+ return;
+ }
+ std::string indent(4, ' ');
+ std::ostream& out = GetOutputStream();
+ if (!first_report_) {
+ out << ",\n";
+ }
+ first_report_ = false;
+
+ for (auto it = reports.begin(); it != reports.end(); ++it) {
+ out << indent << "{\n";
+ PrintRunData(*it);
+ out << indent << '}';
+ auto it_cp = it;
+ if (++it_cp != reports.end()) {
+ out << ",\n";
+ }
+ }
+}
+
+void JSONReporter::Finalize() {
+ // Close the list of benchmarks and the top level object.
+ GetOutputStream() << "\n ]\n}\n";
+}
+
+void JSONReporter::PrintRunData(Run const& run) {
+ std::string indent(6, ' ');
+ std::ostream& out = GetOutputStream();
+ out << indent << FormatKV("name", run.benchmark_name) << ",\n";
+ if (run.error_occurred) {
+ out << indent << FormatKV("error_occurred", run.error_occurred) << ",\n";
+ out << indent << FormatKV("error_message", run.error_message) << ",\n";
+ }
+ if (!run.report_big_o && !run.report_rms) {
+ out << indent << FormatKV("iterations", run.iterations) << ",\n";
+ out << indent
+ << FormatKV("real_time", RoundDouble(run.GetAdjustedRealTime()))
+ << ",\n";
+ out << indent
+ << FormatKV("cpu_time", RoundDouble(run.GetAdjustedCPUTime()));
+ out << ",\n"
+ << indent << FormatKV("time_unit", GetTimeUnitString(run.time_unit));
+ } else if (run.report_big_o) {
+ out << indent
+ << FormatKV("cpu_coefficient", RoundDouble(run.GetAdjustedCPUTime()))
+ << ",\n";
+ out << indent
+ << FormatKV("real_coefficient", RoundDouble(run.GetAdjustedRealTime()))
+ << ",\n";
+ out << indent << FormatKV("big_o", GetBigOString(run.complexity)) << ",\n";
+ out << indent << FormatKV("time_unit", GetTimeUnitString(run.time_unit));
+ } else if (run.report_rms) {
+ out << indent
+ << FormatKV("rms", run.GetAdjustedCPUTime());
+ }
+ if (run.bytes_per_second > 0.0) {
+ out << ",\n"
+ << indent
+ << FormatKV("bytes_per_second", RoundDouble(run.bytes_per_second));
+ }
+ if (run.items_per_second > 0.0) {
+ out << ",\n"
+ << indent
+ << FormatKV("items_per_second", RoundDouble(run.items_per_second));
+ }
+ if (!run.report_label.empty()) {
+ out << ",\n" << indent << FormatKV("label", run.report_label);
+ }
+ out << '\n';
+}
+
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/log.h b/utils/google-benchmark/src/log.h
new file mode 100644
index 000000000000..978cb0b4c8cb
--- /dev/null
+++ b/utils/google-benchmark/src/log.h
@@ -0,0 +1,73 @@
+#ifndef BENCHMARK_LOG_H_
+#define BENCHMARK_LOG_H_
+
+#include <iostream>
+#include <ostream>
+
+#include "benchmark/macros.h"
+
+namespace benchmark {
+namespace internal {
+
+typedef std::basic_ostream<char>&(EndLType)(std::basic_ostream<char>&);
+
+class LogType {
+ friend LogType& GetNullLogInstance();
+ friend LogType& GetErrorLogInstance();
+
+ // FIXME: Add locking to output.
+ template <class Tp>
+ friend LogType& operator<<(LogType&, Tp const&);
+ friend LogType& operator<<(LogType&, EndLType*);
+
+ private:
+ LogType(std::ostream* out) : out_(out) {}
+ std::ostream* out_;
+ BENCHMARK_DISALLOW_COPY_AND_ASSIGN(LogType);
+};
+
+template <class Tp>
+LogType& operator<<(LogType& log, Tp const& value) {
+ if (log.out_) {
+ *log.out_ << value;
+ }
+ return log;
+}
+
+inline LogType& operator<<(LogType& log, EndLType* m) {
+ if (log.out_) {
+ *log.out_ << m;
+ }
+ return log;
+}
+
+inline int& LogLevel() {
+ static int log_level = 0;
+ return log_level;
+}
+
+inline LogType& GetNullLogInstance() {
+ static LogType log(nullptr);
+ return log;
+}
+
+inline LogType& GetErrorLogInstance() {
+ static LogType log(&std::clog);
+ return log;
+}
+
+inline LogType& GetLogInstanceForLevel(int level) {
+ if (level <= LogLevel()) {
+ return GetErrorLogInstance();
+ }
+ return GetNullLogInstance();
+}
+
+} // end namespace internal
+} // end namespace benchmark
+
+#define VLOG(x) \
+ (::benchmark::internal::GetLogInstanceForLevel(x) << "-- LOG(" << x << "):" \
+ " ")
+
+#endif \ No newline at end of file
diff --git a/utils/google-benchmark/src/mutex.h b/utils/google-benchmark/src/mutex.h
new file mode 100644
index 000000000000..5f461d05a0c6
--- /dev/null
+++ b/utils/google-benchmark/src/mutex.h
@@ -0,0 +1,155 @@
+#ifndef BENCHMARK_MUTEX_H_
+#define BENCHMARK_MUTEX_H_
+
+#include <condition_variable>
+#include <mutex>
+
+#include "check.h"
+
+// Enable thread safety attributes only with clang.
+// The attributes can be safely erased when compiling with other compilers.
+#if defined(HAVE_THREAD_SAFETY_ATTRIBUTES)
+#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
+#else
+#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op
+#endif
+
+#define CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
+
+#define SCOPED_CAPABILITY THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
+
+#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
+
+#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
+
+#define ACQUIRED_BEFORE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
+
+#define ACQUIRED_AFTER(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
+
+#define REQUIRES(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(__VA_ARGS__))
+
+#define REQUIRES_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(__VA_ARGS__))
+
+#define ACQUIRE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(__VA_ARGS__))
+
+#define ACQUIRE_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(__VA_ARGS__))
+
+#define RELEASE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(release_capability(__VA_ARGS__))
+
+#define RELEASE_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(__VA_ARGS__))
+
+#define TRY_ACQUIRE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(__VA_ARGS__))
+
+#define TRY_ACQUIRE_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(__VA_ARGS__))
+
+#define EXCLUDES(...) THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
+
+#define ASSERT_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
+
+#define ASSERT_SHARED_CAPABILITY(x) \
+ THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
+
+#define RETURN_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
+
+#define NO_THREAD_SAFETY_ANALYSIS \
+ THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
+
+namespace benchmark {
+
+typedef std::condition_variable Condition;
+
+// NOTE: Wrappers for std::mutex and std::unique_lock are provided so that
+// we can annotate them with thread safety attributes and use the
+// -Wthread-safety warning with clang. The standard library types cannot be
+// used directly because they do not provided the required annotations.
+class CAPABILITY("mutex") Mutex {
+ public:
+ Mutex() {}
+
+ void lock() ACQUIRE() { mut_.lock(); }
+ void unlock() RELEASE() { mut_.unlock(); }
+ std::mutex& native_handle() { return mut_; }
+
+ private:
+ std::mutex mut_;
+};
+
+class SCOPED_CAPABILITY MutexLock {
+ typedef std::unique_lock<std::mutex> MutexLockImp;
+
+ public:
+ MutexLock(Mutex& m) ACQUIRE(m) : ml_(m.native_handle()) {}
+ ~MutexLock() RELEASE() {}
+ MutexLockImp& native_handle() { return ml_; }
+
+ private:
+ MutexLockImp ml_;
+};
+
+class Barrier {
+ public:
+ Barrier(int num_threads) : running_threads_(num_threads) {}
+
+ // Called by each thread
+ bool wait() EXCLUDES(lock_) {
+ bool last_thread = false;
+ {
+ MutexLock ml(lock_);
+ last_thread = createBarrier(ml);
+ }
+ if (last_thread) phase_condition_.notify_all();
+ return last_thread;
+ }
+
+ void removeThread() EXCLUDES(lock_) {
+ MutexLock ml(lock_);
+ --running_threads_;
+ if (entered_ != 0) phase_condition_.notify_all();
+ }
+
+ private:
+ Mutex lock_;
+ Condition phase_condition_;
+ int running_threads_;
+
+ // State for barrier management
+ int phase_number_ = 0;
+ int entered_ = 0; // Number of threads that have entered this barrier
+
+ // Enter the barrier and wait until all other threads have also
+ // entered the barrier. Returns iff this is the last thread to
+ // enter the barrier.
+ bool createBarrier(MutexLock& ml) REQUIRES(lock_) {
+ CHECK_LT(entered_, running_threads_);
+ entered_++;
+ if (entered_ < running_threads_) {
+ // Wait for all threads to enter
+ int phase_number_cp = phase_number_;
+ auto cb = [this, phase_number_cp]() {
+ return this->phase_number_ > phase_number_cp ||
+ entered_ == running_threads_; // A thread has aborted in error
+ };
+ phase_condition_.wait(ml.native_handle(), cb);
+ if (phase_number_ > phase_number_cp) return false;
+ // else (running_threads_ == entered_) and we are the last thread.
+ }
+ // Last thread has reached the barrier
+ phase_number_++;
+ entered_ = 0;
+ return true;
+ }
+};
+
+} // end namespace benchmark
+
+#endif // BENCHMARK_MUTEX_H_
diff --git a/utils/google-benchmark/src/re.h b/utils/google-benchmark/src/re.h
new file mode 100644
index 000000000000..af4a498c9f7a
--- /dev/null
+++ b/utils/google-benchmark/src/re.h
@@ -0,0 +1,126 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef BENCHMARK_RE_H_
+#define BENCHMARK_RE_H_
+
+#if defined(HAVE_STD_REGEX)
+#include <regex>
+#elif defined(HAVE_GNU_POSIX_REGEX)
+#include <gnuregex.h>
+#elif defined(HAVE_POSIX_REGEX)
+#include <regex.h>
+#else
+#error No regular expression backend was found!
+#endif
+#include <string>
+
+#include "check.h"
+
+namespace benchmark {
+
+// A wrapper around the POSIX regular expression API that provides automatic
+// cleanup
+class Regex {
+ public:
+ Regex() : init_(false) {}
+
+ ~Regex();
+
+ // Compile a regular expression matcher from spec. Returns true on success.
+ //
+ // On failure (and if error is not nullptr), error is populated with a human
+ // readable error message if an error occurs.
+ bool Init(const std::string& spec, std::string* error);
+
+ // Returns whether str matches the compiled regular expression.
+ bool Match(const std::string& str);
+
+ private:
+ bool init_;
+// Underlying regular expression object
+#if defined(HAVE_STD_REGEX)
+ std::regex re_;
+#elif defined(HAVE_POSIX_REGEX) || defined(HAVE_GNU_POSIX_REGEX)
+ regex_t re_;
+#else
+#error No regular expression backend implementation available
+#endif
+};
+
+#if defined(HAVE_STD_REGEX)
+
+inline bool Regex::Init(const std::string& spec, std::string* error) {
+ try {
+ re_ = std::regex(spec, std::regex_constants::extended);
+
+ init_ = true;
+ } catch (const std::regex_error& e) {
+ if (error) {
+ *error = e.what();
+ }
+ }
+ return init_;
+}
+
+inline Regex::~Regex() {}
+
+inline bool Regex::Match(const std::string& str) {
+ if (!init_) {
+ return false;
+ }
+ return std::regex_search(str, re_);
+}
+
+#else
+inline bool Regex::Init(const std::string& spec, std::string* error) {
+ int ec = regcomp(&re_, spec.c_str(), REG_EXTENDED | REG_NOSUB);
+ if (ec != 0) {
+ if (error) {
+ size_t needed = regerror(ec, &re_, nullptr, 0);
+ char* errbuf = new char[needed];
+ regerror(ec, &re_, errbuf, needed);
+
+ // regerror returns the number of bytes necessary to null terminate
+ // the string, so we move that when assigning to error.
+ CHECK_NE(needed, 0);
+ error->assign(errbuf, needed - 1);
+
+ delete[] errbuf;
+ }
+
+ return false;
+ }
+
+ init_ = true;
+ return true;
+}
+
+inline Regex::~Regex() {
+ if (init_) {
+ regfree(&re_);
+ }
+}
+
+inline bool Regex::Match(const std::string& str) {
+ if (!init_) {
+ return false;
+ }
+ return regexec(&re_, str.c_str(), 0, nullptr, 0) == 0;
+}
+#endif
+
+} // end namespace benchmark
+
+#endif // BENCHMARK_RE_H_
diff --git a/utils/google-benchmark/src/reporter.cc b/utils/google-benchmark/src/reporter.cc
new file mode 100644
index 000000000000..64742426cd3e
--- /dev/null
+++ b/utils/google-benchmark/src/reporter.cc
@@ -0,0 +1,68 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/reporter.h"
+#include "timers.h"
+
+#include <cstdlib>
+
+#include <iostream>
+#include <tuple>
+#include <vector>
+
+#include "check.h"
+#include "stat.h"
+
+namespace benchmark {
+
+BenchmarkReporter::BenchmarkReporter()
+ : output_stream_(&std::cout), error_stream_(&std::cerr) {}
+
+BenchmarkReporter::~BenchmarkReporter() {}
+
+void BenchmarkReporter::PrintBasicContext(std::ostream *out_ptr,
+ Context const &context) {
+ CHECK(out_ptr) << "cannot be null";
+ auto &Out = *out_ptr;
+
+ Out << "Run on (" << context.num_cpus << " X " << context.mhz_per_cpu
+ << " MHz CPU " << ((context.num_cpus > 1) ? "s" : "") << ")\n";
+
+ Out << LocalDateTimeString() << "\n";
+
+ if (context.cpu_scaling_enabled) {
+ Out << "***WARNING*** CPU scaling is enabled, the benchmark "
+ "real time measurements may be noisy and will incur extra "
+ "overhead.\n";
+ }
+
+#ifndef NDEBUG
+ Out << "***WARNING*** Library was built as DEBUG. Timings may be "
+ "affected.\n";
+#endif
+}
+
+double BenchmarkReporter::Run::GetAdjustedRealTime() const {
+ double new_time = real_accumulated_time * GetTimeUnitMultiplier(time_unit);
+ if (iterations != 0) new_time /= static_cast<double>(iterations);
+ return new_time;
+}
+
+double BenchmarkReporter::Run::GetAdjustedCPUTime() const {
+ double new_time = cpu_accumulated_time * GetTimeUnitMultiplier(time_unit);
+ if (iterations != 0) new_time /= static_cast<double>(iterations);
+ return new_time;
+}
+
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/sleep.cc b/utils/google-benchmark/src/sleep.cc
new file mode 100644
index 000000000000..918abc485dc3
--- /dev/null
+++ b/utils/google-benchmark/src/sleep.cc
@@ -0,0 +1,50 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "sleep.h"
+
+#include <cerrno>
+#include <ctime>
+
+#include "internal_macros.h"
+
+#ifdef BENCHMARK_OS_WINDOWS
+#include <Windows.h>
+#endif
+
+namespace benchmark {
+#ifdef BENCHMARK_OS_WINDOWS
+// Window's Sleep takes milliseconds argument.
+void SleepForMilliseconds(int milliseconds) { Sleep(milliseconds); }
+void SleepForSeconds(double seconds) {
+ SleepForMilliseconds(static_cast<int>(kNumMillisPerSecond * seconds));
+}
+#else // BENCHMARK_OS_WINDOWS
+void SleepForMicroseconds(int microseconds) {
+ struct timespec sleep_time;
+ sleep_time.tv_sec = microseconds / kNumMicrosPerSecond;
+ sleep_time.tv_nsec = (microseconds % kNumMicrosPerSecond) * kNumNanosPerMicro;
+ while (nanosleep(&sleep_time, &sleep_time) != 0 && errno == EINTR)
+ ; // Ignore signals and wait for the full interval to elapse.
+}
+
+void SleepForMilliseconds(int milliseconds) {
+ SleepForMicroseconds(static_cast<int>(milliseconds) * kNumMicrosPerMilli);
+}
+
+void SleepForSeconds(double seconds) {
+ SleepForMicroseconds(static_cast<int>(seconds * kNumMicrosPerSecond));
+}
+#endif // BENCHMARK_OS_WINDOWS
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/sleep.h b/utils/google-benchmark/src/sleep.h
new file mode 100644
index 000000000000..f1e515ca4f3a
--- /dev/null
+++ b/utils/google-benchmark/src/sleep.h
@@ -0,0 +1,17 @@
+#ifndef BENCHMARK_SLEEP_H_
+#define BENCHMARK_SLEEP_H_
+
+#include <cstdint>
+
+namespace benchmark {
+const int64_t kNumMillisPerSecond = 1000LL;
+const int64_t kNumMicrosPerMilli = 1000LL;
+const int64_t kNumMicrosPerSecond = kNumMillisPerSecond * 1000LL;
+const int64_t kNumNanosPerMicro = 1000LL;
+const int64_t kNumNanosPerSecond = kNumNanosPerMicro * kNumMicrosPerSecond;
+
+void SleepForMilliseconds(int milliseconds);
+void SleepForSeconds(double seconds);
+} // end namespace benchmark
+
+#endif // BENCHMARK_SLEEP_H_
diff --git a/utils/google-benchmark/src/stat.h b/utils/google-benchmark/src/stat.h
new file mode 100644
index 000000000000..136c3aa8d61f
--- /dev/null
+++ b/utils/google-benchmark/src/stat.h
@@ -0,0 +1,306 @@
+#ifndef BENCHMARK_STAT_H_
+#define BENCHMARK_STAT_H_
+
+#include <cmath>
+#include <limits>
+#include <ostream>
+#include <type_traits>
+
+namespace benchmark {
+
+template <typename VType, typename NumType>
+class Stat1;
+
+template <typename VType, typename NumType>
+class Stat1MinMax;
+
+typedef Stat1<float, int64_t> Stat1_f;
+typedef Stat1<double, int64_t> Stat1_d;
+typedef Stat1MinMax<float, int64_t> Stat1MinMax_f;
+typedef Stat1MinMax<double, int64_t> Stat1MinMax_d;
+
+template <typename VType>
+class Vector2;
+template <typename VType>
+class Vector3;
+template <typename VType>
+class Vector4;
+
+template <typename VType, typename NumType>
+class Stat1 {
+ public:
+ typedef Stat1<VType, NumType> Self;
+
+ Stat1() { Clear(); }
+ // Create a sample of value dat and weight 1
+ explicit Stat1(const VType &dat) {
+ sum_ = dat;
+ sum_squares_ = Sqr(dat);
+ numsamples_ = 1;
+ }
+ // Create statistics for all the samples between begin (included)
+ // and end(excluded)
+ explicit Stat1(const VType *begin, const VType *end) {
+ Clear();
+ for (const VType *item = begin; item < end; ++item) {
+ (*this) += Stat1(*item);
+ }
+ }
+ // Create a sample of value dat and weight w
+ Stat1(const VType &dat, const NumType &w) {
+ sum_ = w * dat;
+ sum_squares_ = w * Sqr(dat);
+ numsamples_ = w;
+ }
+ // Copy operator
+ Stat1(const Self &stat) {
+ sum_ = stat.sum_;
+ sum_squares_ = stat.sum_squares_;
+ numsamples_ = stat.numsamples_;
+ }
+
+ void Clear() {
+ numsamples_ = NumType();
+ sum_squares_ = sum_ = VType();
+ }
+
+ Self &operator=(const Self &stat) {
+ sum_ = stat.sum_;
+ sum_squares_ = stat.sum_squares_;
+ numsamples_ = stat.numsamples_;
+ return (*this);
+ }
+ // Merge statistics from two sample sets.
+ Self &operator+=(const Self &stat) {
+ sum_ += stat.sum_;
+ sum_squares_ += stat.sum_squares_;
+ numsamples_ += stat.numsamples_;
+ return (*this);
+ }
+ // The operation opposite to +=
+ Self &operator-=(const Self &stat) {
+ sum_ -= stat.sum_;
+ sum_squares_ -= stat.sum_squares_;
+ numsamples_ -= stat.numsamples_;
+ return (*this);
+ }
+ // Multiply the weight of the set of samples by a factor k
+ Self &operator*=(const VType &k) {
+ sum_ *= k;
+ sum_squares_ *= k;
+ numsamples_ *= k;
+ return (*this);
+ }
+
+ // Merge statistics from two sample sets.
+ Self operator+(const Self &stat) const { return Self(*this) += stat; }
+
+ // The operation opposite to +
+ Self operator-(const Self &stat) const { return Self(*this) -= stat; }
+
+ // Multiply the weight of the set of samples by a factor k
+ Self operator*(const VType &k) const { return Self(*this) *= k; }
+
+ // Return the total weight of this sample set
+ NumType numSamples() const { return numsamples_; }
+
+ // Return the sum of this sample set
+ VType Sum() const { return sum_; }
+
+ // Return the mean of this sample set
+ VType Mean() const {
+ if (numsamples_ == 0) return VType();
+ return sum_ * (1.0 / numsamples_);
+ }
+
+ // Return the mean of this sample set and compute the standard deviation at
+ // the same time.
+ VType Mean(VType *stddev) const {
+ if (numsamples_ == 0) return VType();
+ VType mean = sum_ * (1.0 / numsamples_);
+ if (stddev) {
+ VType avg_squares = sum_squares_ * (1.0 / numsamples_);
+ *stddev = Sqrt(avg_squares - Sqr(mean));
+ }
+ return mean;
+ }
+
+ // Return the standard deviation of the sample set
+ VType StdDev() const {
+ if (numsamples_ == 0) return VType();
+ VType mean = Mean();
+ VType avg_squares = sum_squares_ * (1.0 / numsamples_);
+ return Sqrt(avg_squares - Sqr(mean));
+ }
+
+ private:
+ static_assert(std::is_integral<NumType>::value &&
+ !std::is_same<NumType, bool>::value,
+ "NumType must be an integral type that is not bool.");
+ // Let i be the index of the samples provided (using +=)
+ // and weight[i],value[i] be the data of sample #i
+ // then the variables have the following meaning:
+ NumType numsamples_; // sum of weight[i];
+ VType sum_; // sum of weight[i]*value[i];
+ VType sum_squares_; // sum of weight[i]*value[i]^2;
+
+ // Template function used to square a number.
+ // For a vector we square all components
+ template <typename SType>
+ static inline SType Sqr(const SType &dat) {
+ return dat * dat;
+ }
+
+ template <typename SType>
+ static inline Vector2<SType> Sqr(const Vector2<SType> &dat) {
+ return dat.MulComponents(dat);
+ }
+
+ template <typename SType>
+ static inline Vector3<SType> Sqr(const Vector3<SType> &dat) {
+ return dat.MulComponents(dat);
+ }
+
+ template <typename SType>
+ static inline Vector4<SType> Sqr(const Vector4<SType> &dat) {
+ return dat.MulComponents(dat);
+ }
+
+ // Template function used to take the square root of a number.
+ // For a vector we square all components
+ template <typename SType>
+ static inline SType Sqrt(const SType &dat) {
+ // Avoid NaN due to imprecision in the calculations
+ if (dat < 0) return 0;
+ return sqrt(dat);
+ }
+
+ template <typename SType>
+ static inline Vector2<SType> Sqrt(const Vector2<SType> &dat) {
+ // Avoid NaN due to imprecision in the calculations
+ return Max(dat, Vector2<SType>()).Sqrt();
+ }
+
+ template <typename SType>
+ static inline Vector3<SType> Sqrt(const Vector3<SType> &dat) {
+ // Avoid NaN due to imprecision in the calculations
+ return Max(dat, Vector3<SType>()).Sqrt();
+ }
+
+ template <typename SType>
+ static inline Vector4<SType> Sqrt(const Vector4<SType> &dat) {
+ // Avoid NaN due to imprecision in the calculations
+ return Max(dat, Vector4<SType>()).Sqrt();
+ }
+};
+
+// Useful printing function
+template <typename VType, typename NumType>
+std::ostream &operator<<(std::ostream &out, const Stat1<VType, NumType> &s) {
+ out << "{ avg = " << s.Mean() << " std = " << s.StdDev()
+ << " nsamples = " << s.NumSamples() << "}";
+ return out;
+}
+
+// Stat1MinMax: same as Stat1, but it also
+// keeps the Min and Max values; the "-"
+// operator is disabled because it cannot be implemented
+// efficiently
+template <typename VType, typename NumType>
+class Stat1MinMax : public Stat1<VType, NumType> {
+ public:
+ typedef Stat1MinMax<VType, NumType> Self;
+
+ Stat1MinMax() { Clear(); }
+ // Create a sample of value dat and weight 1
+ explicit Stat1MinMax(const VType &dat) : Stat1<VType, NumType>(dat) {
+ max_ = dat;
+ min_ = dat;
+ }
+ // Create statistics for all the samples between begin (included)
+ // and end(excluded)
+ explicit Stat1MinMax(const VType *begin, const VType *end) {
+ Clear();
+ for (const VType *item = begin; item < end; ++item) {
+ (*this) += Stat1MinMax(*item);
+ }
+ }
+ // Create a sample of value dat and weight w
+ Stat1MinMax(const VType &dat, const NumType &w)
+ : Stat1<VType, NumType>(dat, w) {
+ max_ = dat;
+ min_ = dat;
+ }
+ // Copy operator
+ Stat1MinMax(const Self &stat) : Stat1<VType, NumType>(stat) {
+ max_ = stat.max_;
+ min_ = stat.min_;
+ }
+
+ void Clear() {
+ Stat1<VType, NumType>::Clear();
+ if (std::numeric_limits<VType>::has_infinity) {
+ min_ = std::numeric_limits<VType>::infinity();
+ max_ = -std::numeric_limits<VType>::infinity();
+ } else {
+ min_ = std::numeric_limits<VType>::max();
+ max_ = std::numeric_limits<VType>::min();
+ }
+ }
+
+ Self &operator=(const Self &stat) {
+ this->Stat1<VType, NumType>::operator=(stat);
+ max_ = stat.max_;
+ min_ = stat.min_;
+ return (*this);
+ }
+ // Merge statistics from two sample sets.
+ Self &operator+=(const Self &stat) {
+ this->Stat1<VType, NumType>::operator+=(stat);
+ if (stat.max_ > max_) max_ = stat.max_;
+ if (stat.min_ < min_) min_ = stat.min_;
+ return (*this);
+ }
+ // Multiply the weight of the set of samples by a factor k
+ Self &operator*=(const VType &stat) {
+ this->Stat1<VType, NumType>::operator*=(stat);
+ return (*this);
+ }
+ // Merge statistics from two sample sets.
+ Self operator+(const Self &stat) const { return Self(*this) += stat; }
+ // Multiply the weight of the set of samples by a factor k
+ Self operator*(const VType &k) const { return Self(*this) *= k; }
+
+ // Return the maximal value in this sample set
+ VType Max() const { return max_; }
+ // Return the minimal value in this sample set
+ VType Min() const { return min_; }
+
+ private:
+ // The - operation makes no sense with Min/Max
+ // unless we keep the full list of values (but we don't)
+ // make it private, and let it undefined so nobody can call it
+ Self &operator-=(const Self &stat); // senseless. let it undefined.
+
+ // The operation opposite to -
+ Self operator-(const Self &stat) const; // senseless. let it undefined.
+
+ // Let i be the index of the samples provided (using +=)
+ // and weight[i],value[i] be the data of sample #i
+ // then the variables have the following meaning:
+ VType max_; // max of value[i]
+ VType min_; // min of value[i]
+};
+
+// Useful printing function
+template <typename VType, typename NumType>
+std::ostream &operator<<(std::ostream &out,
+ const Stat1MinMax<VType, NumType> &s) {
+ out << "{ avg = " << s.Mean() << " std = " << s.StdDev()
+ << " nsamples = " << s.NumSamples() << " min = " << s.Min()
+ << " max = " << s.Max() << "}";
+ return out;
+}
+} // end namespace benchmark
+
+#endif // BENCHMARK_STAT_H_
diff --git a/utils/google-benchmark/src/string_util.cc b/utils/google-benchmark/src/string_util.cc
new file mode 100644
index 000000000000..4cefbfba6c27
--- /dev/null
+++ b/utils/google-benchmark/src/string_util.cc
@@ -0,0 +1,168 @@
+#include "string_util.h"
+
+#include <array>
+#include <cmath>
+#include <cstdarg>
+#include <cstdio>
+#include <memory>
+#include <sstream>
+
+#include "arraysize.h"
+
+namespace benchmark {
+namespace {
+
+// kilo, Mega, Giga, Tera, Peta, Exa, Zetta, Yotta.
+const char kBigSIUnits[] = "kMGTPEZY";
+// Kibi, Mebi, Gibi, Tebi, Pebi, Exbi, Zebi, Yobi.
+const char kBigIECUnits[] = "KMGTPEZY";
+// milli, micro, nano, pico, femto, atto, zepto, yocto.
+const char kSmallSIUnits[] = "munpfazy";
+
+// We require that all three arrays have the same size.
+static_assert(arraysize(kBigSIUnits) == arraysize(kBigIECUnits),
+ "SI and IEC unit arrays must be the same size");
+static_assert(arraysize(kSmallSIUnits) == arraysize(kBigSIUnits),
+ "Small SI and Big SI unit arrays must be the same size");
+
+static const int64_t kUnitsSize = arraysize(kBigSIUnits);
+
+} // end anonymous namespace
+
+void ToExponentAndMantissa(double val, double thresh, int precision,
+ double one_k, std::string* mantissa,
+ int64_t* exponent) {
+ std::stringstream mantissa_stream;
+
+ if (val < 0) {
+ mantissa_stream << "-";
+ val = -val;
+ }
+
+ // Adjust threshold so that it never excludes things which can't be rendered
+ // in 'precision' digits.
+ const double adjusted_threshold =
+ std::max(thresh, 1.0 / std::pow(10.0, precision));
+ const double big_threshold = adjusted_threshold * one_k;
+ const double small_threshold = adjusted_threshold;
+
+ if (val > big_threshold) {
+ // Positive powers
+ double scaled = val;
+ for (size_t i = 0; i < arraysize(kBigSIUnits); ++i) {
+ scaled /= one_k;
+ if (scaled <= big_threshold) {
+ mantissa_stream << scaled;
+ *exponent = i + 1;
+ *mantissa = mantissa_stream.str();
+ return;
+ }
+ }
+ mantissa_stream << val;
+ *exponent = 0;
+ } else if (val < small_threshold) {
+ // Negative powers
+ double scaled = val;
+ for (size_t i = 0; i < arraysize(kSmallSIUnits); ++i) {
+ scaled *= one_k;
+ if (scaled >= small_threshold) {
+ mantissa_stream << scaled;
+ *exponent = -static_cast<int64_t>(i + 1);
+ *mantissa = mantissa_stream.str();
+ return;
+ }
+ }
+ mantissa_stream << val;
+ *exponent = 0;
+ } else {
+ mantissa_stream << val;
+ *exponent = 0;
+ }
+ *mantissa = mantissa_stream.str();
+}
+
+std::string ExponentToPrefix(int64_t exponent, bool iec) {
+ if (exponent == 0) return "";
+
+ const int64_t index = (exponent > 0 ? exponent - 1 : -exponent - 1);
+ if (index >= kUnitsSize) return "";
+
+ const char* array =
+ (exponent > 0 ? (iec ? kBigIECUnits : kBigSIUnits) : kSmallSIUnits);
+ if (iec)
+ return array[index] + std::string("i");
+ else
+ return std::string(1, array[index]);
+}
+
+std::string ToBinaryStringFullySpecified(double value, double threshold,
+ int precision) {
+ std::string mantissa;
+ int64_t exponent;
+ ToExponentAndMantissa(value, threshold, precision, 1024.0, &mantissa,
+ &exponent);
+ return mantissa + ExponentToPrefix(exponent, false);
+}
+
+void AppendHumanReadable(int n, std::string* str) {
+ std::stringstream ss;
+ // Round down to the nearest SI prefix.
+ ss << ToBinaryStringFullySpecified(n, 1.0, 0);
+ *str += ss.str();
+}
+
+std::string HumanReadableNumber(double n) {
+ // 1.1 means that figures up to 1.1k should be shown with the next unit down;
+ // this softens edge effects.
+ // 1 means that we should show one decimal place of precision.
+ return ToBinaryStringFullySpecified(n, 1.1, 1);
+}
+
+std::string StringPrintFImp(const char* msg, va_list args) {
+ // we might need a second shot at this, so pre-emptivly make a copy
+ va_list args_cp;
+ va_copy(args_cp, args);
+
+ // TODO(ericwf): use std::array for first attempt to avoid one memory
+ // allocation guess what the size might be
+ std::array<char, 256> local_buff;
+ std::size_t size = local_buff.size();
+ // 2015-10-08: vsnprintf is used instead of snd::vsnprintf due to a limitation
+ // in the android-ndk
+ auto ret = vsnprintf(local_buff.data(), size, msg, args_cp);
+
+ va_end(args_cp);
+
+ // handle empty expansion
+ if (ret == 0) return std::string{};
+ if (static_cast<std::size_t>(ret) < size)
+ return std::string(local_buff.data());
+
+ // we did not provide a long enough buffer on our first attempt.
+ // add 1 to size to account for null-byte in size cast to prevent overflow
+ size = static_cast<std::size_t>(ret) + 1;
+ auto buff_ptr = std::unique_ptr<char[]>(new char[size]);
+ // 2015-10-08: vsnprintf is used instead of snd::vsnprintf due to a limitation
+ // in the android-ndk
+ ret = vsnprintf(buff_ptr.get(), size, msg, args);
+ return std::string(buff_ptr.get());
+}
+
+std::string StringPrintF(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ std::string tmp = StringPrintFImp(format, args);
+ va_end(args);
+ return tmp;
+}
+
+void ReplaceAll(std::string* str, const std::string& from,
+ const std::string& to) {
+ std::size_t start = 0;
+ while ((start = str->find(from, start)) != std::string::npos) {
+ str->replace(start, from.length(), to);
+ start += to.length();
+ }
+}
+
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/string_util.h b/utils/google-benchmark/src/string_util.h
new file mode 100644
index 000000000000..0b190b91a16e
--- /dev/null
+++ b/utils/google-benchmark/src/string_util.h
@@ -0,0 +1,40 @@
+#ifndef BENCHMARK_STRING_UTIL_H_
+#define BENCHMARK_STRING_UTIL_H_
+
+#include <sstream>
+#include <string>
+#include <utility>
+#include "internal_macros.h"
+
+namespace benchmark {
+
+void AppendHumanReadable(int n, std::string* str);
+
+std::string HumanReadableNumber(double n);
+
+std::string StringPrintF(const char* format, ...);
+
+inline std::ostream& StringCatImp(std::ostream& out) BENCHMARK_NOEXCEPT {
+ return out;
+}
+
+template <class First, class... Rest>
+inline std::ostream& StringCatImp(std::ostream& out, First&& f,
+ Rest&&... rest) {
+ out << std::forward<First>(f);
+ return StringCatImp(out, std::forward<Rest>(rest)...);
+}
+
+template <class... Args>
+inline std::string StrCat(Args&&... args) {
+ std::ostringstream ss;
+ StringCatImp(ss, std::forward<Args>(args)...);
+ return ss.str();
+}
+
+void ReplaceAll(std::string* str, const std::string& from,
+ const std::string& to);
+
+} // end namespace benchmark
+
+#endif // BENCHMARK_STRING_UTIL_H_
diff --git a/utils/google-benchmark/src/sysinfo.cc b/utils/google-benchmark/src/sysinfo.cc
new file mode 100644
index 000000000000..dd1e66306e18
--- /dev/null
+++ b/utils/google-benchmark/src/sysinfo.cc
@@ -0,0 +1,348 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "sysinfo.h"
+#include "internal_macros.h"
+
+#ifdef BENCHMARK_OS_WINDOWS
+#include <Shlwapi.h>
+#include <VersionHelpers.h>
+#include <Windows.h>
+#else
+#include <fcntl.h>
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h> // this header must be included before 'sys/sysctl.h' to avoid compilation error on FreeBSD
+#include <unistd.h>
+#if defined BENCHMARK_OS_FREEBSD || defined BENCHMARK_OS_MACOSX
+#include <sys/sysctl.h>
+#endif
+#endif
+
+#include <cerrno>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <limits>
+#include <mutex>
+
+#include "arraysize.h"
+#include "check.h"
+#include "cycleclock.h"
+#include "internal_macros.h"
+#include "log.h"
+#include "sleep.h"
+#include "string_util.h"
+
+namespace benchmark {
+namespace {
+std::once_flag cpuinfo_init;
+double cpuinfo_cycles_per_second = 1.0;
+int cpuinfo_num_cpus = 1; // Conservative guess
+
+#if !defined BENCHMARK_OS_MACOSX
+const int64_t estimate_time_ms = 1000;
+
+// Helper function estimates cycles/sec by observing cycles elapsed during
+// sleep(). Using small sleep time decreases accuracy significantly.
+int64_t EstimateCyclesPerSecond() {
+ const int64_t start_ticks = cycleclock::Now();
+ SleepForMilliseconds(estimate_time_ms);
+ return cycleclock::Now() - start_ticks;
+}
+#endif
+
+#if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN
+// Helper function for reading an int from a file. Returns true if successful
+// and the memory location pointed to by value is set to the value read.
+bool ReadIntFromFile(const char* file, long* value) {
+ bool ret = false;
+ int fd = open(file, O_RDONLY);
+ if (fd != -1) {
+ char line[1024];
+ char* err;
+ memset(line, '\0', sizeof(line));
+ CHECK(read(fd, line, sizeof(line) - 1));
+ const long temp_value = strtol(line, &err, 10);
+ if (line[0] != '\0' && (*err == '\n' || *err == '\0')) {
+ *value = temp_value;
+ ret = true;
+ }
+ close(fd);
+ }
+ return ret;
+}
+#endif
+
+#if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN
+static std::string convertToLowerCase(std::string s) {
+ for (auto& ch : s)
+ ch = std::tolower(ch);
+ return s;
+}
+static bool startsWithKey(std::string Value, std::string Key,
+ bool IgnoreCase = true) {
+ if (IgnoreCase) {
+ Key = convertToLowerCase(std::move(Key));
+ Value = convertToLowerCase(std::move(Value));
+ }
+ return Value.compare(0, Key.size(), Key) == 0;
+}
+#endif
+
+void InitializeSystemInfo() {
+#if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN
+ char line[1024];
+ char* err;
+ long freq;
+
+ bool saw_mhz = false;
+
+ // If the kernel is exporting the tsc frequency use that. There are issues
+ // where cpuinfo_max_freq cannot be relied on because the BIOS may be
+ // exporintg an invalid p-state (on x86) or p-states may be used to put the
+ // processor in a new mode (turbo mode). Essentially, those frequencies
+ // cannot always be relied upon. The same reasons apply to /proc/cpuinfo as
+ // well.
+ if (!saw_mhz &&
+ ReadIntFromFile("/sys/devices/system/cpu/cpu0/tsc_freq_khz", &freq)) {
+ // The value is in kHz (as the file name suggests). For example, on a
+ // 2GHz warpstation, the file contains the value "2000000".
+ cpuinfo_cycles_per_second = freq * 1000.0;
+ saw_mhz = true;
+ }
+
+ // If CPU scaling is in effect, we want to use the *maximum* frequency,
+ // not whatever CPU speed some random processor happens to be using now.
+ if (!saw_mhz &&
+ ReadIntFromFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq",
+ &freq)) {
+ // The value is in kHz. For example, on a 2GHz warpstation, the file
+ // contains the value "2000000".
+ cpuinfo_cycles_per_second = freq * 1000.0;
+ saw_mhz = true;
+ }
+
+ // Read /proc/cpuinfo for other values, and if there is no cpuinfo_max_freq.
+ const char* pname = "/proc/cpuinfo";
+ int fd = open(pname, O_RDONLY);
+ if (fd == -1) {
+ perror(pname);
+ if (!saw_mhz) {
+ cpuinfo_cycles_per_second =
+ static_cast<double>(EstimateCyclesPerSecond());
+ }
+ return;
+ }
+
+ double bogo_clock = 1.0;
+ bool saw_bogo = false;
+ long max_cpu_id = 0;
+ int num_cpus = 0;
+ line[0] = line[1] = '\0';
+ size_t chars_read = 0;
+ do { // we'll exit when the last read didn't read anything
+ // Move the next line to the beginning of the buffer
+ const size_t oldlinelen = strlen(line);
+ if (sizeof(line) == oldlinelen + 1) // oldlinelen took up entire line
+ line[0] = '\0';
+ else // still other lines left to save
+ memmove(line, line + oldlinelen + 1, sizeof(line) - (oldlinelen + 1));
+ // Terminate the new line, reading more if we can't find the newline
+ char* newline = strchr(line, '\n');
+ if (newline == nullptr) {
+ const size_t linelen = strlen(line);
+ const size_t bytes_to_read = sizeof(line) - 1 - linelen;
+ CHECK(bytes_to_read > 0); // because the memmove recovered >=1 bytes
+ chars_read = read(fd, line + linelen, bytes_to_read);
+ line[linelen + chars_read] = '\0';
+ newline = strchr(line, '\n');
+ }
+ if (newline != nullptr) *newline = '\0';
+
+ // When parsing the "cpu MHz" and "bogomips" (fallback) entries, we only
+ // accept postive values. Some environments (virtual machines) report zero,
+ // which would cause infinite looping in WallTime_Init.
+ if (!saw_mhz && startsWithKey(line, "cpu MHz")) {
+ const char* freqstr = strchr(line, ':');
+ if (freqstr) {
+ cpuinfo_cycles_per_second = strtod(freqstr + 1, &err) * 1000000.0;
+ if (freqstr[1] != '\0' && *err == '\0' && cpuinfo_cycles_per_second > 0)
+ saw_mhz = true;
+ }
+ } else if (startsWithKey(line, "bogomips")) {
+ const char* freqstr = strchr(line, ':');
+ if (freqstr) {
+ bogo_clock = strtod(freqstr + 1, &err) * 1000000.0;
+ if (freqstr[1] != '\0' && *err == '\0' && bogo_clock > 0)
+ saw_bogo = true;
+ }
+ } else if (startsWithKey(line, "processor", /*IgnoreCase*/false)) {
+ // The above comparison is case-sensitive because ARM kernels often
+ // include a "Processor" line that tells you about the CPU, distinct
+ // from the usual "processor" lines that give you CPU ids. No current
+ // Linux architecture is using "Processor" for CPU ids.
+ num_cpus++; // count up every time we see an "processor :" entry
+ const char* id_str = strchr(line, ':');
+ if (id_str) {
+ const long cpu_id = strtol(id_str + 1, &err, 10);
+ if (id_str[1] != '\0' && *err == '\0' && max_cpu_id < cpu_id)
+ max_cpu_id = cpu_id;
+ }
+ }
+ } while (chars_read > 0);
+ close(fd);
+
+ if (!saw_mhz) {
+ if (saw_bogo) {
+ // If we didn't find anything better, we'll use bogomips, but
+ // we're not happy about it.
+ cpuinfo_cycles_per_second = bogo_clock;
+ } else {
+ // If we don't even have bogomips, we'll use the slow estimation.
+ cpuinfo_cycles_per_second =
+ static_cast<double>(EstimateCyclesPerSecond());
+ }
+ }
+ if (num_cpus == 0) {
+ fprintf(stderr, "Failed to read num. CPUs correctly from /proc/cpuinfo\n");
+ } else {
+ if ((max_cpu_id + 1) != num_cpus) {
+ fprintf(stderr,
+ "CPU ID assignments in /proc/cpuinfo seem messed up."
+ " This is usually caused by a bad BIOS.\n");
+ }
+ cpuinfo_num_cpus = num_cpus;
+ }
+
+#elif defined BENCHMARK_OS_FREEBSD
+// For this sysctl to work, the machine must be configured without
+// SMP, APIC, or APM support. hz should be 64-bit in freebsd 7.0
+// and later. Before that, it's a 32-bit quantity (and gives the
+// wrong answer on machines faster than 2^32 Hz). See
+// http://lists.freebsd.org/pipermail/freebsd-i386/2004-November/001846.html
+// But also compare FreeBSD 7.0:
+// http://fxr.watson.org/fxr/source/i386/i386/tsc.c?v=RELENG70#L223
+// 231 error = sysctl_handle_quad(oidp, &freq, 0, req);
+// To FreeBSD 6.3 (it's the same in 6-STABLE):
+// http://fxr.watson.org/fxr/source/i386/i386/tsc.c?v=RELENG6#L131
+// 139 error = sysctl_handle_int(oidp, &freq, sizeof(freq), req);
+#if __FreeBSD__ >= 7
+ uint64_t hz = 0;
+#else
+ unsigned int hz = 0;
+#endif
+ size_t sz = sizeof(hz);
+ const char* sysctl_path = "machdep.tsc_freq";
+ if (sysctlbyname(sysctl_path, &hz, &sz, nullptr, 0) != 0) {
+ fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n",
+ sysctl_path, strerror(errno));
+ cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond());
+ } else {
+ cpuinfo_cycles_per_second = hz;
+ }
+// TODO: also figure out cpuinfo_num_cpus
+
+#elif defined BENCHMARK_OS_WINDOWS
+ // In NT, read MHz from the registry. If we fail to do so or we're in win9x
+ // then make a crude estimate.
+ DWORD data, data_size = sizeof(data);
+ if (IsWindowsXPOrGreater() &&
+ SUCCEEDED(
+ SHGetValueA(HKEY_LOCAL_MACHINE,
+ "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
+ "~MHz", nullptr, &data, &data_size)))
+ cpuinfo_cycles_per_second =
+ static_cast<double>((int64_t)data * (int64_t)(1000 * 1000)); // was mhz
+ else
+ cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond());
+
+ SYSTEM_INFO sysinfo;
+ // Use memset as opposed to = {} to avoid GCC missing initializer false
+ // positives.
+ std::memset(&sysinfo, 0, sizeof(SYSTEM_INFO));
+ GetSystemInfo(&sysinfo);
+ cpuinfo_num_cpus = sysinfo.dwNumberOfProcessors; // number of logical
+ // processors in the current
+ // group
+
+#elif defined BENCHMARK_OS_MACOSX
+ int32_t num_cpus = 0;
+ size_t size = sizeof(num_cpus);
+ if (::sysctlbyname("hw.ncpu", &num_cpus, &size, nullptr, 0) == 0 &&
+ (size == sizeof(num_cpus))) {
+ cpuinfo_num_cpus = num_cpus;
+ } else {
+ fprintf(stderr, "%s\n", strerror(errno));
+ std::exit(EXIT_FAILURE);
+ }
+ int64_t cpu_freq = 0;
+ size = sizeof(cpu_freq);
+ if (::sysctlbyname("hw.cpufrequency", &cpu_freq, &size, nullptr, 0) == 0 &&
+ (size == sizeof(cpu_freq))) {
+ cpuinfo_cycles_per_second = cpu_freq;
+ } else {
+ fprintf(stderr, "%s\n", strerror(errno));
+ std::exit(EXIT_FAILURE);
+ }
+#else
+ // Generic cycles per second counter
+ cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond());
+#endif
+}
+
+} // end namespace
+
+double CyclesPerSecond(void) {
+ std::call_once(cpuinfo_init, InitializeSystemInfo);
+ return cpuinfo_cycles_per_second;
+}
+
+int NumCPUs(void) {
+ std::call_once(cpuinfo_init, InitializeSystemInfo);
+ return cpuinfo_num_cpus;
+}
+
+// The ""'s catch people who don't pass in a literal for "str"
+#define strliterallen(str) (sizeof("" str "") - 1)
+
+// Must use a string literal for prefix.
+#define memprefix(str, len, prefix) \
+ ((((len) >= strliterallen(prefix)) && \
+ std::memcmp(str, prefix, strliterallen(prefix)) == 0) \
+ ? str + strliterallen(prefix) \
+ : nullptr)
+
+bool CpuScalingEnabled() {
+#ifndef BENCHMARK_OS_WINDOWS
+ // On Linux, the CPUfreq subsystem exposes CPU information as files on the
+ // local file system. If reading the exported files fails, then we may not be
+ // running on Linux, so we silently ignore all the read errors.
+ for (int cpu = 0, num_cpus = NumCPUs(); cpu < num_cpus; ++cpu) {
+ std::string governor_file =
+ StrCat("/sys/devices/system/cpu/cpu", cpu, "/cpufreq/scaling_governor");
+ FILE* file = fopen(governor_file.c_str(), "r");
+ if (!file) break;
+ char buff[16];
+ size_t bytes_read = fread(buff, 1, sizeof(buff), file);
+ fclose(file);
+ if (memprefix(buff, bytes_read, "performance") == nullptr) return true;
+ }
+#endif
+ return false;
+}
+
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/sysinfo.h b/utils/google-benchmark/src/sysinfo.h
new file mode 100644
index 000000000000..c5d9916d2dde
--- /dev/null
+++ b/utils/google-benchmark/src/sysinfo.h
@@ -0,0 +1,10 @@
+#ifndef BENCHMARK_SYSINFO_H_
+#define BENCHMARK_SYSINFO_H_
+
+namespace benchmark {
+int NumCPUs();
+double CyclesPerSecond();
+bool CpuScalingEnabled();
+} // end namespace benchmark
+
+#endif // BENCHMARK_SYSINFO_H_
diff --git a/utils/google-benchmark/src/timers.cc b/utils/google-benchmark/src/timers.cc
new file mode 100644
index 000000000000..fadc08f791e7
--- /dev/null
+++ b/utils/google-benchmark/src/timers.cc
@@ -0,0 +1,195 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "timers.h"
+#include "internal_macros.h"
+
+#ifdef BENCHMARK_OS_WINDOWS
+#include <Shlwapi.h>
+#include <VersionHelpers.h>
+#include <Windows.h>
+#else
+#include <fcntl.h>
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h> // this header must be included before 'sys/sysctl.h' to avoid compilation error on FreeBSD
+#include <unistd.h>
+#if defined BENCHMARK_OS_FREEBSD || defined BENCHMARK_OS_MACOSX
+#include <sys/sysctl.h>
+#endif
+#if defined(BENCHMARK_OS_MACOSX)
+#include <mach/mach_init.h>
+#include <mach/mach_port.h>
+#include <mach/thread_act.h>
+#endif
+#endif
+
+#include <cerrno>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <iostream>
+#include <limits>
+#include <mutex>
+
+#include "check.h"
+#include "log.h"
+#include "sleep.h"
+#include "string_util.h"
+
+namespace benchmark {
+
+// Suppress unused warnings on helper functions.
+#if defined(__GNUC__)
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+
+namespace {
+#if defined(BENCHMARK_OS_WINDOWS)
+double MakeTime(FILETIME const& kernel_time, FILETIME const& user_time) {
+ ULARGE_INTEGER kernel;
+ ULARGE_INTEGER user;
+ kernel.HighPart = kernel_time.dwHighDateTime;
+ kernel.LowPart = kernel_time.dwLowDateTime;
+ user.HighPart = user_time.dwHighDateTime;
+ user.LowPart = user_time.dwLowDateTime;
+ return (static_cast<double>(kernel.QuadPart) +
+ static_cast<double>(user.QuadPart)) *
+ 1e-7;
+}
+#else
+double MakeTime(struct rusage const& ru) {
+ return (static_cast<double>(ru.ru_utime.tv_sec) +
+ static_cast<double>(ru.ru_utime.tv_usec) * 1e-6 +
+ static_cast<double>(ru.ru_stime.tv_sec) +
+ static_cast<double>(ru.ru_stime.tv_usec) * 1e-6);
+}
+#endif
+#if defined(BENCHMARK_OS_MACOSX)
+double MakeTime(thread_basic_info_data_t const& info) {
+ return (static_cast<double>(info.user_time.seconds) +
+ static_cast<double>(info.user_time.microseconds) * 1e-6 +
+ static_cast<double>(info.system_time.seconds) +
+ static_cast<double>(info.system_time.microseconds) * 1e-6);
+}
+#endif
+#if defined(CLOCK_PROCESS_CPUTIME_ID) || defined(CLOCK_THREAD_CPUTIME_ID)
+double MakeTime(struct timespec const& ts) {
+ return ts.tv_sec + (static_cast<double>(ts.tv_nsec) * 1e-9);
+}
+#endif
+
+BENCHMARK_NORETURN static void DiagnoseAndExit(const char* msg) {
+ std::cerr << "ERROR: " << msg << std::endl;
+ std::exit(EXIT_FAILURE);
+}
+
+} // end namespace
+
+double ProcessCPUUsage() {
+// FIXME We want to use clock_gettime, but its not available in MacOS 10.11. See
+// https://github.com/google/benchmark/pull/292
+#if defined(CLOCK_PROCESS_CPUTIME_ID) && !defined(BENCHMARK_OS_MACOSX)
+ struct timespec spec;
+ if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &spec) == 0)
+ return MakeTime(spec);
+ DiagnoseAndExit("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...) failed");
+#elif defined(BENCHMARK_OS_WINDOWS)
+ HANDLE proc = GetCurrentProcess();
+ FILETIME creation_time;
+ FILETIME exit_time;
+ FILETIME kernel_time;
+ FILETIME user_time;
+ if (GetProcessTimes(proc, &creation_time, &exit_time, &kernel_time,
+ &user_time))
+ return MakeTime(kernel_time, user_time);
+ DiagnoseAndExit("GetProccessTimes() failed");
+#else
+ struct rusage ru;
+ if (getrusage(RUSAGE_SELF, &ru) == 0) return MakeTime(ru);
+ DiagnoseAndExit("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...) failed");
+#endif
+}
+
+double ThreadCPUUsage() {
+// FIXME We want to use clock_gettime, but its not available in MacOS 10.11. See
+// https://github.com/google/benchmark/pull/292
+#if defined(CLOCK_THREAD_CPUTIME_ID) && !defined(BENCHMARK_OS_MACOSX)
+ struct timespec ts;
+ if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0) return MakeTime(ts);
+ DiagnoseAndExit("clock_gettime(CLOCK_THREAD_CPUTIME_ID, ...) failed");
+#elif defined(BENCHMARK_OS_WINDOWS)
+ HANDLE this_thread = GetCurrentThread();
+ FILETIME creation_time;
+ FILETIME exit_time;
+ FILETIME kernel_time;
+ FILETIME user_time;
+ GetThreadTimes(this_thread, &creation_time, &exit_time, &kernel_time,
+ &user_time);
+ return MakeTime(kernel_time, user_time);
+#elif defined(BENCHMARK_OS_MACOSX)
+ mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT;
+ thread_basic_info_data_t info;
+ mach_port_t thread = pthread_mach_thread_np(pthread_self());
+ if (thread_info(thread, THREAD_BASIC_INFO, (thread_info_t)&info, &count) ==
+ KERN_SUCCESS) {
+ return MakeTime(info);
+ }
+ DiagnoseAndExit("ThreadCPUUsage() failed when evaluating thread_info");
+#else
+#error Per-thread timing is not available on your system.
+#endif
+}
+
+namespace {
+
+std::string DateTimeString(bool local) {
+ typedef std::chrono::system_clock Clock;
+ std::time_t now = Clock::to_time_t(Clock::now());
+ const std::size_t kStorageSize = 128;
+ char storage[kStorageSize];
+ std::size_t written;
+
+ if (local) {
+#if defined(BENCHMARK_OS_WINDOWS)
+ written =
+ std::strftime(storage, sizeof(storage), "%x %X", ::localtime(&now));
+#else
+ std::tm timeinfo;
+ std::memset(&timeinfo, 0, sizeof(std::tm));
+ ::localtime_r(&now, &timeinfo);
+ written = std::strftime(storage, sizeof(storage), "%F %T", &timeinfo);
+#endif
+ } else {
+#if defined(BENCHMARK_OS_WINDOWS)
+ written = std::strftime(storage, sizeof(storage), "%x %X", ::gmtime(&now));
+#else
+ std::tm timeinfo;
+ std::memset(&timeinfo, 0, sizeof(std::tm));
+ ::gmtime_r(&now, &timeinfo);
+ written = std::strftime(storage, sizeof(storage), "%F %T", &timeinfo);
+#endif
+ }
+ CHECK(written < kStorageSize);
+ ((void)written); // prevent unused variable in optimized mode.
+ return std::string(storage);
+}
+
+} // end namespace
+
+std::string LocalDateTimeString() { return DateTimeString(true); }
+
+} // end namespace benchmark
diff --git a/utils/google-benchmark/src/timers.h b/utils/google-benchmark/src/timers.h
new file mode 100644
index 000000000000..65606ccd93d1
--- /dev/null
+++ b/utils/google-benchmark/src/timers.h
@@ -0,0 +1,48 @@
+#ifndef BENCHMARK_TIMERS_H
+#define BENCHMARK_TIMERS_H
+
+#include <chrono>
+#include <string>
+
+namespace benchmark {
+
+// Return the CPU usage of the current process
+double ProcessCPUUsage();
+
+// Return the CPU usage of the children of the current process
+double ChildrenCPUUsage();
+
+// Return the CPU usage of the current thread
+double ThreadCPUUsage();
+
+#if defined(HAVE_STEADY_CLOCK)
+template <bool HighResIsSteady = std::chrono::high_resolution_clock::is_steady>
+struct ChooseSteadyClock {
+ typedef std::chrono::high_resolution_clock type;
+};
+
+template <>
+struct ChooseSteadyClock<false> {
+ typedef std::chrono::steady_clock type;
+};
+#endif
+
+struct ChooseClockType {
+#if defined(HAVE_STEADY_CLOCK)
+ typedef ChooseSteadyClock<>::type type;
+#else
+ typedef std::chrono::high_resolution_clock type;
+#endif
+};
+
+inline double ChronoClockNow() {
+ typedef ChooseClockType::type ClockType;
+ using FpSeconds = std::chrono::duration<double, std::chrono::seconds::period>;
+ return FpSeconds(ClockType::now().time_since_epoch()).count();
+}
+
+std::string LocalDateTimeString();
+
+} // end namespace benchmark
+
+#endif // BENCHMARK_TIMERS_H
diff --git a/utils/google-benchmark/test/CMakeLists.txt b/utils/google-benchmark/test/CMakeLists.txt
new file mode 100644
index 000000000000..87245984dd4c
--- /dev/null
+++ b/utils/google-benchmark/test/CMakeLists.txt
@@ -0,0 +1,139 @@
+# Enable the tests
+
+find_package(Threads REQUIRED)
+
+# NOTE: These flags must be added after find_package(Threads REQUIRED) otherwise
+# they will break the configuration check.
+if (DEFINED BENCHMARK_CXX_LINKER_FLAGS)
+ list(APPEND CMAKE_EXE_LINKER_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS})
+endif()
+
+add_library(output_test_helper STATIC output_test_helper.cc)
+
+macro(compile_benchmark_test name)
+ add_executable(${name} "${name}.cc")
+ target_link_libraries(${name} benchmark ${CMAKE_THREAD_LIBS_INIT})
+endmacro(compile_benchmark_test)
+
+
+macro(compile_output_test name)
+ add_executable(${name} "${name}.cc" output_test.h)
+ target_link_libraries(${name} output_test_helper benchmark
+ ${BENCHMARK_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+endmacro(compile_output_test)
+
+
+# Demonstration executable
+compile_benchmark_test(benchmark_test)
+add_test(benchmark benchmark_test --benchmark_min_time=0.01)
+
+compile_benchmark_test(filter_test)
+macro(add_filter_test name filter expect)
+ add_test(${name} filter_test --benchmark_min_time=0.01 --benchmark_filter=${filter} ${expect})
+ add_test(${name}_list_only filter_test --benchmark_list_tests --benchmark_filter=${filter} ${expect})
+endmacro(add_filter_test)
+
+add_filter_test(filter_simple "Foo" 3)
+add_filter_test(filter_suffix "BM_.*" 4)
+add_filter_test(filter_regex_all ".*" 5)
+add_filter_test(filter_regex_blank "" 5)
+add_filter_test(filter_regex_none "monkey" 0)
+add_filter_test(filter_regex_wildcard ".*Foo.*" 3)
+add_filter_test(filter_regex_begin "^BM_.*" 4)
+add_filter_test(filter_regex_begin2 "^N" 1)
+add_filter_test(filter_regex_end ".*Ba$" 1)
+
+compile_benchmark_test(options_test)
+add_test(options_benchmarks options_test --benchmark_min_time=0.01)
+
+compile_benchmark_test(basic_test)
+add_test(basic_benchmark basic_test --benchmark_min_time=0.01)
+
+compile_benchmark_test(diagnostics_test)
+add_test(diagnostics_test diagnostics_test --benchmark_min_time=0.01)
+
+compile_benchmark_test(skip_with_error_test)
+add_test(skip_with_error_test skip_with_error_test --benchmark_min_time=0.01)
+
+compile_benchmark_test(donotoptimize_test)
+add_test(donotoptimize_test donotoptimize_test --benchmark_min_time=0.01)
+
+compile_benchmark_test(fixture_test)
+add_test(fixture_test fixture_test --benchmark_min_time=0.01)
+
+compile_benchmark_test(register_benchmark_test)
+add_test(register_benchmark_test register_benchmark_test --benchmark_min_time=0.01)
+
+compile_benchmark_test(map_test)
+add_test(map_test map_test --benchmark_min_time=0.01)
+
+compile_benchmark_test(multiple_ranges_test)
+add_test(multiple_ranges_test multiple_ranges_test --benchmark_min_time=0.01)
+
+compile_output_test(reporter_output_test)
+add_test(reporter_output_test reporter_output_test --benchmark_min_time=0.01)
+
+check_cxx_compiler_flag(-std=c++03 BENCHMARK_HAS_CXX03_FLAG)
+if (BENCHMARK_HAS_CXX03_FLAG)
+ set(CXX03_FLAGS "${CMAKE_CXX_FLAGS}")
+ string(REPLACE "-std=c++11" "-std=c++03" CXX03_FLAGS "${CXX03_FLAGS}")
+ string(REPLACE "-std=c++0x" "-std=c++03" CXX03_FLAGS "${CXX03_FLAGS}")
+
+ compile_benchmark_test(cxx03_test)
+ set_target_properties(cxx03_test
+ PROPERTIES COMPILE_FLAGS "${CXX03_FLAGS}")
+ add_test(cxx03 cxx03_test --benchmark_min_time=0.01)
+endif()
+
+# Attempt to work around flaky test failures when running on Appveyor servers.
+if (DEFINED ENV{APPVEYOR})
+ set(COMPLEXITY_MIN_TIME "0.5")
+else()
+ set(COMPLEXITY_MIN_TIME "0.01")
+endif()
+compile_output_test(complexity_test)
+add_test(complexity_benchmark complexity_test --benchmark_min_time=${COMPLEXITY_MIN_TIME})
+
+# Add the coverage command(s)
+if(CMAKE_BUILD_TYPE)
+ string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
+endif()
+if (${CMAKE_BUILD_TYPE_LOWER} MATCHES "coverage")
+ find_program(GCOV gcov)
+ find_program(LCOV lcov)
+ find_program(GENHTML genhtml)
+ find_program(CTEST ctest)
+ if (GCOV AND LCOV AND GENHTML AND CTEST AND HAVE_CXX_FLAG_COVERAGE)
+ add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/lcov/index.html
+ COMMAND ${LCOV} -q -z -d .
+ COMMAND ${LCOV} -q --no-external -c -b "${CMAKE_SOURCE_DIR}" -d . -o before.lcov -i
+ COMMAND ${CTEST} --force-new-ctest-process
+ COMMAND ${LCOV} -q --no-external -c -b "${CMAKE_SOURCE_DIR}" -d . -o after.lcov
+ COMMAND ${LCOV} -q -a before.lcov -a after.lcov --output-file final.lcov
+ COMMAND ${LCOV} -q -r final.lcov "'${CMAKE_SOURCE_DIR}/test/*'" -o final.lcov
+ COMMAND ${GENHTML} final.lcov -o lcov --demangle-cpp --sort -p "${CMAKE_BINARY_DIR}" -t benchmark
+ DEPENDS filter_test benchmark_test options_test basic_test fixture_test cxx03_test complexity_test
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ COMMENT "Running LCOV"
+ )
+ add_custom_target(coverage
+ DEPENDS ${CMAKE_BINARY_DIR}/lcov/index.html
+ COMMENT "LCOV report at lcov/index.html"
+ )
+ message(STATUS "Coverage command added")
+ else()
+ if (HAVE_CXX_FLAG_COVERAGE)
+ set(CXX_FLAG_COVERAGE_MESSAGE supported)
+ else()
+ set(CXX_FLAG_COVERAGE_MESSAGE unavailable)
+ endif()
+ message(WARNING
+ "Coverage not available:\n"
+ " gcov: ${GCOV}\n"
+ " lcov: ${LCOV}\n"
+ " genhtml: ${GENHTML}\n"
+ " ctest: ${CTEST}\n"
+ " --coverage flag: ${CXX_FLAG_COVERAGE_MESSAGE}")
+ endif()
+endif()
diff --git a/utils/google-benchmark/test/basic_test.cc b/utils/google-benchmark/test/basic_test.cc
new file mode 100644
index 000000000000..22de007cb6dd
--- /dev/null
+++ b/utils/google-benchmark/test/basic_test.cc
@@ -0,0 +1,99 @@
+
+#include "benchmark/benchmark_api.h"
+
+#define BASIC_BENCHMARK_TEST(x) BENCHMARK(x)->Arg(8)->Arg(512)->Arg(8192)
+
+void BM_empty(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ benchmark::DoNotOptimize(state.iterations());
+ }
+}
+BENCHMARK(BM_empty);
+BENCHMARK(BM_empty)->ThreadPerCpu();
+
+void BM_spin_empty(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ for (int x = 0; x < state.range(0); ++x) {
+ benchmark::DoNotOptimize(x);
+ }
+ }
+}
+BASIC_BENCHMARK_TEST(BM_spin_empty);
+BASIC_BENCHMARK_TEST(BM_spin_empty)->ThreadPerCpu();
+
+void BM_spin_pause_before(benchmark::State& state) {
+ for (int i = 0; i < state.range(0); ++i) {
+ benchmark::DoNotOptimize(i);
+ }
+ while (state.KeepRunning()) {
+ for (int i = 0; i < state.range(0); ++i) {
+ benchmark::DoNotOptimize(i);
+ }
+ }
+}
+BASIC_BENCHMARK_TEST(BM_spin_pause_before);
+BASIC_BENCHMARK_TEST(BM_spin_pause_before)->ThreadPerCpu();
+
+void BM_spin_pause_during(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ state.PauseTiming();
+ for (int i = 0; i < state.range(0); ++i) {
+ benchmark::DoNotOptimize(i);
+ }
+ state.ResumeTiming();
+ for (int i = 0; i < state.range(0); ++i) {
+ benchmark::DoNotOptimize(i);
+ }
+ }
+}
+BASIC_BENCHMARK_TEST(BM_spin_pause_during);
+BASIC_BENCHMARK_TEST(BM_spin_pause_during)->ThreadPerCpu();
+
+void BM_pause_during(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ state.PauseTiming();
+ state.ResumeTiming();
+ }
+}
+BENCHMARK(BM_pause_during);
+BENCHMARK(BM_pause_during)->ThreadPerCpu();
+BENCHMARK(BM_pause_during)->UseRealTime();
+BENCHMARK(BM_pause_during)->UseRealTime()->ThreadPerCpu();
+
+void BM_spin_pause_after(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ for (int i = 0; i < state.range(0); ++i) {
+ benchmark::DoNotOptimize(i);
+ }
+ }
+ for (int i = 0; i < state.range(0); ++i) {
+ benchmark::DoNotOptimize(i);
+ }
+}
+BASIC_BENCHMARK_TEST(BM_spin_pause_after);
+BASIC_BENCHMARK_TEST(BM_spin_pause_after)->ThreadPerCpu();
+
+void BM_spin_pause_before_and_after(benchmark::State& state) {
+ for (int i = 0; i < state.range(0); ++i) {
+ benchmark::DoNotOptimize(i);
+ }
+ while (state.KeepRunning()) {
+ for (int i = 0; i < state.range(0); ++i) {
+ benchmark::DoNotOptimize(i);
+ }
+ }
+ for (int i = 0; i < state.range(0); ++i) {
+ benchmark::DoNotOptimize(i);
+ }
+}
+BASIC_BENCHMARK_TEST(BM_spin_pause_before_and_after);
+BASIC_BENCHMARK_TEST(BM_spin_pause_before_and_after)->ThreadPerCpu();
+
+void BM_empty_stop_start(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_empty_stop_start);
+BENCHMARK(BM_empty_stop_start)->ThreadPerCpu();
+
+BENCHMARK_MAIN()
diff --git a/utils/google-benchmark/test/benchmark_test.cc b/utils/google-benchmark/test/benchmark_test.cc
new file mode 100644
index 000000000000..d832f81ae433
--- /dev/null
+++ b/utils/google-benchmark/test/benchmark_test.cc
@@ -0,0 +1,241 @@
+#include "benchmark/benchmark.h"
+
+#include <assert.h>
+#include <math.h>
+#include <stdint.h>
+
+#include <chrono>
+#include <cstdlib>
+#include <iostream>
+#include <limits>
+#include <list>
+#include <map>
+#include <mutex>
+#include <set>
+#include <sstream>
+#include <string>
+#include <thread>
+#include <utility>
+#include <vector>
+
+#if defined(__GNUC__)
+#define BENCHMARK_NOINLINE __attribute__((noinline))
+#else
+#define BENCHMARK_NOINLINE
+#endif
+
+namespace {
+
+int BENCHMARK_NOINLINE Factorial(uint32_t n) {
+ return (n == 1) ? 1 : n * Factorial(n - 1);
+}
+
+double CalculatePi(int depth) {
+ double pi = 0.0;
+ for (int i = 0; i < depth; ++i) {
+ double numerator = static_cast<double>(((i % 2) * 2) - 1);
+ double denominator = static_cast<double>((2 * i) - 1);
+ pi += numerator / denominator;
+ }
+ return (pi - 1.0) * 4;
+}
+
+std::set<int> ConstructRandomSet(int size) {
+ std::set<int> s;
+ for (int i = 0; i < size; ++i) s.insert(i);
+ return s;
+}
+
+std::mutex test_vector_mu;
+std::vector<int>* test_vector = nullptr;
+
+} // end namespace
+
+static void BM_Factorial(benchmark::State& state) {
+ int fac_42 = 0;
+ while (state.KeepRunning()) fac_42 = Factorial(8);
+ // Prevent compiler optimizations
+ std::stringstream ss;
+ ss << fac_42;
+ state.SetLabel(ss.str());
+}
+BENCHMARK(BM_Factorial);
+BENCHMARK(BM_Factorial)->UseRealTime();
+
+static void BM_CalculatePiRange(benchmark::State& state) {
+ double pi = 0.0;
+ while (state.KeepRunning()) pi = CalculatePi(state.range(0));
+ std::stringstream ss;
+ ss << pi;
+ state.SetLabel(ss.str());
+}
+BENCHMARK_RANGE(BM_CalculatePiRange, 1, 1024 * 1024);
+
+static void BM_CalculatePi(benchmark::State& state) {
+ static const int depth = 1024;
+ while (state.KeepRunning()) {
+ benchmark::DoNotOptimize(CalculatePi(depth));
+ }
+}
+BENCHMARK(BM_CalculatePi)->Threads(8);
+BENCHMARK(BM_CalculatePi)->ThreadRange(1, 32);
+BENCHMARK(BM_CalculatePi)->ThreadPerCpu();
+
+static void BM_SetInsert(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ state.PauseTiming();
+ std::set<int> data = ConstructRandomSet(state.range(0));
+ state.ResumeTiming();
+ for (int j = 0; j < state.range(1); ++j) data.insert(rand());
+ }
+ state.SetItemsProcessed(state.iterations() * state.range(1));
+ state.SetBytesProcessed(state.iterations() * state.range(1) * sizeof(int));
+}
+BENCHMARK(BM_SetInsert)->Ranges({{1 << 10, 8 << 10}, {1, 10}});
+
+template <typename Container,
+ typename ValueType = typename Container::value_type>
+static void BM_Sequential(benchmark::State& state) {
+ ValueType v = 42;
+ while (state.KeepRunning()) {
+ Container c;
+ for (int i = state.range(0); --i;) c.push_back(v);
+ }
+ const size_t items_processed = state.iterations() * state.range(0);
+ state.SetItemsProcessed(items_processed);
+ state.SetBytesProcessed(items_processed * sizeof(v));
+}
+BENCHMARK_TEMPLATE2(BM_Sequential, std::vector<int>, int)
+ ->Range(1 << 0, 1 << 10);
+BENCHMARK_TEMPLATE(BM_Sequential, std::list<int>)->Range(1 << 0, 1 << 10);
+// Test the variadic version of BENCHMARK_TEMPLATE in C++11 and beyond.
+#if __cplusplus >= 201103L
+BENCHMARK_TEMPLATE(BM_Sequential, std::vector<int>, int)->Arg(512);
+#endif
+
+static void BM_StringCompare(benchmark::State& state) {
+ std::string s1(state.range(0), '-');
+ std::string s2(state.range(0), '-');
+ while (state.KeepRunning()) benchmark::DoNotOptimize(s1.compare(s2));
+}
+BENCHMARK(BM_StringCompare)->Range(1, 1 << 20);
+
+static void BM_SetupTeardown(benchmark::State& state) {
+ if (state.thread_index == 0) {
+ // No need to lock test_vector_mu here as this is running single-threaded.
+ test_vector = new std::vector<int>();
+ }
+ int i = 0;
+ while (state.KeepRunning()) {
+ std::lock_guard<std::mutex> l(test_vector_mu);
+ if (i % 2 == 0)
+ test_vector->push_back(i);
+ else
+ test_vector->pop_back();
+ ++i;
+ }
+ if (state.thread_index == 0) {
+ delete test_vector;
+ }
+}
+BENCHMARK(BM_SetupTeardown)->ThreadPerCpu();
+
+static void BM_LongTest(benchmark::State& state) {
+ double tracker = 0.0;
+ while (state.KeepRunning()) {
+ for (int i = 0; i < state.range(0); ++i)
+ benchmark::DoNotOptimize(tracker += i);
+ }
+}
+BENCHMARK(BM_LongTest)->Range(1 << 16, 1 << 28);
+
+static void BM_ParallelMemset(benchmark::State& state) {
+ int size = state.range(0) / sizeof(int);
+ int thread_size = size / state.threads;
+ int from = thread_size * state.thread_index;
+ int to = from + thread_size;
+
+ if (state.thread_index == 0) {
+ test_vector = new std::vector<int>(size);
+ }
+
+ while (state.KeepRunning()) {
+ for (int i = from; i < to; i++) {
+ // No need to lock test_vector_mu as ranges
+ // do not overlap between threads.
+ benchmark::DoNotOptimize(test_vector->at(i) = 1);
+ }
+ }
+
+ if (state.thread_index == 0) {
+ delete test_vector;
+ }
+}
+BENCHMARK(BM_ParallelMemset)->Arg(10 << 20)->ThreadRange(1, 4);
+
+static void BM_ManualTiming(benchmark::State& state) {
+ size_t slept_for = 0;
+ int microseconds = state.range(0);
+ std::chrono::duration<double, std::micro> sleep_duration{
+ static_cast<double>(microseconds)};
+
+ while (state.KeepRunning()) {
+ auto start = std::chrono::high_resolution_clock::now();
+ // Simulate some useful workload with a sleep
+ std::this_thread::sleep_for(
+ std::chrono::duration_cast<std::chrono::nanoseconds>(sleep_duration));
+ auto end = std::chrono::high_resolution_clock::now();
+
+ auto elapsed =
+ std::chrono::duration_cast<std::chrono::duration<double>>(end - start);
+
+ state.SetIterationTime(elapsed.count());
+ slept_for += microseconds;
+ }
+ state.SetItemsProcessed(slept_for);
+}
+BENCHMARK(BM_ManualTiming)->Range(1, 1 << 14)->UseRealTime();
+BENCHMARK(BM_ManualTiming)->Range(1, 1 << 14)->UseManualTime();
+
+#if __cplusplus >= 201103L
+
+template <class... Args>
+void BM_with_args(benchmark::State& state, Args&&...) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK_CAPTURE(BM_with_args, int_test, 42, 43, 44);
+BENCHMARK_CAPTURE(BM_with_args, string_and_pair_test, std::string("abc"),
+ std::pair<int, double>(42, 3.8));
+
+void BM_non_template_args(benchmark::State& state, int, double) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK_CAPTURE(BM_non_template_args, basic_test, 0, 0);
+
+#endif // __cplusplus >= 201103L
+
+static void BM_DenseThreadRanges(benchmark::State& st) {
+ switch (st.range(0)) {
+ case 1:
+ assert(st.threads == 1 || st.threads == 2 || st.threads == 3);
+ break;
+ case 2:
+ assert(st.threads == 1 || st.threads == 3 || st.threads == 4);
+ break;
+ case 3:
+ assert(st.threads == 5 || st.threads == 8 || st.threads == 11 ||
+ st.threads == 14);
+ break;
+ default:
+ assert(false && "Invalid test case number");
+ }
+ while (st.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_DenseThreadRanges)->Arg(1)->DenseThreadRange(1, 3);
+BENCHMARK(BM_DenseThreadRanges)->Arg(2)->DenseThreadRange(1, 4, 2);
+BENCHMARK(BM_DenseThreadRanges)->Arg(3)->DenseThreadRange(5, 14, 3);
+
+BENCHMARK_MAIN()
diff --git a/utils/google-benchmark/test/complexity_test.cc b/utils/google-benchmark/test/complexity_test.cc
new file mode 100644
index 000000000000..14e03b06eb1a
--- /dev/null
+++ b/utils/google-benchmark/test/complexity_test.cc
@@ -0,0 +1,167 @@
+#undef NDEBUG
+#include <algorithm>
+#include <cassert>
+#include <cmath>
+#include <cstdlib>
+#include <vector>
+#include "benchmark/benchmark.h"
+#include "output_test.h"
+
+namespace {
+
+#define ADD_COMPLEXITY_CASES(...) \
+ int CONCAT(dummy, __LINE__) = AddComplexityTest(__VA_ARGS__)
+
+int AddComplexityTest(std::string big_o_test_name, std::string rms_test_name,
+ std::string big_o) {
+ SetSubstitutions({{"%bigo_name", big_o_test_name},
+ {"%rms_name", rms_test_name},
+ {"%bigo_str", "[ ]* %float " + big_o},
+ {"%bigo", big_o},
+ {"%rms", "[ ]*[0-9]+ %"}});
+ AddCases(
+ TC_ConsoleOut,
+ {{"^%bigo_name %bigo_str %bigo_str[ ]*$"},
+ {"^%bigo_name", MR_Not}, // Assert we we didn't only matched a name.
+ {"^%rms_name %rms %rms[ ]*$", MR_Next}});
+ AddCases(TC_JSONOut, {{"\"name\": \"%bigo_name\",$"},
+ {"\"cpu_coefficient\": [0-9]+,$", MR_Next},
+ {"\"real_coefficient\": [0-9]{1,5},$", MR_Next},
+ {"\"big_o\": \"%bigo\",$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next},
+ {"\"name\": \"%rms_name\",$"},
+ {"\"rms\": %float$", MR_Next},
+ {"}", MR_Next}});
+ AddCases(TC_CSVOut, {{"^\"%bigo_name\",,%float,%float,%bigo,,,,,$"},
+ {"^\"%bigo_name\"", MR_Not},
+ {"^\"%rms_name\",,%float,%float,,,,,,$", MR_Next}});
+ return 0;
+}
+
+} // end namespace
+
+// ========================================================================= //
+// --------------------------- Testing BigO O(1) --------------------------- //
+// ========================================================================= //
+
+void BM_Complexity_O1(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ for (int i = 0; i < 1024; ++i) {
+ benchmark::DoNotOptimize(&i);
+ }
+ }
+ state.SetComplexityN(state.range(0));
+}
+BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity(benchmark::o1);
+BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity();
+BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity([](int) {
+ return 1.0;
+});
+
+const char *big_o_1_test_name = "BM_Complexity_O1_BigO";
+const char *rms_o_1_test_name = "BM_Complexity_O1_RMS";
+const char *enum_big_o_1 = "\\([0-9]+\\)";
+// FIXME: Tolerate both '(1)' and 'lgN' as output when the complexity is auto
+// deduced.
+// See https://github.com/google/benchmark/issues/272
+const char *auto_big_o_1 = "(\\([0-9]+\\))|(lgN)";
+const char *lambda_big_o_1 = "f\\(N\\)";
+
+// Add enum tests
+ADD_COMPLEXITY_CASES(big_o_1_test_name, rms_o_1_test_name, enum_big_o_1);
+
+// Add auto enum tests
+ADD_COMPLEXITY_CASES(big_o_1_test_name, rms_o_1_test_name, auto_big_o_1);
+
+// Add lambda tests
+ADD_COMPLEXITY_CASES(big_o_1_test_name, rms_o_1_test_name, lambda_big_o_1);
+
+// ========================================================================= //
+// --------------------------- Testing BigO O(N) --------------------------- //
+// ========================================================================= //
+
+std::vector<int> ConstructRandomVector(int size) {
+ std::vector<int> v;
+ v.reserve(size);
+ for (int i = 0; i < size; ++i) {
+ v.push_back(std::rand() % size);
+ }
+ return v;
+}
+
+void BM_Complexity_O_N(benchmark::State& state) {
+ auto v = ConstructRandomVector(state.range(0));
+ const int item_not_in_vector =
+ state.range(0) * 2; // Test worst case scenario (item not in vector)
+ while (state.KeepRunning()) {
+ benchmark::DoNotOptimize(std::find(v.begin(), v.end(), item_not_in_vector));
+ }
+ state.SetComplexityN(state.range(0));
+}
+BENCHMARK(BM_Complexity_O_N)
+ ->RangeMultiplier(2)
+ ->Range(1 << 10, 1 << 16)
+ ->Complexity(benchmark::oN);
+BENCHMARK(BM_Complexity_O_N)
+ ->RangeMultiplier(2)
+ ->Range(1 << 10, 1 << 16)
+ ->Complexity([](int n) -> double { return n; });
+BENCHMARK(BM_Complexity_O_N)
+ ->RangeMultiplier(2)
+ ->Range(1 << 10, 1 << 16)
+ ->Complexity();
+
+const char *big_o_n_test_name = "BM_Complexity_O_N_BigO";
+const char *rms_o_n_test_name = "BM_Complexity_O_N_RMS";
+const char *enum_auto_big_o_n = "N";
+const char *lambda_big_o_n = "f\\(N\\)";
+
+// Add enum tests
+ADD_COMPLEXITY_CASES(big_o_n_test_name, rms_o_n_test_name, enum_auto_big_o_n);
+
+// Add lambda tests
+ADD_COMPLEXITY_CASES(big_o_n_test_name, rms_o_n_test_name, lambda_big_o_n);
+
+// ========================================================================= //
+// ------------------------- Testing BigO O(N*lgN) ------------------------- //
+// ========================================================================= //
+
+static void BM_Complexity_O_N_log_N(benchmark::State& state) {
+ auto v = ConstructRandomVector(state.range(0));
+ while (state.KeepRunning()) {
+ std::sort(v.begin(), v.end());
+ }
+ state.SetComplexityN(state.range(0));
+}
+BENCHMARK(BM_Complexity_O_N_log_N)
+ ->RangeMultiplier(2)
+ ->Range(1 << 10, 1 << 16)
+ ->Complexity(benchmark::oNLogN);
+BENCHMARK(BM_Complexity_O_N_log_N)
+ ->RangeMultiplier(2)
+ ->Range(1 << 10, 1 << 16)
+ ->Complexity([](int n) { return n * std::log2(n); });
+BENCHMARK(BM_Complexity_O_N_log_N)
+ ->RangeMultiplier(2)
+ ->Range(1 << 10, 1 << 16)
+ ->Complexity();
+
+const char *big_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_BigO";
+const char *rms_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_RMS";
+const char *enum_auto_big_o_n_lg_n = "NlgN";
+const char *lambda_big_o_n_lg_n = "f\\(N\\)";
+
+// Add enum tests
+ADD_COMPLEXITY_CASES(big_o_n_lg_n_test_name, rms_o_n_lg_n_test_name,
+ enum_auto_big_o_n_lg_n);
+
+// Add lambda tests
+ADD_COMPLEXITY_CASES(big_o_n_lg_n_test_name, rms_o_n_lg_n_test_name,
+ lambda_big_o_n_lg_n);
+
+// ========================================================================= //
+// --------------------------- TEST CASES END ------------------------------ //
+// ========================================================================= //
+
+int main(int argc, char *argv[]) { RunOutputTests(argc, argv); }
diff --git a/utils/google-benchmark/test/cxx03_test.cc b/utils/google-benchmark/test/cxx03_test.cc
new file mode 100644
index 000000000000..4f3d0fb6f49c
--- /dev/null
+++ b/utils/google-benchmark/test/cxx03_test.cc
@@ -0,0 +1,42 @@
+#undef NDEBUG
+#include <cassert>
+#include <cstddef>
+
+#include "benchmark/benchmark.h"
+
+#if __cplusplus >= 201103L
+#error C++11 or greater detected. Should be C++03.
+#endif
+
+void BM_empty(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ volatile std::size_t x = state.iterations();
+ ((void)x);
+ }
+}
+BENCHMARK(BM_empty);
+
+// The new C++11 interface for args/ranges requires initializer list support.
+// Therefore we provide the old interface to support C++03.
+void BM_old_arg_range_interface(benchmark::State& state) {
+ assert((state.range(0) == 1 && state.range(1) == 2) ||
+ (state.range(0) == 5 && state.range(1) == 6));
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_old_arg_range_interface)->ArgPair(1, 2)->RangePair(5, 5, 6, 6);
+
+template <class T, class U>
+void BM_template2(benchmark::State& state) {
+ BM_empty(state);
+}
+BENCHMARK_TEMPLATE2(BM_template2, int, long);
+
+template <class T>
+void BM_template1(benchmark::State& state) {
+ BM_empty(state);
+}
+BENCHMARK_TEMPLATE(BM_template1, long);
+BENCHMARK_TEMPLATE1(BM_template1, int);
+
+BENCHMARK_MAIN()
diff --git a/utils/google-benchmark/test/diagnostics_test.cc b/utils/google-benchmark/test/diagnostics_test.cc
new file mode 100644
index 000000000000..c6c235d0c265
--- /dev/null
+++ b/utils/google-benchmark/test/diagnostics_test.cc
@@ -0,0 +1,64 @@
+// Testing:
+// State::PauseTiming()
+// State::ResumeTiming()
+// Test that CHECK's within these function diagnose when they are called
+// outside of the KeepRunning() loop.
+//
+// NOTE: Users should NOT include or use src/check.h. This is only done in
+// order to test library internals.
+
+#include <cstdlib>
+#include <stdexcept>
+
+#include "../src/check.h"
+#include "benchmark/benchmark_api.h"
+
+#if defined(__GNUC__) && !defined(__EXCEPTIONS)
+#define TEST_HAS_NO_EXCEPTIONS
+#endif
+
+void TestHandler() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ throw std::logic_error("");
+#else
+ std::abort();
+#endif
+}
+
+void try_invalid_pause_resume(benchmark::State& state) {
+#if !defined(NDEBUG) && !defined(TEST_HAS_NO_EXCEPTIONS)
+ try {
+ state.PauseTiming();
+ std::abort();
+ } catch (std::logic_error const&) {
+ }
+ try {
+ state.ResumeTiming();
+ std::abort();
+ } catch (std::logic_error const&) {
+ }
+#else
+ (void)state; // avoid unused warning
+#endif
+}
+
+void BM_diagnostic_test(benchmark::State& state) {
+ static bool called_once = false;
+
+ if (called_once == false) try_invalid_pause_resume(state);
+
+ while (state.KeepRunning()) {
+ benchmark::DoNotOptimize(state.iterations());
+ }
+
+ if (called_once == false) try_invalid_pause_resume(state);
+
+ called_once = true;
+}
+BENCHMARK(BM_diagnostic_test);
+
+int main(int argc, char* argv[]) {
+ benchmark::internal::GetAbortHandler() = &TestHandler;
+ benchmark::Initialize(&argc, argv);
+ benchmark::RunSpecifiedBenchmarks();
+}
diff --git a/utils/google-benchmark/test/donotoptimize_test.cc b/utils/google-benchmark/test/donotoptimize_test.cc
new file mode 100644
index 000000000000..b21187aadc21
--- /dev/null
+++ b/utils/google-benchmark/test/donotoptimize_test.cc
@@ -0,0 +1,33 @@
+#include "benchmark/benchmark.h"
+
+#include <cstdint>
+
+namespace {
+#if defined(__GNUC__)
+std::uint64_t double_up(const std::uint64_t x) __attribute__((const));
+#endif
+std::uint64_t double_up(const std::uint64_t x) { return x * 2; }
+}
+
+int main(int, char*[]) {
+ // this test verifies compilation of DoNotOptimize() for some types
+
+ char buffer8[8];
+ benchmark::DoNotOptimize(buffer8);
+
+ char buffer20[20];
+ benchmark::DoNotOptimize(buffer20);
+
+ char buffer1024[1024];
+ benchmark::DoNotOptimize(buffer1024);
+ benchmark::DoNotOptimize(&buffer1024[0]);
+
+ int x = 123;
+ benchmark::DoNotOptimize(x);
+ benchmark::DoNotOptimize(&x);
+ benchmark::DoNotOptimize(x += 42);
+
+ benchmark::DoNotOptimize(double_up(x));
+
+ return 0;
+}
diff --git a/utils/google-benchmark/test/filter_test.cc b/utils/google-benchmark/test/filter_test.cc
new file mode 100644
index 000000000000..3a205295f091
--- /dev/null
+++ b/utils/google-benchmark/test/filter_test.cc
@@ -0,0 +1,104 @@
+#include "benchmark/benchmark.h"
+
+#include <cassert>
+#include <cmath>
+#include <cstdint>
+#include <cstdlib>
+
+#include <iostream>
+#include <limits>
+#include <sstream>
+#include <string>
+
+namespace {
+
+class TestReporter : public benchmark::ConsoleReporter {
+ public:
+ virtual bool ReportContext(const Context& context) {
+ return ConsoleReporter::ReportContext(context);
+ };
+
+ virtual void ReportRuns(const std::vector<Run>& report) {
+ ++count_;
+ ConsoleReporter::ReportRuns(report);
+ };
+
+ TestReporter() : count_(0) {}
+
+ virtual ~TestReporter() {}
+
+ size_t GetCount() const { return count_; }
+
+ private:
+ mutable size_t count_;
+};
+
+} // end namespace
+
+static void NoPrefix(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(NoPrefix);
+
+static void BM_Foo(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_Foo);
+
+static void BM_Bar(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_Bar);
+
+static void BM_FooBar(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_FooBar);
+
+static void BM_FooBa(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_FooBa);
+
+int main(int argc, char **argv) {
+ bool list_only = false;
+ for (int i = 0; i < argc; ++i)
+ list_only |= std::string(argv[i]).find("--benchmark_list_tests") !=
+ std::string::npos;
+
+ benchmark::Initialize(&argc, argv);
+
+ TestReporter test_reporter;
+ const size_t returned_count =
+ benchmark::RunSpecifiedBenchmarks(&test_reporter);
+
+ if (argc == 2) {
+ // Make sure we ran all of the tests
+ std::stringstream ss(argv[1]);
+ size_t expected_return;
+ ss >> expected_return;
+
+ if (returned_count != expected_return) {
+ std::cerr << "ERROR: Expected " << expected_return
+ << " tests to match the filter but returned_count = "
+ << returned_count << std::endl;
+ return -1;
+ }
+
+ const size_t expected_reports = list_only ? 0 : expected_return;
+ const size_t reports_count = test_reporter.GetCount();
+ if (reports_count != expected_reports) {
+ std::cerr << "ERROR: Expected " << expected_reports
+ << " tests to be run but reported_count = " << reports_count
+ << std::endl;
+ return -1;
+ }
+ }
+
+ return 0;
+}
diff --git a/utils/google-benchmark/test/fixture_test.cc b/utils/google-benchmark/test/fixture_test.cc
new file mode 100644
index 000000000000..bbc2f9579023
--- /dev/null
+++ b/utils/google-benchmark/test/fixture_test.cc
@@ -0,0 +1,49 @@
+
+#include "benchmark/benchmark.h"
+
+#include <cassert>
+#include <memory>
+
+class MyFixture : public ::benchmark::Fixture {
+ public:
+ void SetUp(const ::benchmark::State& state) {
+ if (state.thread_index == 0) {
+ assert(data.get() == nullptr);
+ data.reset(new int(42));
+ }
+ }
+
+ void TearDown(const ::benchmark::State& state) {
+ if (state.thread_index == 0) {
+ assert(data.get() != nullptr);
+ data.reset();
+ }
+ }
+
+ ~MyFixture() { assert(data == nullptr); }
+
+ std::unique_ptr<int> data;
+};
+
+BENCHMARK_F(MyFixture, Foo)(benchmark::State &st) {
+ assert(data.get() != nullptr);
+ assert(*data == 42);
+ while (st.KeepRunning()) {
+ }
+}
+
+BENCHMARK_DEFINE_F(MyFixture, Bar)(benchmark::State& st) {
+ if (st.thread_index == 0) {
+ assert(data.get() != nullptr);
+ assert(*data == 42);
+ }
+ while (st.KeepRunning()) {
+ assert(data.get() != nullptr);
+ assert(*data == 42);
+ }
+ st.SetItemsProcessed(st.range(0));
+}
+BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42);
+BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42)->ThreadPerCpu();
+
+BENCHMARK_MAIN()
diff --git a/utils/google-benchmark/test/map_test.cc b/utils/google-benchmark/test/map_test.cc
new file mode 100644
index 000000000000..83457c9981cd
--- /dev/null
+++ b/utils/google-benchmark/test/map_test.cc
@@ -0,0 +1,56 @@
+#include "benchmark/benchmark.h"
+
+#include <cstdlib>
+#include <map>
+
+namespace {
+
+std::map<int, int> ConstructRandomMap(int size) {
+ std::map<int, int> m;
+ for (int i = 0; i < size; ++i) {
+ m.insert(std::make_pair(rand() % size, rand() % size));
+ }
+ return m;
+}
+
+} // namespace
+
+// Basic version.
+static void BM_MapLookup(benchmark::State& state) {
+ const int size = state.range(0);
+ while (state.KeepRunning()) {
+ state.PauseTiming();
+ std::map<int, int> m = ConstructRandomMap(size);
+ state.ResumeTiming();
+ for (int i = 0; i < size; ++i) {
+ benchmark::DoNotOptimize(m.find(rand() % size));
+ }
+ }
+ state.SetItemsProcessed(state.iterations() * size);
+}
+BENCHMARK(BM_MapLookup)->Range(1 << 3, 1 << 12);
+
+// Using fixtures.
+class MapFixture : public ::benchmark::Fixture {
+ public:
+ void SetUp(const ::benchmark::State& st) {
+ m = ConstructRandomMap(st.range(0));
+ }
+
+ void TearDown(const ::benchmark::State&) { m.clear(); }
+
+ std::map<int, int> m;
+};
+
+BENCHMARK_DEFINE_F(MapFixture, Lookup)(benchmark::State& state) {
+ const int size = state.range(0);
+ while (state.KeepRunning()) {
+ for (int i = 0; i < size; ++i) {
+ benchmark::DoNotOptimize(m.find(rand() % size));
+ }
+ }
+ state.SetItemsProcessed(state.iterations() * size);
+}
+BENCHMARK_REGISTER_F(MapFixture, Lookup)->Range(1 << 3, 1 << 12);
+
+BENCHMARK_MAIN()
diff --git a/utils/google-benchmark/test/multiple_ranges_test.cc b/utils/google-benchmark/test/multiple_ranges_test.cc
new file mode 100644
index 000000000000..8e67b3b2a99c
--- /dev/null
+++ b/utils/google-benchmark/test/multiple_ranges_test.cc
@@ -0,0 +1,74 @@
+#include "benchmark/benchmark.h"
+
+#include <cassert>
+#include <set>
+
+class MultipleRangesFixture : public ::benchmark::Fixture {
+ public:
+ MultipleRangesFixture()
+ : expectedValues({{1, 3, 5},
+ {1, 3, 8},
+ {1, 3, 15},
+ {2, 3, 5},
+ {2, 3, 8},
+ {2, 3, 15},
+ {1, 4, 5},
+ {1, 4, 8},
+ {1, 4, 15},
+ {2, 4, 5},
+ {2, 4, 8},
+ {2, 4, 15},
+ {1, 7, 5},
+ {1, 7, 8},
+ {1, 7, 15},
+ {2, 7, 5},
+ {2, 7, 8},
+ {2, 7, 15},
+ {7, 6, 3}}) {}
+
+ void SetUp(const ::benchmark::State& state) {
+ std::vector<int> ranges = {state.range(0), state.range(1), state.range(2)};
+
+ assert(expectedValues.find(ranges) != expectedValues.end());
+
+ actualValues.insert(ranges);
+ }
+
+ virtual ~MultipleRangesFixture() {
+ assert(actualValues.size() == expectedValues.size());
+ }
+
+ std::set<std::vector<int>> expectedValues;
+ std::set<std::vector<int>> actualValues;
+};
+
+BENCHMARK_DEFINE_F(MultipleRangesFixture, Empty)(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ int product = state.range(0) * state.range(1) * state.range(2);
+ for (int x = 0; x < product; x++) {
+ benchmark::DoNotOptimize(x);
+ }
+ }
+}
+
+BENCHMARK_REGISTER_F(MultipleRangesFixture, Empty)
+ ->RangeMultiplier(2)
+ ->Ranges({{1, 2}, {3, 7}, {5, 15}})
+ ->Args({7, 6, 3});
+
+void BM_CheckDefaultArgument(benchmark::State& state) {
+ // Test that the 'range()' without an argument is the same as 'range(0)'.
+ assert(state.range() == state.range(0));
+ assert(state.range() != state.range(1));
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_CheckDefaultArgument)->Ranges({{1, 5}, {6, 10}});
+
+static void BM_MultipleRanges(benchmark::State& st) {
+ while (st.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_MultipleRanges)->Ranges({{5, 5}, {6, 6}});
+
+BENCHMARK_MAIN()
diff --git a/utils/google-benchmark/test/options_test.cc b/utils/google-benchmark/test/options_test.cc
new file mode 100644
index 000000000000..bedb1cc3ee99
--- /dev/null
+++ b/utils/google-benchmark/test/options_test.cc
@@ -0,0 +1,43 @@
+#include "benchmark/benchmark_api.h"
+
+#include <chrono>
+#include <thread>
+
+void BM_basic(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+
+void BM_basic_slow(benchmark::State& state) {
+ std::chrono::milliseconds sleep_duration(state.range(0));
+ while (state.KeepRunning()) {
+ std::this_thread::sleep_for(
+ std::chrono::duration_cast<std::chrono::nanoseconds>(sleep_duration));
+ }
+}
+
+BENCHMARK(BM_basic);
+BENCHMARK(BM_basic)->Arg(42);
+BENCHMARK(BM_basic_slow)->Arg(10)->Unit(benchmark::kNanosecond);
+BENCHMARK(BM_basic_slow)->Arg(100)->Unit(benchmark::kMicrosecond);
+BENCHMARK(BM_basic_slow)->Arg(1000)->Unit(benchmark::kMillisecond);
+BENCHMARK(BM_basic)->Range(1, 8);
+BENCHMARK(BM_basic)->RangeMultiplier(2)->Range(1, 8);
+BENCHMARK(BM_basic)->DenseRange(10, 15);
+BENCHMARK(BM_basic)->Args({42, 42});
+BENCHMARK(BM_basic)->Ranges({{64, 512}, {64, 512}});
+BENCHMARK(BM_basic)->MinTime(0.7);
+BENCHMARK(BM_basic)->UseRealTime();
+BENCHMARK(BM_basic)->ThreadRange(2, 4);
+BENCHMARK(BM_basic)->ThreadPerCpu();
+BENCHMARK(BM_basic)->Repetitions(3);
+
+void CustomArgs(benchmark::internal::Benchmark* b) {
+ for (int i = 0; i < 10; ++i) {
+ b->Arg(i);
+ }
+}
+
+BENCHMARK(BM_basic)->Apply(CustomArgs);
+
+BENCHMARK_MAIN()
diff --git a/utils/google-benchmark/test/output_test.h b/utils/google-benchmark/test/output_test.h
new file mode 100644
index 000000000000..57d4397ad5db
--- /dev/null
+++ b/utils/google-benchmark/test/output_test.h
@@ -0,0 +1,71 @@
+#ifndef TEST_OUTPUT_TEST_H
+#define TEST_OUTPUT_TEST_H
+
+#undef NDEBUG
+#include <initializer_list>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "../src/re.h"
+#include "benchmark/benchmark.h"
+
+#define CONCAT2(x, y) x##y
+#define CONCAT(x, y) CONCAT2(x, y)
+
+#define ADD_CASES(...) int CONCAT(dummy, __LINE__) = ::AddCases(__VA_ARGS__)
+
+#define SET_SUBSTITUTIONS(...) \
+ int CONCAT(dummy, __LINE__) = ::SetSubstitutions(__VA_ARGS__)
+
+enum MatchRules {
+ MR_Default, // Skip non-matching lines until a match is found.
+ MR_Next, // Match must occur on the next line.
+ MR_Not // No line between the current position and the next match matches
+ // the regex
+};
+
+struct TestCase {
+ TestCase(std::string re, int rule = MR_Default);
+
+ std::string regex_str;
+ int match_rule;
+ std::string substituted_regex;
+ std::shared_ptr<benchmark::Regex> regex;
+};
+
+enum TestCaseID {
+ TC_ConsoleOut,
+ TC_ConsoleErr,
+ TC_JSONOut,
+ TC_JSONErr,
+ TC_CSVOut,
+ TC_CSVErr,
+
+ TC_NumID // PRIVATE
+};
+
+// Add a list of test cases to be run against the output specified by
+// 'ID'
+int AddCases(TestCaseID ID, std::initializer_list<TestCase> il);
+
+// Add or set a list of substitutions to be performed on constructed regex's
+// See 'output_test_helper.cc' for a list of default substitutions.
+int SetSubstitutions(
+ std::initializer_list<std::pair<std::string, std::string>> il);
+
+// Run all output tests.
+void RunOutputTests(int argc, char* argv[]);
+
+// ========================================================================= //
+// --------------------------- Misc Utilities ------------------------------ //
+// ========================================================================= //
+
+namespace {
+
+const char* const dec_re = "[0-9]*[.]?[0-9]+([eE][-+][0-9]+)?";
+
+} // end namespace
+
+#endif // TEST_OUTPUT_TEST_H
diff --git a/utils/google-benchmark/test/output_test_helper.cc b/utils/google-benchmark/test/output_test_helper.cc
new file mode 100644
index 000000000000..721d39f92706
--- /dev/null
+++ b/utils/google-benchmark/test/output_test_helper.cc
@@ -0,0 +1,234 @@
+#include <iostream>
+#include <map>
+#include <memory>
+#include <sstream>
+
+#include "../src/check.h" // NOTE: check.h is for internal use only!
+#include "../src/re.h" // NOTE: re.h is for internal use only
+#include "output_test.h"
+
+// ========================================================================= //
+// ------------------------------ Internals -------------------------------- //
+// ========================================================================= //
+namespace internal {
+namespace {
+
+using TestCaseList = std::vector<TestCase>;
+
+// Use a vector because the order elements are added matters during iteration.
+// std::map/unordered_map don't guarantee that.
+// For example:
+// SetSubstitutions({{"%HelloWorld", "Hello"}, {"%Hello", "Hi"}});
+// Substitute("%HelloWorld") // Always expands to Hello.
+using SubMap = std::vector<std::pair<std::string, std::string>>;
+
+TestCaseList& GetTestCaseList(TestCaseID ID) {
+ // Uses function-local statics to ensure initialization occurs
+ // before first use.
+ static TestCaseList lists[TC_NumID];
+ return lists[ID];
+}
+
+SubMap& GetSubstitutions() {
+ // Don't use 'dec_re' from header because it may not yet be initialized.
+ static std::string dec_re = "[0-9]*[.]?[0-9]+([eE][-+][0-9]+)?";
+ static SubMap map = {
+ {"%float", "[0-9]*[.]?[0-9]+([eE][-+][0-9]+)?"},
+ {"%int", "[ ]*[0-9]+"},
+ {" %s ", "[ ]+"},
+ {"%time", "[ ]*[0-9]{1,5} ns"},
+ {"%console_report", "[ ]*[0-9]{1,5} ns [ ]*[0-9]{1,5} ns [ ]*[0-9]+"},
+ {"%console_us_report", "[ ]*[0-9] us [ ]*[0-9] us [ ]*[0-9]+"},
+ {"%csv_report", "[0-9]+," + dec_re + "," + dec_re + ",ns,,,,,"},
+ {"%csv_us_report", "[0-9]+," + dec_re + "," + dec_re + ",us,,,,,"},
+ {"%csv_bytes_report",
+ "[0-9]+," + dec_re + "," + dec_re + ",ns," + dec_re + ",,,,"},
+ {"%csv_items_report",
+ "[0-9]+," + dec_re + "," + dec_re + ",ns,," + dec_re + ",,,"},
+ {"%csv_label_report_begin", "[0-9]+," + dec_re + "," + dec_re + ",ns,,,"},
+ {"%csv_label_report_end", ",,"}};
+ return map;
+}
+
+std::string PerformSubstitutions(std::string source) {
+ SubMap const& subs = GetSubstitutions();
+ using SizeT = std::string::size_type;
+ for (auto const& KV : subs) {
+ SizeT pos;
+ SizeT next_start = 0;
+ while ((pos = source.find(KV.first, next_start)) != std::string::npos) {
+ next_start = pos + KV.second.size();
+ source.replace(pos, KV.first.size(), KV.second);
+ }
+ }
+ return source;
+}
+
+void CheckCase(std::stringstream& remaining_output, TestCase const& TC,
+ TestCaseList const& not_checks) {
+ std::string first_line;
+ bool on_first = true;
+ std::string line;
+ while (remaining_output.eof() == false) {
+ CHECK(remaining_output.good());
+ std::getline(remaining_output, line);
+ if (on_first) {
+ first_line = line;
+ on_first = false;
+ }
+ for (const auto& NC : not_checks) {
+ CHECK(!NC.regex->Match(line))
+ << "Unexpected match for line \"" << line << "\" for MR_Not regex \""
+ << NC.regex_str << "\""
+ << "\n actual regex string \"" << TC.substituted_regex << "\""
+ << "\n started matching near: " << first_line;
+ }
+ if (TC.regex->Match(line)) return;
+ CHECK(TC.match_rule != MR_Next)
+ << "Expected line \"" << line << "\" to match regex \"" << TC.regex_str
+ << "\""
+ << "\n actual regex string \"" << TC.substituted_regex << "\""
+ << "\n started matching near: " << first_line;
+ }
+ CHECK(remaining_output.eof() == false)
+ << "End of output reached before match for regex \"" << TC.regex_str
+ << "\" was found"
+ << "\n actual regex string \"" << TC.substituted_regex << "\""
+ << "\n started matching near: " << first_line;
+}
+
+void CheckCases(TestCaseList const& checks, std::stringstream& output) {
+ std::vector<TestCase> not_checks;
+ for (size_t i = 0; i < checks.size(); ++i) {
+ const auto& TC = checks[i];
+ if (TC.match_rule == MR_Not) {
+ not_checks.push_back(TC);
+ continue;
+ }
+ CheckCase(output, TC, not_checks);
+ not_checks.clear();
+ }
+}
+
+class TestReporter : public benchmark::BenchmarkReporter {
+ public:
+ TestReporter(std::vector<benchmark::BenchmarkReporter*> reps)
+ : reporters_(reps) {}
+
+ virtual bool ReportContext(const Context& context) {
+ bool last_ret = false;
+ bool first = true;
+ for (auto rep : reporters_) {
+ bool new_ret = rep->ReportContext(context);
+ CHECK(first || new_ret == last_ret)
+ << "Reports return different values for ReportContext";
+ first = false;
+ last_ret = new_ret;
+ }
+ (void)first;
+ return last_ret;
+ }
+
+ void ReportRuns(const std::vector<Run>& report) {
+ for (auto rep : reporters_) rep->ReportRuns(report);
+ }
+ void Finalize() {
+ for (auto rep : reporters_) rep->Finalize();
+ }
+
+ private:
+ std::vector<benchmark::BenchmarkReporter *> reporters_;
+};
+}
+} // end namespace internal
+
+// ========================================================================= //
+// -------------------------- Public API Definitions------------------------ //
+// ========================================================================= //
+
+TestCase::TestCase(std::string re, int rule)
+ : regex_str(std::move(re)),
+ match_rule(rule),
+ substituted_regex(internal::PerformSubstitutions(regex_str)),
+ regex(std::make_shared<benchmark::Regex>()) {
+ std::string err_str;
+ regex->Init(substituted_regex,& err_str);
+ CHECK(err_str.empty()) << "Could not construct regex \"" << substituted_regex
+ << "\""
+ << "\n originally \"" << regex_str << "\""
+ << "\n got error: " << err_str;
+}
+
+int AddCases(TestCaseID ID, std::initializer_list<TestCase> il) {
+ auto& L = internal::GetTestCaseList(ID);
+ L.insert(L.end(), il);
+ return 0;
+}
+
+int SetSubstitutions(
+ std::initializer_list<std::pair<std::string, std::string>> il) {
+ auto& subs = internal::GetSubstitutions();
+ for (auto KV : il) {
+ bool exists = false;
+ KV.second = internal::PerformSubstitutions(KV.second);
+ for (auto& EKV : subs) {
+ if (EKV.first == KV.first) {
+ EKV.second = std::move(KV.second);
+ exists = true;
+ break;
+ }
+ }
+ if (!exists) subs.push_back(std::move(KV));
+ }
+ return 0;
+}
+
+void RunOutputTests(int argc, char* argv[]) {
+ using internal::GetTestCaseList;
+ benchmark::Initialize(&argc, argv);
+ benchmark::ConsoleReporter CR(benchmark::ConsoleReporter::OO_None);
+ benchmark::JSONReporter JR;
+ benchmark::CSVReporter CSVR;
+ struct ReporterTest {
+ const char* name;
+ std::vector<TestCase>& output_cases;
+ std::vector<TestCase>& error_cases;
+ benchmark::BenchmarkReporter& reporter;
+ std::stringstream out_stream;
+ std::stringstream err_stream;
+
+ ReporterTest(const char* n, std::vector<TestCase>& out_tc,
+ std::vector<TestCase>& err_tc,
+ benchmark::BenchmarkReporter& br)
+ : name(n), output_cases(out_tc), error_cases(err_tc), reporter(br) {
+ reporter.SetOutputStream(&out_stream);
+ reporter.SetErrorStream(&err_stream);
+ }
+ } TestCases[] = {
+ {"ConsoleReporter", GetTestCaseList(TC_ConsoleOut),
+ GetTestCaseList(TC_ConsoleErr), CR},
+ {"JSONReporter", GetTestCaseList(TC_JSONOut), GetTestCaseList(TC_JSONErr),
+ JR},
+ {"CSVReporter", GetTestCaseList(TC_CSVOut), GetTestCaseList(TC_CSVErr),
+ CSVR},
+ };
+
+ // Create the test reporter and run the benchmarks.
+ std::cout << "Running benchmarks...\n";
+ internal::TestReporter test_rep({&CR, &JR, &CSVR});
+ benchmark::RunSpecifiedBenchmarks(&test_rep);
+
+ for (auto& rep_test : TestCases) {
+ std::string msg = std::string("\nTesting ") + rep_test.name + " Output\n";
+ std::string banner(msg.size() - 1, '-');
+ std::cout << banner << msg << banner << "\n";
+
+ std::cerr << rep_test.err_stream.str();
+ std::cout << rep_test.out_stream.str();
+
+ internal::CheckCases(rep_test.error_cases, rep_test.err_stream);
+ internal::CheckCases(rep_test.output_cases, rep_test.out_stream);
+
+ std::cout << "\n";
+ }
+}
diff --git a/utils/google-benchmark/test/register_benchmark_test.cc b/utils/google-benchmark/test/register_benchmark_test.cc
new file mode 100644
index 000000000000..e9f8ea530c10
--- /dev/null
+++ b/utils/google-benchmark/test/register_benchmark_test.cc
@@ -0,0 +1,148 @@
+
+#undef NDEBUG
+#include <cassert>
+#include <vector>
+
+#include "../src/check.h" // NOTE: check.h is for internal use only!
+#include "benchmark/benchmark.h"
+
+namespace {
+
+class TestReporter : public benchmark::ConsoleReporter {
+ public:
+ virtual void ReportRuns(const std::vector<Run>& report) {
+ all_runs_.insert(all_runs_.end(), begin(report), end(report));
+ ConsoleReporter::ReportRuns(report);
+ }
+
+ std::vector<Run> all_runs_;
+};
+
+struct TestCase {
+ std::string name;
+ const char* label;
+ // Note: not explicit as we rely on it being converted through ADD_CASES.
+ TestCase(const char* xname) : TestCase(xname, nullptr) {}
+ TestCase(const char* xname, const char* xlabel)
+ : name(xname), label(xlabel) {}
+
+ typedef benchmark::BenchmarkReporter::Run Run;
+
+ void CheckRun(Run const& run) const {
+ CHECK(name == run.benchmark_name) << "expected " << name << " got "
+ << run.benchmark_name;
+ if (label) {
+ CHECK(run.report_label == label) << "expected " << label << " got "
+ << run.report_label;
+ } else {
+ CHECK(run.report_label == "");
+ }
+ }
+};
+
+std::vector<TestCase> ExpectedResults;
+
+int AddCases(std::initializer_list<TestCase> const& v) {
+ for (auto N : v) {
+ ExpectedResults.push_back(N);
+ }
+ return 0;
+}
+
+#define CONCAT(x, y) CONCAT2(x, y)
+#define CONCAT2(x, y) x##y
+#define ADD_CASES(...) int CONCAT(dummy, __LINE__) = AddCases({__VA_ARGS__})
+
+} // end namespace
+
+typedef benchmark::internal::Benchmark* ReturnVal;
+
+//----------------------------------------------------------------------------//
+// Test RegisterBenchmark with no additional arguments
+//----------------------------------------------------------------------------//
+void BM_function(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_function);
+ReturnVal dummy = benchmark::RegisterBenchmark(
+ "BM_function_manual_registration", BM_function);
+ADD_CASES({"BM_function"}, {"BM_function_manual_registration"});
+
+//----------------------------------------------------------------------------//
+// Test RegisterBenchmark with additional arguments
+// Note: GCC <= 4.8 do not support this form of RegisterBenchmark because they
+// reject the variadic pack expansion of lambda captures.
+//----------------------------------------------------------------------------//
+#ifndef BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK
+
+void BM_extra_args(benchmark::State& st, const char* label) {
+ while (st.KeepRunning()) {
+ }
+ st.SetLabel(label);
+}
+int RegisterFromFunction() {
+ std::pair<const char*, const char*> cases[] = {
+ {"test1", "One"}, {"test2", "Two"}, {"test3", "Three"}};
+ for (auto const& c : cases)
+ benchmark::RegisterBenchmark(c.first, &BM_extra_args, c.second);
+ return 0;
+}
+int dummy2 = RegisterFromFunction();
+ADD_CASES({"test1", "One"}, {"test2", "Two"}, {"test3", "Three"});
+
+#endif // BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK
+
+//----------------------------------------------------------------------------//
+// Test RegisterBenchmark with different callable types
+//----------------------------------------------------------------------------//
+
+struct CustomFixture {
+ void operator()(benchmark::State& st) {
+ while (st.KeepRunning()) {
+ }
+ }
+};
+
+void TestRegistrationAtRuntime() {
+#ifdef BENCHMARK_HAS_CXX11
+ {
+ CustomFixture fx;
+ benchmark::RegisterBenchmark("custom_fixture", fx);
+ AddCases({"custom_fixture"});
+ }
+#endif
+#ifndef BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK
+ {
+ int x = 42;
+ auto capturing_lam = [=](benchmark::State& st) {
+ while (st.KeepRunning()) {
+ }
+ st.SetLabel(std::to_string(x));
+ };
+ benchmark::RegisterBenchmark("lambda_benchmark", capturing_lam);
+ AddCases({{"lambda_benchmark", "42"}});
+ }
+#endif
+}
+
+int main(int argc, char* argv[]) {
+ TestRegistrationAtRuntime();
+
+ benchmark::Initialize(&argc, argv);
+
+ TestReporter test_reporter;
+ benchmark::RunSpecifiedBenchmarks(&test_reporter);
+
+ typedef benchmark::BenchmarkReporter::Run Run;
+ auto EB = ExpectedResults.begin();
+
+ for (Run const& run : test_reporter.all_runs_) {
+ assert(EB != ExpectedResults.end());
+ EB->CheckRun(run);
+ ++EB;
+ }
+ assert(EB == ExpectedResults.end());
+
+ return 0;
+}
diff --git a/utils/google-benchmark/test/reporter_output_test.cc b/utils/google-benchmark/test/reporter_output_test.cc
new file mode 100644
index 000000000000..2e6d2b2a0e0f
--- /dev/null
+++ b/utils/google-benchmark/test/reporter_output_test.cc
@@ -0,0 +1,256 @@
+
+#undef NDEBUG
+#include <utility>
+
+#include "benchmark/benchmark.h"
+#include "output_test.h"
+
+// ========================================================================= //
+// ---------------------- Testing Prologue Output -------------------------- //
+// ========================================================================= //
+
+ADD_CASES(TC_ConsoleOut, {{"^Benchmark %s Time %s CPU %s Iterations$", MR_Next},
+ {"^[-]+$", MR_Next}});
+ADD_CASES(TC_CSVOut,
+ {{"name,iterations,real_time,cpu_time,time_unit,bytes_per_second,"
+ "items_per_second,label,error_occurred,error_message"}});
+
+// ========================================================================= //
+// ------------------------ Testing Basic Output --------------------------- //
+// ========================================================================= //
+
+void BM_basic(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_basic);
+
+ADD_CASES(TC_ConsoleOut, {{"^BM_basic %console_report$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_basic\",$"},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %int,$", MR_Next},
+ {"\"cpu_time\": %int,$", MR_Next},
+ {"\"time_unit\": \"ns\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_basic\",%csv_report$"}});
+
+// ========================================================================= //
+// ------------------------ Testing Bytes per Second Output ---------------- //
+// ========================================================================= //
+
+void BM_bytes_per_second(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+ state.SetBytesProcessed(1);
+}
+BENCHMARK(BM_bytes_per_second);
+
+ADD_CASES(TC_ConsoleOut,
+ {{"^BM_bytes_per_second %console_report +%floatB/s$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_bytes_per_second\",$"},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %int,$", MR_Next},
+ {"\"cpu_time\": %int,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"bytes_per_second\": %int$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_bytes_per_second\",%csv_bytes_report$"}});
+
+// ========================================================================= //
+// ------------------------ Testing Items per Second Output ---------------- //
+// ========================================================================= //
+
+void BM_items_per_second(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+ state.SetItemsProcessed(1);
+}
+BENCHMARK(BM_items_per_second);
+
+ADD_CASES(TC_ConsoleOut,
+ {{"^BM_items_per_second %console_report +%float items/s$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_items_per_second\",$"},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %int,$", MR_Next},
+ {"\"cpu_time\": %int,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"items_per_second\": %int$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_items_per_second\",%csv_items_report$"}});
+
+// ========================================================================= //
+// ------------------------ Testing Label Output --------------------------- //
+// ========================================================================= //
+
+void BM_label(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+ state.SetLabel("some label");
+}
+BENCHMARK(BM_label);
+
+ADD_CASES(TC_ConsoleOut, {{"^BM_label %console_report some label$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_label\",$"},
+ {"\"iterations\": %int,$", MR_Next},
+ {"\"real_time\": %int,$", MR_Next},
+ {"\"cpu_time\": %int,$", MR_Next},
+ {"\"time_unit\": \"ns\",$", MR_Next},
+ {"\"label\": \"some label\"$", MR_Next},
+ {"}", MR_Next}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_label\",%csv_label_report_begin\"some "
+ "label\"%csv_label_report_end$"}});
+
+// ========================================================================= //
+// ------------------------ Testing Error Output --------------------------- //
+// ========================================================================= //
+
+void BM_error(benchmark::State& state) {
+ state.SkipWithError("message");
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_error);
+ADD_CASES(TC_ConsoleOut, {{"^BM_error[ ]+ERROR OCCURRED: 'message'$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_error\",$"},
+ {"\"error_occurred\": true,$", MR_Next},
+ {"\"error_message\": \"message\",$", MR_Next}});
+
+ADD_CASES(TC_CSVOut, {{"^\"BM_error\",,,,,,,,true,\"message\"$"}});
+
+// ========================================================================= //
+// ------------------------ Testing No Arg Name Output -----------------------
+// //
+// ========================================================================= //
+
+void BM_no_arg_name(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_no_arg_name)->Arg(3);
+ADD_CASES(TC_ConsoleOut, {{"^BM_no_arg_name/3 %console_report$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_no_arg_name/3\",$"}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_no_arg_name/3\",%csv_report$"}});
+
+// ========================================================================= //
+// ------------------------ Testing Arg Name Output ----------------------- //
+// ========================================================================= //
+
+void BM_arg_name(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_arg_name)->ArgName("first")->Arg(3);
+ADD_CASES(TC_ConsoleOut, {{"^BM_arg_name/first:3 %console_report$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_arg_name/first:3\",$"}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_arg_name/first:3\",%csv_report$"}});
+
+// ========================================================================= //
+// ------------------------ Testing Arg Names Output ----------------------- //
+// ========================================================================= //
+
+void BM_arg_names(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_arg_names)->Args({2, 5, 4})->ArgNames({"first", "", "third"});
+ADD_CASES(TC_ConsoleOut,
+ {{"^BM_arg_names/first:2/5/third:4 %console_report$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_arg_names/first:2/5/third:4\",$"}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_arg_names/first:2/5/third:4\",%csv_report$"}});
+
+// ========================================================================= //
+// ----------------------- Testing Complexity Output ----------------------- //
+// ========================================================================= //
+
+void BM_Complexity_O1(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+ state.SetComplexityN(state.range(0));
+}
+BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity(benchmark::o1);
+SET_SUBSTITUTIONS({{"%bigOStr", "[ ]* %float \\([0-9]+\\)"},
+ {"%RMS", "[ ]*[0-9]+ %"}});
+ADD_CASES(TC_ConsoleOut, {{"^BM_Complexity_O1_BigO %bigOStr %bigOStr[ ]*$"},
+ {"^BM_Complexity_O1_RMS %RMS %RMS[ ]*$"}});
+
+// ========================================================================= //
+// ----------------------- Testing Aggregate Output ------------------------ //
+// ========================================================================= //
+
+// Test that non-aggregate data is printed by default
+void BM_Repeat(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_Repeat)->Repetitions(3);
+ADD_CASES(TC_ConsoleOut, {{"^BM_Repeat/repeats:3 %console_report$"},
+ {"^BM_Repeat/repeats:3 %console_report$"},
+ {"^BM_Repeat/repeats:3 %console_report$"},
+ {"^BM_Repeat/repeats:3_mean %console_report$"},
+ {"^BM_Repeat/repeats:3_stddev %console_report$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Repeat/repeats:3\",$"},
+ {"\"name\": \"BM_Repeat/repeats:3\",$"},
+ {"\"name\": \"BM_Repeat/repeats:3\",$"},
+ {"\"name\": \"BM_Repeat/repeats:3_mean\",$"},
+ {"\"name\": \"BM_Repeat/repeats:3_stddev\",$"}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_Repeat/repeats:3\",%csv_report$"},
+ {"^\"BM_Repeat/repeats:3\",%csv_report$"},
+ {"^\"BM_Repeat/repeats:3\",%csv_report$"},
+ {"^\"BM_Repeat/repeats:3_mean\",%csv_report$"},
+ {"^\"BM_Repeat/repeats:3_stddev\",%csv_report$"}});
+
+// Test that a non-repeated test still prints non-aggregate results even when
+// only-aggregate reports have been requested
+void BM_RepeatOnce(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_RepeatOnce)->Repetitions(1)->ReportAggregatesOnly();
+ADD_CASES(TC_ConsoleOut, {{"^BM_RepeatOnce/repeats:1 %console_report$"}});
+ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_RepeatOnce/repeats:1\",$"}});
+ADD_CASES(TC_CSVOut, {{"^\"BM_RepeatOnce/repeats:1\",%csv_report$"}});
+
+// Test that non-aggregate data is not reported
+void BM_SummaryRepeat(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_SummaryRepeat)->Repetitions(3)->ReportAggregatesOnly();
+ADD_CASES(TC_ConsoleOut,
+ {{".*BM_SummaryRepeat/repeats:3 ", MR_Not},
+ {"^BM_SummaryRepeat/repeats:3_mean %console_report$"},
+ {"^BM_SummaryRepeat/repeats:3_stddev %console_report$"}});
+ADD_CASES(TC_JSONOut, {{".*BM_SummaryRepeat/repeats:3 ", MR_Not},
+ {"\"name\": \"BM_SummaryRepeat/repeats:3_mean\",$"},
+ {"\"name\": \"BM_SummaryRepeat/repeats:3_stddev\",$"}});
+ADD_CASES(TC_CSVOut, {{".*BM_SummaryRepeat/repeats:3 ", MR_Not},
+ {"^\"BM_SummaryRepeat/repeats:3_mean\",%csv_report$"},
+ {"^\"BM_SummaryRepeat/repeats:3_stddev\",%csv_report$"}});
+
+void BM_RepeatTimeUnit(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ }
+}
+BENCHMARK(BM_RepeatTimeUnit)
+ ->Repetitions(3)
+ ->ReportAggregatesOnly()
+ ->Unit(benchmark::kMicrosecond);
+ADD_CASES(TC_ConsoleOut,
+ {{".*BM_RepeatTimeUnit/repeats:3 ", MR_Not},
+ {"^BM_RepeatTimeUnit/repeats:3_mean %console_us_report$"},
+ {"^BM_RepeatTimeUnit/repeats:3_stddev %console_us_report$"}});
+ADD_CASES(TC_JSONOut, {{".*BM_RepeatTimeUnit/repeats:3 ", MR_Not},
+ {"\"name\": \"BM_RepeatTimeUnit/repeats:3_mean\",$"},
+ {"\"time_unit\": \"us\",?$"},
+ {"\"name\": \"BM_RepeatTimeUnit/repeats:3_stddev\",$"},
+ {"\"time_unit\": \"us\",?$"}});
+ADD_CASES(TC_CSVOut,
+ {{".*BM_RepeatTimeUnit/repeats:3 ", MR_Not},
+ {"^\"BM_RepeatTimeUnit/repeats:3_mean\",%csv_us_report$"},
+ {"^\"BM_RepeatTimeUnit/repeats:3_stddev\",%csv_us_report$"}});
+
+// ========================================================================= //
+// --------------------------- TEST CASES END ------------------------------ //
+// ========================================================================= //
+
+int main(int argc, char* argv[]) { RunOutputTests(argc, argv); }
diff --git a/utils/google-benchmark/test/skip_with_error_test.cc b/utils/google-benchmark/test/skip_with_error_test.cc
new file mode 100644
index 000000000000..b74d33c5899c
--- /dev/null
+++ b/utils/google-benchmark/test/skip_with_error_test.cc
@@ -0,0 +1,150 @@
+
+#undef NDEBUG
+#include <cassert>
+#include <vector>
+
+#include "../src/check.h" // NOTE: check.h is for internal use only!
+#include "benchmark/benchmark.h"
+
+namespace {
+
+class TestReporter : public benchmark::ConsoleReporter {
+ public:
+ virtual bool ReportContext(const Context& context) {
+ return ConsoleReporter::ReportContext(context);
+ };
+
+ virtual void ReportRuns(const std::vector<Run>& report) {
+ all_runs_.insert(all_runs_.end(), begin(report), end(report));
+ ConsoleReporter::ReportRuns(report);
+ }
+
+ TestReporter() {}
+ virtual ~TestReporter() {}
+
+ mutable std::vector<Run> all_runs_;
+};
+
+struct TestCase {
+ std::string name;
+ bool error_occurred;
+ std::string error_message;
+
+ typedef benchmark::BenchmarkReporter::Run Run;
+
+ void CheckRun(Run const& run) const {
+ CHECK(name == run.benchmark_name) << "expected " << name << " got "
+ << run.benchmark_name;
+ CHECK(error_occurred == run.error_occurred);
+ CHECK(error_message == run.error_message);
+ if (error_occurred) {
+ // CHECK(run.iterations == 0);
+ } else {
+ CHECK(run.iterations != 0);
+ }
+ }
+};
+
+std::vector<TestCase> ExpectedResults;
+
+int AddCases(const char* base_name, std::initializer_list<TestCase> const& v) {
+ for (auto TC : v) {
+ TC.name = base_name + TC.name;
+ ExpectedResults.push_back(std::move(TC));
+ }
+ return 0;
+}
+
+#define CONCAT(x, y) CONCAT2(x, y)
+#define CONCAT2(x, y) x##y
+#define ADD_CASES(...) int CONCAT(dummy, __LINE__) = AddCases(__VA_ARGS__)
+
+} // end namespace
+
+void BM_error_before_running(benchmark::State& state) {
+ state.SkipWithError("error message");
+ while (state.KeepRunning()) {
+ assert(false);
+ }
+}
+BENCHMARK(BM_error_before_running);
+ADD_CASES("BM_error_before_running", {{"", true, "error message"}});
+
+void BM_error_during_running(benchmark::State& state) {
+ int first_iter = true;
+ while (state.KeepRunning()) {
+ if (state.range(0) == 1 && state.thread_index <= (state.threads / 2)) {
+ assert(first_iter);
+ first_iter = false;
+ state.SkipWithError("error message");
+ } else {
+ state.PauseTiming();
+ state.ResumeTiming();
+ }
+ }
+}
+BENCHMARK(BM_error_during_running)->Arg(1)->Arg(2)->ThreadRange(1, 8);
+ADD_CASES("BM_error_during_running", {{"/1/threads:1", true, "error message"},
+ {"/1/threads:2", true, "error message"},
+ {"/1/threads:4", true, "error message"},
+ {"/1/threads:8", true, "error message"},
+ {"/2/threads:1", false, ""},
+ {"/2/threads:2", false, ""},
+ {"/2/threads:4", false, ""},
+ {"/2/threads:8", false, ""}});
+
+void BM_error_after_running(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ benchmark::DoNotOptimize(state.iterations());
+ }
+ if (state.thread_index <= (state.threads / 2))
+ state.SkipWithError("error message");
+}
+BENCHMARK(BM_error_after_running)->ThreadRange(1, 8);
+ADD_CASES("BM_error_after_running", {{"/threads:1", true, "error message"},
+ {"/threads:2", true, "error message"},
+ {"/threads:4", true, "error message"},
+ {"/threads:8", true, "error message"}});
+
+void BM_error_while_paused(benchmark::State& state) {
+ bool first_iter = true;
+ while (state.KeepRunning()) {
+ if (state.range(0) == 1 && state.thread_index <= (state.threads / 2)) {
+ assert(first_iter);
+ first_iter = false;
+ state.PauseTiming();
+ state.SkipWithError("error message");
+ } else {
+ state.PauseTiming();
+ state.ResumeTiming();
+ }
+ }
+}
+BENCHMARK(BM_error_while_paused)->Arg(1)->Arg(2)->ThreadRange(1, 8);
+ADD_CASES("BM_error_while_paused", {{"/1/threads:1", true, "error message"},
+ {"/1/threads:2", true, "error message"},
+ {"/1/threads:4", true, "error message"},
+ {"/1/threads:8", true, "error message"},
+ {"/2/threads:1", false, ""},
+ {"/2/threads:2", false, ""},
+ {"/2/threads:4", false, ""},
+ {"/2/threads:8", false, ""}});
+
+int main(int argc, char* argv[]) {
+ benchmark::Initialize(&argc, argv);
+
+ TestReporter test_reporter;
+ benchmark::RunSpecifiedBenchmarks(&test_reporter);
+
+ typedef benchmark::BenchmarkReporter::Run Run;
+ auto EB = ExpectedResults.begin();
+
+ for (Run const& run : test_reporter.all_runs_) {
+ assert(EB != ExpectedResults.end());
+ EB->CheckRun(run);
+ ++EB;
+ }
+ assert(EB == ExpectedResults.end());
+
+ return 0;
+}
diff --git a/utils/google-benchmark/tools/compare_bench.py b/utils/google-benchmark/tools/compare_bench.py
new file mode 100644
index 000000000000..ed0f133e0dc9
--- /dev/null
+++ b/utils/google-benchmark/tools/compare_bench.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+"""
+compare_bench.py - Compare two benchmarks or their results and report the
+ difference.
+"""
+import sys
+import gbench
+from gbench import util, report
+
+def main():
+ # Parse the command line flags
+ def usage():
+ print('compare_bench.py <test1> <test2> [benchmark options]...')
+ exit(1)
+ if '--help' in sys.argv or len(sys.argv) < 3:
+ usage()
+ tests = sys.argv[1:3]
+ bench_opts = sys.argv[3:]
+ bench_opts = list(bench_opts)
+ # Run the benchmarks and report the results
+ json1 = gbench.util.run_or_load_benchmark(tests[0], bench_opts)
+ json2 = gbench.util.run_or_load_benchmark(tests[1], bench_opts)
+ output_lines = gbench.report.generate_difference_report(json1, json2)
+ print 'Comparing %s to %s' % (tests[0], tests[1])
+ for ln in output_lines:
+ print(ln)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json b/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json
new file mode 100644
index 000000000000..da9425e466c5
--- /dev/null
+++ b/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json
@@ -0,0 +1,46 @@
+{
+ "context": {
+ "date": "2016-08-02 17:44:46",
+ "num_cpus": 4,
+ "mhz_per_cpu": 4228,
+ "cpu_scaling_enabled": false,
+ "library_build_type": "release"
+ },
+ "benchmarks": [
+ {
+ "name": "BM_SameTimes",
+ "iterations": 1000,
+ "real_time": 10,
+ "cpu_time": 10,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_2xFaster",
+ "iterations": 1000,
+ "real_time": 50,
+ "cpu_time": 50,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_2xSlower",
+ "iterations": 1000,
+ "real_time": 50,
+ "cpu_time": 50,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_10PercentFaster",
+ "iterations": 1000,
+ "real_time": 100,
+ "cpu_time": 100,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_10PercentSlower",
+ "iterations": 1000,
+ "real_time": 100,
+ "cpu_time": 100,
+ "time_unit": "ns"
+ }
+ ]
+} \ No newline at end of file
diff --git a/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json b/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json
new file mode 100644
index 000000000000..d8bc72d29564
--- /dev/null
+++ b/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json
@@ -0,0 +1,46 @@
+{
+ "context": {
+ "date": "2016-08-02 17:44:46",
+ "num_cpus": 4,
+ "mhz_per_cpu": 4228,
+ "cpu_scaling_enabled": false,
+ "library_build_type": "release"
+ },
+ "benchmarks": [
+ {
+ "name": "BM_SameTimes",
+ "iterations": 1000,
+ "real_time": 10,
+ "cpu_time": 10,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_2xFaster",
+ "iterations": 1000,
+ "real_time": 25,
+ "cpu_time": 25,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_2xSlower",
+ "iterations": 20833333,
+ "real_time": 100,
+ "cpu_time": 100,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_10PercentFaster",
+ "iterations": 1000,
+ "real_time": 90,
+ "cpu_time": 90,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_10PercentSlower",
+ "iterations": 1000,
+ "real_time": 110,
+ "cpu_time": 110,
+ "time_unit": "ns"
+ }
+ ]
+} \ No newline at end of file
diff --git a/utils/google-benchmark/tools/gbench/__init__.py b/utils/google-benchmark/tools/gbench/__init__.py
new file mode 100644
index 000000000000..fce1a1acfbb3
--- /dev/null
+++ b/utils/google-benchmark/tools/gbench/__init__.py
@@ -0,0 +1,8 @@
+"""Google Benchmark tooling"""
+
+__author__ = 'Eric Fiselier'
+__email__ = 'eric@efcs.ca'
+__versioninfo__ = (0, 5, 0)
+__version__ = '.'.join(str(v) for v in __versioninfo__) + 'dev'
+
+__all__ = []
diff --git a/utils/google-benchmark/tools/gbench/report.py b/utils/google-benchmark/tools/gbench/report.py
new file mode 100644
index 000000000000..ac69b9bef664
--- /dev/null
+++ b/utils/google-benchmark/tools/gbench/report.py
@@ -0,0 +1,141 @@
+"""report.py - Utilities for reporting statistics about benchmark results
+"""
+import os
+
+class BenchmarkColor(object):
+ def __init__(self, name, code):
+ self.name = name
+ self.code = code
+
+ def __repr__(self):
+ return '%s%r' % (self.__class__.__name__,
+ (self.name, self.code))
+
+ def __format__(self, format):
+ return self.code
+
+# Benchmark Colors Enumeration
+BC_NONE = BenchmarkColor('NONE', '')
+BC_MAGENTA = BenchmarkColor('MAGENTA', '\033[95m')
+BC_CYAN = BenchmarkColor('CYAN', '\033[96m')
+BC_OKBLUE = BenchmarkColor('OKBLUE', '\033[94m')
+BC_HEADER = BenchmarkColor('HEADER', '\033[92m')
+BC_WARNING = BenchmarkColor('WARNING', '\033[93m')
+BC_WHITE = BenchmarkColor('WHITE', '\033[97m')
+BC_FAIL = BenchmarkColor('FAIL', '\033[91m')
+BC_ENDC = BenchmarkColor('ENDC', '\033[0m')
+BC_BOLD = BenchmarkColor('BOLD', '\033[1m')
+BC_UNDERLINE = BenchmarkColor('UNDERLINE', '\033[4m')
+
+def color_format(use_color, fmt_str, *args, **kwargs):
+ """
+ Return the result of 'fmt_str.format(*args, **kwargs)' after transforming
+ 'args' and 'kwargs' according to the value of 'use_color'. If 'use_color'
+ is False then all color codes in 'args' and 'kwargs' are replaced with
+ the empty string.
+ """
+ assert use_color is True or use_color is False
+ if not use_color:
+ args = [arg if not isinstance(arg, BenchmarkColor) else BC_NONE
+ for arg in args]
+ kwargs = {key: arg if not isinstance(arg, BenchmarkColor) else BC_NONE
+ for key, arg in kwargs.items()}
+ return fmt_str.format(*args, **kwargs)
+
+
+def find_longest_name(benchmark_list):
+ """
+ Return the length of the longest benchmark name in a given list of
+ benchmark JSON objects
+ """
+ longest_name = 1
+ for bc in benchmark_list:
+ if len(bc['name']) > longest_name:
+ longest_name = len(bc['name'])
+ return longest_name
+
+
+def calculate_change(old_val, new_val):
+ """
+ Return a float representing the decimal change between old_val and new_val.
+ """
+ if old_val == 0 and new_val == 0:
+ return 0.0
+ if old_val == 0:
+ return float(new_val - old_val) / (float(old_val + new_val) / 2)
+ return float(new_val - old_val) / abs(old_val)
+
+
+def generate_difference_report(json1, json2, use_color=True):
+ """
+ Calculate and report the difference between each test of two benchmarks
+ runs specified as 'json1' and 'json2'.
+ """
+ first_col_width = find_longest_name(json1['benchmarks']) + 5
+ def find_test(name):
+ for b in json2['benchmarks']:
+ if b['name'] == name:
+ return b
+ return None
+ first_line = "{:<{}s} Time CPU Old New".format(
+ 'Benchmark', first_col_width)
+ output_strs = [first_line, '-' * len(first_line)]
+ for bn in json1['benchmarks']:
+ other_bench = find_test(bn['name'])
+ if not other_bench:
+ continue
+
+ def get_color(res):
+ if res > 0.05:
+ return BC_FAIL
+ elif res > -0.07:
+ return BC_WHITE
+ else:
+ return BC_CYAN
+ fmt_str = "{}{:<{}s}{endc} {}{:+.2f}{endc} {}{:+.2f}{endc} {:4d} {:4d}"
+ tres = calculate_change(bn['real_time'], other_bench['real_time'])
+ cpures = calculate_change(bn['cpu_time'], other_bench['cpu_time'])
+ output_strs += [color_format(use_color, fmt_str,
+ BC_HEADER, bn['name'], first_col_width,
+ get_color(tres), tres, get_color(cpures), cpures,
+ bn['cpu_time'], other_bench['cpu_time'],
+ endc=BC_ENDC)]
+ return output_strs
+
+###############################################################################
+# Unit tests
+
+import unittest
+
+class TestReportDifference(unittest.TestCase):
+ def load_results(self):
+ import json
+ testInputs = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Inputs')
+ testOutput1 = os.path.join(testInputs, 'test1_run1.json')
+ testOutput2 = os.path.join(testInputs, 'test1_run2.json')
+ with open(testOutput1, 'r') as f:
+ json1 = json.load(f)
+ with open(testOutput2, 'r') as f:
+ json2 = json.load(f)
+ return json1, json2
+
+ def test_basic(self):
+ expect_lines = [
+ ['BM_SameTimes', '+0.00', '+0.00'],
+ ['BM_2xFaster', '-0.50', '-0.50'],
+ ['BM_2xSlower', '+1.00', '+1.00'],
+ ['BM_10PercentFaster', '-0.10', '-0.10'],
+ ['BM_10PercentSlower', '+0.10', '+0.10']
+ ]
+ json1, json2 = self.load_results()
+ output_lines = generate_difference_report(json1, json2, use_color=False)
+ print output_lines
+ self.assertEqual(len(output_lines), len(expect_lines))
+ for i in xrange(0, len(output_lines)):
+ parts = [x for x in output_lines[i].split(' ') if x]
+ self.assertEqual(len(parts), 3)
+ self.assertEqual(parts, expect_lines[i])
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/utils/google-benchmark/tools/gbench/util.py b/utils/google-benchmark/tools/gbench/util.py
new file mode 100644
index 000000000000..169b71c2c315
--- /dev/null
+++ b/utils/google-benchmark/tools/gbench/util.py
@@ -0,0 +1,130 @@
+"""util.py - General utilities for running, loading, and processing benchmarks
+"""
+import json
+import os
+import tempfile
+import subprocess
+import sys
+
+# Input file type enumeration
+IT_Invalid = 0
+IT_JSON = 1
+IT_Executable = 2
+
+_num_magic_bytes = 2 if sys.platform.startswith('win') else 4
+def is_executable_file(filename):
+ """
+ Return 'True' if 'filename' names a valid file which is likely
+ an executable. A file is considered an executable if it starts with the
+ magic bytes for a EXE, Mach O, or ELF file.
+ """
+ if not os.path.isfile(filename):
+ return False
+ with open(filename, 'r') as f:
+ magic_bytes = f.read(_num_magic_bytes)
+ if sys.platform == 'darwin':
+ return magic_bytes in [
+ '\xfe\xed\xfa\xce', # MH_MAGIC
+ '\xce\xfa\xed\xfe', # MH_CIGAM
+ '\xfe\xed\xfa\xcf', # MH_MAGIC_64
+ '\xcf\xfa\xed\xfe', # MH_CIGAM_64
+ '\xca\xfe\xba\xbe', # FAT_MAGIC
+ '\xbe\xba\xfe\xca' # FAT_CIGAM
+ ]
+ elif sys.platform.startswith('win'):
+ return magic_bytes == 'MZ'
+ else:
+ return magic_bytes == '\x7FELF'
+
+
+def is_json_file(filename):
+ """
+ Returns 'True' if 'filename' names a valid JSON output file.
+ 'False' otherwise.
+ """
+ try:
+ with open(filename, 'r') as f:
+ json.load(f)
+ return True
+ except:
+ pass
+ return False
+
+
+def classify_input_file(filename):
+ """
+ Return a tuple (type, msg) where 'type' specifies the classified type
+ of 'filename'. If 'type' is 'IT_Invalid' then 'msg' is a human readable
+ string represeting the error.
+ """
+ ftype = IT_Invalid
+ err_msg = None
+ if not os.path.exists(filename):
+ err_msg = "'%s' does not exist" % filename
+ elif not os.path.isfile(filename):
+ err_msg = "'%s' does not name a file" % filename
+ elif is_executable_file(filename):
+ ftype = IT_Executable
+ elif is_json_file(filename):
+ ftype = IT_JSON
+ else:
+ err_msg = "'%s' does not name a valid benchmark executable or JSON file"
+ return ftype, err_msg
+
+
+def check_input_file(filename):
+ """
+ Classify the file named by 'filename' and return the classification.
+ If the file is classified as 'IT_Invalid' print an error message and exit
+ the program.
+ """
+ ftype, msg = classify_input_file(filename)
+ if ftype == IT_Invalid:
+ print "Invalid input file: %s" % msg
+ sys.exit(1)
+ return ftype
+
+
+def load_benchmark_results(fname):
+ """
+ Read benchmark output from a file and return the JSON object.
+ REQUIRES: 'fname' names a file containing JSON benchmark output.
+ """
+ with open(fname, 'r') as f:
+ return json.load(f)
+
+
+def run_benchmark(exe_name, benchmark_flags):
+ """
+ Run a benchmark specified by 'exe_name' with the specified
+ 'benchmark_flags'. The benchmark is run directly as a subprocess to preserve
+ real time console output.
+ RETURNS: A JSON object representing the benchmark output
+ """
+ thandle, tname = tempfile.mkstemp()
+ os.close(thandle)
+ cmd = [exe_name] + benchmark_flags
+ print("RUNNING: %s" % ' '.join(cmd))
+ exitCode = subprocess.call(cmd + ['--benchmark_out=%s' % tname])
+ if exitCode != 0:
+ print('TEST FAILED...')
+ sys.exit(exitCode)
+ json_res = load_benchmark_results(tname)
+ os.unlink(tname)
+ return json_res
+
+
+def run_or_load_benchmark(filename, benchmark_flags):
+ """
+ Get the results for a specified benchmark. If 'filename' specifies
+ an executable benchmark then the results are generated by running the
+ benchmark. Otherwise 'filename' must name a valid JSON output file,
+ which is loaded and the result returned.
+ """
+ ftype = check_input_file(filename)
+ if ftype == IT_JSON:
+ return load_benchmark_results(filename)
+ elif ftype == IT_Executable:
+ return run_benchmark(filename, benchmark_flags)
+ else:
+ assert False # This branch is unreachable \ No newline at end of file
diff --git a/utils/merge_archives.py b/utils/merge_archives.py
new file mode 100755
index 000000000000..856dd3bfae90
--- /dev/null
+++ b/utils/merge_archives.py
@@ -0,0 +1,130 @@
+#!/usr/bin/env python
+#===----------------------------------------------------------------------===##
+#
+# 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.
+#
+#===----------------------------------------------------------------------===##
+
+from argparse import ArgumentParser
+from ctypes.util import find_library
+import distutils.spawn
+import glob
+import tempfile
+import os
+import shutil
+import subprocess
+import signal
+import sys
+
+temp_directory_root = None
+def exit_with_cleanups(status):
+ if temp_directory_root is not None:
+ shutil.rmtree(temp_directory_root)
+ sys.exit(status)
+
+def print_and_exit(msg):
+ sys.stderr.write(msg + '\n')
+ exit_with_cleanups(1)
+
+def find_and_diagnose_missing(lib, search_paths):
+ if os.path.exists(lib):
+ return os.path.abspath(lib)
+ if not lib.startswith('lib') or not lib.endswith('.a'):
+ print_and_exit(("input file '%s' not not name a static library. "
+ "It should start with 'lib' and end with '.a") % lib)
+ for sp in search_paths:
+ assert type(sp) is list and len(sp) == 1
+ path = os.path.join(sp[0], lib)
+ if os.path.exists(path):
+ return os.path.abspath(path)
+ print_and_exit("input '%s' does not exist" % lib)
+
+
+def execute_command(cmd, cwd=None):
+ """
+ Execute a command, capture and return its output.
+ """
+ kwargs = {
+ 'stdin': subprocess.PIPE,
+ 'stdout': subprocess.PIPE,
+ 'stderr': subprocess.PIPE,
+ 'cwd': cwd
+ }
+ p = subprocess.Popen(cmd, **kwargs)
+ out, err = p.communicate()
+ exitCode = p.wait()
+ if exitCode == -signal.SIGINT:
+ raise KeyboardInterrupt
+ return out, err, exitCode
+
+
+def execute_command_verbose(cmd, cwd=None, verbose=False):
+ """
+ Execute a command and print its output on failure.
+ """
+ out, err, exitCode = execute_command(cmd, cwd=cwd)
+ if exitCode != 0 or verbose:
+ report = "Command: %s\n" % ' '.join(["'%s'" % a for a in cmd])
+ if exitCode != 0:
+ report += "Exit Code: %d\n" % exitCode
+ if out:
+ report += "Standard Output:\n--\n%s--" % out
+ if err:
+ report += "Standard Error:\n--\n%s--" % err
+ if exitCode != 0:
+ report += "\n\nFailed!"
+ sys.stderr.write('%s\n' % report)
+ if exitCode != 0:
+ exit_with_cleanups(exitCode)
+
+def main():
+ parser = ArgumentParser(
+ description="Merge multiple archives into a single library")
+ parser.add_argument(
+ '-v', '--verbose', dest='verbose', action='store_true', default=False)
+ parser.add_argument(
+ '-o', '--output', dest='output', required=True,
+ help='The output file. stdout is used if not given',
+ type=str, action='store')
+ parser.add_argument(
+ '-L', dest='search_paths',
+ help='Paths to search for the libraries along', action='append',
+ nargs=1)
+ parser.add_argument(
+ 'archives', metavar='archives', nargs='+',
+ help='The archives to merge')
+
+ args = parser.parse_args()
+
+ ar_exe = distutils.spawn.find_executable('ar')
+ if not ar_exe:
+ print_and_exit("failed to find 'ar' executable")
+
+ if len(args.archives) < 2:
+ print_and_exit('fewer than 2 inputs provided')
+ archives = [find_and_diagnose_missing(ar, args.search_paths)
+ for ar in args.archives]
+ print ('Merging archives: %s' % archives)
+ if not os.path.exists(os.path.dirname(args.output)):
+ print_and_exit("output path doesn't exist: '%s'" % args.output)
+
+ global temp_directory_root
+ temp_directory_root = tempfile.mkdtemp('.libcxx.merge.archives')
+
+ for arc in archives:
+ execute_command_verbose([ar_exe, '-x', arc], cwd=temp_directory_root,
+ verbose=args.verbose)
+
+ files = glob.glob(os.path.join(temp_directory_root, '*.o'))
+ if not files:
+ print_and_exit('Failed to glob for %s' % glob_path)
+ cmd = [ar_exe, '-qc', args.output] + files
+ execute_command_verbose(cmd, cwd=temp_directory_root, verbose=args.verbose)
+
+
+if __name__ == '__main__':
+ main()
+ exit_with_cleanups(0)
diff --git a/utils/sym_check/sym_check/extract.py b/utils/sym_check/sym_check/extract.py
index 7bafd8ec4c54..d132e22822bb 100644
--- a/utils/sym_check/sym_check/extract.py
+++ b/utils/sym_check/sym_check/extract.py
@@ -12,9 +12,11 @@ extract - A set of function that extract symbol lists from shared libraries.
"""
import distutils.spawn
import sys
+import re
from sym_check import util
+extract_ignore_names = ['_init', '_fini']
class NMExtractor(object):
"""
@@ -65,7 +67,8 @@ class NMExtractor(object):
return None
new_sym = {
'name': bits[0],
- 'type': bits[1]
+ 'type': bits[1],
+ 'is_defined': (bits[1].lower() != 'u')
}
new_sym['name'] = new_sym['name'].replace('@@', '@')
new_sym = self._transform_sym_type(new_sym)
@@ -81,6 +84,8 @@ class NMExtractor(object):
"""
if sym is None or len(sym) < 2:
return False
+ if sym['name'] in extract_ignore_names:
+ return False
bad_types = ['t', 'b', 'r', 'd', 'w']
return (sym['type'] not in bad_types
and sym['name'] not in ['__bss_start', '_end', '_edata'])
@@ -148,8 +153,11 @@ class ReadElfExtractor(object):
'name': parts[7],
'size': int(parts[2]),
'type': parts[3],
+ 'is_defined': (parts[6] != 'UND')
}
assert new_sym['type'] in ['OBJECT', 'FUNC', 'NOTYPE']
+ if new_sym['name'] in extract_ignore_names:
+ continue
if new_sym['type'] == 'NOTYPE':
continue
if new_sym['type'] == 'FUNC':
diff --git a/utils/sym_check/sym_check/util.py b/utils/sym_check/sym_check/util.py
index 6ae71b01080a..9543984673cc 100644
--- a/utils/sym_check/sym_check/util.py
+++ b/utils/sym_check/sym_check/util.py
@@ -12,7 +12,7 @@ import distutils.spawn
import signal
import subprocess
import sys
-
+import re
def execute_command(cmd, input_str=None):
"""
@@ -79,9 +79,9 @@ def write_syms(sym_list, out=None, names_only=False):
"""
out_str = ''
out_list = sym_list
+ out_list.sort(key=lambda x: x['name'])
if names_only:
out_list = [sym['name'] for sym in sym_list]
- out_list.sort()
for sym in out_list:
out_str += '%s\n' % sym
if out is None:
@@ -135,3 +135,168 @@ def extract_or_load(filename):
if is_library_file(filename):
return sym_check.extract.extract_symbols(filename)
return read_syms_from_file(filename)
+
+def adjust_mangled_name(name):
+ if not name.startswith('__Z'):
+ return name
+ return name[1:]
+
+new_delete_std_symbols = [
+ '_Znam',
+ '_Znwm',
+ '_ZdaPv',
+ '_ZdaPvm',
+ '_ZdlPv',
+ '_ZdlPvm'
+]
+
+cxxabi_symbols = [
+ '___dynamic_cast',
+ '___gxx_personality_v0',
+ '_ZTIDi',
+ '_ZTIDn',
+ '_ZTIDs',
+ '_ZTIPDi',
+ '_ZTIPDn',
+ '_ZTIPDs',
+ '_ZTIPKDi',
+ '_ZTIPKDn',
+ '_ZTIPKDs',
+ '_ZTIPKa',
+ '_ZTIPKb',
+ '_ZTIPKc',
+ '_ZTIPKd',
+ '_ZTIPKe',
+ '_ZTIPKf',
+ '_ZTIPKh',
+ '_ZTIPKi',
+ '_ZTIPKj',
+ '_ZTIPKl',
+ '_ZTIPKm',
+ '_ZTIPKs',
+ '_ZTIPKt',
+ '_ZTIPKv',
+ '_ZTIPKw',
+ '_ZTIPKx',
+ '_ZTIPKy',
+ '_ZTIPa',
+ '_ZTIPb',
+ '_ZTIPc',
+ '_ZTIPd',
+ '_ZTIPe',
+ '_ZTIPf',
+ '_ZTIPh',
+ '_ZTIPi',
+ '_ZTIPj',
+ '_ZTIPl',
+ '_ZTIPm',
+ '_ZTIPs',
+ '_ZTIPt',
+ '_ZTIPv',
+ '_ZTIPw',
+ '_ZTIPx',
+ '_ZTIPy',
+ '_ZTIa',
+ '_ZTIb',
+ '_ZTIc',
+ '_ZTId',
+ '_ZTIe',
+ '_ZTIf',
+ '_ZTIh',
+ '_ZTIi',
+ '_ZTIj',
+ '_ZTIl',
+ '_ZTIm',
+ '_ZTIs',
+ '_ZTIt',
+ '_ZTIv',
+ '_ZTIw',
+ '_ZTIx',
+ '_ZTIy',
+ '_ZTSDi',
+ '_ZTSDn',
+ '_ZTSDs',
+ '_ZTSPDi',
+ '_ZTSPDn',
+ '_ZTSPDs',
+ '_ZTSPKDi',
+ '_ZTSPKDn',
+ '_ZTSPKDs',
+ '_ZTSPKa',
+ '_ZTSPKb',
+ '_ZTSPKc',
+ '_ZTSPKd',
+ '_ZTSPKe',
+ '_ZTSPKf',
+ '_ZTSPKh',
+ '_ZTSPKi',
+ '_ZTSPKj',
+ '_ZTSPKl',
+ '_ZTSPKm',
+ '_ZTSPKs',
+ '_ZTSPKt',
+ '_ZTSPKv',
+ '_ZTSPKw',
+ '_ZTSPKx',
+ '_ZTSPKy',
+ '_ZTSPa',
+ '_ZTSPb',
+ '_ZTSPc',
+ '_ZTSPd',
+ '_ZTSPe',
+ '_ZTSPf',
+ '_ZTSPh',
+ '_ZTSPi',
+ '_ZTSPj',
+ '_ZTSPl',
+ '_ZTSPm',
+ '_ZTSPs',
+ '_ZTSPt',
+ '_ZTSPv',
+ '_ZTSPw',
+ '_ZTSPx',
+ '_ZTSPy',
+ '_ZTSa',
+ '_ZTSb',
+ '_ZTSc',
+ '_ZTSd',
+ '_ZTSe',
+ '_ZTSf',
+ '_ZTSh',
+ '_ZTSi',
+ '_ZTSj',
+ '_ZTSl',
+ '_ZTSm',
+ '_ZTSs',
+ '_ZTSt',
+ '_ZTSv',
+ '_ZTSw',
+ '_ZTSx',
+ '_ZTSy'
+]
+
+def is_stdlib_symbol_name(name):
+ name = adjust_mangled_name(name)
+ if re.search("@GLIBC|@GCC", name):
+ return False
+ if re.search('(St[0-9])|(__cxa)|(__cxxabi)', name):
+ return True
+ if name in new_delete_std_symbols:
+ return True
+ if name in cxxabi_symbols:
+ return True
+ if name.startswith('_Z'):
+ return True
+ return False
+
+def filter_stdlib_symbols(syms):
+ stdlib_symbols = []
+ other_symbols = []
+ for s in syms:
+ canon_name = adjust_mangled_name(s['name'])
+ if not is_stdlib_symbol_name(canon_name):
+ assert not s['is_defined'] and "found defined non-std symbol"
+ other_symbols += [s]
+ else:
+ stdlib_symbols += [s]
+ return stdlib_symbols, other_symbols
diff --git a/utils/sym_check/sym_diff.py b/utils/sym_check/sym_diff.py
index 69c340028c6b..842e908dd42e 100755
--- a/utils/sym_check/sym_diff.py
+++ b/utils/sym_check/sym_diff.py
@@ -24,6 +24,13 @@ def main():
help='Only print symbol names',
action='store_true', default=False)
parser.add_argument(
+ '--removed-only', dest='removed_only',
+ help='Only print removed symbols',
+ action='store_true', default=False)
+ parser.add_argument('--only-stdlib-symbols', dest='only_stdlib',
+ help="Filter all symbols not related to the stdlib",
+ action='store_true', default=False)
+ parser.add_argument(
'-o', '--output', dest='output',
help='The output file. stdout is used if not given',
type=str, action='store', default=None)
@@ -40,7 +47,13 @@ def main():
old_syms_list = util.extract_or_load(args.old_syms)
new_syms_list = util.extract_or_load(args.new_syms)
+ if args.only_stdlib:
+ old_syms_list, _ = util.filter_stdlib_symbols(old_syms_list)
+ new_syms_list, _ = util.filter_stdlib_symbols(new_syms_list)
+
added, removed, changed = diff.diff(old_syms_list, new_syms_list)
+ if args.removed_only:
+ added = {}
report, is_break = diff.report_diff(added, removed, changed,
names_only=args.names_only,
demangle=args.demangle)
diff --git a/utils/sym_check/sym_extract.py b/utils/sym_check/sym_extract.py
index a0fbb3e6341a..27765679ed80 100755
--- a/utils/sym_check/sym_extract.py
+++ b/utils/sym_check/sym_extract.py
@@ -25,11 +25,16 @@ def main():
parser.add_argument('--names-only', dest='names_only',
help='Output only the name of the symbol',
action='store_true', default=False)
+ parser.add_argument('--only-stdlib-symbols', dest='only_stdlib',
+ help="Filter all symbols not related to the stdlib",
+ action='store_true', default=False)
args = parser.parse_args()
if args.output is not None:
print('Extracting symbols from %s to %s.'
% (args.library, args.output))
syms = extract.extract_symbols(args.library)
+ if args.only_stdlib:
+ syms, other_syms = util.filter_stdlib_symbols(syms)
util.write_syms(syms, out=args.output, names_only=args.names_only)
diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html
index dc6587a1d1fd..2a78c84d3c6f 100644
--- a/www/cxx1z_status.html
+++ b/www/cxx1z_status.html
@@ -3,7 +3,7 @@
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>libc++ C++1Z Status</title>
<link type="text/css" rel="stylesheet" href="menu.css">
<link type="text/css" rel="stylesheet" href="content.css">
@@ -64,7 +64,7 @@
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4284">N4284</a></td><td>LWG</td></td><td>Contiguous Iterators.</td><td>Urbana</td><td>Complete</td><td>3.6</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4285">N4285</a></td><td>CWG</td></td><td>Cleanup for exception-specification and throw-expression.</td><td>Urbana</td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4387">N4387</a></td><td>LWG</td></td><td>improving pair and tuple</td><td>Lenexa</td><td></td><td></td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4387">N4387</a></td><td>LWG</td></td><td>improving pair and tuple</td><td>Lenexa</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4389">N4389</a></td><td>LWG</td></td><td>bool_constant</td><td>Lenexa</td><td>Complete</td><td>3.7</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4508">N4508</a></td><td>LWG</td></td><td>shared_mutex for C++17</td><td>Lenexa</td><td>Complete</td><td>3.7</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4366">N4366</a></td><td>LWG</td></td><td>LWG 2228 missing SFINAE rule</td><td>Lenexa</td><td>Complete</td><td>3.1</td></tr>
@@ -90,40 +90,62 @@
<tr><td><a href="http://wg21.link/P0025R0">P0025R0</a></td><td>LWG</td><td>An algorithm to "clamp" a value between a pair of boundary values</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
<tr><td><a href="http://wg21.link/P0154R1">P0154R1</a></td><td>LWG</td><td>constexpr std::hardware_{constructive,destructive}_interference_size</td><td>Jacksonville</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0030R1">P0030R1</a></td><td>LWG</td><td>Proposal to Introduce a 3-Argument Overload to std::hypot</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
- <tr><td><a href="http://wg21.link/P0031R0">P0031R0</a></td><td>LWG</td><td>A Proposal to Add Constexpr Modifiers to reverse_iterator, move_iterator, array and Range Access</td><td>Jacksonville</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0031R0">P0031R0</a></td><td>LWG</td><td>A Proposal to Add Constexpr Modifiers to reverse_iterator, move_iterator, array and Range Access</td><td>Jacksonville</td><td>In progress</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/P0272R1">P0272R1</a></td><td>LWG</td><td>Give <tt>std::string</tt> a non-const <tt>.data()</tt> member function</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
<tr><td><a href="http://wg21.link/P0077R2">P0077R2</a></td><td>LWG</td><td><tt>is_callable</tt>, the missing INVOKE related trait</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
<tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0032r3">p0032r3</a></td><td>LWG</td><td>Homogeneous interface for variant, any and optional</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0040r3">p0040r3</a></td><td>LWG</td><td>Extending memory management tools</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0063r3">p0063r3</a></td><td>LWG</td><td>C++17 should refer to C11 instead of C99</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0067r3">p0067r3</a></td><td>LWG</td><td>Elementary string conversions</td><td>Oulu</td><td>Postponed to Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0032r3">p0032r3</a></td><td>LWG</td><td>Homogeneous interface for variant, any and optional</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0040r3">p0040r3</a></td><td>LWG</td><td>Extending memory management tools</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0063r3">p0063r3</a></td><td>LWG</td><td>C++17 should refer to C11 instead of C99</td><td>Oulu</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+ <tr><td><a href="http://wg21.link/p0067r3">p0067r3</a></td><td>LWG</td><td>Elementary string conversions</td><td>Oulu</td><td>Now <a href="http://wg21.link/P0067R5">P0067R5</a></td><td></td></tr>
<tr><td><a href="http://wg21.link/p0083r3">p0083r3</a></td><td>LWG</td><td>Splicing Maps and Sets</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0084r2">p0084r2</a></td><td>LWG</td><td>Emplace Return Type</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0088r3">p0088r3</a></td><td>LWG</td><td>Variant: a type-safe union for C++17</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0084r2">p0084r2</a></td><td>LWG</td><td>Emplace Return Type</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0088r3">p0088r3</a></td><td>LWG</td><td>Variant: a type-safe union for C++17</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/p0163r0">p0163r0</a></td><td>LWG</td><td>shared_ptr::weak_type</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr>
<tr><td><a href="http://wg21.link/p0174r2">p0174r2</a></td><td>LWG</td><td>Deprecating Vestigial Library Parts in C++17</td><td>Oulu</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/p0175r1">p0175r1</a></td><td>LWG</td><td>Synopses for the C library</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0180r2">p0180r2</a></td><td>LWG</td><td>Reserve a New Library Namespace for Future Standardization</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0180r2">p0180r2</a></td><td>LWG</td><td>Reserve a New Library Namespace for Future Standardization</td><td>Oulu</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
<tr><td><a href="http://wg21.link/p0181r1">p0181r1</a></td><td>LWG</td><td>Ordered by Default</td><td>Oulu</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/p0209r2">p0209r2</a></td><td>LWG</td><td>make_from_tuple: apply for construction</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr>
<tr><td><a href="http://wg21.link/p0219r1">p0219r1</a></td><td>LWG</td><td>Relative Paths for Filesystem</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0254r2">p0254r2</a></td><td>LWG</td><td>Integrating std::string_view and std::string</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0254r2">p0254r2</a></td><td>LWG</td><td>Integrating std::string_view and std::string</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/p0258r2">p0258r2</a></td><td>LWG</td><td>has_unique_object_representations</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0295r0">p0295r0</a></td><td>LWG</td><td>Adopt Selected Library Fundamentals V2 Components for C++17</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0302r1">p0302r1</a></td><td>LWG</td><td>Removing Allocator Support in std::function</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0307r2">p0307r2</a></td><td>LWG</td><td>Making Optional Greater Equal Again</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0295r0">p0295r0</a></td><td>LWG</td><td>Adopt Selected Library Fundamentals V2 Components for C++17</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0302r1">p0302r1</a></td><td>LWG</td><td>Removing Allocator Support in std::function</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0307r2">p0307r2</a></td><td>LWG</td><td>Making Optional Greater Equal Again</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/p0336r1">p0336r1</a></td><td>LWG</td><td>Better Names for Parallel Execution Policies in C++17</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0337r0">p0337r0</a></td><td>LWG</td><td>Delete operator= for polymorphic_allocator</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0346r1">p0346r1</a></td><td>LWG</td><td>A &lt;random&gt; Nomenclature Tweak</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0358r1">p0358r1</a></td><td>LWG</td><td>Fixes for not_fn</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0371r1">p0371r1</a></td><td>LWG</td><td>Temporarily discourage memory_order_consume</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0392r0">p0392r0</a></td><td>LWG</td><td>Adapting string_view by filesystem paths</td><td>Oulu</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/p0393r3">p0393r3</a></td><td>LWG</td><td>Making Variant Greater Equal</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0337r0">p0337r0</a></td><td>LWG</td><td>Delete operator= for polymorphic_allocator</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/p0346r1">p0346r1</a></td><td>LWG</td><td>A &lt;random&gt; Nomenclature Tweak</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/p0358r1">p0358r1</a></td><td>LWG</td><td>Fixes for not_fn</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/p0371r1">p0371r1</a></td><td>LWG</td><td>Temporarily discourage memory_order_consume</td><td>Oulu</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+ <tr><td><a href="http://wg21.link/p0392r0">p0392r0</a></td><td>LWG</td><td>Adapting string_view by filesystem paths</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0393r3">p0393r3</a></td><td>LWG</td><td>Making Variant Greater Equal</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/P0394r4">P0394r4</a></td><td>LWG</td><td>Hotel Parallelifornia: terminate() for Parallel Algorithms Exception Handling</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0003R5">P0003R5</a></td><td>LWG</td><td>Removing Deprecated Exception Specifications from C++17</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0067R5">P0067R5</a></td><td>LWG</td><td>Elementary string conversions, revision 5</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0403R1">P0403R1</a></td><td>LWG</td><td>Literal suffixes for <tt>basic_string_view</tt></td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0414R2">P0414R2</a></td><td>LWG</td><td>Merging shared_ptr changes from Library Fundamentals to C++17</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0418R2">P0418R2</a></td><td>LWG</td><td>Fail or succeed: there is no atomic lattice</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0426R1">P0426R1</a></td><td>LWG</td><td>Constexpr for <tt>std::char_traits</tt></td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0435R1">P0435R1</a></td><td>LWG</td><td>Resolving LWG Issues re <tt>common_type</tt></td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0502R0">P0502R0</a></td><td>LWG</td><td>Throwing out of a parallel algorithm terminates - but how?</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0503R0">P0503R0</a></td><td>LWG</td><td>Correcting library usage of "literal type"</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0504R0">P0504R0</a></td><td>LWG</td><td>Revisiting in-place tag types for any/optional/variant</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0505R0">P0505R0</a></td><td>LWG</td><td>Wording for GB 50 - constexpr for chrono</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0508R0">P0508R0</a></td><td>LWG</td><td>Wording for GB 58 - structured bindings for node_handles</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0509R1">P0509R1</a></td><td>LWG</td><td>Updating “Restrictions on exception handlingâ€</td><td>Issaquah</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+ <tr><td><a href="http://wg21.link/P0510R0">P0510R0</a></td><td>LWG</td><td>Disallowing references, incomplete types, arrays, and empty variants</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0513R0">P0513R0</a></td><td>LWG</td><td>Poisoning the Hash</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0516R0">P0516R0</a></td><td>LWG</td><td>Clarify That shared_future’s Copy Operations have Wide Contracts</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0517R0">P0517R0</a></td><td>LWG</td><td>Make future_error Constructible</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0521R0">P0521R0</a></td><td>LWG</td><td>Proposed Resolution for CA 14 (shared_ptr use_count/unique)</td><td>Issaquah</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+
<!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
</table>
+<p><i>[ Note: "Nothing to do" means that no library changes were needed to implement this change -- end note]</i></p>
+
<h3>Library Working group Issues Status</h3>
<!-- <I>Note: "NAD" means that the issue was deemed "Not a defect"</I> -->
<table id="issues" border="1">
@@ -140,7 +162,7 @@
<tr><td><a href="http://wg21.link/LWG2400">2400</a></td><td><code>shared_ptr</code>'s <code>get_deleter()</code> should use <code>addressof()</code></td><td>Urbana</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2401">2401</a></td><td><code>std::function</code> needs more noexcept</td><td>Urbana</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2404">2404</a></td><td><code>mismatch()</code>'s complexity needs to be updated</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2408">2408</a></td><td>SFINAE-friendly <code>common_type</code> / <code>iterator_traits</code> is missing in C++14</td><td>Urbana</td><td><code>common_type</code> is waiting on <a href="http://wg21.link/LWG2465">LWG#2465</a></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2408">2408</a></td><td>SFINAE-friendly <code>common_type</code> / <code>iterator_traits</code> is missing in C++14</td><td>Urbana</td><td>Complete</td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2106">2106</td><td><code>move_iterator</code> wrapping iterators returning prvalues</td><td>Urbana</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2129">2129</td><td>User specializations of <code>std::initializer_list</code></td><td>Urbana</td><td>Complete</td></tr>
@@ -264,14 +286,14 @@
<tr><td><a href="http://wg21.link/LWG2309">2309</a></td><td>mutex::lock() should not throw device_or_resource_busy</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2310">2310</a></td><td>Public exposition only member in std::array</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2312">2312</a></td><td>tuple's constructor constraints need to be phrased more precisely</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2328">2328</a></td><td>Rvalue stream extraction should use perfect forwarding</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2393">2393</a></td><td>std::function's Callable definition is broken</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2328">2328</a></td><td>Rvalue stream extraction should use perfect forwarding</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2393">2393</a></td><td>std::function's Callable definition is broken</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2422">2422</a></td><td>std::numeric_limits&lt;T&gt;::is_modulo description: "most machines" errata</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2426">2426</a></td><td>Issue about compare_exchange</td><td>Oulu</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2436">2436</a></td><td>Comparators for associative containers should always be CopyConstructible</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2441">2441</a></td><td>Exact-width atomic typedefs should be provided</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2451">2451</a></td><td>[fund.ts.v2] optional should 'forward' T's implicit conversions</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2509">2509</a></td><td>[fund.ts.v2] any_cast doesn't work with rvalue reference targets and cannot move with a value target</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2509">2509</a></td><td>[fund.ts.v2] any_cast doesn't work with rvalue reference targets and cannot move with a value target</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2516">2516</a></td><td>[fund.ts.v2] Public "exposition only" members in observer_ptr</td><td>Oulu</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2542">2542</a></td><td>Missing const requirements for associative containers</td><td>Oulu</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2549">2549</a></td><td>Tuple EXPLICIT constructor templates that take tuple parameters end up taking references to temporaries and will create dangling references</td><td>Oulu</td><td>Complete</td></tr>
@@ -286,7 +308,7 @@
<tr><td><a href="http://wg21.link/LWG2671">2671</a></td><td>Errors in Copy</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2673">2673</a></td><td>status() effects cannot be implemented as specified</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2674">2674</a></td><td>Bidirectional iterator requirement on path::iterator is very expensive</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2683">2683</a></td><td>filesystem::copy() says "no effects"</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2683">2683</a></td><td>filesystem::copy() says "no effects"</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2684">2684</a></td><td>priority_queue lacking comparator typedef</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2685">2685</a></td><td>shared_ptr deleters must not throw on move construction</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2687">2687</a></td><td>{inclusive,exclusive}_scan misspecified</td><td>Oulu</td><td></td></tr>
@@ -298,8 +320,8 @@
<tr><td><a href="http://wg21.link/LWG2707">2707</a></td><td>path construction and assignment should have "string_type&&" overloads</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2709">2709</a></td><td>offsetof is unnecessarily imprecise</td><td>Oulu</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2710">2710</a></td><td>"Effects: Equivalent to ..." doesn't count "Synchronization:" as determined semantics</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2711">2711</a></td><td>path is convertible from approximately everything under the sun</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2716">2716</a></td><td>Specification of shuffle and sample disallows lvalue URNGs</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2711">2711</a></td><td>path is convertible from approximately everything under the sun</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2716">2716</a></td><td>Specification of shuffle and sample disallows lvalue URNGs</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2718">2718</a></td><td>Parallelism bug in [algorithms.parallel.exec] p2</td><td>Oulu</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2719">2719</a></td><td>permissions function should not be noexcept due to narrow contract</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2720">2720</a></td><td>permissions function incorrectly specified for symlinks</td><td>Oulu</td><td>Complete</td></tr>
@@ -307,9 +329,87 @@
<tr><td><a href="http://wg21.link/LWG2723">2723</a></td><td>Do directory_iterator and recursive_directory_iterator become the end iterator upon error?</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2724">2724</a></td><td>The protected virtual member functions of memory_resource should be private</td><td>Oulu</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2725">2725</a></td><td>filesystem::exists(const path&, error_code&) error reporting</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2726">2726</a></td><td>[recursive_]directory_iterator::increment(error_code&) is underspecified</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2726">2726</a></td><td>[recursive_]directory_iterator::increment(error_code&) is underspecified</td><td>Oulu</td><td>Complete</td></tr>
<tr><td><a href="http://wg21.link/LWG2727">2727</a></td><td>Parallel algorithms with constexpr specifier</td><td>Oulu</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2728">2728</a></td><td>status(p).permissions() and symlink_status(p).permissions() are not specified</td><td>Oulu</td><td>Complete</td></tr>
+<!-- <tr><td></td><td></td><td></td><td></td></tr> -->
+ <tr><td><a href="http://wg21.link/LWG2062">2062</a></td><td>Effect contradictions w/o no-throw guarantee of std::function swaps</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2166">2166</a></td><td>Heap property underspecified?</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2221">2221</a></td><td>No formatted output operator for nullptr</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2223">2223</a></td><td>shrink_to_fit effect on iterator validity</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2261">2261</a></td><td>Are containers required to use their 'pointer' type internally?</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2394">2394</a></td><td>locale::name specification unclear - what is implementation-defined?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2460">2460</a></td><td>LWG issue 2408 and value categories</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2468">2468</a></td><td>Self-move-assignment of library types</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2475">2475</a></td><td>Allow overwriting of std::basic_string terminator with charT() to allow cleaner interoperation with legacy APIs</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2503">2503</a></td><td>multiline option should be added to syntax_option_type</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2510">2510</a></td><td>Tag types should not be DefaultConstructible</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2514">2514</a></td><td>Type traits must not be final</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2518">2518</a></td><td>[fund.ts.v2] Non-member swap for propagate_const should call member swap</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2519">2519</a></td><td>Iterator operator-= has gratuitous undefined behaviour</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2521">2521</a></td><td>[fund.ts.v2] weak_ptr's converting move constructor should be modified as well for array support</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2525">2525</a></td><td>[fund.ts.v2] get_memory_resource should be const and noexcept</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2527">2527</a></td><td>[fund.ts.v2] ALLOCATOR_OF for function::operator= has incorrect default</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2531">2531</a></td><td>future::get should explicitly state that the shared state is released</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2534">2534</a></td><td>Constrain rvalue stream operators</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2536">2536</a></td><td>What should &lt;complex.h&gt; do?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2540">2540</a></td><td>unordered_multimap::insert hint iterator</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2543">2543</a></td><td>LWG 2148 (hash support for enum types) seems under-specified</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2544">2544</a></td><td>istreambuf_iterator(basic_streambuf<charT, traits>* s) effects unclear when s is 0</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2556">2556</a></td><td>Wide contract for future::share()</td><td>Issaquah</td><td>Patch ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2562">2562</a></td><td>Consistent total ordering of pointers by comparison functors</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2567">2567</a></td><td>Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraits</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2568">2568</a></td><td>[fund.ts.v2] Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraits</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2569">2569</a></td><td>conjunction and disjunction requirements are too strict</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2570">2570</a></td><td>[fund.ts.v2] conjunction and disjunction requirements are too strict</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2578">2578</a></td><td>Iterator requirements should reference iterator traits</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2584">2584</a></td><td><regex> ECMAScript IdentityEscape is ambiguous</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2588">2588</a></td><td>[fund.ts.v2] "Convertible to bool" requirement in conjunction and disjunction</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2589">2589</a></td><td>match_results can't satisfy the requirements of a container</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2591">2591</a></td><td>std::function's member template target() should not lead to undefined behaviour</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2598">2598</a></td><td>addressof works on temporaries</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2664">2664</a></td><td>operator/ (and other append) semantics not useful if argument has root</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2665">2665</a></td><td>remove_filename() post condition is incorrect</td><td>Issaquah</td><td>See Below</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2672">2672</a></td><td>Should is_empty use error_code in its specification?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2678">2678</a></td><td>std::filesystem enum classes overspecified</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2679">2679</a></td><td>Inconsistent Use of Effects and Equivalent To</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2680">2680</a></td><td>Add "Equivalent to" to filesystem</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2681">2681</a></td><td>filesystem::copy() cannot copy symlinks</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2682">2682</a></td><td>filesystem::copy() won't create a symlink to a directory</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2686">2686</a></td><td>Why is std::hash specialized for error_code, but not error_condition?</td><td>Issaquah</td><td>Patch ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2694">2694</a></td><td>Application of LWG 436 accidentally deleted definition of "facet"</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2696">2696</a></td><td>Interaction between make_shared and enable_shared_from_this is underspecified</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2699">2699</a></td><td>Missing restriction in [numeric.requirements]</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2712">2712</a></td><td>copy_file(from, to, ...) has a number of unspecified error conditions</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2722">2722</a></td><td>equivalent incorrectly specifies throws clause</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2729">2729</a></td><td>Missing SFINAE on std::pair::operator=</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2732">2732</a></td><td>Questionable specification of path::operator/= and path::append</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2733">2733</a></td><td>[fund.ts.v2] gcd / lcm and bool</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2735">2735</a></td><td>std::abs(short), std::abs(signed char) and others should return int instead of double in order to be compatible with C++98 and C</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2736">2736</a></td><td>nullopt_t insufficiently constrained</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2738">2738</a></td><td>is_constructible with void types</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2739">2739</a></td><td>Issue with time_point non-member subtraction with an unsigned duration</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2740">2740</a></td><td>constexpr optional<T>::operator-></td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2742">2742</a></td><td>Inconsistent string interface taking string_view</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2744">2744</a></td><td>any's in_place constructors</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2745">2745</a></td><td>[fund.ts.v2] Implementability of LWG 2451</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2747">2747</a></td><td>Possibly redundant std::move in [alg.foreach]</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2748">2748</a></td><td>swappable traits for optionals</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2749">2749</a></td><td>swappable traits for variants</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2750">2750</a></td><td>[fund.ts.v2] LWG 2451 conversion constructor constraint</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2752">2752</a></td><td>"Throws:" clauses of async and packaged_task are unimplementable</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2755">2755</a></td><td>[string.view.io] uses non-existent basic_string_view::to_string function</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2756">2756</a></td><td>C++ WP optional<T> should 'forward' T's implicit conversions</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2758">2758</a></td><td>std::string{}.assign("ABCDE", 0, 1) is ambiguous</td><td>Complete</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2759">2759</a></td><td>gcd / lcm and bool for the WP</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2760">2760</a></td><td>non-const basic_string::data should not invalidate iterators</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2765">2765</a></td><td>Did LWG 1123 go too far?</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2767">2767</a></td><td>not_fn call_wrapper can form invalid types</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2769">2769</a></td><td>Redundant const in the return type of any_cast(const any&)</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2771">2771</a></td><td>Broken Effects of some basic_string::compare functions in terms of basic_string_view</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2773">2773</a></td><td>Making std::ignore constexpr</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2777">2777</a></td><td>basic_string_view::copy should use char_traits::copy</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2778">2778</a></td><td>basic_string_view is missing constexpr</td><td>Issaquah</td><td></td></tr>
<!--
<tr><td><a href="http://wg21.link/LWG1214">1214</a></td><td>Insufficient/inconsistent key immutability requirements for associative containers</td><td>Urbana</td><td></td></tr>
@@ -317,7 +417,7 @@
<!-- <tr><td></td><td></td><td></td><td></td></tr> -->
</table>
- <p>Last Updated: 12-Jul-2016</p>
+ <p>Last Updated: 14-Nov-2016</p>
</div>
</body>
</html>
diff --git a/www/debug_mode.html b/www/debug_mode.html
deleted file mode 100644
index 943c47db011e..000000000000
--- a/www/debug_mode.html
+++ /dev/null
@@ -1,162 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>libc++ debug mode status</title>
-</head>
-<body>
-
-<p>
-Work is beginning on a libc++ debug mode. The purpose of this table is to
-record which parts of libc++ have debug mode support.
-</p>
-
-<p>
-Note: Debug mode is currently not functional. Defining _LIBCPP_DEBUG will result
-in fairly nasty compile errors.
-</p>
-
-<table border=1>
-<tr>
-<th>Section</th>
-<th>Completed ?</th>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>vector&lt;T&gt;, T != bool</code>
-</p>
-</td>
-<td align="center"> &#10003; </td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;list&gt;</code>
-</p>
-</td>
-<td align="center"> &#10003; </td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;unordered_set&gt;</code>
-</p>
-</td>
-<td align="center"> &#10003; </td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;unordered_map&gt;</code>
-</p>
-</td>
-<td align="center"> &#10003; </td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;string&gt;</code>
-</p>
-</td>
-<td align="center"> &#10003; </td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;set&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;map&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>vector&lt;bool&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;deque&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;forward_list&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;array&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;stack&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;queue&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;algorithm&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-
-</table>
-
-<p>
-At present the table is known to not be a complete list. It is currently ordered
-in approximate priority order.
-</p>
-
-<p>Last Updated: 3-June-2014</p>
-
-</body>
-</html>
diff --git a/www/index.html b/www/index.html
index 70cf5b60155e..6b464ebec4e6 100644
--- a/www/index.html
+++ b/www/index.html
@@ -140,11 +140,6 @@
"C++1z" (probably to be C++17) can be found <a href="cxx1z_status.html">here</a>.</p>
<p>Implementation of the post-c++14 Technical Specifications is in progress. A list of features and
the current status of these features can be found <a href="ts1z_status.html">here</a>.</p>
- <p>
- Ports to other platforms are underway. Here are recent test
- results for <a href="results.Windows.html">Windows</a>
- and <a href="results.Linux.html">Linux</a>.
- </p>
<!--======================================================================-->
<h2 id="buildbots">Build Bots</h2>
@@ -225,7 +220,6 @@
<li><a href="atomic_design.html"><tt>&lt;atomic&gt;</tt></a></li>
<li><a href="type_traits_design.html"><tt>&lt;type_traits&gt;</tt></a></li>
<li><a href="http://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/">Excellent notes by Marshall Clow</a></li>
-<li><a href="debug_mode.html">Status of debug mode</a></li>
</ul>
</div>
diff --git a/www/results.Linux.html b/www/results.Linux.html
deleted file mode 100644
index 82416a36e13e..000000000000
--- a/www/results.Linux.html
+++ /dev/null
@@ -1,513 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>results.Linux</title>
-</head>
-<body>
-<pre>
-All failures in the libc++ test suite will be documented here.
-Note: glibc >= 2.16 is required for full C11 compatibility.
-
-Test Suite Run Information:
-Date: 8/18/2014
-Compiler: Clang Tip-of-Tree (r215809)
-ABI: libc++abi
-C Library: eglibc 2.19
-Platform: x86_64-linux-gnu
-Kernel: 3.13.0-32-generic
-Distribution: Ubuntu 14.04
-Run By: Eric Fiselier (eric at efcs dot ca)
-
-
-Testing Time: 1187.82s
-********************
-Failing Tests (33):
- libc++ :: localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp
- - GLIBC's locales collate strings differently. Needs investigation.
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
- - Needs Investigation.
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
- - Idem
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
- - Idem
- libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
- - Differences in GLIBC locales. Needs investigation.
- libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
- - Differences in GLIBC locales. Puts '-' before 'CNY' as opposed to after.
- libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
- - Differences in GLIBC locales. Needs investigation.
- libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
- - Differences in GLIBC locales. Puts '-' before 'CNY' as opposed to after.
- libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
- - Expects ',' for ru_RU but gets '.'.
- libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
- - Expects ',' for ru_RU but gets '.'.
- libc++ :: localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
- - GLIBC puts "+nan" where "nan" is expected.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
- - GLIBC has different locale data for fr_FR, ru_RU and zh_CN.
- The is also a possible bug in zh_CN tests. Needs investigation.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
- - Some test cases are non-portible with GLIBC (include time zone).
- Other failures related to GLIBC locale data. Needs investigation.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
- - GLIBC starts weekdays with lowercase letters. Test case expectes upper case.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
- - GLIBC abbreviated days end with '.'. Test case expects no '.'.
- libc++ :: localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp
- - Needs investigation.
- libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
- - Fails due to differences in GLIBC locales
- libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
- - Fails due to differences in GLIBC locales
- libc++ :: re/re.alg/re.alg.match/basic.pass.cpp
- - Needs investigation.
- libc++ :: re/re.alg/re.alg.match/ecma.pass.cpp
- - Idem.
- libc++ :: re/re.alg/re.alg.match/extended.pass.cpp
- - Idem.
- libc++ :: re/re.alg/re.alg.search/awk.pass.cpp
- - Idem.
- libc++ :: re/re.alg/re.alg.search/basic.pass.cpp
- - Idem.
- libc++ :: re/re.alg/re.alg.search/ecma.pass.cpp
- - Idem.
- libc++ :: re/re.alg/re.alg.search/extended.pass.cpp
- - Idem.
- libc++ :: re/re.traits/lookup_collatename.pass.cpp
- - Idem.
- libc++ :: re/re.traits/translate_nocase.pass.cpp
- - Idem.
-
-********************
-Expected Failing Tests (5):
- libc++ :: depr/depr.c.headers/math_h.pass.cpp
- - Fails a static assert that the return type of
- isnan(double) and isinf(double) is a bool. see PR18382.
- libc++ :: numerics/c.math/cmath_isinf.pass.cpp
- - Idem.
- libc++ :: numerics/c.math/cmath_isnan.pass.cpp
- - Idem.
- libc++ :: strings/c.strings/cuchar.pass.cpp
- - &lt;cuchar&gt; is not implemented.
- libc++ :: strings/c.strings/version_cuchar.pass.cpp
- - Idem.
-
- Expected Passes : 4716
- Expected Failures : 5
- Unexpected Failures: 33
-
-********************************************************************************
-
--- Testing: 4754 tests, 2 threads --
-FAIL: libc++ :: localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp (2073 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp4DtKocexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp4DtKocexe'
-Exit Code: -6
-Standard Error:
---
-tmp4DtKocexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp:38: int main(): Assertion `f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp (2152 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpAfkClkexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpAfkClkexe'
-Exit Code: -6
-Standard Error:
---
-tmpAfkClkexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp:38: int main(): Assertion `f.tolower('\xDA') == '\xFA'' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp (2153 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpGjakKeexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpGjakKeexe'
-Exit Code: -6
-Standard Error:
---
-tmpGjakKeexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp:35: int main(): Assertion `in[0] == '\xFA'' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp (2154 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp0gK3Y6exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp0gK3Y6exe'
-Exit Code: -6
-Standard Error:
---
-tmp0gK3Y6exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp:39: int main(): Assertion `f.toupper('\xFA') == '\xDA'' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp (2155 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpCoF624exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpCoF624exe'
-Exit Code: -6
-Standard Error:
---
-tmpCoF624exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp:35: int main(): Assertion `in[0] == '\xDA'' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp (2157 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpjOo8fnexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpjOo8fnexe'
-Exit Code: -6
-Standard Error:
---
-tmpjOo8fnexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp:53: int main(): Assertion `f.widen(char(-5)) == wchar_t(251)' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp (2158 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpDWZ5aNexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpDWZ5aNexe'
-Exit Code: -6
-Standard Error:
---
-tmpDWZ5aNexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp:60: int main(): Assertion `v[6] == wchar_t(133)' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp (2184 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpfA5HOrexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpfA5HOrexe'
-Exit Code: -6
-Standard Error:
---
-tmpfA5HOrexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp:71: int main(): Assertion `iter.base() == v.data() + v.size()' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp (2185 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpTI59qtexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpTI59qtexe'
-Exit Code: -6
-Standard Error:
---
-tmpTI59qtexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp:314: int main(): Assertion `iter.base() == v.data() + v.size()' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp (2192 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp1psSk2exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp1psSk2exe'
-Exit Code: -6
-Standard Error:
---
-tmp1psSk2exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp:70: int main(): Assertion `ex == "0,00 "' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp (2193 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpKwjbrPexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpKwjbrPexe'
-Exit Code: -6
-Standard Error:
---
-tmpKwjbrPexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp:218: int main(): Assertion `ex == "CNY -0.01"' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp (2198 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp4UnNQ2exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp4UnNQ2exe'
-Exit Code: -6
-Standard Error:
---
-tmp4UnNQ2exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp:114: int main(): Assertion `f.decimal_point() == ','' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp (2205 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp6MGZAmexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp6MGZAmexe'
-Exit Code: -6
-Standard Error:
---
-tmp6MGZAmexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp:114: int main(): Assertion `f.thousands_sep() == ' '' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp (2229 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp7AME77exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp7AME77exe'
-Exit Code: -6
-Standard Error:
---
-tmp7AME77exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp:10886: void test5(): Assertion `ex == "nan"' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp (2249 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpooRjFgexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpooRjFgexe'
-Exit Code: -6
-Standard Error:
---
-tmpooRjFgexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp:64: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp (2250 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpcm_vb9exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpcm_vb9exe'
-Exit Code: -6
-Standard Error:
---
-tmpcm_vb9exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp:64: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp (2253 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpLKJQXHexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpLKJQXHexe'
-Exit Code: -6
-Standard Error:
---
-tmpLKJQXHexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp:51: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp (2254 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpiDgYiqexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpiDgYiqexe'
-Exit Code: -6
-Standard Error:
---
-tmpiDgYiqexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp:51: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp (2257 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpAUaH78exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpAUaH78exe'
-Exit Code: -6
-Standard Error:
---
-tmpAUaH78exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp:74: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp (2258 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp7iGNTDexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp7iGNTDexe'
-Exit Code: -6
-Standard Error:
---
-tmp7iGNTDexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp:72: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp (2277 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpnT0vVFexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpnT0vVFexe'
-Exit Code: -6
-Standard Error:
---
-tmpnT0vVFexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp:73: int main(): Assertion `(ex == "Today is Samedi which is abbreviated Sam.")|| (ex == "Today is samedi which is abbreviated sam." )' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp (2281 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp47THCHexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp47THCHexe'
-Exit Code: -6
-Standard Error:
---
-tmp47THCHexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp:185: int main(): Assertion `ex == "May"' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp (2285 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpn6fLHJexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpn6fLHJexe'
-Exit Code: -6
-Standard Error:
---
-tmpn6fLHJexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp:57: int main(): Assertion `np.grouping() == "\x7F"' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp (2286 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpkna8llexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpkna8llexe'
-Exit Code: -6
-Standard Error:
---
-tmpkna8llexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp:57: int main(): Assertion `np.thousands_sep() == ','' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.match/basic.pass.cpp (3203 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.match/basic.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp0wkTrlexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/basic.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp0wkTrlexe'
-Exit Code: -6
-Standard Error:
---
-tmp0wkTrlexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/basic.pass.cpp:624: int main(): Assertion `std::regex_match(s, m, std::regex("[a[=M=]z]", std::regex_constants::basic))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.match/ecma.pass.cpp (3204 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.match/ecma.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpghcl7yexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/ecma.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpghcl7yexe'
-Exit Code: -6
-Standard Error:
---
-tmpghcl7yexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/ecma.pass.cpp:585: int main(): Assertion `std::regex_match(s, m, std::regex("[a[=M=]z]"))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.match/extended.pass.cpp (3208 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.match/extended.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpGVUdIMexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/extended.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpGVUdIMexe'
-Exit Code: -6
-Standard Error:
---
-tmpGVUdIMexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/extended.pass.cpp:622: int main(): Assertion `std::regex_match(s, m, std::regex("[a[=M=]z]", std::regex_constants::extended))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.search/awk.pass.cpp (3218 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.search/awk.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpgFuw4cexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/awk.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpgFuw4cexe'
-Exit Code: -6
-Standard Error:
---
-tmpgFuw4cexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/awk.pass.cpp:694: int main(): Assertion `std::regex_search(s, m, std::regex("[a[=M=]z]", std::regex_constants::awk))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.search/basic.pass.cpp (3219 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.search/basic.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpXeQuwGexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/basic.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpXeQuwGexe'
-Exit Code: -6
-Standard Error:
---
-tmpXeQuwGexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/basic.pass.cpp:696: int main(): Assertion `std::regex_search(s, m, std::regex("[a[=M=]z]", std::regex_constants::basic))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.search/ecma.pass.cpp (3220 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.search/ecma.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpvGAAImexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/ecma.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpvGAAImexe'
-Exit Code: -6
-Standard Error:
---
-tmpvGAAImexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/ecma.pass.cpp:675: int main(): Assertion `std::regex_search(s, m, std::regex("[a[=M=]z]"))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.search/extended.pass.cpp (3224 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.search/extended.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpGvouurexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/extended.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpGvouurexe'
-Exit Code: -6
-Standard Error:
---
-tmpGvouurexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/extended.pass.cpp:694: int main(): Assertion `std::regex_search(s, m, std::regex("[a[=M=]z]", std::regex_constants::extended))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.traits/lookup_collatename.pass.cpp (3349 of 4754)
-******************** TEST 'libc++ :: re/re.traits/lookup_collatename.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpItXmtJexe' '/home/eric/workspace/staging-libcxx/test/re/re.traits/lookup_collatename.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpItXmtJexe'
-Exit Code: -6
-Standard Error:
---
-tmpItXmtJexe: /home/eric/workspace/staging-libcxx/test/re/re.traits/lookup_collatename.pass.cpp:31: void test(const char_type *, const std::basic_string<char_type> &) [char_type = char]: Assertion `t.lookup_collatename(F(A), F(A + t.length(A))) == expected' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.traits/translate_nocase.pass.cpp (3354 of 4754)
-******************** TEST 'libc++ :: re/re.traits/translate_nocase.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpGsRNu3exe' '/home/eric/workspace/staging-libcxx/test/re/re.traits/translate_nocase.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpGsRNu3exe'
-Exit Code: -6
-Standard Error:
---
-tmpGsRNu3exe: /home/eric/workspace/staging-libcxx/test/re/re.traits/translate_nocase.pass.cpp:44: int main(): Assertion `t.translate_nocase('\xDA') == '\xFA'' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-</pre>
-</body>
-</html>
diff --git a/www/results.Windows.html b/www/results.Windows.html
deleted file mode 100644
index a5ec1218a1b5..000000000000
--- a/www/results.Windows.html
+++ /dev/null
@@ -1,487 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>results.Windows</title>
-</head>
-<body>
-<pre>
-All failures in the libc++ test suite will be documented here.
-
-Last run was with Clang (pre-3.1) and GCC 4.6.3 (with dw2 exception handling) and
- mingw-w64 v2.0.3 on i686-w64-mingw32.
-
-The following line was added to ./lib/buildit to make a static libc++ library because a DLL requires "declspec(dllexport)" or a .def file:
-ar rcs libc++.a *.o
-I also deleted libc++.dll and libc++.dll.a to make sure libc++ was linked statically to prevent unrelated issues from contaminating the test results.
-The commands to build and test were (-nodefaultlibs does not work, lots of MinGW related stuff gets left out resulting in linker failures):
-TRIPLE=i686-w64-mingw32 ./buildit
-TRIPLE=i686-w64-mingw32 HEADER_INCLUDE="-I/home/Ruben/libcxx/include" LIBS="-L/home/ruben/libcxx/lib -lc++ -lpthread -lsupc++ -lmsvcr100 -Wl,--allow-multiple-definition" ./testit > test.log 2>&1
-
-Note: Some locale tests may "Need investigating", but I think most problems are
- caused by wrong/unportable locale naming in the tests.
-Note: Some tests failed to link because "test.exe" was still running when ld.exe
- tried to link the next test. I left these failures out of the list; they
- account for about 10-30 failures, and are counted in the total scores below.
- I reran some of these failures manually and they passed.
-Note: Some tests fail at runtime but pass when run manually. Usage of std::cout
- segfaults so further investigation is difficult. These also contribute to
- the failures total, but are left out of the failure list, as the cause is
- probably not located in that part of libc++, not locatable due to the lack
- of usable debug info generated by Clang at this time.
-
-TOTAL RESULTS:
-Section failures / total sections: 104 / 1064 = 9.8% failures
-Test failures / total number of tests: 292 / 4326 = 6.7% failures
-
-depr/
- depr.c.headers/
- inttypes_h.pass.cpp: missing macros for C++.
- uchar_h.pass.cpp: bug in mingw-w64 headers for C++11 builtin char types.
- wchar_h.pass.cpp: Windows does not have swprintf, should use _snwprintf.
- Suggest #define swprintf as _snwprintf for _WIN32.
-exception.unexpected/
- set.unexpected/
- get_unexpected.pass.cpp: Segmentation fault - needs investigation.
- set_unexpected.pass.cpp: idem.
-diagnostics/
- syserr/
- syserr.errcat/
- syserr.errcat.objects/
- system_category.pass.cpp: Needs investigation.
-input.output/
- file.streams/
- c.files/
- cinttypes.pass.cpp: missing macros for C++.
- fstreams/
- filebuf.assign/
- member_swap.pass.cpp: Segmentation fault - needs investigation.
- move_assign.pass.cpp: idem.
- nonmember_swap.pass.cpp: idem.
- filebuf.cons/
- move.pass.cpp: idem.
- filebuf.members/
- open_pointers.pass.cpp: idem.
- filebuf.virtuals/
- overflow.pass.cpp: idem.
- pbackfail.pass.cpp: idem.
- seekoff.pass.cpp: idem.
- underflow.pass.cpp: idem.
- fstream.assign/
- member_swap.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- nonmember_swap.pass.cpp: idem.
- fstream.cons/
- move.pass.cpp: idem.
- pointer.pass.cpp: idem.
- string.pass.cpp: idem.
- fstream.members/
- open_pointer.pass.cpp: idem.
- open_string.pass.cpp: idem.
- ifstream.assign/
- member_swap.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- nonmember_swap.pass.cpp: idem.
- ifstream.cons/
- move.pass.cpp: idem.
- pointer.pass.cpp: idem.
- string.pass.cpp: idem.
- ifstream.members/
- open_pointer.pass.cpp: idem.
- open_string.pass.cpp: idem.
- rdbuf.pass.cpp: idem.
- ofstream.assign/
- member_swap.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- nonmember_swap.pass.cpp: idem.
- ofstream.cons/
- move.pass.cpp: idem.
- pointer.pass.cpp: idem.
- string.pass.cpp: idem.
- ofstream.members/
- open_pointer.pass.cpp: idem.
- open_string.pass.cpp: idem.
- rdbuf.pass.cpp: idem.
- iostream.format/
- ext.manip
- get_money.pass.cpp: Windows locale names don't follow UNIX convention.
- get_time.pass.cpp: idem.
- put_money.pass.cpp: idem.
- put_time.pass.cpp: idem.
- output.streams/
- ostream.formatted/
- ostream.inserters.arithmetic/
- long_double.pass.cpp: Segfault - needs investigation.
- pointer.pass.cpp: idem.
- ostream_sentry/
- destruct.pass.cpp: idem.
- iostream.objects/
- narrow.stream.objects/
- cerr.pass.cpp: idem.
- cin.pass.cpp: idem.
- wide.stream.objects/
- wcerr.pass.cpp: idem.
- wcin.pass.cpp: idem.
- iostreams.base/
- ios/
- basic.ios.members/
- copyfmt.pass.cpp: Windows locale names don't follow UNIX convention.
- imbue.pass.cpp: idem.
- move.pass.cpp: idem.
- swap.pass.cpp: Windows locale names don't follow UNIX convention.
- ios.base/
- ios.base.callback/
- register_callback.pass.cpp: Windows locale names don't follow UNIX convention.
- ios.base.locales/
- imbue.pass.cpp: Windows locale names don't follow UNIX convention.
- stream.buffers/
- streambuf/
- streambuf.cons/
- copy.pass.cpp: Windows locale names don't follow UNIX convention.
- default.pass.cpp: idem.
- streambuf.members/
- streambuf.buffer/
- locales.pass.cpp: Windows locale names don't follow UNIX convention.
- streambuf.protected/
- streambuf.assign/
- assign.pass.cpp: Windows locale names don't follow UNIX convention.
- swap.pass.cpp: idem.
-language.support/
- support.exception/
- except.nested/
- assign.pass.cpp: Needs investigation.
- ctor_copy.pass.cpp: idem.
- ctor_default.pass.cpp: idem.
- rethrow_if_nested.pass.cpp: idem.
- rethrow_nested.pass.cpp: idem.
- throw_with_nested.pass.cpp: idem.
- propagation/
- current_exception.pass.cpp: Needs investigation.
- exception_ptr.pass.cpp: idem.
- make_exception_ptr.pass.cpp: idem.
- rethrow_exception.pass.cpp: idem.
- uncaught/
- uncaught_exception.pass.cpp: Needs investigation.
- support.limits/
- limits/
- numeric.limits.members/
- digits.pass.cpp: Needs investigation (wrong assumptions?).
- digits10.pass.cpp: idem.
- support.runtime/
- support.start.term/
- quick_exit.pass.cpp: Not declared in libc++ headers. Is it from the ABI lib?
- support.types/
- max_align_t.pass.cpp: needs investigation (wrong assumptions?).
-localization/
- locale.categories/
- category.collate/
- locale.collate.byname/
- compare.pass.cpp: Windows locale names don't follow UNIX convention.
- hash.pass.cpp: idem.
- transform.pass.cpp: getenv should be replaced by putenv for portability.
- Windows locale names don't follow UNIX convention.
- types.pass.cpp: Windows locale names don't follow UNIX convention.
- locale.categories/
- category.ctype/
- locale.codecvt/
- locale.codecvt.members/
- wchar_t_in.pass.cpp: Most likely wchar_t is assumed 4 bytes.
- wchar_t_length.pass.cpp: idem.
- wchar_t_out.pass.cpp: idem.
- wchar_t_unshift.pass.cpp: idem.
- locale.codecvt.byname/
- ctor_wchar_t.pass.cpp: Windows locale names don't follow UNIX convention.
- locale.ctype.byname/
- is_1.pass.cpp: Windows locale names don't follow UNIX convention.
- is_many.pass.cpp: idem.
- narrow_1.pass.cpp: idem.
- narrow_many.pass.cpp: idem.
- scan_is.pass.cpp: idem.
- scan_not.pass.cpp: idem.
- tolower_1.pass.cpp: idem.
- tolower_many.pass.cpp: idem.
- toupper_1.pass.cpp: idem.
- toupper_many.pass.cpp: idem.
- types.pass.cpp: idem.
- widen_1.pass.cpp: idem.
- widen_many.pass.cpp: idem.
- category.monetary/
- locale.money.get/
- locale.money.get.members/
- get_long_double_en_US.pass.cpp: Windows locale names don't follow UNIX convention.
- get_long_double_fr_FR.pass.cpp: idem.
- get_long_double_ru_RU.pass.cpp: idem.
- get_long_double_zh_CN.pass.cpp: idem.
- get_string_en_US.pass.cpp: idem.
- locale.money.put/
- locale.money.put.members/
- put_long_double_en_US.pass.cpp: Windows locale names don't follow UNIX convention.
- put_long_double_fr_FR.pass.cpp: idem.
- put_long_double_ru_RU.pass.cpp: idem.
- put_long_double_zh_CN.pass.cpp: idem.
- put_string_en_US.pass.cpp: idem.
- locale.moneypunct.byname/
- curr_symbol.pass.cpp: Failed constructing from C locale. Needs investigation.
- decimal_point.pass.cpp: idem.
- frac_digits.pass.cpp: idem.
- grouping.pass.cpp: idem.
- neg_format.pass.cpp: idem.
- negative_sign.pass.cpp: idem.
- pos_format.pass.cpp: idem.
- positive_sign.pass.cpp: idem.
- thousands_sep.pass.cpp: idem.
- category.numeric/
- locale.nm.put/
- facet.num.put.members/
- put_double.pass.cpp: idem. (different floating point format?)
- put_long_double.pass.cpp: idem.
- put_pointer.pass.cpp: idem.
- locale.num.get/
- facet.num.get.members/
- get_double.pass.cpp: Needs investigating.
- get_float.pass.cpp: idem.
- get_long_double.pass.cpp: idem.
- get_pointer.pass.cpp: idem.
- category.time/
- locale.time.get/
- locale.time.get.byname/
- date_order.pass.cpp: Windows locale names don't follow UNIX convention.
- date_order_wide.pass.cpp: idem.
- get_date.pass.cpp: idem.
- get_date_wide.pass.cpp: idem.
- get_monthname.pass.cpp: idem.
- get_monthname_wide.pass.cpp: idem.
- get_one.pass.cpp: idem.
- get_one_wide.pass.cpp: idem.
- get_time.pass.cpp: idem.
- get_time_wide.pass.cpp: idem.
- get_weekday.pass.cpp: idem.
- get_weekday_wide.pass.cpp: idem.
- get_year.pass.cpp: idem.
- get_year_wide.pass.cpp: idem.
- locale.time.put/
- locale.time.put.members/
- put1.pass.cpp: Needs investigating.
- put2.pass.cpp: idem.
- locale.time.put.byname/
- put1.pass.cpp: Windows locale names don't follow UNIX convention.
- facet.numpunct/
- locale.numpunct/
- locale.numpunct.byname/
- decimal_point.pass.cpp: Failed constructing from C locale. Needs investigation.
- grouping.pass.cpp: idem.
- thousands_sep.pass.cpp: idem.
- locale.stdcvt/
- codecvt_utf16_in.pass.cpp: 0x40003 does not fit in a 2-byte wchar_t.
- codecvt_utf16_out.pass.cpp: idem.
- codecvt_utf8_in.pass.cpp: idem.
- codecvt_utf8_out.pass.cpp: idem.
- codecvt_utf8_utf16_in.pass: idem.
- codecvt_utf8_utf16_out.pass.cpp: idem.
- locales/
- locale/
- locale.cons/
- assign.pass.cpp: Windows locale names don't follow UNIX convention.
- char_pointer.pass.cpp: idem.
- copy.pass.cpp: idem.
- default.pass.cpp: idem.
- locale_char_pointer_cat.pass.cpp: idem.
- locale_facetptr.pass.cpp: idem.
- locale_locale_cat.pass.cpp: idem.
- locale_string_cat.pass.cpp: idem.
- string.pass.cpp: idem.
- locale.members/
- name.pass.cpp: Windows locale names don't follow UNIX convention.
- locale.operators/
- eq.pass.cpp: Windows locale names don't follow UNIX convention.
- locale/locale.statics/
- classic.pass.cpp: Failed constructing from C locale. Needs investigation.
- global.pass.cpp: Windows locale names don't follow UNIX convention.
- locale.convenience/
- conversions/
- conversions.buffer/
- overflow.pass.cpp: Needs investigation.
- pbackfail.pass.cpp: idem.
- seekoff.pass.cpp: idem.
- test.pass.cpp: idem.
- underflow.pass.cpp: idem.
- conversions.string/
- converted.pass.cpp: out of range hex sequence due to 2-byte wchar_t.
- from_bytes.pass.cpp: idem (This test passed while it probably shouldn't!).
- to_bytes.pass.cpp: idem.
-numerics/
- complex.number/
- complex.value.ops/
- abs.pass.cpp: Failed assertion.
- arg.pass.cpp: idem.
- rand/
- rand.device/
- ctor.pass.cpp: No such thing as /dev/urandom on Windows. Need alternative.
- entropy.pass.cpp: idem.
- eval.pass.cpp: idem.
- rand.dis/
- rand.dist.bern/
- rand.dist.bern.bernoulli/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.bern.bin/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.bern.geo/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.bern.negbin/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm/
- rand.dist.norm.cauchy/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm.chisq/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm.norm.f/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm.lognormal/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm.normal/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm.t/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.pois/
- rand.dist.pois.exp/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.pois.extreme/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.pois.gamma/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.pois.poisson/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.pois.weibull/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.samp/
- rand.dist.samp.discrete/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.samp.pconst/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.samp.plinear/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.uni/
- rand.dist.uni.real/
- io.pass.cpp: Needs investigation. (different output double format?)
-re/
- re.alg/
- re.alg.match/
- awk.pass.cpp: Needs investigation.
- basic.pass.cpp: idem.
- ecma.pass.cpp: idem.
- extended.pass.cpp: idem.
- re.alg.search/
- awk.pass.cpp: Needs investigation.
- basic.pass.cpp: idem.
- ecma.pass.cpp: idem.
- extended.pass.cpp: idem.
- re.regex/
- re.regex.locale/
- imbue.pass.cpp: Windows locale names don't follow UNIX convention.
- re.traits/
- default.pass.cpp: Windows locale names don't follow UNIX convention.
- getloc.pass.cpp: idem.
- imbue.pass.cpp: idem.
- isctype.pass.cpp: Needs investigation.
- lookup_classname.pass.cpp: idem.
- lookup_collatename.pass.cpp: Windows locale names don't follow UNIX convention.
- transform.pass.cpp: idem.
- transform_primary.pass.cpp: idem
- translate_nocase.pass.cpp: Needs investigation.
-strings/
- c.strings/
- cuchar.pass.cpp: see previous note about uchar.h.
- cwchar.pass.cpp: I suggest including the win32 support header which defines
- (v)swprintf to the Windows equivalent.
- version_cuchar.pass.cpp: see previous note about uchar.h.
- string.conversions/
- stod.pass.cpp: "no conversion". Needs investigation.
- stof.pass.cpp: idem.
- to_string.pass.cpp: Needs investigation.
- to_wstring.pass.cpp: idem.
-thread/
- futures/
- futures.async/
- async.pass.cpp: Needs investigation.
- futures.promise/
- alloc_ctor.pass.cpp: Needs investigation.
- default.pass.cpp: idem.
- dtor.pass.cpp: idem.
- get_future.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- move_ctor.pass.cpp: idem.
- set_exception.pass.cpp: idem.
- set_exception_at_thread_exit.pass.cpp: idem.
- set_lvalue.pass.cpp: idem.
- set_lvalue_at_thread_exit.pass.cpp: idem.
- set_rvalue.pass.cpp: idem.
- set_rvalue_at_thread_exit.pass.cpp: idem.
- set_value_at_thread_exit_const.pass.cpp: idem.
- set_value_at_thread_exit_void.pass.cpp: idem.
- set_value_const.pass.cpp: idem.
- set_value_void.pass.cpp: idem.
- swap.pass.cpp: idem.
- futures.shared_future/
- copy_assign.pass.cpp: Needs investigation.
- copy_ctor.pass.cpp: idem.
- ctor_future.pass.cpp: idem.
- dtor.pass.cpp: idem.
- get.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- move_ctor.pass.cpp: idem.
- wait.pass.cpp: idem.
- wait_for.pass.cpp: idem.
- wait_until.pass.cpp: idem.
- futures.tas/
- futures.task.members/
- assign_move.pass.cpp: Needs investigation.
- ctor_func.pass.cpp: idem.
- ctor_func_alloc.pass.cpp: idem.
- ctor_move.pass.cpp: idem.
- dtor.pass.cpp: idem.
- get_future.pass.cpp: idem.
- make_ready_at_thread_exit.pass.cpp: idem.
- operator.pass.cpp: idem.
- reset.pass.cpp: idem.
- swap.pass.cpp: idem.
- futures.task.nonmembers/
- swap.pass.cpp: Needs investigation.
- futures.unique_future/
- dtor.pass.cpp: Needs investigation.
- get.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- move_ctor.pass.cpp: idem.
- share.pass.cpp: idem.
- wait.pass.cpp: idem.
- wait_for.pass.cpp: idem.
- wait_until.pass.cpp: idem.
- thread.condition/
- thread.condition.condvar/
- wait_for.pass.cpp: Needs investigation.
- thread.condition.condvarany/
- wait_for.pass.cpp: Needs investigation.
- thread.mutex/
- thread.lock/
- thread.lock.unique/
- thread.lock.unique.cons/
- mutex_try_to_lock.pass.cpp: Needs investigation.
- thread.threads/
- thread.thread.class/
- thread.thread.constr/
- move.pass.cpp: Needs investigation.
- thread.thread.id/
- join.pass.cpp: Needs investigation.
- thread.thread.static/
- hardware_concurrency.pass.cpp: Needs investigation.
-utilities/
- meta/
- meta.trans/
- meta.trans.other/
- aligned_storage.pass.cpp: Probably due to sizeof(long) != 8.
- meta.trans.sign/
- make_signed.pass.cpp: Probably due to sizeof(wchar_t) != 4.
- make_unsigned.pass.cpp: idem.
- meta.unary.prop.query/
- alignment_of.pass.cpp: Probably a Clang problem on Windows.
-</pre>
-</body>
-</html>
diff --git a/www/upcoming_meeting.html b/www/upcoming_meeting.html
index 1316618e9b41..3b1a4d02ab0a 100644
--- a/www/upcoming_meeting.html
+++ b/www/upcoming_meeting.html
@@ -32,11 +32,11 @@
<div id="content">
<!--*********************************************************************-->
- <h1>libc++ Oulu Status</h1>
+ <h1>libc++ Issaquah Status</h1>
<!--*********************************************************************-->
<p>This is a temporary page; please check the c++1z status <a href="http://libcxx.llvm.org/cxx1z_status.html">here</a></p>
- <p>This page shows the status of the papers and issues that are expected to be adopted in Oulu.</p>
+ <p>This page shows the status of the papers and issues that are expected to be adopted in Issaquah.</p>
<p>The groups that have contributed papers:
<ul>
@@ -59,79 +59,163 @@
<table id="issues" border="1">
<tr><th>Issue #</th><th>Issue Name</th><th>Meeting</th><th>Status</th></tr>
- <tr><td><a href="http://wg21.link/LWG2181">2181</a></td><td>Exceptions from seed sequence operations</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2309">2309</a></td><td>mutex::lock() should not throw device_or_resource_busy</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2310">2310</a></td><td>Public exposition only member in std::array</td><td>Oulu</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://wg21.link/LWG2328">2328</a></td><td>Rvalue stream extraction should use perfect forwarding</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2393">2393</a></td><td>std::function's Callable definition is broken</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2426">2426</a></td><td>Issue about compare_exchange</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2436">2436</a></td><td>Comparators for associative containers should always be CopyConstructible</td><td>Oulu</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://wg21.link/LWG2441">2441</a></td><td>Exact-width atomic typedefs should be provided</td><td>Oulu</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://wg21.link/LWG2451">2451</a></td><td>[fund.ts.v2] optional<T> should 'forward' T's implicit conversions</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2509">2509</a></td><td>[fund.ts.v2] any_cast doesn't work with rvalue reference targets and cannot move with a value target</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2516">2516</a></td><td>[fund.ts.v2] Public "exposition only" members in observer_ptr</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2542">2542</a></td><td>Missing const requirements for associative containers</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2549">2549</a></td><td>Tuple EXPLICIT constructor templates that take tuple parameters end up taking references to temporaries and will create dangling references</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2550">2550</a></td><td>Wording of unordered container's clear() method complexity</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2551">2551</a></td><td>[fund.ts.v2] "Exception safety" cleanup in library fundamentals required</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2555">2555</a></td><td>[fund.ts.v2] No handling for over-aligned types in optional</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2573">2573</a></td><td>[fund.ts.v2] std::hash<std::experimental::shared_ptr<T>> does not work for arrays</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2596">2596</a></td><td>vector::data() should use addressof</td><td>Oulu</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://wg21.link/LWG2667">2667</a></td><td>path::root_directory() description is confusing</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2669">2669</a></td><td>recursive_directory_iterator effects refers to non-existent functions</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2670">2670</a></td><td>system_complete refers to undefined variable 'base'</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2671">2671</a></td><td>Errors in Copy</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2673">2673</a></td><td>status() effects cannot be implemented as specified</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2674">2674</a></td><td>Bidirectional iterator requirement on path::iterator is very expensive</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2683">2683</a></td><td>filesystem::copy() says "no effects"</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2684">2684</a></td><td>priority_queue lacking comparator typedef</td><td>Oulu</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://wg21.link/LWG2685">2685</a></td><td>shared_ptr deleters must not not throw on move construction</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2688">2688</a></td><td>clamp misses preconditions and has extraneous condition on result</td><td>Oulu</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://wg21.link/LWG2689">2689</a></td><td>Parallel versions of std::copy and std::move shouldn't be in order</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2698">2698</a></td><td>Effect of assign() on iterators/pointers/references</td><td>Oulu</td><td>Complete</td></tr>
- <tr><td><a href="http://wg21.link/LWG2706">2706</a></td><td>Error reporting for recursive_directory_iterator::pop() is under-specified</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2707">2707</a></td><td>path construction and assignment should have "string_type&&" overloads</td><td>Oulu</td><td></td></tr>
- <tr><td><a href="http://wg21.link/LWG2710">2710</a></td><td>"Effects: Equivalent to ..." doesn't count "Synchronization:" as determined semantics</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2062">2062</a></td><td>Effect contradictions w/o no-throw guarantee of std::function swaps</td><td>Issaquah</td><td>Nothing to do.</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2166">2166</a></td><td>Heap property underspecified?</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2221">2221</a></td><td>No formatted output operator for nullptr</td><td>Issaquah</td><td>Patch ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2223">2223</a></td><td>shrink_to_fit effect on iterator validity</td><td>Issaquah</td><td>Nothing to do.</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2261">2261</a></td><td>Are containers required to use their 'pointer' type internally?</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2394">2394</a></td><td>locale::name specification unclear - what is implementation-defined?</td><td>Issaquah</td><td>Nothing to do.</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2460">2460</a></td><td>LWG issue 2408 and value categories</td><td>Issaquah</td><td>Nothing to do.</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2468">2468</a></td><td>Self-move-assignment of library types</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2475">2475</a></td><td>Allow overwriting of std::basic_string terminator with charT() to allow cleaner interoperation with legacy APIs</td><td>Issaquah</td><td>Nothing to do.</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2503">2503</a></td><td>multiline option should be added to syntax_option_type</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2510">2510</a></td><td>Tag types should not be DefaultConstructible</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2514">2514</a></td><td>Type traits must not be final</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2519">2519</a></td><td>Iterator operator-= has gratuitous undefined behaviour</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2531">2531</a></td><td>future::get should explicitly state that the shared state is released</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2534">2534</a></td><td>Constrain rvalue stream operators</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2536">2536</a></td><td>What should &lt;complex.h&gt; do?</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2540">2540</a></td><td>unordered_multimap::insert hint iterator</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2543">2543</a></td><td>LWG 2148 (hash support for enum types) seems under-specified</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2544">2544</a></td><td>istreambuf_iterator(basic_streambuf<charT, traits>* s) effects unclear when s is 0</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2556">2556</a></td><td>Wide contract for future::share()</td><td>Issaquah</td><td>Patch ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2562">2562</a></td><td>Consistent total ordering of pointers by comparison functors</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2567">2567</a></td><td>Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraits</td><td>Issaquah</td><td>Nothing to do.</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2569">2569</a></td><td>conjunction and disjunction requirements are too strict</td><td>Issaquah</td><td>Nothing to do.</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2570">2570</a></td><td>[fund.ts.v2] conjunction and disjunction requirements are too strict</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2578">2578</a></td><td>Iterator requirements should reference iterator traits</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2584">2584</a></td><td><regex> ECMAScript IdentityEscape is ambiguous</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2589">2589</a></td><td>match_results can't satisfy the requirements of a container</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2591">2591</a></td><td>std::function's member template target() should not lead to undefined behaviour</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2598">2598</a></td><td>addressof works on temporaries</td><td>Issaquah</td><td>Patch ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2664">2664</a></td><td>operator/ (and other append) semantics not useful if argument has root</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2665">2665</a></td><td>remove_filename() post condition is incorrect</td><td>Issaquah</td><td>See Below</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2672">2672</a></td><td>Should is_empty use error_code in its specification?</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2678">2678</a></td><td>std::filesystem enum classes overspecified</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2679">2679</a></td><td>Inconsistent Use of Effects and Equivalent To</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2680">2680</a></td><td>Add "Equivalent to" to filesystem</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2681">2681</a></td><td>filesystem::copy() cannot copy symlinks</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2682">2682</a></td><td>filesystem::copy() won't create a symlink to a directory</td><td>Issaquah</td><td>Implemented in trunk</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2686">2686</a></td><td>Why is std::hash specialized for error_code, but not error_condition?</td><td>Issaquah</td><td>Patch ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2694">2694</a></td><td>Application of LWG 436 accidentally deleted definition of "facet"</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2696">2696</a></td><td>Interaction between make_shared and enable_shared_from_this is underspecified</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2699">2699</a></td><td>Missing restriction in [numeric.requirements]</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2712">2712</a></td><td>copy_file(from, to, ...) has a number of unspecified error conditions</td><td>Issaquah</td><td>Implemented in trunk</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2722">2722</a></td><td>equivalent incorrectly specifies throws clause</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2729">2729</a></td><td>Missing SFINAE on std::pair::operator=</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2732">2732</a></td><td>Questionable specification of path::operator/= and path::append</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2733">2733</a></td><td>[fund.ts.v2] gcd / lcm and bool</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2735">2735</a></td><td>std::abs(short), std::abs(signed char) and others should return int instead of double in order to be compatible with C++98 and C</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2736">2736</a></td><td>nullopt_t insufficiently constrained</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2738">2738</a></td><td>is_constructible with void types</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2739">2739</a></td><td>Issue with time_point non-member subtraction with an unsigned duration</td><td>Issaquah</td><td>Patch Ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2740">2740</a></td><td>constexpr optional<T>::operator-></td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2742">2742</a></td><td>Inconsistent string interface taking string_view</td><td>Issaquah</td><td>Patch Ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2744">2744</a></td><td>any's in_place constructors</td><td>Issaquah</td><td>Implemented in trunk</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2745">2745</a></td><td>[fund.ts.v2] Implementability of LWG 2451</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2747">2747</a></td><td>Possibly redundant std::move in [alg.foreach]</td><td>Issaquah</td><td>Patch ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2748">2748</a></td><td>swappable traits for optionals</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2749">2749</a></td><td>swappable traits for variants</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2750">2750</a></td><td>[fund.ts.v2] LWG 2451 conversion constructor constraint</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2752">2752</a></td><td>"Throws:" clauses of async and packaged_task are unimplementable</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2753">2753</a></td><td>Optional's constructors and assignments need constraints</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2754">2754</a></td><td>The in_place constructors and emplace functions added by P0032R3 don't require CopyConstructible</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2755">2755</a></td><td>§[string.view.io] uses non-existent basic_string_view::to_string function</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2756">2756</a></td><td>C++ WP optional<T> should 'forward' T's implicit conversions</td><td>Issaquah</td><td>Implemented in trunk</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2758">2758</a></td><td>std::string{}.assign("ABCDE", 0, 1) is ambiguous</td><td>We already do this</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2759">2759</a></td><td>gcd / lcm and bool for the WP</td><td>Issaquah</td><td>Patch ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2760">2760</a></td><td>non-const basic_string::data should not invalidate iterators</td><td>Issaquah</td><td>Nothing to do</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2765">2765</a></td><td>Did LWG 1123 go too far?</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2767">2767</a></td><td>not_fn call_wrapper can form invalid types</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2768">2768</a></td><td>any_cast and move semantics</td><td>Issaquah</td><td>Resolved by LWG 2769</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2769">2769</a></td><td>Redundant const in the return type of any_cast(const any&)</td><td>Issaquah</td><td>Implemented in trunk</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2771">2771</a></td><td>Broken Effects of some basic_string::compare functions in terms of basic_string_view</td><td>Issaquah</td><td>We already do this</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2773">2773</a></td><td>Making std::ignore constexpr</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2777">2777</a></td><td>basic_string_view::copy should use char_traits::copy</td><td>Issaquah</td><td>Patch Ready</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2778">2778</a></td><td>basic_string_view is missing constexpr</td><td>Issaquah</td><td></td></tr>
</table>
<h3>Comments about the issues</h3>
<ul>
-<li>2181 - </li>
-<li>2309 - I don't think there's anything to do here.</li>
-<li>2310 - I think we need a test that checks array::data() == addressof(front()). Other than that, we're good.</li>
-<li>2328 - &lt;istream&gt;:1467 - fix is straightforward. Need to think about tests.</li>
-<li>2393 - </li>
-<li>2426 - I believe this is just a wording clarification, but need to study it some more.</li>
-<li>2436 - Adds Requirements on compare/hasher. We can static_assert this, and test it.</li>
-<li>2441 - Looks straightforward.</li>
-<li>2451 - <i>Significant work.</i></li>
-<li>2509 - <i>Significant work.</i></li>
-<li>2516 - We don't have an observer_ptr implementation yet.</li>
-<li>2542 - This is probably mostly writing additional tests.</li>
-<li>2549 - Tuple EXPLICIT - Eric?</li>
-<li>2550 - Wording clarification; no code change needed.</li>
-<li>2551 - Wording cleanup; no code change needed.</li>
-<li>2555 - Wording clarification; no code change needed.</li>
-<li>2573 - </li>
-<li>2596 - Turns out we do this already. Needs tests, though.</li>
-<li>2667 - Wording clarification; no code change needed.</li>
-<li>2669 - Wording clarification; no code change needed.</li>
-<li>2670 - Wording clarification; no code change needed.</li>
-<li>2671 - Wording clarification; no code change needed.</li>
-<li>2673 - Wording clarification; no code change needed.</li>
-<li>2674 - We already depend on the requirements being relaxed.</li>
-<li>2683 - We already do this.</li>
-<li>2684 - We already have one; just need to add a test for it.</li>
-<li>2685 - Wording clarification; no code change needed. We don't handle throwing move ctors here anyway.</li>
-<li>2688 - I believe that we already do this. Add more tests</li>
-<li>2689 - We don't have a parallel implementation yet (though I'm working on it).</li>
-<li>2698 - Wording clarification; no code change needed.</li>
-<li>2706 - We already implement the new pop(error_code&) overloads</li>
-<li>2707 - We already implement the new overloads.</li>
-<li>2710 - Wording cleanup; no code change needed.</li>
+<li>2062 - We already do this; added some tests to make sure we keep doing so.</li>
+<li>2166 - I <b>suspect</b> that this is just better specification of the existing structure. Probably need more tests for this.</li>
+<li>2221 - Patch and tests ready</li>
+<li>2223 - This is just wording cleanup. </li>
+<li>2261 - <b>Survey our containers to make sure we do this.</b> Ideally, this will result in no code changes.</li>
+<li>2394 - This is just wording cleanup.</li>
+<li>2460 - This is just wording cleanup.</li>
+<li>2468 - <i>I think we already do this; but will need to survey the libray to be sure</i></li>
+<li>2475 - Nothing to do here. </li>
+<li>2503 - </li>
+<li>2510 - <b>Need to write tests for all the tag types</b></li>
+<li>2514 - Nothing to do; We don't mark any of the type traits as final. </li>
+<li>2519 - This is just wording cleanup. </li>
+<li>2531 - This <b>should be</b> just wording cleanup. </li>
+<li>2534 - </li>
+<li>2536 - We already do this. </li>
+<li>2540 - We already do this, and have tests for it.</li>
+<li>2543 - </li>
+<li>2544 - We already do this; I've added tests to make sure we keep doing so</li>
+<li>2556 - Patch and tests ready</li>
+<li>2562 - I <b>suspect</b> that this is just better specification of the existing structure. Probably need more tests for this.</li>
+<li>2567 - This is just wording cleanup.</li>
+<li>2569 - This is just wording cleanup.</li>
+<li>2570 - Same as 2569, but applied to LFTS</li>
+<li>2578 - This is just wording cleanup. </li>
+<li>2584 - </li>
+<li>2589 - This is just wording cleanup. </li>
+<li>2591 - I <b>suspect</b> that this is just better specification of the existing structure. Probably need more tests for this.</li>
+<li>2598 - Patch and tests ready</li>
+<li>2664 - No change needed. _LIBCPP_DEBUG mode tests the new requirements.</li>
+<li>2665 - PR is incorrect as-is. We implement a modified version</li>
+<li>2672 - Patch and tests in tree. </li>
+<li>2678 - No change needed. Mostly wording cleanup. </li>
+<li>2679 - This is just wording cleanup. </li>
+<li>2680 - This is just wording cleanup. </li>
+<li>2681 - LGTM </li>
+<li>2682 - Current PR is incorrect. A modified version has been implemented</li>
+<li>2686 - Patch and tests ready</li>
+<li>2694 - Restoring inadvertently deleted text. No code changes needed.</li>
+<li>2696 - I <b>suspect</b> that this is just better specification of the existing structure. Probably need more tests for this.</li>
+<li>2699 - I don't think this requires any code changes; look more closely.</li>
+<li>2712 - LGTM. </li>
+<li>2722 - LGTM </li>
+<li>2729 - </li>
+<li>2732 - Our implementation is already equivalent. </li>
+<li>2733 - LFTS; same as 2759</li>
+<li>2735 - I <b>suspect</b> that this is just better specification of the existing structure. Probably need more tests for this.</li>
+<li>2736 - </li>
+<li>2738 - We already do this; I added tests for cv-void</li>
+<li>2739 - Patch and tests ready</li>
+<li>2740 - <i>std::optional</i>: The resolution LGTM. </li>
+<li>2742 - Patch and tests ready</li>
+<li>2744 - <i>std::any</i>: We already do this. We also check for a decayed in_place_type_t. </li>
+<li>2745 - <i>std::optional</i> for LFTS -- should be considered for C++17</li>
+<li>2747 - Patch ready, but I can't think of any way to test it.</li>
+<li>2748 - <i>std::optional</i>: LGTM. </li>
+<li>2749 - <i>std::variant</i></li>
+<li>2750 - <i>std::optional</i> for LFTS -- should be considered for C++17</li>
+<li>2752 - </li>
+<li>2753 - <i>std::optional</i>: LGTM. </li>
+<li>2754 - <i>std::any</i>: LGTM. </li>
+<li>2755 - Both string and string_view call a common routine for output; so no code changes needed.</li>
+<li>2756 - <i>std::optional</i>: Very large change. It is fully implemented and tested. </li>
+<li>2758 - We already do this. </li>
+<li>2759 - Patch and tests ready</li>
+<li>2760 - This is just wording cleanup; no code or test changes needed.</li>
+<li>2765 - is this just wording cleanup????? I don't think this actually requires code changes. </li>
+<li>2767 - The test case on the issue is incorrect. See not_fn.pass.cpp for the correct test case. </li>
+<li>2768 - <i>std::any</i>: There is no PR for this issue. It is resolved by LWG 2769. </li>
+<li>2769 - <i>std::any</i>: The PR looks good except that
+ <code>remove_reference_t&lt;remove_cv_t&lt;T&gt;&gt;</code> should read
+ <code>remove_cv_t&lt;remove_reference_t&lt;T&gt;&gt;</code>. </li>
+<li>2771 - We already do this.</li>
+<li>2773 - </li>
+<li>2777 - Patch ready; existing tests should suffice</li>
+<li>2778 - This is mostly tests.</li>
</ul>
-<p>Last Updated: 7-Jun-2016</p>
+<p>Last Updated: 10-Oct-2016</p>
</div>
</body>
</html>